diff --git a/.latest-tag-aws-sdk-go b/.latest-tag-aws-sdk-go index afa01408..aed8dd17 100644 --- a/.latest-tag-aws-sdk-go +++ b/.latest-tag-aws-sdk-go @@ -1 +1 @@ -release-2024-11-14 +release-2024-11-15.2 diff --git a/src/aws_cloudwatch.erl b/src/aws_cloudwatch.erl index 9f385fcc..955d6e5b 100644 --- a/src/aws_cloudwatch.erl +++ b/src/aws_cloudwatch.erl @@ -2,29 +2,32 @@ %% See https://github.com/aws-beam/aws-codegen for more details. %% @doc Amazon CloudWatch monitors your Amazon Web Services (Amazon Web -%% Services) resources and the -%% applications you run on Amazon Web Services in real time. +%% Services) +%% resources and the applications you run on Amazon Web Services in real +%% time. %% -%% You can use CloudWatch to collect and track -%% metrics, which are the variables you want to measure for your resources -%% and -%% applications. +%% You can use +%% CloudWatch to collect and track metrics, which are the variables you want +%% to +%% measure for your resources and applications. %% %% CloudWatch alarms send notifications or automatically change the resources -%% you are monitoring based on rules -%% that you define. For example, you can monitor the CPU usage and disk reads -%% and writes of your Amazon EC2 -%% instances. Then, use this data to determine whether you should launch -%% additional instances to handle increased load. You can also use this data -%% to stop -%% under-used instances to save -%% money. +%% you are +%% monitoring based on rules that you define. For example, you can monitor +%% the CPU usage +%% and disk reads and writes of your Amazon EC2 instances. Then, use this +%% data to determine +%% whether you should launch additional instances to handle increased load. +%% You can also +%% use this data to stop under-used instances to save money. %% %% In addition to monitoring the built-in metrics that come with Amazon Web -%% Services, you can monitor -%% your own custom metrics. With CloudWatch, you gain system-wide visibility -%% into resource -%% utilization, application performance, and operational health. +%% Services, +%% you can monitor your own custom metrics. With CloudWatch, you gain +%% system-wide +%% visibility into resource utilization, application performance, and +%% operational +%% health. -module(aws_cloudwatch). -export([delete_alarms/2, @@ -223,6 +226,13 @@ %% } -type alarm_history_item() :: #{binary() => any()}. +%% Example: +%% entity() :: #{ +%% <<"Attributes">> => map(), +%% <<"KeyAttributes">> => map() +%% } +-type entity() :: #{binary() => any()}. + %% Example: %% delete_dashboards_input() :: #{ %% <<"DashboardNames">> := list(string()()) @@ -684,8 +694,10 @@ %% Example: %% put_metric_data_input() :: #{ -%% <<"MetricData">> := list(metric_datum()()), -%% <<"Namespace">> := string() +%% <<"EntityMetricData">> => list(entity_metric_data()()), +%% <<"MetricData">> => list(metric_datum()()), +%% <<"Namespace">> := string(), +%% <<"StrictEntityValidation">> => boolean() %% } -type put_metric_data_input() :: #{binary() => any()}. @@ -1065,6 +1077,13 @@ %% } -type describe_insight_rules_input() :: #{binary() => any()}. +%% Example: +%% entity_metric_data() :: #{ +%% <<"Entity">> => entity(), +%% <<"MetricData">> => list(metric_datum()()) +%% } +-type entity_metric_data() :: #{binary() => any()}. + %% Example: %% get_dashboard_input() :: #{ %% <<"DashboardName">> := string() @@ -1269,32 +1288,37 @@ %% @doc Deletes the specified alarms. %% -%% You can delete up to 100 alarms in one operation. However, this total can -%% include no more -%% than one composite alarm. For example, you could delete 99 metric alarms -%% and one composite alarms with one operation, but you can't +%% You can delete up to 100 alarms in one operation. +%% However, this total can include no more than one composite alarm. For +%% example, you could +%% delete 99 metric alarms and one composite alarms with one operation, but +%% you can't %% delete two composite alarms with one operation. %% %% If you specify an incorrect alarm name or make any other error in the -%% operation, no alarms are -%% deleted. To confirm that alarms were deleted successfully, you can use -%% the DescribeAlarms: +%% operation, +%% no alarms are deleted. To confirm that alarms were deleted successfully, +%% you can use the +%% DescribeAlarms: %% https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarms.html -%% operation after using -%% `DeleteAlarms'. +%% operation after using `DeleteAlarms'. %% %% It is possible to create a loop or cycle of composite alarms, where -%% composite alarm A depends on composite alarm B, and -%% composite alarm B also depends on composite alarm A. In this scenario, you -%% can't delete any composite alarm that is part of the cycle -%% because there is always still a composite alarm that depends on that alarm -%% that you want to delete. -%% -%% To get out of such a situation, you must -%% break the cycle by changing the rule of one of the composite alarms in the -%% cycle to remove a dependency that creates the cycle. The simplest -%% change to make to break a cycle is to change the `AlarmRule' of one of -%% the alarms to `false'. +%% composite +%% alarm A depends on composite alarm B, and composite alarm B also depends +%% on +%% composite alarm A. In this scenario, you can't delete any composite +%% alarm that is +%% part of the cycle because there is always still a composite alarm that +%% depends on +%% that alarm that you want to delete. +%% +%% To get out of such a situation, you must break the cycle by changing the +%% rule of +%% one of the composite alarms in the cycle to remove a dependency that +%% creates the +%% cycle. The simplest change to make to break a cycle is to change the +%% `AlarmRule' of one of the alarms to `false'. %% %% Additionally, the evaluation of composite alarms stops if CloudWatch %% detects a cycle in the evaluation path. @@ -1314,16 +1338,14 @@ delete_alarms(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"DeleteAlarms">>, Input, Options). -%% @doc -%% Deletes the specified anomaly detection model -%% from your account. +%% @doc Deletes the specified anomaly detection model from your account. %% %% For more information -%% about -%% how to delete an anomaly detection model, -%% see Deleting an anomaly detection model: +%% about how to delete an anomaly detection model, see Deleting an anomaly +%% detection model: %% https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Create_Anomaly_Detection_Alarm.html#Delete_Anomaly_Detection_Model -%% in the CloudWatch User Guide. +%% in the CloudWatch User +%% Guide. -spec delete_anomaly_detector(aws_client:aws_client(), delete_anomaly_detector_input()) -> {ok, delete_anomaly_detector_output(), tuple()} | {error, any()} | @@ -1342,10 +1364,8 @@ delete_anomaly_detector(Client, Input, Options) %% @doc Deletes all dashboards that you specify. %% -%% You -%% can specify up to 100 dashboards to delete. If there is an error during -%% this call, no dashboards are -%% deleted. +%% You can specify up to 100 dashboards to +%% delete. If there is an error during this call, no dashboards are deleted. -spec delete_dashboards(aws_client:aws_client(), delete_dashboards_input()) -> {ok, delete_dashboards_output(), tuple()} | {error, any()} | @@ -1365,9 +1385,8 @@ delete_dashboards(Client, Input, Options) %% @doc Permanently deletes the specified Contributor Insights rules. %% %% If you create a rule, delete it, and then re-create it with the same name, -%% historical data from the first time -%% the rule was created might -%% not be available. +%% historical +%% data from the first time the rule was created might not be available. -spec delete_insight_rules(aws_client:aws_client(), delete_insight_rules_input()) -> {ok, delete_insight_rules_output(), tuple()} | {error, any()} | @@ -1403,18 +1422,20 @@ delete_metric_stream(Client, Input, Options) %% @doc Retrieves the history for the specified alarm. %% -%% You can filter the results by date range or item type. -%% If an alarm name is not specified, the histories for either all metric -%% alarms or all composite alarms are returned. +%% You can filter the results by date +%% range or item type. If an alarm name is not specified, the histories for +%% either all +%% metric alarms or all composite alarms are returned. %% %% CloudWatch retains the history of an alarm even if you delete the alarm. %% %% To use this operation and return information about a composite alarm, you -%% must be signed on with -%% the `cloudwatch:DescribeAlarmHistory' permission that is scoped to -%% `*'. You can't return information -%% about composite alarms if your `cloudwatch:DescribeAlarmHistory' -%% permission has a narrower scope. +%% must be +%% signed on with the `cloudwatch:DescribeAlarmHistory' permission that +%% is +%% scoped to `*'. You can't return information about composite alarms +%% if your +%% `cloudwatch:DescribeAlarmHistory' permission has a narrower scope. -spec describe_alarm_history(aws_client:aws_client(), describe_alarm_history_input()) -> {ok, describe_alarm_history_output(), tuple()} | {error, any()} | @@ -1433,15 +1454,15 @@ describe_alarm_history(Client, Input, Options) %% @doc Retrieves the specified alarms. %% -%% You can filter the results by specifying a prefix for the alarm -%% name, the alarm state, or a prefix for any action. +%% You can filter the results by specifying a prefix +%% for the alarm name, the alarm state, or a prefix for any action. %% %% To use this operation and return information about composite alarms, you -%% must be signed on with -%% the `cloudwatch:DescribeAlarms' permission that is scoped to `*'. -%% You can't return information -%% about composite alarms if your `cloudwatch:DescribeAlarms' permission -%% has a narrower scope. +%% must be +%% signed on with the `cloudwatch:DescribeAlarms' permission that is +%% scoped to +%% `*'. You can't return information about composite alarms if your +%% `cloudwatch:DescribeAlarms' permission has a narrower scope. -spec describe_alarms(aws_client:aws_client(), describe_alarms_input()) -> {ok, describe_alarms_output(), tuple()} | {error, any()} | @@ -1460,14 +1481,14 @@ describe_alarms(Client, Input, Options) %% @doc Retrieves the alarms for the specified metric. %% -%% To -%% filter the results, specify a statistic, period, or unit. +%% To filter the results, specify a +%% statistic, period, or unit. %% -%% This operation retrieves only standard alarms that are based on -%% the specified metric. It does not return alarms based on math expressions -%% that -%% use the specified metric, or composite alarms that use the specified -%% metric. +%% This operation retrieves only standard alarms that are based on the +%% specified +%% metric. It does not return alarms based on math expressions that use the +%% specified +%% metric, or composite alarms that use the specified metric. -spec describe_alarms_for_metric(aws_client:aws_client(), describe_alarms_for_metric_input()) -> {ok, describe_alarms_for_metric_output(), tuple()} | {error, any()}. @@ -1485,14 +1506,15 @@ describe_alarms_for_metric(Client, Input, Options) %% @doc Lists the anomaly detection models that you have created in your %% account. %% -%% For single metric anomaly detectors, -%% you can list all of the models in your account or filter the results -%% to only the models that are related to a certain namespace, metric name, -%% or metric dimension. -%% For metric math anomaly detectors, -%% you can list them by adding `METRIC_MATH' to the -%% `AnomalyDetectorTypes' array. -%% This will return all metric math anomaly detectors in your account. +%% For single +%% metric anomaly detectors, you can list all of the models in your account +%% or filter the +%% results to only the models that are related to a certain namespace, metric +%% name, or +%% metric dimension. For metric math anomaly detectors, you can list them by +%% adding +%% `METRIC_MATH' to the `AnomalyDetectorTypes' array. This will +%% return all metric math anomaly detectors in your account. -spec describe_anomaly_detectors(aws_client:aws_client(), describe_anomaly_detectors_input()) -> {ok, describe_anomaly_detectors_output(), tuple()} | {error, any()} | @@ -1511,8 +1533,8 @@ describe_anomaly_detectors(Client, Input, Options) %% @doc Returns a list of all the Contributor Insights rules in your account. %% -%% For more information about Contributor Insights, see -%% Using Contributor Insights to Analyze High-Cardinality Data: +%% For more information about Contributor Insights, see Using Contributor +%% Insights to Analyze High-Cardinality Data: %% https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContributorInsights.html. -spec describe_insight_rules(aws_client:aws_client(), describe_insight_rules_input()) -> {ok, describe_insight_rules_output(), tuple()} | @@ -1532,8 +1554,8 @@ describe_insight_rules(Client, Input, Options) %% @doc Disables the actions for the specified alarms. %% -%% When an alarm's actions are disabled, the -%% alarm actions do not execute when the alarm state changes. +%% When an alarm's actions are +%% disabled, the alarm actions do not execute when the alarm state changes. -spec disable_alarm_actions(aws_client:aws_client(), disable_alarm_actions_input()) -> {ok, undefined, tuple()} | {error, any()}. @@ -1550,8 +1572,8 @@ disable_alarm_actions(Client, Input, Options) %% @doc Disables the specified Contributor Insights rules. %% -%% When rules are disabled, they do not analyze log groups and do -%% not incur costs. +%% When rules are disabled, they do +%% not analyze log groups and do not incur costs. -spec disable_insight_rules(aws_client:aws_client(), disable_insight_rules_input()) -> {ok, disable_insight_rules_output(), tuple()} | {error, any()} | @@ -1585,7 +1607,8 @@ enable_alarm_actions(Client, Input, Options) %% @doc Enables the specified Contributor Insights rules. %% -%% When rules are enabled, they immediately begin analyzing log data. +%% When rules are enabled, they +%% immediately begin analyzing log data. -spec enable_insight_rules(aws_client:aws_client(), enable_insight_rules_input()) -> {ok, enable_insight_rules_output(), tuple()} | {error, any()} | @@ -1605,10 +1628,10 @@ enable_insight_rules(Client, Input, Options) %% @doc Displays the details of the dashboard that you specify. %% %% To copy an existing dashboard, use `GetDashboard', and then use the -%% data returned -%% within `DashboardBody' as the template for the new dashboard when you -%% call `PutDashboard' to create -%% the copy. +%% data +%% returned within `DashboardBody' as the template for the new dashboard +%% when +%% you call `PutDashboard' to create the copy. -spec get_dashboard(aws_client:aws_client(), get_dashboard_input()) -> {ok, get_dashboard_output(), tuple()} | {error, any()} | @@ -1628,30 +1651,34 @@ get_dashboard(Client, Input, Options) %% @doc This operation returns the time series data collected by a %% Contributor Insights rule. %% -%% The data includes the identity and number of -%% contributors to the log group. +%% The data includes the identity and number of contributors to the log +%% group. %% %% You can also optionally return one or more statistics about each data -%% point in the time series. These statistics can include the following: +%% point in the +%% time series. These statistics can include the following: %% %% `UniqueContributors' -- the number of unique contributors for each %% data point. %% %% `MaxContributorValue' -- the value of the top contributor for each -%% data point. The identity of the -%% contributor might change for each data point in the graph. +%% data point. The identity of the contributor might change for each data +%% point in +%% the graph. %% %% If this rule aggregates by COUNT, the top contributor for each data point -%% is the contributor with the -%% most occurrences in that period. If the rule aggregates by SUM, the top -%% contributor is the contributor with the highest sum in the log field -%% specified -%% by the rule's `Value', during that period. +%% is +%% the contributor with the most occurrences in that period. If the rule +%% aggregates +%% by SUM, the top contributor is the contributor with the highest sum in the +%% log +%% field specified by the rule's `Value', during that period. %% -%% `SampleCount' -- the number of data points matched by the rule. +%% `SampleCount' -- the number of data points matched by the +%% rule. %% -%% `Sum' -- the sum of the values from all contributors during the time -%% period represented by that data point. +%% `Sum' -- the sum of the values from all contributors during the +%% time period represented by that data point. %% %% `Minimum' -- the minimum value from a single observation during the %% time period represented by that data point. @@ -1659,8 +1686,8 @@ get_dashboard(Client, Input, Options) %% `Maximum' -- the maximum value from a single observation during the %% time period represented by that data point. %% -%% `Average' -- the average value from all contributors during the time -%% period represented by that data point. +%% `Average' -- the average value from all contributors during the +%% time period represented by that data point. -spec get_insight_rule_report(aws_client:aws_client(), get_insight_rule_report_input()) -> {ok, get_insight_rule_report_output(), tuple()} | {error, any()} | @@ -1680,47 +1707,49 @@ get_insight_rule_report(Client, Input, Options) %% @doc You can use the `GetMetricData' API to retrieve CloudWatch metric %% values. %% -%% The operation -%% can also include a CloudWatch Metrics Insights query, and one or more -%% metric math functions. +%% The operation can also include a CloudWatch Metrics Insights query, and +%% one or more metric math functions. %% %% A `GetMetricData' operation that does not include a query can retrieve -%% as many as 500 different -%% metrics in a single request, with a total of as many as 100,800 data -%% points. You can also -%% optionally perform metric math expressions on the values of the returned -%% statistics, to create -%% new time series that represent new insights into your data. For example, -%% using Lambda -%% metrics, you could divide the Errors metric by the Invocations metric to -%% get an error -%% rate time series. For more information about metric math expressions, see -%% Metric Math Syntax and Functions: +%% as many as 500 different metrics in a single request, with a total of as +%% many as 100,800 +%% data points. You can also optionally perform metric math expressions on +%% the values of +%% the returned statistics, to create new time series that represent new +%% insights into your +%% data. For example, using Lambda metrics, you could divide the Errors +%% metric by the +%% Invocations metric to get an error rate time series. For more information +%% about metric +%% math expressions, see Metric Math Syntax and Functions: %% https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax %% in the Amazon CloudWatch User %% Guide. %% %% If you include a Metrics Insights query, each `GetMetricData' -%% operation can include only one -%% query. But the same `GetMetricData' operation can also retrieve other -%% metrics. Metrics Insights queries -%% can query only the most recent three hours of metric data. For more -%% information about Metrics Insights, -%% see Query your metrics with CloudWatch Metrics Insights: +%% operation can +%% include only one query. But the same `GetMetricData' operation can +%% also +%% retrieve other metrics. Metrics Insights queries can query only the most +%% recent three +%% hours of metric data. For more information about Metrics Insights, see +%% Query your metrics with CloudWatch Metrics Insights: %% https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/query_with_cloudwatch-metrics-insights.html. %% %% Calls to the `GetMetricData' API have a different pricing structure %% than %% calls to `GetMetricStatistics'. For more information about pricing, %% see -%% Amazon CloudWatch Pricing: https://aws.amazon.com/cloudwatch/pricing/. +%% Amazon CloudWatch +%% Pricing: https://aws.amazon.com/cloudwatch/pricing/. %% %% Amazon CloudWatch retains metric data as follows: %% %% Data points with a period of less than 60 seconds are available for 3 -%% hours. These data points are high-resolution -%% metrics and are available only for custom metrics that have been defined -%% with a `StorageResolution' of 1. +%% hours. These data points are high-resolution metrics and are available +%% only for +%% custom metrics that have been defined with a `StorageResolution' of +%% 1. %% %% Data points with a period of 60 seconds (1-minute) are available for 15 %% days. @@ -1732,33 +1761,44 @@ get_insight_rule_report(Client, Input, Options) %% days (15 months). %% %% Data points that are initially published with a shorter period are -%% aggregated together for long-term storage. For example, if you collect -%% data using a period of 1 minute, the data remains available for 15 days -%% with 1-minute resolution. After 15 days, this data is still available, -%% but is aggregated and retrievable only with a resolution of 5 minutes. -%% After 63 days, the data is further aggregated and is available with -%% a resolution of 1 hour. +%% aggregated +%% together for long-term storage. For example, if you collect data using a +%% period of 1 +%% minute, the data remains available for 15 days with 1-minute resolution. +%% After 15 days, +%% this data is still available, but is aggregated and retrievable only with +%% a resolution +%% of 5 minutes. After 63 days, the data is further aggregated and is +%% available with a +%% resolution of 1 hour. %% %% If you omit `Unit' in your request, all data that was collected with -%% any unit is returned, along with the corresponding units that were -%% specified -%% when the data was reported to CloudWatch. If you specify a unit, the -%% operation returns only data that was collected with that unit specified. -%% If you specify a unit that does not match the data collected, the results -%% of the operation are null. CloudWatch does not perform unit conversions. -%% -%% Using Metrics Insights queries with metric math +%% any +%% unit is returned, along with the corresponding units that were specified +%% when the data +%% was reported to CloudWatch. If you specify a unit, the operation returns +%% only data that +%% was collected with that unit specified. If you specify a unit that does +%% not match the +%% data collected, the results of the operation are null. CloudWatch does not +%% perform unit +%% conversions. +%% +%% Using Metrics Insights queries with metric +%% math %% %% You can't mix a Metric Insights query and metric math syntax in the -%% same expression, but -%% you can reference results from a Metrics Insights query within other -%% Metric math expressions. A Metrics Insights -%% query without a GROUP BY clause returns a single time-series (TS), -%% and can be used as input for a metric math expression that expects a -%% single time series. A Metrics Insights -%% query with a GROUP BY clause returns an array of time-series (TS[]), -%% and can be used as input for a metric math expression that expects an -%% array of time series. +%% same expression, +%% but you can reference results from a Metrics Insights query within other +%% Metric math +%% expressions. A Metrics Insights query without a GROUP +%% BY clause returns a single time-series (TS), and can be used as input for +%% a metric math expression that expects a single time series. A Metrics +%% Insights query +%% with a GROUP BY clause returns an array of time-series +%% (TS[]), and can be used as input for a metric math expression that expects +%% an array of +%% time series. -spec get_metric_data(aws_client:aws_client(), get_metric_data_input()) -> {ok, get_metric_data_output(), tuple()} | {error, any()} | @@ -1778,41 +1818,46 @@ get_metric_data(Client, Input, Options) %% @doc Gets statistics for the specified metric. %% %% The maximum number of data points returned from a single call is 1,440. If -%% you request more than 1,440 data points, CloudWatch returns an error. -%% To reduce the number of data points, you can narrow the specified time -%% range and make -%% multiple requests across adjacent time ranges, or you can increase the -%% specified period. -%% Data points are not returned in chronological order. -%% -%% CloudWatch aggregates data points based on the length of the period -%% that you specify. For example, if you request statistics with a one-hour -%% period, -%% CloudWatch aggregates all data points with time stamps that fall within -%% each -%% one-hour period. Therefore, the number of values aggregated by CloudWatch -%% is larger than -%% the number of data points returned. +%% you +%% request more than 1,440 data points, CloudWatch returns an error. To +%% reduce the number +%% of data points, you can narrow the specified time range and make multiple +%% requests +%% across adjacent time ranges, or you can increase the specified period. +%% Data points are +%% not returned in chronological order. +%% +%% CloudWatch aggregates data points based on the length of the period that +%% you +%% specify. For example, if you request statistics with a one-hour period, +%% CloudWatch +%% aggregates all data points with time stamps that fall within each one-hour +%% period. +%% Therefore, the number of values aggregated by CloudWatch is larger than +%% the number of +%% data points returned. %% %% CloudWatch needs raw data points to calculate percentile statistics. If %% you publish -%% data using a statistic set instead, you can only retrieve -%% percentile statistics for this data if one of the following conditions is -%% true: +%% data using a statistic set instead, you can only retrieve percentile +%% statistics for this +%% data if one of the following conditions is true: %% %% The SampleCount value of the statistic set is 1. %% %% The Min and the Max values of the statistic set are equal. %% %% Percentile statistics are not available for metrics when any of the metric -%% values are negative numbers. +%% values +%% are negative numbers. %% %% Amazon CloudWatch retains metric data as follows: %% %% Data points with a period of less than 60 seconds are available for 3 -%% hours. These data points are high-resolution -%% metrics and are available only for custom metrics that have been defined -%% with a `StorageResolution' of 1. +%% hours. These data points are high-resolution metrics and are available +%% only for +%% custom metrics that have been defined with a `StorageResolution' of +%% 1. %% %% Data points with a period of 60 seconds (1-minute) are available for 15 %% days. @@ -1824,22 +1869,27 @@ get_metric_data(Client, Input, Options) %% days (15 months). %% %% Data points that are initially published with a shorter period are -%% aggregated together for long-term storage. For example, if you collect -%% data using a period of 1 minute, the data remains available for 15 days -%% with 1-minute resolution. After 15 days, this data is still available, -%% but is aggregated and retrievable only with a resolution of 5 minutes. -%% After 63 days, the data is further aggregated and is available with -%% a resolution of 1 hour. +%% aggregated +%% together for long-term storage. For example, if you collect data using a +%% period of 1 +%% minute, the data remains available for 15 days with 1-minute resolution. +%% After 15 days, +%% this data is still available, but is aggregated and retrievable only with +%% a resolution +%% of 5 minutes. After 63 days, the data is further aggregated and is +%% available with a +%% resolution of 1 hour. %% %% CloudWatch started retaining 5-minute and 1-hour metric data as of July 9, %% 2016. %% %% For information about metrics and dimensions supported by Amazon Web -%% Services services, see the -%% Amazon CloudWatch Metrics and Dimensions Reference: +%% Services +%% services, see the Amazon CloudWatch +%% Metrics and Dimensions Reference: %% https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CW_Support_For_AWS.html -%% in the -%% Amazon CloudWatch User Guide. +%% in the Amazon CloudWatch User +%% Guide. -spec get_metric_statistics(aws_client:aws_client(), get_metric_statistics_input()) -> {ok, get_metric_statistics_output(), tuple()} | {error, any()} | @@ -1874,19 +1924,19 @@ get_metric_stream(Client, Input, Options) request(Client, <<"GetMetricStream">>, Input, Options). %% @doc You can use the `GetMetricWidgetImage' API to retrieve a snapshot -%% graph of -%% one or more Amazon CloudWatch metrics as a bitmap image. +%% graph +%% of one or more Amazon CloudWatch metrics as a bitmap image. %% %% You can then embed this %% image into your services and products, such as wiki pages, reports, and -%% documents. -%% You could also retrieve images regularly, such as every minute, and create -%% your own -%% custom live dashboard. +%% documents. You +%% could also retrieve images regularly, such as every minute, and create +%% your own custom +%% live dashboard. %% %% The graph you retrieve can include all CloudWatch metric graph features, -%% including metric math -%% and horizontal and vertical annotations. +%% including +%% metric math and horizontal and vertical annotations. %% %% There is a limit of 20 transactions per second for this API. Each %% `GetMetricWidgetImage' action has the following limits: @@ -1910,16 +1960,17 @@ get_metric_widget_image(Client, Input, Options) %% @doc Returns a list of the dashboards for your account. %% -%% If you include `DashboardNamePrefix', only -%% those dashboards with names starting with the prefix are listed. -%% Otherwise, all dashboards in your account are -%% listed. -%% -%% `ListDashboards' returns up to 1000 results on one page. If there -%% are more than 1000 dashboards, you can call `ListDashboards' again and -%% include the value you received for `NextToken' in the first call, to -%% receive -%% the next 1000 results. +%% If you include +%% `DashboardNamePrefix', only those dashboards with names starting with +%% the +%% prefix are listed. Otherwise, all dashboards in your account are listed. +%% +%% `ListDashboards' returns up to 1000 results on one page. If there are +%% more than 1000 dashboards, you can call `ListDashboards' again and +%% include +%% the value you received for `NextToken' in the first call, to receive +%% the next +%% 1000 results. -spec list_dashboards(aws_client:aws_client(), list_dashboards_input()) -> {ok, list_dashboards_output(), tuple()} | {error, any()} | @@ -1936,11 +1987,9 @@ list_dashboards(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"ListDashboards">>, Input, Options). -%% @doc -%% Returns a list -%% that contains the number -%% of managed Contributor Insights rules -%% in your account. +%% @doc Returns a list that contains the number of managed Contributor +%% Insights rules in your +%% account. -spec list_managed_insight_rules(aws_client:aws_client(), list_managed_insight_rules_input()) -> {ok, list_managed_insight_rules_output(), tuple()} | {error, any()} | @@ -1987,25 +2036,24 @@ list_metric_streams(Client, Input, Options) %% use the returned token with subsequent calls. %% %% After you create a metric, allow up to 15 minutes for the metric to -%% appear. To see metric -%% statistics sooner, use GetMetricData: +%% appear. To see +%% metric statistics sooner, use GetMetricData: %% https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricData.html %% or GetMetricStatistics: %% https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricStatistics.html. %% %% If you are using CloudWatch cross-account observability, you can use this -%% operation in a monitoring account and -%% view metrics from the linked source accounts. For more information, see -%% CloudWatch cross-account observability: +%% operation in a monitoring account and view metrics from the linked source +%% accounts. For +%% more information, see CloudWatch cross-account observability: %% https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html. %% %% `ListMetrics' doesn't return information about metrics if those -%% metrics haven't -%% reported data in the past two weeks. To retrieve those metrics, use -%% GetMetricData: +%% metrics +%% haven't reported data in the past two weeks. To retrieve those +%% metrics, use GetMetricData: %% https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricData.html -%% or -%% GetMetricStatistics: +%% or GetMetricStatistics: %% https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricStatistics.html. -spec list_metrics(aws_client:aws_client(), list_metrics_input()) -> {ok, list_metrics_output(), tuple()} | @@ -2025,8 +2073,8 @@ list_metrics(Client, Input, Options) %% @doc Displays the tags associated with a CloudWatch resource. %% -%% Currently, alarms -%% and Contributor Insights rules support tagging. +%% Currently, alarms and +%% Contributor Insights rules support tagging. -spec list_tags_for_resource(aws_client:aws_client(), list_tags_for_resource_input()) -> {ok, list_tags_for_resource_output(), tuple()} | {error, any()} | @@ -2045,15 +2093,15 @@ list_tags_for_resource(Client, Input, Options) %% @doc Creates an anomaly detection model for a CloudWatch metric. %% -%% You can use the model -%% to display a band of expected normal values when the metric is graphed. +%% You can use the model to +%% display a band of expected normal values when the metric is graphed. %% %% If you have enabled unified cross-account observability, and this account -%% is a monitoring -%% account, the metric can be in the same account or a source account. You -%% can specify the account ID -%% in the object you specify in the `SingleMetricAnomalyDetector' -%% parameter. +%% is a +%% monitoring account, the metric can be in the same account or a source +%% account. You can +%% specify the account ID in the object you specify in the +%% `SingleMetricAnomalyDetector' parameter. %% %% For more information, see CloudWatch Anomaly Detection: %% https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Anomaly_Detection.html. @@ -2085,18 +2133,18 @@ put_anomaly_detector(Client, Input, Options) %% The alarms specified in a composite alarm's rule expression can %% include metric alarms %% and other composite alarms. The rule expression of a composite alarm can -%% include as many as 100 underlying alarms. -%% Any single alarm can be included in the rule expressions of as many as 150 -%% composite alarms. -%% -%% Using composite alarms can reduce -%% alarm noise. You can create multiple metric alarms, -%% and also create a composite alarm and -%% set up alerts only -%% for the composite alarm. For example, you could create a composite -%% alarm that goes into ALARM state only when more than one of the underlying -%% metric alarms -%% are in ALARM state. +%% include as many +%% as 100 underlying alarms. Any single alarm can be included in the rule +%% expressions of as +%% many as 150 composite alarms. +%% +%% Using composite alarms can reduce alarm noise. You can create multiple +%% metric alarms, +%% and also create a composite alarm and set up alerts only for the composite +%% alarm. For +%% example, you could create a composite alarm that goes into ALARM state +%% only when more +%% than one of the underlying metric alarms are in ALARM state. %% %% Composite alarms can take the following actions: %% @@ -2109,20 +2157,25 @@ put_anomaly_detector(Client, Input, Options) %% Create incidents in Systems Manager Incident Manager. %% %% It is possible to create a loop or cycle of composite alarms, where -%% composite alarm A depends on composite alarm B, and -%% composite alarm B also depends on composite alarm A. In this scenario, you -%% can't delete any composite alarm that is part of the cycle -%% because there is always still a composite alarm that depends on that alarm -%% that you want to delete. -%% -%% To get out of such a situation, you must -%% break the cycle by changing the rule of one of the composite alarms in the -%% cycle to remove a dependency that creates the cycle. The simplest -%% change to make to break a cycle is to change the `AlarmRule' of one of -%% the alarms to `false'. +%% composite +%% alarm A depends on composite alarm B, and composite alarm B also depends +%% on +%% composite alarm A. In this scenario, you can't delete any composite +%% alarm that is +%% part of the cycle because there is always still a composite alarm that +%% depends on +%% that alarm that you want to delete. +%% +%% To get out of such a situation, you must break the cycle by changing the +%% rule of +%% one of the composite alarms in the cycle to remove a dependency that +%% creates the +%% cycle. The simplest change to make to break a cycle is to change the +%% `AlarmRule' of one of the alarms to `false'. %% %% Additionally, the evaluation of composite alarms stops if CloudWatch -%% detects a cycle in the evaluation path. +%% detects a +%% cycle in the evaluation path. %% %% When this operation creates an alarm, the alarm state is immediately set %% to @@ -2130,22 +2183,21 @@ put_anomaly_detector(Client, Input, Options) %% appropriately. Any actions associated with the new state are then %% executed. For a %% composite alarm, this initial time after creation is the only time that -%% the -%% alarm can be in `INSUFFICIENT_DATA' state. +%% the alarm can be +%% in `INSUFFICIENT_DATA' state. %% %% When you update an existing alarm, its state is left unchanged, but the %% update %% completely overwrites the previous configuration of the alarm. %% -%% To use this operation, you must be signed on with -%% the `cloudwatch:PutCompositeAlarm' permission that is scoped to -%% `*'. You can't create a -%% composite alarms if your `cloudwatch:PutCompositeAlarm' permission has -%% a narrower scope. +%% To use this operation, you must be signed on with the +%% `cloudwatch:PutCompositeAlarm' permission that is scoped to +%% `*'. You can't create a composite alarms if your +%% `cloudwatch:PutCompositeAlarm' permission has a narrower scope. %% -%% If you are an IAM user, you must have `iam:CreateServiceLinkedRole' to -%% create -%% a composite alarm that has Systems Manager OpsItem actions. +%% If you are an IAM user, you must have +%% `iam:CreateServiceLinkedRole' to create a composite alarm that has +%% Systems Manager OpsItem actions. -spec put_composite_alarm(aws_client:aws_client(), put_composite_alarm_input()) -> {ok, undefined, tuple()} | {error, any()} | @@ -2165,29 +2217,30 @@ put_composite_alarm(Client, Input, Options) %% @doc Creates a dashboard if it does not already exist, or updates an %% existing dashboard. %% -%% If you update a dashboard, -%% the entire contents are replaced with what you specify here. +%% If you update a dashboard, the entire contents are replaced with what you +%% specify +%% here. %% %% All dashboards in your account are global, not region-specific. %% %% A simple way to create a dashboard using `PutDashboard' is to copy an %% existing dashboard. To copy an existing dashboard using the console, you -%% can load the dashboard -%% and then use the View/edit source command in the Actions menu to display -%% the JSON block -%% for that dashboard. Another way to copy a dashboard is to -%% use `GetDashboard', and then use the data returned -%% within `DashboardBody' as the template for the new dashboard when you -%% call `PutDashboard'. +%% can load the +%% dashboard and then use the View/edit source command in the Actions menu to +%% display the +%% JSON block for that dashboard. Another way to copy a dashboard is to use +%% `GetDashboard', and then use the data returned within +%% `DashboardBody' as the template for the new dashboard when you call +%% `PutDashboard'. %% %% When you create a dashboard with `PutDashboard', a good practice is to %% add a text widget at the top of the dashboard with a message that the -%% dashboard was created by script and should -%% not be changed in the console. This message could also point console users -%% to the location -%% of the `DashboardBody' script or the CloudFormation template used to -%% create the -%% dashboard. +%% dashboard was +%% created by script and should not be changed in the console. This message +%% could also +%% point console users to the location of the `DashboardBody' script or +%% the +%% CloudFormation template used to create the dashboard. -spec put_dashboard(aws_client:aws_client(), put_dashboard_input()) -> {ok, put_dashboard_output(), tuple()} | {error, any()} | @@ -2206,15 +2259,16 @@ put_dashboard(Client, Input, Options) %% @doc Creates a Contributor Insights rule. %% -%% Rules evaluate log events in a -%% CloudWatch Logs log group, enabling you to find contributor data for the -%% log events in that log group. For more information, -%% see Using Contributor Insights to Analyze High-Cardinality Data: +%% Rules evaluate log events in a CloudWatch Logs +%% log group, enabling you to find contributor data for the log events in +%% that log group. +%% For more information, see Using Contributor +%% Insights to Analyze High-Cardinality Data: %% https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContributorInsights.html. %% %% If you create a rule, delete it, and then re-create it with the same name, -%% historical data from the first time -%% the rule was created might not be available. +%% historical +%% data from the first time the rule was created might not be available. -spec put_insight_rule(aws_client:aws_client(), put_insight_rule_input()) -> {ok, put_insight_rule_output(), tuple()} | {error, any()} | @@ -2231,24 +2285,21 @@ put_insight_rule(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"PutInsightRule">>, Input, Options). -%% @doc -%% Creates a managed Contributor Insights rule -%% for a specified Amazon Web Services resource. -%% -%% When you enable a managed rule, -%% you create a Contributor Insights rule -%% that collects data -%% from Amazon Web Services services. -%% You cannot edit these rules -%% with `PutInsightRule'. -%% The rules can be enabled, disabled, and deleted using +%% @doc Creates a managed Contributor Insights rule for a specified Amazon +%% Web Services +%% resource. +%% +%% When you enable a managed rule, you create a Contributor Insights rule +%% that +%% collects data from Amazon Web Services services. You cannot edit these +%% rules with +%% `PutInsightRule'. The rules can be enabled, disabled, and deleted +%% using %% `EnableInsightRules', `DisableInsightRules', and -%% `DeleteInsightRules'. -%% If a previously created managed rule is currently disabled, -%% a subsequent call -%% to this API will re-enable it. -%% Use `ListManagedInsightRules' -%% to describe all available rules. +%% `DeleteInsightRules'. If a previously created managed rule is +%% currently +%% disabled, a subsequent call to this API will re-enable it. Use +%% `ListManagedInsightRules' to describe all available rules. -spec put_managed_insight_rules(aws_client:aws_client(), put_managed_insight_rules_input()) -> {ok, put_managed_insight_rules_output(), tuple()} | {error, any()} | @@ -2266,12 +2317,12 @@ put_managed_insight_rules(Client, Input, Options) request(Client, <<"PutManagedInsightRules">>, Input, Options). %% @doc Creates or updates an alarm and associates it with the specified -%% metric, metric math expression, -%% anomaly detection model, or Metrics Insights query. +%% metric, metric +%% math expression, anomaly detection model, or Metrics Insights query. %% -%% For more information about using -%% a Metrics Insights query for an alarm, see Create alarms on Metrics -%% Insights queries: +%% For more +%% information about using a Metrics Insights query for an alarm, see Create +%% alarms on Metrics Insights queries: %% https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Create_Metrics_Insights_Alarm.html. %% %% Alarms based on anomaly detection models cannot have Auto Scaling actions. @@ -2283,25 +2334,26 @@ put_managed_insight_rules(Client, Input, Options) %% executed. %% %% When you update an existing alarm, its state is left unchanged, but the -%% update completely overwrites the previous configuration of the alarm. +%% update +%% completely overwrites the previous configuration of the alarm. %% -%% If you are an IAM user, you must have -%% Amazon EC2 permissions for some alarm operations: +%% If you are an IAM user, you must have Amazon EC2 permissions for +%% some alarm operations: %% -%% The `iam:CreateServiceLinkedRole' permission for all alarms with EC2 -%% actions +%% The `iam:CreateServiceLinkedRole' permission for all alarms with +%% EC2 actions %% %% The `iam:CreateServiceLinkedRole' permissions to create an alarm %% with Systems Manager OpsItem or response plan actions. %% -%% The first time you create an alarm in the -%% Amazon Web Services Management Console, the CLI, or by using the -%% PutMetricAlarm API, CloudWatch -%% creates the necessary service-linked role for you. The service-linked -%% roles -%% are called `AWSServiceRoleForCloudWatchEvents' and -%% `AWSServiceRoleForCloudWatchAlarms_ActionSSM'. -%% For more information, see Amazon Web Services service-linked role: +%% The first time you create an alarm in the Amazon Web Services Management +%% Console, the CLI, or by using the PutMetricAlarm API, CloudWatch creates +%% the necessary +%% service-linked role for you. The service-linked roles are called +%% `AWSServiceRoleForCloudWatchEvents' and +%% `AWSServiceRoleForCloudWatchAlarms_ActionSSM'. For more information, +%% see +%% Amazon Web Services service-linked role: %% https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#iam-term-service-linked-role. %% %% Each `PutMetricAlarm' action has a maximum uncompressed payload of 120 @@ -2310,28 +2362,28 @@ put_managed_insight_rules(Client, Input, Options) %% Cross-account alarms %% %% You can set an alarm on metrics in the current account, or in another -%% account. To create a cross-account alarm that watches a metric in a -%% different account, you must have completed the following -%% pre-requisites: -%% -%% The account where the metrics are located (the sharing account) must -%% already have a sharing role named CloudWatch-CrossAccountSharingRole. If -%% it does not already -%% have this role, you must create it using the instructions in Set up a -%% sharing account in -%% Cross-account cross-Region CloudWatch console: +%% account. To +%% create a cross-account alarm that watches a metric in a different account, +%% you must have +%% completed the following pre-requisites: +%% +%% The account where the metrics are located (the sharing +%% account) must already have a sharing role named +%% CloudWatch-CrossAccountSharingRole. If it does not +%% already have this role, you must create it using the instructions in Set +%% up a sharing account in Cross-account cross-Region CloudWatch console: %% https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Cross-Account-Cross-Region.html#enable-cross-account-cross-Region. -%% The policy for that -%% role must grant access -%% to the ID of the account where you are creating the alarm. +%% The policy +%% for that role must grant access to the ID of the account where you are +%% creating +%% the alarm. %% -%% The account where you are creating the alarm (the monitoring account) must -%% already have a service-linked role named +%% The account where you are creating the alarm (the monitoring +%% account) must already have a service-linked role named %% AWSServiceRoleForCloudWatchCrossAccount to allow -%% CloudWatch to assume the sharing role in the sharing account. If it does -%% not, you must create it following the directions in Set up a -%% monitoring account in -%% Cross-account cross-Region CloudWatch console: +%% CloudWatch to assume the sharing role in the sharing account. If it +%% does not, you must create it following the directions in Set up a +%% monitoring account in Cross-account cross-Region CloudWatch console: %% https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Cross-Account-Cross-Region.html#enable-cross-account-cross-Region. -spec put_metric_alarm(aws_client:aws_client(), put_metric_alarm_input()) -> {ok, undefined, tuple()} | @@ -2349,79 +2401,90 @@ put_metric_alarm(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"PutMetricAlarm">>, Input, Options). -%% @doc Publishes metric data points to Amazon CloudWatch. +%% @doc Publishes metric data to Amazon CloudWatch. %% -%% CloudWatch associates -%% the data points with the specified metric. If the specified metric does -%% not exist, -%% CloudWatch creates the metric. When CloudWatch creates a metric, it can -%% take up to fifteen minutes for the metric to appear in calls to -%% ListMetrics: +%% CloudWatch associates the data with the +%% specified metric. If the specified metric does not exist, CloudWatch +%% creates the metric. +%% When CloudWatch creates a metric, it can take up to fifteen minutes for +%% the metric to +%% appear in calls to ListMetrics: %% https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_ListMetrics.html. %% -%% You can publish either individual data points in the `Value' field, or -%% arrays of values and the number of times each value occurred during the -%% period by using the -%% `Values' and `Counts' fields in the `MetricData' structure. -%% Using -%% the `Values' and `Counts' method enables you to publish up to 150 -%% values per metric -%% with one `PutMetricData' request, and +%% You can publish metrics with associated entity data (so that related +%% telemetry can be +%% found and viewed together), or publish metric data by itself. To send +%% entity data with +%% your metrics, use the `EntityMetricData' parameter. To send metrics +%% without +%% entity data, use the `MetricData' parameter. The +%% `EntityMetricData' structure includes `MetricData' structures +%% for the metric data. +%% +%% You can publish either individual values in the `Value' field, or +%% arrays of +%% values and the number of times each value occurred during the period by +%% using the +%% `Values' and `Counts' fields in the `MetricData' +%% structure. Using the `Values' and `Counts' method enables you to +%% publish up to 150 values per metric with one `PutMetricData' request, +%% and %% supports retrieving percentile statistics on this data. %% %% Each `PutMetricData' request is limited to 1 MB in size for HTTP POST -%% requests. You can -%% send a payload compressed by gzip. Each request -%% is also limited to no more than 1000 different metrics. -%% -%% Although the `Value' parameter accepts numbers of type -%% `Double', CloudWatch rejects values that are either too small -%% or too large. Values must be in the range of -2^360 to 2^360. In addition, -%% special values (for example, NaN, +Infinity, +%% requests. You can send a payload compressed by gzip. Each request is also +%% limited to no +%% more than 1000 different metrics (across both the `MetricData' and +%% `EntityMetricData' properties). +%% +%% Although the `Value' parameter accepts numbers of type `Double', +%% CloudWatch rejects values that are either too small or too large. Values +%% must be in the +%% range of -2^360 to 2^360. In addition, special values (for example, NaN, +%% +Infinity, %% -Infinity) are not supported. %% %% You can use up to 30 dimensions per metric to further clarify what data -%% the metric collects. Each dimension -%% consists of a Name and Value pair. For more information about specifying -%% dimensions, see Publishing Metrics: +%% the metric +%% collects. Each dimension consists of a Name and Value pair. For more +%% information about +%% specifying dimensions, see Publishing +%% Metrics: %% https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/publishingMetrics.html -%% in the -%% Amazon CloudWatch User Guide. +%% in the Amazon CloudWatch User Guide. %% %% You specify the time stamp to be associated with each data point. You can -%% specify -%% time stamps that are as much as two weeks before the current date, and as -%% much as 2 hours after -%% the current day and time. +%% specify time +%% stamps that are as much as two weeks before the current date, and as much +%% as 2 hours +%% after the current day and time. %% %% Data points with time stamps from 24 hours ago or longer can take at least -%% 48 -%% hours to become available for GetMetricData: +%% 48 hours to +%% become available for GetMetricData: %% https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricData.html -%% or -%% GetMetricStatistics: +%% or GetMetricStatistics: %% https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricStatistics.html -%% from the time they -%% are submitted. Data points with time stamps between 3 and 24 hours ago can -%% take as much as 2 hours to become available -%% for for GetMetricData: +%% from the time they are submitted. Data points with time +%% stamps between 3 and 24 hours ago can take as much as 2 hours to become +%% available for +%% GetMetricData: %% https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricData.html -%% or -%% GetMetricStatistics: +%% or GetMetricStatistics: %% https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricStatistics.html. %% %% CloudWatch needs raw data points to calculate percentile statistics. If %% you publish -%% data using a statistic set instead, you can only retrieve -%% percentile statistics for this data if one of the following conditions is -%% true: +%% data using a statistic set instead, you can only retrieve percentile +%% statistics for this +%% data if one of the following conditions is true: %% -%% The `SampleCount' value of the statistic set is 1 and `Min', -%% `Max', and `Sum' are all equal. +%% The `SampleCount' value of the statistic set is 1 and +%% `Min', `Max', and `Sum' are all +%% equal. %% -%% The `Min' and -%% `Max' are equal, and `Sum' is equal to `Min' -%% multiplied by `SampleCount'. +%% The `Min' and `Max' are equal, and `Sum' +%% is equal to `Min' multiplied by `SampleCount'. -spec put_metric_data(aws_client:aws_client(), put_metric_data_input()) -> {ok, undefined, tuple()} | {error, any()} | @@ -2445,8 +2508,8 @@ put_metric_data(Client, Input, Options) %% many third-party %% solutions. %% -%% For more information, see -%% Using Metric Streams: +%% For more information, see Using +%% Metric Streams: %% https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Metric-Streams.html. %% %% To create a metric stream, you must be signed in to an account that has @@ -2460,8 +2523,8 @@ put_metric_data(Client, Input, Options) %% %% Stream metrics from all metric namespaces in the account. %% -%% Stream metrics from all metric namespaces in the account, except -%% for the namespaces that you list in `ExcludeFilters'. +%% Stream metrics from all metric namespaces in the account, except for the +%% namespaces that you list in `ExcludeFilters'. %% %% Stream metrics from only the metric namespaces that you list in %% `IncludeFilters'. @@ -2476,16 +2539,17 @@ put_metric_data(Client, Input, Options) %% Pricing: https://aws.amazon.com/cloudwatch/pricing/. %% %% When you use `PutMetricStream' to create a new metric stream, the -%% stream -%% is created in the `running' state. If you use it to update an existing +%% stream is +%% created in the `running' state. If you use it to update an existing %% stream, %% the state of the stream is not changed. %% %% If you are using CloudWatch cross-account observability and you create a -%% metric stream in a monitoring account, -%% you can choose whether to include metrics from source accounts in the -%% stream. For more information, see -%% CloudWatch cross-account observability: +%% metric +%% stream in a monitoring account, you can choose whether to include metrics +%% from source +%% accounts in the stream. For more information, see CloudWatch cross-account +%% observability: %% https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html. -spec put_metric_stream(aws_client:aws_client(), put_metric_stream_input()) -> {ok, put_metric_stream_output(), tuple()} | @@ -2505,34 +2569,35 @@ put_metric_stream(Client, Input, Options) %% @doc Temporarily sets the state of an alarm for testing purposes. %% -%% When the updated -%% state differs from the previous value, the action configured for -%% the appropriate state is invoked. For example, if your alarm is configured -%% to send an -%% Amazon SNS message when an alarm is triggered, temporarily changing the -%% alarm state to -%% `ALARM' sends an SNS message. -%% -%% Metric alarms -%% returns to their actual state quickly, often within seconds. Because the -%% metric alarm state change -%% happens quickly, it is typically only visible in the alarm's History -%% tab in the Amazon CloudWatch console or through -%% DescribeAlarmHistory: +%% When the updated state +%% differs from the previous value, the action configured for the appropriate +%% state is +%% invoked. For example, if your alarm is configured to send an Amazon SNS +%% message when an +%% alarm is triggered, temporarily changing the alarm state to `ALARM' +%% sends an +%% SNS message. +%% +%% Metric alarms returns to their actual state quickly, often within seconds. +%% Because +%% the metric alarm state change happens quickly, it is typically only +%% visible in the +%% alarm's History tab in the Amazon CloudWatch console or +%% through DescribeAlarmHistory: %% https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarmHistory.html. %% %% If you use `SetAlarmState' on a composite alarm, the composite alarm -%% is not guaranteed to return -%% to its actual state. It -%% returns to its actual state only once any of its children alarms change -%% state. It is also -%% reevaluated if you update its +%% is +%% not guaranteed to return to its actual state. It returns to its actual +%% state only once +%% any of its children alarms change state. It is also reevaluated if you +%% update its %% configuration. %% %% If an alarm triggers EC2 Auto Scaling policies or application Auto Scaling -%% policies, you must include -%% information in the `StateReasonData' parameter to enable the policy to -%% take the correct action. +%% policies, you must include information in the `StateReasonData' +%% parameter to +%% enable the policy to take the correct action. -spec set_alarm_state(aws_client:aws_client(), set_alarm_state_input()) -> {ok, undefined, tuple()} | {error, any()} | @@ -2588,23 +2653,29 @@ stop_metric_streams(Client, Input, Options) %% @doc Assigns one or more tags (key-value pairs) to the specified %% CloudWatch resource. %% -%% Currently, the only CloudWatch resources that -%% can be tagged are alarms and Contributor Insights rules. +%% Currently, the only CloudWatch resources that can be tagged are alarms and +%% Contributor +%% Insights rules. %% %% Tags can help you organize and categorize your resources. You can also use -%% them to scope user -%% permissions by granting a user -%% permission to access or change only resources with certain tag values. +%% them to +%% scope user permissions by granting a user permission to access or change +%% only resources +%% with certain tag values. %% %% Tags don't have any semantic meaning to Amazon Web Services and are -%% interpreted strictly as strings of characters. +%% interpreted +%% strictly as strings of characters. %% %% You can use the `TagResource' action with an alarm that already has -%% tags. If you specify a new tag key for the alarm, -%% this tag is appended to the list of tags associated -%% with the alarm. If you specify a tag key that is already associated with -%% the alarm, the new tag value that you specify replaces -%% the previous value for that tag. +%% tags. +%% If you specify a new tag key for the alarm, this tag is appended to the +%% list of tags +%% associated with the alarm. If you specify a tag key that is already +%% associated with the +%% alarm, the new tag value that you specify replaces the previous value for +%% that +%% tag. %% %% You can associate as many as 50 tags with a CloudWatch resource. -spec tag_resource(aws_client:aws_client(), tag_resource_input()) -> diff --git a/src/aws_connectcampaignsv2.erl b/src/aws_connectcampaignsv2.erl new file mode 100644 index 00000000..d31092e4 --- /dev/null +++ b/src/aws_connectcampaignsv2.erl @@ -0,0 +1,2292 @@ +%% WARNING: DO NOT EDIT, AUTO-GENERATED CODE! +%% See https://github.com/aws-beam/aws-codegen for more details. + +%% @doc Provide APIs to create and manage Amazon Connect Campaigns. +-module(aws_connectcampaignsv2). + +-export([create_campaign/2, + create_campaign/3, + delete_campaign/3, + delete_campaign/4, + delete_campaign_channel_subtype_config/3, + delete_campaign_channel_subtype_config/4, + delete_campaign_communication_limits/3, + delete_campaign_communication_limits/4, + delete_campaign_communication_time/3, + delete_campaign_communication_time/4, + delete_connect_instance_config/3, + delete_connect_instance_config/4, + delete_connect_instance_integration/3, + delete_connect_instance_integration/4, + delete_instance_onboarding_job/3, + delete_instance_onboarding_job/4, + describe_campaign/2, + describe_campaign/4, + describe_campaign/5, + get_campaign_state/2, + get_campaign_state/4, + get_campaign_state/5, + get_campaign_state_batch/2, + get_campaign_state_batch/3, + get_connect_instance_config/2, + get_connect_instance_config/4, + get_connect_instance_config/5, + get_instance_onboarding_job_status/2, + get_instance_onboarding_job_status/4, + get_instance_onboarding_job_status/5, + list_campaigns/2, + list_campaigns/3, + list_connect_instance_integrations/2, + list_connect_instance_integrations/4, + list_connect_instance_integrations/5, + list_tags_for_resource/2, + list_tags_for_resource/4, + list_tags_for_resource/5, + pause_campaign/3, + pause_campaign/4, + put_connect_instance_integration/3, + put_connect_instance_integration/4, + put_outbound_request_batch/3, + put_outbound_request_batch/4, + resume_campaign/3, + resume_campaign/4, + start_campaign/3, + start_campaign/4, + start_instance_onboarding_job/3, + start_instance_onboarding_job/4, + stop_campaign/3, + stop_campaign/4, + tag_resource/3, + tag_resource/4, + untag_resource/3, + untag_resource/4, + update_campaign_channel_subtype_config/3, + update_campaign_channel_subtype_config/4, + update_campaign_communication_limits/3, + update_campaign_communication_limits/4, + update_campaign_communication_time/3, + update_campaign_communication_time/4, + update_campaign_flow_association/3, + update_campaign_flow_association/4, + update_campaign_name/3, + update_campaign_name/4, + update_campaign_schedule/3, + update_campaign_schedule/4, + update_campaign_source/3, + update_campaign_source/4]). + +-include_lib("hackney/include/hackney_lib.hrl"). + + + +%% Example: +%% answer_machine_detection_config() :: #{ +%% <<"awaitAnswerMachinePrompt">> => [boolean()], +%% <<"enableAnswerMachineDetection">> => [boolean()] +%% } +-type answer_machine_detection_config() :: #{binary() => any()}. + + +%% Example: +%% q_connect_integration_summary() :: #{ +%% <<"knowledgeBaseArn">> => string() +%% } +-type q_connect_integration_summary() :: #{binary() => any()}. + + +%% Example: +%% describe_campaign_response() :: #{ +%% <<"campaign">> => campaign() +%% } +-type describe_campaign_response() :: #{binary() => any()}. + + +%% Example: +%% tag_resource_request() :: #{ +%% <<"tags">> := map() +%% } +-type tag_resource_request() :: #{binary() => any()}. + + +%% Example: +%% encryption_config() :: #{ +%% <<"enabled">> => boolean(), +%% <<"encryptionType">> => string(), +%% <<"keyArn">> => string() +%% } +-type encryption_config() :: #{binary() => any()}. + + +%% Example: +%% email_channel_subtype_config() :: #{ +%% <<"capacity">> => float(), +%% <<"defaultOutboundConfig">> => email_outbound_config(), +%% <<"outboundMode">> => list() +%% } +-type email_channel_subtype_config() :: #{binary() => any()}. + + +%% Example: +%% campaign() :: #{ +%% <<"arn">> => string(), +%% <<"channelSubtypeConfig">> => channel_subtype_config(), +%% <<"communicationLimitsOverride">> => communication_limits_config(), +%% <<"communicationTimeConfig">> => communication_time_config(), +%% <<"connectCampaignFlowArn">> => string(), +%% <<"connectInstanceId">> => string(), +%% <<"id">> => string(), +%% <<"name">> => string(), +%% <<"schedule">> => schedule(), +%% <<"source">> => list(), +%% <<"tags">> => map() +%% } +-type campaign() :: #{binary() => any()}. + + +%% Example: +%% customer_profiles_integration_config() :: #{ +%% <<"domainArn">> => string(), +%% <<"objectTypeNames">> => map() +%% } +-type customer_profiles_integration_config() :: #{binary() => any()}. + + +%% Example: +%% successful_request() :: #{ +%% <<"clientToken">> => string(), +%% <<"id">> => string() +%% } +-type successful_request() :: #{binary() => any()}. + + +%% Example: +%% sms_outbound_config() :: #{ +%% <<"connectSourcePhoneNumberArn">> => string(), +%% <<"wisdomTemplateArn">> => string() +%% } +-type sms_outbound_config() :: #{binary() => any()}. + +%% Example: +%% delete_instance_onboarding_job_request() :: #{} +-type delete_instance_onboarding_job_request() :: #{}. + + +%% Example: +%% customer_profiles_integration_summary() :: #{ +%% <<"domainArn">> => string(), +%% <<"objectTypeNames">> => map() +%% } +-type customer_profiles_integration_summary() :: #{binary() => any()}. + + +%% Example: +%% delete_connect_instance_config_request() :: #{ +%% <<"campaignDeletionPolicy">> => string() +%% } +-type delete_connect_instance_config_request() :: #{binary() => any()}. + + +%% Example: +%% delete_campaign_channel_subtype_config_request() :: #{ +%% <<"channelSubtype">> := string() +%% } +-type delete_campaign_channel_subtype_config_request() :: #{binary() => any()}. + + +%% Example: +%% get_campaign_state_batch_response() :: #{ +%% <<"failedRequests">> => list(failed_campaign_state_response()()), +%% <<"successfulRequests">> => list(successful_campaign_state_response()()) +%% } +-type get_campaign_state_batch_response() :: #{binary() => any()}. + + +%% Example: +%% instance_onboarding_job_status() :: #{ +%% <<"connectInstanceId">> => string(), +%% <<"failureCode">> => string(), +%% <<"status">> => string() +%% } +-type instance_onboarding_job_status() :: #{binary() => any()}. + + +%% Example: +%% put_outbound_request_batch_response() :: #{ +%% <<"failedRequests">> => list(failed_request()()), +%% <<"successfulRequests">> => list(successful_request()()) +%% } +-type put_outbound_request_batch_response() :: #{binary() => any()}. + + +%% Example: +%% delete_connect_instance_integration_request() :: #{ +%% <<"integrationIdentifier">> := list() +%% } +-type delete_connect_instance_integration_request() :: #{binary() => any()}. + + +%% Example: +%% list_campaigns_response() :: #{ +%% <<"campaignSummaryList">> => list(campaign_summary()()), +%% <<"nextToken">> => string() +%% } +-type list_campaigns_response() :: #{binary() => any()}. + + +%% Example: +%% get_campaign_state_response() :: #{ +%% <<"state">> => string() +%% } +-type get_campaign_state_response() :: #{binary() => any()}. + +%% Example: +%% delete_campaign_request() :: #{} +-type delete_campaign_request() :: #{}. + + +%% Example: +%% update_campaign_source_request() :: #{ +%% <<"source">> := list() +%% } +-type update_campaign_source_request() :: #{binary() => any()}. + + +%% Example: +%% local_time_zone_config() :: #{ +%% <<"defaultTimeZone">> => string(), +%% <<"localTimeZoneDetection">> => list(string()()) +%% } +-type local_time_zone_config() :: #{binary() => any()}. + +%% Example: +%% describe_campaign_request() :: #{} +-type describe_campaign_request() :: #{}. + + +%% Example: +%% delete_campaign_communication_time_request() :: #{ +%% <<"config">> := string() +%% } +-type delete_campaign_communication_time_request() :: #{binary() => any()}. + + +%% Example: +%% untag_resource_request() :: #{ +%% <<"tagKeys">> := list(string()()) +%% } +-type untag_resource_request() :: #{binary() => any()}. + + +%% Example: +%% invalid_state_exception() :: #{ +%% <<"message">> => [string()], +%% <<"xAmzErrorType">> => string() +%% } +-type invalid_state_exception() :: #{binary() => any()}. + + +%% Example: +%% delete_campaign_communication_limits_request() :: #{ +%% <<"config">> := string() +%% } +-type delete_campaign_communication_limits_request() :: #{binary() => any()}. + + +%% Example: +%% update_campaign_schedule_request() :: #{ +%% <<"schedule">> := schedule() +%% } +-type update_campaign_schedule_request() :: #{binary() => any()}. + + +%% Example: +%% instance_id_filter() :: #{ +%% <<"operator">> => string(), +%% <<"value">> => string() +%% } +-type instance_id_filter() :: #{binary() => any()}. + + +%% Example: +%% invalid_campaign_state_exception() :: #{ +%% <<"message">> => [string()], +%% <<"state">> => string(), +%% <<"xAmzErrorType">> => string() +%% } +-type invalid_campaign_state_exception() :: #{binary() => any()}. + + +%% Example: +%% list_campaigns_request() :: #{ +%% <<"filters">> => campaign_filters(), +%% <<"maxResults">> => integer(), +%% <<"nextToken">> => string() +%% } +-type list_campaigns_request() :: #{binary() => any()}. + + +%% Example: +%% update_campaign_flow_association_request() :: #{ +%% <<"connectCampaignFlowArn">> := string() +%% } +-type update_campaign_flow_association_request() :: #{binary() => any()}. + + +%% Example: +%% update_campaign_name_request() :: #{ +%% <<"name">> := string() +%% } +-type update_campaign_name_request() :: #{binary() => any()}. + + +%% Example: +%% start_instance_onboarding_job_response() :: #{ +%% <<"connectInstanceOnboardingJobStatus">> => instance_onboarding_job_status() +%% } +-type start_instance_onboarding_job_response() :: #{binary() => any()}. + + +%% Example: +%% conflict_exception() :: #{ +%% <<"message">> => [string()], +%% <<"xAmzErrorType">> => string() +%% } +-type conflict_exception() :: #{binary() => any()}. + + +%% Example: +%% resource_not_found_exception() :: #{ +%% <<"message">> => [string()], +%% <<"xAmzErrorType">> => string() +%% } +-type resource_not_found_exception() :: #{binary() => any()}. + + +%% Example: +%% telephony_channel_subtype_config() :: #{ +%% <<"capacity">> => float(), +%% <<"connectQueueId">> => string(), +%% <<"defaultOutboundConfig">> => telephony_outbound_config(), +%% <<"outboundMode">> => list() +%% } +-type telephony_channel_subtype_config() :: #{binary() => any()}. + + +%% Example: +%% time_window() :: #{ +%% <<"openHours">> => list(), +%% <<"restrictedPeriods">> => list() +%% } +-type time_window() :: #{binary() => any()}. + +%% Example: +%% get_campaign_state_request() :: #{} +-type get_campaign_state_request() :: #{}. + + +%% Example: +%% q_connect_integration_config() :: #{ +%% <<"knowledgeBaseArn">> => string() +%% } +-type q_connect_integration_config() :: #{binary() => any()}. + + +%% Example: +%% service_quota_exceeded_exception() :: #{ +%% <<"message">> => [string()], +%% <<"xAmzErrorType">> => string() +%% } +-type service_quota_exceeded_exception() :: #{binary() => any()}. + + +%% Example: +%% progressive_config() :: #{ +%% <<"bandwidthAllocation">> => float() +%% } +-type progressive_config() :: #{binary() => any()}. + +%% Example: +%% resume_campaign_request() :: #{} +-type resume_campaign_request() :: #{}. + +%% Example: +%% get_connect_instance_config_request() :: #{} +-type get_connect_instance_config_request() :: #{}. + + +%% Example: +%% update_campaign_communication_limits_request() :: #{ +%% <<"communicationLimitsOverride">> := communication_limits_config() +%% } +-type update_campaign_communication_limits_request() :: #{binary() => any()}. + + +%% Example: +%% get_campaign_state_batch_request() :: #{ +%% <<"campaignIds">> := list(string()()) +%% } +-type get_campaign_state_batch_request() :: #{binary() => any()}. + + +%% Example: +%% list_tags_for_resource_response() :: #{ +%% <<"tags">> => map() +%% } +-type list_tags_for_resource_response() :: #{binary() => any()}. + + +%% Example: +%% list_connect_instance_integrations_response() :: #{ +%% <<"integrationSummaryList">> => list(list()()), +%% <<"nextToken">> => string() +%% } +-type list_connect_instance_integrations_response() :: #{binary() => any()}. + + +%% Example: +%% telephony_channel_subtype_parameters() :: #{ +%% <<"answerMachineDetectionConfig">> => answer_machine_detection_config(), +%% <<"attributes">> => map(), +%% <<"connectSourcePhoneNumber">> => string(), +%% <<"destinationPhoneNumber">> => string() +%% } +-type telephony_channel_subtype_parameters() :: #{binary() => any()}. + + +%% Example: +%% customer_profiles_integration_identifier() :: #{ +%% <<"domainArn">> => string() +%% } +-type customer_profiles_integration_identifier() :: #{binary() => any()}. + + +%% Example: +%% communication_limit() :: #{ +%% <<"frequency">> => [integer()], +%% <<"maxCountPerRecipient">> => [integer()], +%% <<"unit">> => string() +%% } +-type communication_limit() :: #{binary() => any()}. + + +%% Example: +%% outbound_request() :: #{ +%% <<"channelSubtypeParameters">> => list(), +%% <<"clientToken">> => string(), +%% <<"expirationTime">> => non_neg_integer() +%% } +-type outbound_request() :: #{binary() => any()}. + + +%% Example: +%% communication_limits_config() :: #{ +%% <<"allChannelSubtypes">> => list() +%% } +-type communication_limits_config() :: #{binary() => any()}. + +%% Example: +%% agentless_config() :: #{} +-type agentless_config() :: #{}. + + +%% Example: +%% internal_server_exception() :: #{ +%% <<"message">> => [string()], +%% <<"xAmzErrorType">> => string() +%% } +-type internal_server_exception() :: #{binary() => any()}. + + +%% Example: +%% schedule() :: #{ +%% <<"endTime">> => non_neg_integer(), +%% <<"refreshFrequency">> => string(), +%% <<"startTime">> => non_neg_integer() +%% } +-type schedule() :: #{binary() => any()}. + + +%% Example: +%% channel_subtype_config() :: #{ +%% <<"email">> => email_channel_subtype_config(), +%% <<"sms">> => sms_channel_subtype_config(), +%% <<"telephony">> => telephony_channel_subtype_config() +%% } +-type channel_subtype_config() :: #{binary() => any()}. + +%% Example: +%% stop_campaign_request() :: #{} +-type stop_campaign_request() :: #{}. + + +%% Example: +%% sms_channel_subtype_parameters() :: #{ +%% <<"connectSourcePhoneNumberArn">> => string(), +%% <<"destinationPhoneNumber">> => string(), +%% <<"templateArn">> => string(), +%% <<"templateParameters">> => map() +%% } +-type sms_channel_subtype_parameters() :: #{binary() => any()}. + + +%% Example: +%% email_outbound_config() :: #{ +%% <<"connectSourceEmailAddress">> => string(), +%% <<"sourceEmailAddressDisplayName">> => string(), +%% <<"wisdomTemplateArn">> => string() +%% } +-type email_outbound_config() :: #{binary() => any()}. + + +%% Example: +%% communication_time_config() :: #{ +%% <<"email">> => time_window(), +%% <<"localTimeZoneConfig">> => local_time_zone_config(), +%% <<"sms">> => time_window(), +%% <<"telephony">> => time_window() +%% } +-type communication_time_config() :: #{binary() => any()}. + + +%% Example: +%% time_range() :: #{ +%% <<"endTime">> => string(), +%% <<"startTime">> => string() +%% } +-type time_range() :: #{binary() => any()}. + +%% Example: +%% pause_campaign_request() :: #{} +-type pause_campaign_request() :: #{}. + + +%% Example: +%% access_denied_exception() :: #{ +%% <<"message">> => [string()], +%% <<"xAmzErrorType">> => string() +%% } +-type access_denied_exception() :: #{binary() => any()}. + +%% Example: +%% start_campaign_request() :: #{} +-type start_campaign_request() :: #{}. + + +%% Example: +%% create_campaign_request() :: #{ +%% <<"channelSubtypeConfig">> := channel_subtype_config(), +%% <<"communicationLimitsOverride">> => communication_limits_config(), +%% <<"communicationTimeConfig">> => communication_time_config(), +%% <<"connectCampaignFlowArn">> => string(), +%% <<"connectInstanceId">> := string(), +%% <<"name">> := string(), +%% <<"schedule">> => schedule(), +%% <<"source">> => list(), +%% <<"tags">> => map() +%% } +-type create_campaign_request() :: #{binary() => any()}. + + +%% Example: +%% get_instance_onboarding_job_status_response() :: #{ +%% <<"connectInstanceOnboardingJobStatus">> => instance_onboarding_job_status() +%% } +-type get_instance_onboarding_job_status_response() :: #{binary() => any()}. + + +%% Example: +%% validation_exception() :: #{ +%% <<"message">> => [string()], +%% <<"xAmzErrorType">> => string() +%% } +-type validation_exception() :: #{binary() => any()}. + +%% Example: +%% list_tags_for_resource_request() :: #{} +-type list_tags_for_resource_request() :: #{}. + + +%% Example: +%% get_connect_instance_config_response() :: #{ +%% <<"connectInstanceConfig">> => instance_config() +%% } +-type get_connect_instance_config_response() :: #{binary() => any()}. + + +%% Example: +%% instance_config() :: #{ +%% <<"connectInstanceId">> => string(), +%% <<"encryptionConfig">> => encryption_config(), +%% <<"serviceLinkedRoleArn">> => string() +%% } +-type instance_config() :: #{binary() => any()}. + + +%% Example: +%% sms_channel_subtype_config() :: #{ +%% <<"capacity">> => float(), +%% <<"defaultOutboundConfig">> => sms_outbound_config(), +%% <<"outboundMode">> => list() +%% } +-type sms_channel_subtype_config() :: #{binary() => any()}. + + +%% Example: +%% update_campaign_communication_time_request() :: #{ +%% <<"communicationTimeConfig">> := communication_time_config() +%% } +-type update_campaign_communication_time_request() :: #{binary() => any()}. + + +%% Example: +%% throttling_exception() :: #{ +%% <<"message">> => [string()], +%% <<"xAmzErrorType">> => string() +%% } +-type throttling_exception() :: #{binary() => any()}. + + +%% Example: +%% telephony_outbound_config() :: #{ +%% <<"answerMachineDetectionConfig">> => answer_machine_detection_config(), +%% <<"connectContactFlowId">> => string(), +%% <<"connectSourcePhoneNumber">> => string() +%% } +-type telephony_outbound_config() :: #{binary() => any()}. + + +%% Example: +%% update_campaign_channel_subtype_config_request() :: #{ +%% <<"channelSubtypeConfig">> := channel_subtype_config() +%% } +-type update_campaign_channel_subtype_config_request() :: #{binary() => any()}. + + +%% Example: +%% put_connect_instance_integration_request() :: #{ +%% <<"integrationConfig">> := list() +%% } +-type put_connect_instance_integration_request() :: #{binary() => any()}. + + +%% Example: +%% q_connect_integration_identifier() :: #{ +%% <<"knowledgeBaseArn">> => string() +%% } +-type q_connect_integration_identifier() :: #{binary() => any()}. + + +%% Example: +%% failed_request() :: #{ +%% <<"clientToken">> => string(), +%% <<"failureCode">> => string(), +%% <<"id">> => string() +%% } +-type failed_request() :: #{binary() => any()}. + + +%% Example: +%% list_connect_instance_integrations_request() :: #{ +%% <<"maxResults">> => integer(), +%% <<"nextToken">> => string() +%% } +-type list_connect_instance_integrations_request() :: #{binary() => any()}. + + +%% Example: +%% predictive_config() :: #{ +%% <<"bandwidthAllocation">> => float() +%% } +-type predictive_config() :: #{binary() => any()}. + + +%% Example: +%% email_channel_subtype_parameters() :: #{ +%% <<"connectSourceEmailAddress">> => string(), +%% <<"destinationEmailAddress">> => string(), +%% <<"templateArn">> => string(), +%% <<"templateParameters">> => map() +%% } +-type email_channel_subtype_parameters() :: #{binary() => any()}. + + +%% Example: +%% put_outbound_request_batch_request() :: #{ +%% <<"outboundRequests">> := list(outbound_request()()) +%% } +-type put_outbound_request_batch_request() :: #{binary() => any()}. + + +%% Example: +%% create_campaign_response() :: #{ +%% <<"arn">> => string(), +%% <<"id">> => string(), +%% <<"tags">> => map() +%% } +-type create_campaign_response() :: #{binary() => any()}. + + +%% Example: +%% successful_campaign_state_response() :: #{ +%% <<"campaignId">> => string(), +%% <<"state">> => string() +%% } +-type successful_campaign_state_response() :: #{binary() => any()}. + + +%% Example: +%% campaign_summary() :: #{ +%% <<"arn">> => string(), +%% <<"channelSubtypes">> => list(string()()), +%% <<"connectCampaignFlowArn">> => string(), +%% <<"connectInstanceId">> => string(), +%% <<"id">> => string(), +%% <<"name">> => string(), +%% <<"schedule">> => schedule() +%% } +-type campaign_summary() :: #{binary() => any()}. + +%% Example: +%% get_instance_onboarding_job_status_request() :: #{} +-type get_instance_onboarding_job_status_request() :: #{}. + + +%% Example: +%% failed_campaign_state_response() :: #{ +%% <<"campaignId">> => string(), +%% <<"failureCode">> => string() +%% } +-type failed_campaign_state_response() :: #{binary() => any()}. + + +%% Example: +%% start_instance_onboarding_job_request() :: #{ +%% <<"encryptionConfig">> := encryption_config() +%% } +-type start_instance_onboarding_job_request() :: #{binary() => any()}. + + +%% Example: +%% campaign_filters() :: #{ +%% <<"instanceIdFilter">> => instance_id_filter() +%% } +-type campaign_filters() :: #{binary() => any()}. + + +%% Example: +%% restricted_period() :: #{ +%% <<"endDate">> => string(), +%% <<"name">> => string(), +%% <<"startDate">> => string() +%% } +-type restricted_period() :: #{binary() => any()}. + +-type create_campaign_errors() :: + throttling_exception() | + validation_exception() | + access_denied_exception() | + internal_server_exception() | + service_quota_exceeded_exception() | + resource_not_found_exception() | + conflict_exception(). + +-type delete_campaign_errors() :: + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception(). + +-type delete_campaign_channel_subtype_config_errors() :: + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception() | + conflict_exception(). + +-type delete_campaign_communication_limits_errors() :: + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception() | + conflict_exception() | + invalid_campaign_state_exception(). + +-type delete_campaign_communication_time_errors() :: + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception() | + conflict_exception() | + invalid_campaign_state_exception(). + +-type delete_connect_instance_config_errors() :: + throttling_exception() | + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception() | + invalid_state_exception(). + +-type delete_connect_instance_integration_errors() :: + throttling_exception() | + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception(). + +-type delete_instance_onboarding_job_errors() :: + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception() | + invalid_state_exception(). + +-type describe_campaign_errors() :: + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception(). + +-type get_campaign_state_errors() :: + throttling_exception() | + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception(). + +-type get_campaign_state_batch_errors() :: + throttling_exception() | + validation_exception() | + access_denied_exception() | + internal_server_exception(). + +-type get_connect_instance_config_errors() :: + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception(). + +-type get_instance_onboarding_job_status_errors() :: + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception(). + +-type list_campaigns_errors() :: + validation_exception() | + access_denied_exception() | + internal_server_exception(). + +-type list_connect_instance_integrations_errors() :: + throttling_exception() | + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception(). + +-type list_tags_for_resource_errors() :: + throttling_exception() | + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception(). + +-type pause_campaign_errors() :: + throttling_exception() | + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception() | + conflict_exception() | + invalid_campaign_state_exception(). + +-type put_connect_instance_integration_errors() :: + throttling_exception() | + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception() | + conflict_exception(). + +-type put_outbound_request_batch_errors() :: + throttling_exception() | + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception() | + conflict_exception() | + invalid_campaign_state_exception(). + +-type resume_campaign_errors() :: + throttling_exception() | + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception() | + conflict_exception() | + invalid_campaign_state_exception(). + +-type start_campaign_errors() :: + throttling_exception() | + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception() | + conflict_exception() | + invalid_campaign_state_exception(). + +-type start_instance_onboarding_job_errors() :: + throttling_exception() | + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception() | + conflict_exception(). + +-type stop_campaign_errors() :: + throttling_exception() | + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception() | + conflict_exception() | + invalid_campaign_state_exception(). + +-type tag_resource_errors() :: + throttling_exception() | + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception(). + +-type untag_resource_errors() :: + throttling_exception() | + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception(). + +-type update_campaign_channel_subtype_config_errors() :: + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception() | + conflict_exception(). + +-type update_campaign_communication_limits_errors() :: + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception() | + conflict_exception() | + invalid_campaign_state_exception(). + +-type update_campaign_communication_time_errors() :: + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception() | + conflict_exception() | + invalid_campaign_state_exception(). + +-type update_campaign_flow_association_errors() :: + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception() | + conflict_exception() | + invalid_campaign_state_exception(). + +-type update_campaign_name_errors() :: + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception() | + conflict_exception(). + +-type update_campaign_schedule_errors() :: + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception() | + conflict_exception() | + invalid_campaign_state_exception(). + +-type update_campaign_source_errors() :: + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception() | + conflict_exception() | + invalid_campaign_state_exception(). + +%%==================================================================== +%% API +%%==================================================================== + +%% @doc Creates a campaign for the specified Amazon Connect account. +%% +%% This API is idempotent. +-spec create_campaign(aws_client:aws_client(), create_campaign_request()) -> + {ok, create_campaign_response(), tuple()} | + {error, any()} | + {error, create_campaign_errors(), tuple()}. +create_campaign(Client, Input) -> + create_campaign(Client, Input, []). + +-spec create_campaign(aws_client:aws_client(), create_campaign_request(), proplists:proplist()) -> + {ok, create_campaign_response(), tuple()} | + {error, any()} | + {error, create_campaign_errors(), tuple()}. +create_campaign(Client, Input0, Options0) -> + Method = put, + Path = ["/v2/campaigns"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary}, + {append_sha256_content_hash, false} + | Options2], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + Query_ = [], + Input = Input2, + + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%% @doc Deletes a campaign from the specified Amazon Connect account. +-spec delete_campaign(aws_client:aws_client(), binary() | list(), delete_campaign_request()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, delete_campaign_errors(), tuple()}. +delete_campaign(Client, Id, Input) -> + delete_campaign(Client, Id, Input, []). + +-spec delete_campaign(aws_client:aws_client(), binary() | list(), delete_campaign_request(), proplists:proplist()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, delete_campaign_errors(), tuple()}. +delete_campaign(Client, Id, Input0, Options0) -> + Method = delete, + Path = ["/v2/campaigns/", aws_util:encode_uri(Id), ""], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary}, + {append_sha256_content_hash, false} + | Options2], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + Query_ = [], + Input = Input2, + + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%% @doc Deletes the channel subtype config of a campaign. +%% +%% This API is idempotent. +-spec delete_campaign_channel_subtype_config(aws_client:aws_client(), binary() | list(), delete_campaign_channel_subtype_config_request()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, delete_campaign_channel_subtype_config_errors(), tuple()}. +delete_campaign_channel_subtype_config(Client, Id, Input) -> + delete_campaign_channel_subtype_config(Client, Id, Input, []). + +-spec delete_campaign_channel_subtype_config(aws_client:aws_client(), binary() | list(), delete_campaign_channel_subtype_config_request(), proplists:proplist()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, delete_campaign_channel_subtype_config_errors(), tuple()}. +delete_campaign_channel_subtype_config(Client, Id, Input0, Options0) -> + Method = delete, + Path = ["/v2/campaigns/", aws_util:encode_uri(Id), "/channel-subtype-config"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary}, + {append_sha256_content_hash, false} + | Options2], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + QueryMapping = [ + {<<"channelSubtype">>, <<"channelSubtype">>} + ], + {Query_, Input} = aws_request:build_headers(QueryMapping, Input2), + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%% @doc Deletes the communication limits config for a campaign. +%% +%% This API is idempotent. +-spec delete_campaign_communication_limits(aws_client:aws_client(), binary() | list(), delete_campaign_communication_limits_request()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, delete_campaign_communication_limits_errors(), tuple()}. +delete_campaign_communication_limits(Client, Id, Input) -> + delete_campaign_communication_limits(Client, Id, Input, []). + +-spec delete_campaign_communication_limits(aws_client:aws_client(), binary() | list(), delete_campaign_communication_limits_request(), proplists:proplist()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, delete_campaign_communication_limits_errors(), tuple()}. +delete_campaign_communication_limits(Client, Id, Input0, Options0) -> + Method = delete, + Path = ["/v2/campaigns/", aws_util:encode_uri(Id), "/communication-limits"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary}, + {append_sha256_content_hash, false} + | Options2], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + QueryMapping = [ + {<<"config">>, <<"config">>} + ], + {Query_, Input} = aws_request:build_headers(QueryMapping, Input2), + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%% @doc Deletes the communication time config for a campaign. +%% +%% This API is idempotent. +-spec delete_campaign_communication_time(aws_client:aws_client(), binary() | list(), delete_campaign_communication_time_request()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, delete_campaign_communication_time_errors(), tuple()}. +delete_campaign_communication_time(Client, Id, Input) -> + delete_campaign_communication_time(Client, Id, Input, []). + +-spec delete_campaign_communication_time(aws_client:aws_client(), binary() | list(), delete_campaign_communication_time_request(), proplists:proplist()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, delete_campaign_communication_time_errors(), tuple()}. +delete_campaign_communication_time(Client, Id, Input0, Options0) -> + Method = delete, + Path = ["/v2/campaigns/", aws_util:encode_uri(Id), "/communication-time"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary}, + {append_sha256_content_hash, false} + | Options2], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + QueryMapping = [ + {<<"config">>, <<"config">>} + ], + {Query_, Input} = aws_request:build_headers(QueryMapping, Input2), + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%% @doc Deletes a connect instance config from the specified AWS account. +-spec delete_connect_instance_config(aws_client:aws_client(), binary() | list(), delete_connect_instance_config_request()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, delete_connect_instance_config_errors(), tuple()}. +delete_connect_instance_config(Client, ConnectInstanceId, Input) -> + delete_connect_instance_config(Client, ConnectInstanceId, Input, []). + +-spec delete_connect_instance_config(aws_client:aws_client(), binary() | list(), delete_connect_instance_config_request(), proplists:proplist()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, delete_connect_instance_config_errors(), tuple()}. +delete_connect_instance_config(Client, ConnectInstanceId, Input0, Options0) -> + Method = delete, + Path = ["/v2/connect-instance/", aws_util:encode_uri(ConnectInstanceId), "/config"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary}, + {append_sha256_content_hash, false} + | Options2], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + QueryMapping = [ + {<<"campaignDeletionPolicy">>, <<"campaignDeletionPolicy">>} + ], + {Query_, Input} = aws_request:build_headers(QueryMapping, Input2), + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%% @doc Delete the integration for the specified Amazon Connect instance. +-spec delete_connect_instance_integration(aws_client:aws_client(), binary() | list(), delete_connect_instance_integration_request()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, delete_connect_instance_integration_errors(), tuple()}. +delete_connect_instance_integration(Client, ConnectInstanceId, Input) -> + delete_connect_instance_integration(Client, ConnectInstanceId, Input, []). + +-spec delete_connect_instance_integration(aws_client:aws_client(), binary() | list(), delete_connect_instance_integration_request(), proplists:proplist()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, delete_connect_instance_integration_errors(), tuple()}. +delete_connect_instance_integration(Client, ConnectInstanceId, Input0, Options0) -> + Method = post, + Path = ["/v2/connect-instance/", aws_util:encode_uri(ConnectInstanceId), "/integrations/delete"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary}, + {append_sha256_content_hash, false} + | Options2], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + Query_ = [], + Input = Input2, + + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%% @doc Delete the Connect Campaigns onboarding job for the specified Amazon +%% Connect instance. +-spec delete_instance_onboarding_job(aws_client:aws_client(), binary() | list(), delete_instance_onboarding_job_request()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, delete_instance_onboarding_job_errors(), tuple()}. +delete_instance_onboarding_job(Client, ConnectInstanceId, Input) -> + delete_instance_onboarding_job(Client, ConnectInstanceId, Input, []). + +-spec delete_instance_onboarding_job(aws_client:aws_client(), binary() | list(), delete_instance_onboarding_job_request(), proplists:proplist()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, delete_instance_onboarding_job_errors(), tuple()}. +delete_instance_onboarding_job(Client, ConnectInstanceId, Input0, Options0) -> + Method = delete, + Path = ["/v2/connect-instance/", aws_util:encode_uri(ConnectInstanceId), "/onboarding"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary}, + {append_sha256_content_hash, false} + | Options2], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + Query_ = [], + Input = Input2, + + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%% @doc Describes the specific campaign. +-spec describe_campaign(aws_client:aws_client(), binary() | list()) -> + {ok, describe_campaign_response(), tuple()} | + {error, any()} | + {error, describe_campaign_errors(), tuple()}. +describe_campaign(Client, Id) + when is_map(Client) -> + describe_campaign(Client, Id, #{}, #{}). + +-spec describe_campaign(aws_client:aws_client(), binary() | list(), map(), map()) -> + {ok, describe_campaign_response(), tuple()} | + {error, any()} | + {error, describe_campaign_errors(), tuple()}. +describe_campaign(Client, Id, QueryMap, HeadersMap) + when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> + describe_campaign(Client, Id, QueryMap, HeadersMap, []). + +-spec describe_campaign(aws_client:aws_client(), binary() | list(), map(), map(), proplists:proplist()) -> + {ok, describe_campaign_response(), tuple()} | + {error, any()} | + {error, describe_campaign_errors(), tuple()}. +describe_campaign(Client, Id, QueryMap, HeadersMap, Options0) + when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> + Path = ["/v2/campaigns/", aws_util:encode_uri(Id), ""], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary} + | Options2], + + Headers = [], + + Query_ = [], + + request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). + +%% @doc Get state of a campaign for the specified Amazon Connect account. +-spec get_campaign_state(aws_client:aws_client(), binary() | list()) -> + {ok, get_campaign_state_response(), tuple()} | + {error, any()} | + {error, get_campaign_state_errors(), tuple()}. +get_campaign_state(Client, Id) + when is_map(Client) -> + get_campaign_state(Client, Id, #{}, #{}). + +-spec get_campaign_state(aws_client:aws_client(), binary() | list(), map(), map()) -> + {ok, get_campaign_state_response(), tuple()} | + {error, any()} | + {error, get_campaign_state_errors(), tuple()}. +get_campaign_state(Client, Id, QueryMap, HeadersMap) + when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> + get_campaign_state(Client, Id, QueryMap, HeadersMap, []). + +-spec get_campaign_state(aws_client:aws_client(), binary() | list(), map(), map(), proplists:proplist()) -> + {ok, get_campaign_state_response(), tuple()} | + {error, any()} | + {error, get_campaign_state_errors(), tuple()}. +get_campaign_state(Client, Id, QueryMap, HeadersMap, Options0) + when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> + Path = ["/v2/campaigns/", aws_util:encode_uri(Id), "/state"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary} + | Options2], + + Headers = [], + + Query_ = [], + + request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). + +%% @doc Get state of campaigns for the specified Amazon Connect account. +-spec get_campaign_state_batch(aws_client:aws_client(), get_campaign_state_batch_request()) -> + {ok, get_campaign_state_batch_response(), tuple()} | + {error, any()} | + {error, get_campaign_state_batch_errors(), tuple()}. +get_campaign_state_batch(Client, Input) -> + get_campaign_state_batch(Client, Input, []). + +-spec get_campaign_state_batch(aws_client:aws_client(), get_campaign_state_batch_request(), proplists:proplist()) -> + {ok, get_campaign_state_batch_response(), tuple()} | + {error, any()} | + {error, get_campaign_state_batch_errors(), tuple()}. +get_campaign_state_batch(Client, Input0, Options0) -> + Method = post, + Path = ["/v2/campaigns-state"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary}, + {append_sha256_content_hash, false} + | Options2], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + Query_ = [], + Input = Input2, + + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%% @doc Get the specific Connect instance config. +-spec get_connect_instance_config(aws_client:aws_client(), binary() | list()) -> + {ok, get_connect_instance_config_response(), tuple()} | + {error, any()} | + {error, get_connect_instance_config_errors(), tuple()}. +get_connect_instance_config(Client, ConnectInstanceId) + when is_map(Client) -> + get_connect_instance_config(Client, ConnectInstanceId, #{}, #{}). + +-spec get_connect_instance_config(aws_client:aws_client(), binary() | list(), map(), map()) -> + {ok, get_connect_instance_config_response(), tuple()} | + {error, any()} | + {error, get_connect_instance_config_errors(), tuple()}. +get_connect_instance_config(Client, ConnectInstanceId, QueryMap, HeadersMap) + when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> + get_connect_instance_config(Client, ConnectInstanceId, QueryMap, HeadersMap, []). + +-spec get_connect_instance_config(aws_client:aws_client(), binary() | list(), map(), map(), proplists:proplist()) -> + {ok, get_connect_instance_config_response(), tuple()} | + {error, any()} | + {error, get_connect_instance_config_errors(), tuple()}. +get_connect_instance_config(Client, ConnectInstanceId, QueryMap, HeadersMap, Options0) + when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> + Path = ["/v2/connect-instance/", aws_util:encode_uri(ConnectInstanceId), "/config"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary} + | Options2], + + Headers = [], + + Query_ = [], + + request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). + +%% @doc Get the specific instance onboarding job status. +-spec get_instance_onboarding_job_status(aws_client:aws_client(), binary() | list()) -> + {ok, get_instance_onboarding_job_status_response(), tuple()} | + {error, any()} | + {error, get_instance_onboarding_job_status_errors(), tuple()}. +get_instance_onboarding_job_status(Client, ConnectInstanceId) + when is_map(Client) -> + get_instance_onboarding_job_status(Client, ConnectInstanceId, #{}, #{}). + +-spec get_instance_onboarding_job_status(aws_client:aws_client(), binary() | list(), map(), map()) -> + {ok, get_instance_onboarding_job_status_response(), tuple()} | + {error, any()} | + {error, get_instance_onboarding_job_status_errors(), tuple()}. +get_instance_onboarding_job_status(Client, ConnectInstanceId, QueryMap, HeadersMap) + when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> + get_instance_onboarding_job_status(Client, ConnectInstanceId, QueryMap, HeadersMap, []). + +-spec get_instance_onboarding_job_status(aws_client:aws_client(), binary() | list(), map(), map(), proplists:proplist()) -> + {ok, get_instance_onboarding_job_status_response(), tuple()} | + {error, any()} | + {error, get_instance_onboarding_job_status_errors(), tuple()}. +get_instance_onboarding_job_status(Client, ConnectInstanceId, QueryMap, HeadersMap, Options0) + when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> + Path = ["/v2/connect-instance/", aws_util:encode_uri(ConnectInstanceId), "/onboarding"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary} + | Options2], + + Headers = [], + + Query_ = [], + + request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). + +%% @doc Provides summary information about the campaigns under the specified +%% Amazon Connect account. +-spec list_campaigns(aws_client:aws_client(), list_campaigns_request()) -> + {ok, list_campaigns_response(), tuple()} | + {error, any()} | + {error, list_campaigns_errors(), tuple()}. +list_campaigns(Client, Input) -> + list_campaigns(Client, Input, []). + +-spec list_campaigns(aws_client:aws_client(), list_campaigns_request(), proplists:proplist()) -> + {ok, list_campaigns_response(), tuple()} | + {error, any()} | + {error, list_campaigns_errors(), tuple()}. +list_campaigns(Client, Input0, Options0) -> + Method = post, + Path = ["/v2/campaigns-summary"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary}, + {append_sha256_content_hash, false} + | Options2], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + Query_ = [], + Input = Input2, + + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%% @doc Provides summary information about the integration under the +%% specified Connect instance. +-spec list_connect_instance_integrations(aws_client:aws_client(), binary() | list()) -> + {ok, list_connect_instance_integrations_response(), tuple()} | + {error, any()} | + {error, list_connect_instance_integrations_errors(), tuple()}. +list_connect_instance_integrations(Client, ConnectInstanceId) + when is_map(Client) -> + list_connect_instance_integrations(Client, ConnectInstanceId, #{}, #{}). + +-spec list_connect_instance_integrations(aws_client:aws_client(), binary() | list(), map(), map()) -> + {ok, list_connect_instance_integrations_response(), tuple()} | + {error, any()} | + {error, list_connect_instance_integrations_errors(), tuple()}. +list_connect_instance_integrations(Client, ConnectInstanceId, QueryMap, HeadersMap) + when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> + list_connect_instance_integrations(Client, ConnectInstanceId, QueryMap, HeadersMap, []). + +-spec list_connect_instance_integrations(aws_client:aws_client(), binary() | list(), map(), map(), proplists:proplist()) -> + {ok, list_connect_instance_integrations_response(), tuple()} | + {error, any()} | + {error, list_connect_instance_integrations_errors(), tuple()}. +list_connect_instance_integrations(Client, ConnectInstanceId, QueryMap, HeadersMap, Options0) + when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> + Path = ["/v2/connect-instance/", aws_util:encode_uri(ConnectInstanceId), "/integrations"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary} + | Options2], + + Headers = [], + + Query0_ = + [ + {<<"maxResults">>, maps:get(<<"maxResults">>, QueryMap, undefined)}, + {<<"nextToken">>, maps:get(<<"nextToken">>, QueryMap, undefined)} + ], + Query_ = [H || {_, V} = H <- Query0_, V =/= undefined], + + request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). + +%% @doc List tags for a resource. +-spec list_tags_for_resource(aws_client:aws_client(), binary() | list()) -> + {ok, list_tags_for_resource_response(), tuple()} | + {error, any()} | + {error, list_tags_for_resource_errors(), tuple()}. +list_tags_for_resource(Client, Arn) + when is_map(Client) -> + list_tags_for_resource(Client, Arn, #{}, #{}). + +-spec list_tags_for_resource(aws_client:aws_client(), binary() | list(), map(), map()) -> + {ok, list_tags_for_resource_response(), tuple()} | + {error, any()} | + {error, list_tags_for_resource_errors(), tuple()}. +list_tags_for_resource(Client, Arn, QueryMap, HeadersMap) + when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> + list_tags_for_resource(Client, Arn, QueryMap, HeadersMap, []). + +-spec list_tags_for_resource(aws_client:aws_client(), binary() | list(), map(), map(), proplists:proplist()) -> + {ok, list_tags_for_resource_response(), tuple()} | + {error, any()} | + {error, list_tags_for_resource_errors(), tuple()}. +list_tags_for_resource(Client, Arn, QueryMap, HeadersMap, Options0) + when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> + Path = ["/v2/tags/", aws_util:encode_uri(Arn), ""], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary} + | Options2], + + Headers = [], + + Query_ = [], + + request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). + +%% @doc Pauses a campaign for the specified Amazon Connect account. +-spec pause_campaign(aws_client:aws_client(), binary() | list(), pause_campaign_request()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, pause_campaign_errors(), tuple()}. +pause_campaign(Client, Id, Input) -> + pause_campaign(Client, Id, Input, []). + +-spec pause_campaign(aws_client:aws_client(), binary() | list(), pause_campaign_request(), proplists:proplist()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, pause_campaign_errors(), tuple()}. +pause_campaign(Client, Id, Input0, Options0) -> + Method = post, + Path = ["/v2/campaigns/", aws_util:encode_uri(Id), "/pause"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary}, + {append_sha256_content_hash, false} + | Options2], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + Query_ = [], + Input = Input2, + + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%% @doc Put or update the integration for the specified Amazon Connect +%% instance. +-spec put_connect_instance_integration(aws_client:aws_client(), binary() | list(), put_connect_instance_integration_request()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, put_connect_instance_integration_errors(), tuple()}. +put_connect_instance_integration(Client, ConnectInstanceId, Input) -> + put_connect_instance_integration(Client, ConnectInstanceId, Input, []). + +-spec put_connect_instance_integration(aws_client:aws_client(), binary() | list(), put_connect_instance_integration_request(), proplists:proplist()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, put_connect_instance_integration_errors(), tuple()}. +put_connect_instance_integration(Client, ConnectInstanceId, Input0, Options0) -> + Method = put, + Path = ["/v2/connect-instance/", aws_util:encode_uri(ConnectInstanceId), "/integrations"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary}, + {append_sha256_content_hash, false} + | Options2], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + Query_ = [], + Input = Input2, + + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%% @doc Creates outbound requests for the specified campaign Amazon Connect +%% account. +%% +%% This API is idempotent. +-spec put_outbound_request_batch(aws_client:aws_client(), binary() | list(), put_outbound_request_batch_request()) -> + {ok, put_outbound_request_batch_response(), tuple()} | + {error, any()} | + {error, put_outbound_request_batch_errors(), tuple()}. +put_outbound_request_batch(Client, Id, Input) -> + put_outbound_request_batch(Client, Id, Input, []). + +-spec put_outbound_request_batch(aws_client:aws_client(), binary() | list(), put_outbound_request_batch_request(), proplists:proplist()) -> + {ok, put_outbound_request_batch_response(), tuple()} | + {error, any()} | + {error, put_outbound_request_batch_errors(), tuple()}. +put_outbound_request_batch(Client, Id, Input0, Options0) -> + Method = put, + Path = ["/v2/campaigns/", aws_util:encode_uri(Id), "/outbound-requests"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary}, + {append_sha256_content_hash, false} + | Options2], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + Query_ = [], + Input = Input2, + + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%% @doc Stops a campaign for the specified Amazon Connect account. +-spec resume_campaign(aws_client:aws_client(), binary() | list(), resume_campaign_request()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, resume_campaign_errors(), tuple()}. +resume_campaign(Client, Id, Input) -> + resume_campaign(Client, Id, Input, []). + +-spec resume_campaign(aws_client:aws_client(), binary() | list(), resume_campaign_request(), proplists:proplist()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, resume_campaign_errors(), tuple()}. +resume_campaign(Client, Id, Input0, Options0) -> + Method = post, + Path = ["/v2/campaigns/", aws_util:encode_uri(Id), "/resume"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary}, + {append_sha256_content_hash, false} + | Options2], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + Query_ = [], + Input = Input2, + + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%% @doc Starts a campaign for the specified Amazon Connect account. +-spec start_campaign(aws_client:aws_client(), binary() | list(), start_campaign_request()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, start_campaign_errors(), tuple()}. +start_campaign(Client, Id, Input) -> + start_campaign(Client, Id, Input, []). + +-spec start_campaign(aws_client:aws_client(), binary() | list(), start_campaign_request(), proplists:proplist()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, start_campaign_errors(), tuple()}. +start_campaign(Client, Id, Input0, Options0) -> + Method = post, + Path = ["/v2/campaigns/", aws_util:encode_uri(Id), "/start"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary}, + {append_sha256_content_hash, false} + | Options2], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + Query_ = [], + Input = Input2, + + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%% @doc Onboard the specific Amazon Connect instance to Connect Campaigns. +-spec start_instance_onboarding_job(aws_client:aws_client(), binary() | list(), start_instance_onboarding_job_request()) -> + {ok, start_instance_onboarding_job_response(), tuple()} | + {error, any()} | + {error, start_instance_onboarding_job_errors(), tuple()}. +start_instance_onboarding_job(Client, ConnectInstanceId, Input) -> + start_instance_onboarding_job(Client, ConnectInstanceId, Input, []). + +-spec start_instance_onboarding_job(aws_client:aws_client(), binary() | list(), start_instance_onboarding_job_request(), proplists:proplist()) -> + {ok, start_instance_onboarding_job_response(), tuple()} | + {error, any()} | + {error, start_instance_onboarding_job_errors(), tuple()}. +start_instance_onboarding_job(Client, ConnectInstanceId, Input0, Options0) -> + Method = put, + Path = ["/v2/connect-instance/", aws_util:encode_uri(ConnectInstanceId), "/onboarding"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary}, + {append_sha256_content_hash, false} + | Options2], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + Query_ = [], + Input = Input2, + + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%% @doc Stops a campaign for the specified Amazon Connect account. +-spec stop_campaign(aws_client:aws_client(), binary() | list(), stop_campaign_request()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, stop_campaign_errors(), tuple()}. +stop_campaign(Client, Id, Input) -> + stop_campaign(Client, Id, Input, []). + +-spec stop_campaign(aws_client:aws_client(), binary() | list(), stop_campaign_request(), proplists:proplist()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, stop_campaign_errors(), tuple()}. +stop_campaign(Client, Id, Input0, Options0) -> + Method = post, + Path = ["/v2/campaigns/", aws_util:encode_uri(Id), "/stop"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary}, + {append_sha256_content_hash, false} + | Options2], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + Query_ = [], + Input = Input2, + + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%% @doc Tag a resource. +-spec tag_resource(aws_client:aws_client(), binary() | list(), tag_resource_request()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, tag_resource_errors(), tuple()}. +tag_resource(Client, Arn, Input) -> + tag_resource(Client, Arn, Input, []). + +-spec tag_resource(aws_client:aws_client(), binary() | list(), tag_resource_request(), proplists:proplist()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, tag_resource_errors(), tuple()}. +tag_resource(Client, Arn, Input0, Options0) -> + Method = post, + Path = ["/v2/tags/", aws_util:encode_uri(Arn), ""], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary}, + {append_sha256_content_hash, false} + | Options2], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + Query_ = [], + Input = Input2, + + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%% @doc Untag a resource. +-spec untag_resource(aws_client:aws_client(), binary() | list(), untag_resource_request()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, untag_resource_errors(), tuple()}. +untag_resource(Client, Arn, Input) -> + untag_resource(Client, Arn, Input, []). + +-spec untag_resource(aws_client:aws_client(), binary() | list(), untag_resource_request(), proplists:proplist()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, untag_resource_errors(), tuple()}. +untag_resource(Client, Arn, Input0, Options0) -> + Method = delete, + Path = ["/v2/tags/", aws_util:encode_uri(Arn), ""], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary}, + {append_sha256_content_hash, false} + | Options2], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + QueryMapping = [ + {<<"tagKeys">>, <<"tagKeys">>} + ], + {Query_, Input} = aws_request:build_headers(QueryMapping, Input2), + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%% @doc Updates the channel subtype config of a campaign. +%% +%% This API is idempotent. +-spec update_campaign_channel_subtype_config(aws_client:aws_client(), binary() | list(), update_campaign_channel_subtype_config_request()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, update_campaign_channel_subtype_config_errors(), tuple()}. +update_campaign_channel_subtype_config(Client, Id, Input) -> + update_campaign_channel_subtype_config(Client, Id, Input, []). + +-spec update_campaign_channel_subtype_config(aws_client:aws_client(), binary() | list(), update_campaign_channel_subtype_config_request(), proplists:proplist()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, update_campaign_channel_subtype_config_errors(), tuple()}. +update_campaign_channel_subtype_config(Client, Id, Input0, Options0) -> + Method = post, + Path = ["/v2/campaigns/", aws_util:encode_uri(Id), "/channel-subtype-config"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary}, + {append_sha256_content_hash, false} + | Options2], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + Query_ = [], + Input = Input2, + + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%% @doc Updates the communication limits config for a campaign. +%% +%% This API is idempotent. +-spec update_campaign_communication_limits(aws_client:aws_client(), binary() | list(), update_campaign_communication_limits_request()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, update_campaign_communication_limits_errors(), tuple()}. +update_campaign_communication_limits(Client, Id, Input) -> + update_campaign_communication_limits(Client, Id, Input, []). + +-spec update_campaign_communication_limits(aws_client:aws_client(), binary() | list(), update_campaign_communication_limits_request(), proplists:proplist()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, update_campaign_communication_limits_errors(), tuple()}. +update_campaign_communication_limits(Client, Id, Input0, Options0) -> + Method = post, + Path = ["/v2/campaigns/", aws_util:encode_uri(Id), "/communication-limits"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary}, + {append_sha256_content_hash, false} + | Options2], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + Query_ = [], + Input = Input2, + + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%% @doc Updates the communication time config for a campaign. +%% +%% This API is idempotent. +-spec update_campaign_communication_time(aws_client:aws_client(), binary() | list(), update_campaign_communication_time_request()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, update_campaign_communication_time_errors(), tuple()}. +update_campaign_communication_time(Client, Id, Input) -> + update_campaign_communication_time(Client, Id, Input, []). + +-spec update_campaign_communication_time(aws_client:aws_client(), binary() | list(), update_campaign_communication_time_request(), proplists:proplist()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, update_campaign_communication_time_errors(), tuple()}. +update_campaign_communication_time(Client, Id, Input0, Options0) -> + Method = post, + Path = ["/v2/campaigns/", aws_util:encode_uri(Id), "/communication-time"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary}, + {append_sha256_content_hash, false} + | Options2], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + Query_ = [], + Input = Input2, + + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%% @doc Updates the campaign flow associated with a campaign. +%% +%% This API is idempotent. +-spec update_campaign_flow_association(aws_client:aws_client(), binary() | list(), update_campaign_flow_association_request()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, update_campaign_flow_association_errors(), tuple()}. +update_campaign_flow_association(Client, Id, Input) -> + update_campaign_flow_association(Client, Id, Input, []). + +-spec update_campaign_flow_association(aws_client:aws_client(), binary() | list(), update_campaign_flow_association_request(), proplists:proplist()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, update_campaign_flow_association_errors(), tuple()}. +update_campaign_flow_association(Client, Id, Input0, Options0) -> + Method = post, + Path = ["/v2/campaigns/", aws_util:encode_uri(Id), "/flow"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary}, + {append_sha256_content_hash, false} + | Options2], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + Query_ = [], + Input = Input2, + + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%% @doc Updates the name of a campaign. +%% +%% This API is idempotent. +-spec update_campaign_name(aws_client:aws_client(), binary() | list(), update_campaign_name_request()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, update_campaign_name_errors(), tuple()}. +update_campaign_name(Client, Id, Input) -> + update_campaign_name(Client, Id, Input, []). + +-spec update_campaign_name(aws_client:aws_client(), binary() | list(), update_campaign_name_request(), proplists:proplist()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, update_campaign_name_errors(), tuple()}. +update_campaign_name(Client, Id, Input0, Options0) -> + Method = post, + Path = ["/v2/campaigns/", aws_util:encode_uri(Id), "/name"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary}, + {append_sha256_content_hash, false} + | Options2], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + Query_ = [], + Input = Input2, + + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%% @doc Updates the schedule for a campaign. +%% +%% This API is idempotent. +-spec update_campaign_schedule(aws_client:aws_client(), binary() | list(), update_campaign_schedule_request()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, update_campaign_schedule_errors(), tuple()}. +update_campaign_schedule(Client, Id, Input) -> + update_campaign_schedule(Client, Id, Input, []). + +-spec update_campaign_schedule(aws_client:aws_client(), binary() | list(), update_campaign_schedule_request(), proplists:proplist()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, update_campaign_schedule_errors(), tuple()}. +update_campaign_schedule(Client, Id, Input0, Options0) -> + Method = post, + Path = ["/v2/campaigns/", aws_util:encode_uri(Id), "/schedule"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary}, + {append_sha256_content_hash, false} + | Options2], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + Query_ = [], + Input = Input2, + + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%% @doc Updates the campaign source with a campaign. +%% +%% This API is idempotent. +-spec update_campaign_source(aws_client:aws_client(), binary() | list(), update_campaign_source_request()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, update_campaign_source_errors(), tuple()}. +update_campaign_source(Client, Id, Input) -> + update_campaign_source(Client, Id, Input, []). + +-spec update_campaign_source(aws_client:aws_client(), binary() | list(), update_campaign_source_request(), proplists:proplist()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, update_campaign_source_errors(), tuple()}. +update_campaign_source(Client, Id, Input0, Options0) -> + Method = post, + Path = ["/v2/campaigns/", aws_util:encode_uri(Id), "/source"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary}, + {append_sha256_content_hash, false} + | Options2], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + Query_ = [], + Input = Input2, + + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%%==================================================================== +%% Internal functions +%%==================================================================== + +-spec proplists_take(any(), proplists:proplist(), any()) -> {any(), proplists:proplist()}. +proplists_take(Key, Proplist, Default) -> + Value = proplists:get_value(Key, Proplist, Default), + {Value, proplists:delete(Key, Proplist)}. + +-spec request(aws_client:aws_client(), atom(), iolist(), list(), + list(), map() | undefined, list(), pos_integer() | undefined) -> + {ok, {integer(), list()}} | + {ok, Result, {integer(), list(), hackney:client()}} | + {error, Error, {integer(), list(), hackney:client()}} | + {error, term()} when + Result :: map(), + Error :: map(). +request(Client, Method, Path, Query, Headers0, Input, Options, SuccessStatusCode) -> + RequestFun = fun() -> do_request(Client, Method, Path, Query, Headers0, Input, Options, SuccessStatusCode) end, + aws_request:request(RequestFun, Options). + +do_request(Client, Method, Path, Query, Headers0, Input, Options, SuccessStatusCode) -> + Client1 = Client#{service => <<"connect-campaigns">>}, + Host = build_host(<<"connect-campaigns">>, Client1), + URL0 = build_url(Host, Path, Client1), + URL = aws_request:add_query(URL0, Query), + AdditionalHeaders1 = [ {<<"Host">>, Host} + , {<<"Content-Type">>, <<"application/x-amz-json-1.1">>} + ], + Payload = + case proplists:get_value(send_body_as_binary, Options) of + true -> + maps:get(<<"Body">>, Input, <<"">>); + false -> + encode_payload(Input) + end, + AdditionalHeaders = case proplists:get_value(append_sha256_content_hash, Options, false) of + true -> + add_checksum_hash_header(AdditionalHeaders1, Payload); + false -> + AdditionalHeaders1 + end, + Headers1 = aws_request:add_headers(AdditionalHeaders, Headers0), + + MethodBin = aws_request:method_to_binary(Method), + SignedHeaders = aws_request:sign_request(Client1, MethodBin, URL, Headers1, Payload), + Response = hackney:request(Method, URL, SignedHeaders, Payload, Options), + DecodeBody = not proplists:get_value(receive_body_as_binary, Options), + handle_response(Response, SuccessStatusCode, DecodeBody). + +add_checksum_hash_header(Headers, Body) -> + [ {<<"X-Amz-CheckSum-SHA256">>, base64:encode(crypto:hash(sha256, Body))} + | Headers + ]. + +handle_response({ok, StatusCode, ResponseHeaders}, SuccessStatusCode, _DecodeBody) + when StatusCode =:= 200; + StatusCode =:= 202; + StatusCode =:= 204; + StatusCode =:= 206; + StatusCode =:= SuccessStatusCode -> + {ok, {StatusCode, ResponseHeaders}}; +handle_response({ok, StatusCode, ResponseHeaders}, _, _DecodeBody) -> + {error, {StatusCode, ResponseHeaders}}; +handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, DecodeBody) + when StatusCode =:= 200; + StatusCode =:= 202; + StatusCode =:= 204; + StatusCode =:= 206; + StatusCode =:= SuccessStatusCode -> + case hackney:body(Client) of + {ok, <<>>} when StatusCode =:= 200; + StatusCode =:= SuccessStatusCode -> + {ok, #{}, {StatusCode, ResponseHeaders, Client}}; + {ok, Body} -> + Result = case DecodeBody of + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; + false -> #{<<"Body">> => Body} + end, + {ok, Result, {StatusCode, ResponseHeaders, Client}} + end; +handle_response({ok, StatusCode, _ResponseHeaders, _Client}, _, _DecodeBody) + when StatusCode =:= 503 -> + %% Retriable error if retries are enabled + {error, service_unavailable}; +handle_response({ok, StatusCode, ResponseHeaders, Client}, _, _DecodeBody) -> + {ok, Body} = hackney:body(Client), + try + DecodedError = jsx:decode(Body), + {error, DecodedError, {StatusCode, ResponseHeaders, Client}} + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; +handle_response({error, Reason}, _, _DecodeBody) -> + {error, Reason}. + +build_host(_EndpointPrefix, #{region := <<"local">>, endpoint := Endpoint}) -> + Endpoint; +build_host(_EndpointPrefix, #{region := <<"local">>}) -> + <<"localhost">>; +build_host(EndpointPrefix, #{region := Region, endpoint := Endpoint}) -> + aws_util:binary_join([EndpointPrefix, Region, Endpoint], <<".">>). + +build_url(Host, Path0, Client) -> + Proto = aws_client:proto(Client), + Path = erlang:iolist_to_binary(Path0), + Port = aws_client:port(Client), + aws_util:binary_join([Proto, <<"://">>, Host, <<":">>, Port, Path], <<"">>). + +-spec encode_payload(undefined | map()) -> binary(). +encode_payload(undefined) -> + <<>>; +encode_payload(Input) -> + jsx:encode(Input). diff --git a/src/aws_datasync.erl b/src/aws_datasync.erl index d8d570c4..069bea8d 100644 --- a/src/aws_datasync.erl +++ b/src/aws_datasync.erl @@ -2685,8 +2685,8 @@ describe_task(Client, Input, Options) %% differences: %% https://docs.aws.amazon.com/datasync/latest/userguide/choosing-task-mode.html#task-mode-differences %% and Understanding data -%% transfer performance metrics: -%% https://docs.aws.amazon.com/datasync/latest/userguide/transfer-performance-metrics.html. +%% transfer performance counters: +%% https://docs.aws.amazon.com/datasync/latest/userguide/transfer-performance-counters.html. -spec describe_task_execution(aws_client:aws_client(), describe_task_execution_request()) -> {ok, describe_task_execution_response(), tuple()} | {error, any()} | diff --git a/src/aws_iot.erl b/src/aws_iot.erl index dd66f17f..45945c30 100644 --- a/src/aws_iot.erl +++ b/src/aws_iot.erl @@ -477,6 +477,9 @@ list_principal_things/2, list_principal_things/4, list_principal_things/5, + list_principal_things_v2/2, + list_principal_things_v2/4, + list_principal_things_v2/5, list_provisioning_template_versions/2, list_provisioning_template_versions/4, list_provisioning_template_versions/5, @@ -521,6 +524,9 @@ list_thing_principals/2, list_thing_principals/4, list_thing_principals/5, + list_thing_principals_v2/2, + list_thing_principals_v2/4, + list_thing_principals_v2/5, list_thing_registration_task_reports/3, list_thing_registration_task_reports/5, list_thing_registration_task_reports/6, @@ -655,6 +661,8 @@ update_thing_group/4, update_thing_groups_for_thing/2, update_thing_groups_for_thing/3, + update_thing_type/3, + update_thing_type/4, update_topic_rule_destination/2, update_topic_rule_destination/3, validate_security_profile_behaviors/2, @@ -1036,6 +1044,14 @@ -type malformed_policy_exception() :: #{binary() => any()}. +%% Example: +%% list_principal_things_v2_response() :: #{ +%% <<"nextToken">> => string(), +%% <<"principalThingObjects">> => list(principal_thing_object()()) +%% } +-type list_principal_things_v2_response() :: #{binary() => any()}. + + %% Example: %% list_thing_groups_request() :: #{ %% <<"maxResults">> => integer(), @@ -1069,7 +1085,8 @@ %% Example: %% attach_thing_principal_request() :: #{ -%% <<"principal">> := string() +%% <<"principal">> := string(), +%% <<"thingPrincipalType">> => list(any()) %% } -type attach_thing_principal_request() :: #{binary() => any()}. @@ -1355,6 +1372,13 @@ %% detach_thing_principal_response() :: #{} -type detach_thing_principal_response() :: #{}. + +%% Example: +%% update_thing_type_request() :: #{ +%% <<"thingTypeProperties">> => thing_type_properties() +%% } +-type update_thing_type_request() :: #{binary() => any()}. + %% Example: %% delete_thing_type_request() :: #{} -type delete_thing_type_request() :: #{}. @@ -1468,6 +1492,13 @@ -type list_policies_request() :: #{binary() => any()}. +%% Example: +%% mqtt5_configuration() :: #{ +%% <<"propagatingAttributes">> => list(propagating_attribute()()) +%% } +-type mqtt5_configuration() :: #{binary() => any()}. + + %% Example: %% list_billing_groups_request() :: #{ %% <<"maxResults">> => integer(), @@ -1836,6 +1867,10 @@ %% } -type list_fleet_metrics_response() :: #{binary() => any()}. +%% Example: +%% update_thing_type_response() :: #{} +-type update_thing_type_response() :: #{}. + %% Example: %% metric_to_retain() :: #{ @@ -3368,6 +3403,14 @@ -type list_principal_policies_request() :: #{binary() => any()}. +%% Example: +%% thing_principal_object() :: #{ +%% <<"principal">> => string(), +%% <<"thingPrincipalType">> => list(any()) +%% } +-type thing_principal_object() :: #{binary() => any()}. + + %% Example: %% delete_account_audit_configuration_request() :: #{ %% <<"deleteScheduledAudits">> => boolean() @@ -3547,6 +3590,14 @@ -type list_certificate_providers_response() :: #{binary() => any()}. +%% Example: +%% principal_thing_object() :: #{ +%% <<"thingName">> => string(), +%% <<"thingPrincipalType">> => list(any()) +%% } +-type principal_thing_object() :: #{binary() => any()}. + + %% Example: %% attribute_payload() :: #{ %% <<"attributes">> => map(), @@ -3589,6 +3640,15 @@ -type presigned_url_config() :: #{binary() => any()}. +%% Example: +%% list_thing_principals_v2_request() :: #{ +%% <<"maxResults">> => integer(), +%% <<"nextToken">> => string(), +%% <<"thingPrincipalType">> => list(any()) +%% } +-type list_thing_principals_v2_request() :: #{binary() => any()}. + + %% Example: %% aws_job_abort_config() :: #{ %% <<"abortCriteriaList">> => list(aws_job_abort_criteria()()) @@ -4093,6 +4153,15 @@ -type delete_thing_group_response() :: #{}. +%% Example: +%% propagating_attribute() :: #{ +%% <<"connectionAttribute">> => string(), +%% <<"thingAttribute">> => string(), +%% <<"userPropertyKey">> => string() +%% } +-type propagating_attribute() :: #{binary() => any()}. + + %% Example: %% get_policy_response() :: #{ %% <<"creationDate">> => non_neg_integer(), @@ -4614,7 +4683,9 @@ %% Example: %% server_certificate_config() :: #{ -%% <<"enableOCSPCheck">> => boolean() +%% <<"enableOCSPCheck">> => boolean(), +%% <<"ocspAuthorizedResponderArn">> => string(), +%% <<"ocspLambdaArn">> => string() %% } -type server_certificate_config() :: #{binary() => any()}. @@ -5311,6 +5382,14 @@ -type delete_provisioning_template_version_request() :: #{}. +%% Example: +%% list_thing_principals_v2_response() :: #{ +%% <<"nextToken">> => string(), +%% <<"thingPrincipalObjects">> => list(thing_principal_object()()) +%% } +-type list_thing_principals_v2_response() :: #{binary() => any()}. + + %% Example: %% list_audit_mitigation_actions_executions_response() :: #{ %% <<"actionsExecutions">> => list(audit_mitigation_action_execution_metadata()()), @@ -6568,6 +6647,7 @@ %% Example: %% thing_type_properties() :: #{ +%% <<"mqtt5Configuration">> => mqtt5_configuration(), %% <<"searchableAttributes">> => list(string()()), %% <<"thingTypeDescription">> => string() %% } @@ -6625,6 +6705,16 @@ -type list_certificates_response() :: #{binary() => any()}. +%% Example: +%% list_principal_things_v2_request() :: #{ +%% <<"maxResults">> => integer(), +%% <<"nextToken">> => string(), +%% <<"principal">> := string(), +%% <<"thingPrincipalType">> => list(any()) +%% } +-type list_principal_things_v2_request() :: #{binary() => any()}. + + %% Example: %% test_authorization_request() :: #{ %% <<"authInfos">> := list(auth_info()()), @@ -8098,6 +8188,14 @@ unauthorized_exception() | internal_failure_exception(). +-type list_principal_things_v2_errors() :: + throttling_exception() | + service_unavailable_exception() | + invalid_request_exception() | + resource_not_found_exception() | + unauthorized_exception() | + internal_failure_exception(). + -type list_provisioning_template_versions_errors() :: throttling_exception() | invalid_request_exception() | @@ -8195,6 +8293,14 @@ unauthorized_exception() | internal_failure_exception(). +-type list_thing_principals_v2_errors() :: + throttling_exception() | + service_unavailable_exception() | + invalid_request_exception() | + resource_not_found_exception() | + unauthorized_exception() | + internal_failure_exception(). + -type list_thing_registration_task_reports_errors() :: throttling_exception() | invalid_request_exception() | @@ -8645,6 +8751,14 @@ resource_not_found_exception() | internal_failure_exception(). +-type update_thing_type_errors() :: + throttling_exception() | + service_unavailable_exception() | + invalid_request_exception() | + resource_not_found_exception() | + unauthorized_exception() | + internal_failure_exception(). + -type update_topic_rule_destination_errors() :: conflicting_resource_update_exception() | internal_exception() | @@ -9038,9 +9152,10 @@ attach_thing_principal(Client, ThingName, Input0, Options0) -> CustomHeaders = [], Input2 = Input1, - Query_ = [], - Input = Input2, - + QueryMapping = [ + {<<"thingPrincipalType">>, <<"thingPrincipalType">>} + ], + {Query_, Input} = aws_request:build_headers(QueryMapping, Input2), request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Cancels a mitigation action task that is in progress. @@ -16433,6 +16548,60 @@ list_principal_things(Client, Principal, QueryMap, HeadersMap, Options0) request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). +%% @doc Lists the things associated with the specified principal. +%% +%% A principal can be an X.509 +%% certificate or an Amazon Cognito ID. +%% +%% Requires permission to access the ListPrincipalThings: +%% https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions +%% action. +-spec list_principal_things_v2(aws_client:aws_client(), binary() | list()) -> + {ok, list_principal_things_v2_response(), tuple()} | + {error, any()} | + {error, list_principal_things_v2_errors(), tuple()}. +list_principal_things_v2(Client, Principal) + when is_map(Client) -> + list_principal_things_v2(Client, Principal, #{}, #{}). + +-spec list_principal_things_v2(aws_client:aws_client(), binary() | list(), map(), map()) -> + {ok, list_principal_things_v2_response(), tuple()} | + {error, any()} | + {error, list_principal_things_v2_errors(), tuple()}. +list_principal_things_v2(Client, Principal, QueryMap, HeadersMap) + when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> + list_principal_things_v2(Client, Principal, QueryMap, HeadersMap, []). + +-spec list_principal_things_v2(aws_client:aws_client(), binary() | list(), map(), map(), proplists:proplist()) -> + {ok, list_principal_things_v2_response(), tuple()} | + {error, any()} | + {error, list_principal_things_v2_errors(), tuple()}. +list_principal_things_v2(Client, Principal, QueryMap, HeadersMap, Options0) + when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> + Path = ["/principals/things-v2"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary} + | Options2], + + Headers0 = + [ + {<<"x-amzn-principal">>, Principal} + ], + Headers = [H || {_, V} = H <- Headers0, V =/= undefined], + + Query0_ = + [ + {<<"maxResults">>, maps:get(<<"maxResults">>, QueryMap, undefined)}, + {<<"nextToken">>, maps:get(<<"nextToken">>, QueryMap, undefined)}, + {<<"thingPrincipalType">>, maps:get(<<"thingPrincipalType">>, QueryMap, undefined)} + ], + Query_ = [H || {_, V} = H <- Query0_, V =/= undefined], + + request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). + %% @doc A list of provisioning template versions. %% %% Requires permission to access the ListProvisioningTemplateVersions: @@ -17169,6 +17338,56 @@ list_thing_principals(Client, ThingName, QueryMap, HeadersMap, Options0) request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). +%% @doc Lists the principals associated with the specified thing. +%% +%% A principal can be an X.509 +%% certificate or an Amazon Cognito ID. +%% +%% Requires permission to access the ListThingPrincipals: +%% https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions +%% action. +-spec list_thing_principals_v2(aws_client:aws_client(), binary() | list()) -> + {ok, list_thing_principals_v2_response(), tuple()} | + {error, any()} | + {error, list_thing_principals_v2_errors(), tuple()}. +list_thing_principals_v2(Client, ThingName) + when is_map(Client) -> + list_thing_principals_v2(Client, ThingName, #{}, #{}). + +-spec list_thing_principals_v2(aws_client:aws_client(), binary() | list(), map(), map()) -> + {ok, list_thing_principals_v2_response(), tuple()} | + {error, any()} | + {error, list_thing_principals_v2_errors(), tuple()}. +list_thing_principals_v2(Client, ThingName, QueryMap, HeadersMap) + when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> + list_thing_principals_v2(Client, ThingName, QueryMap, HeadersMap, []). + +-spec list_thing_principals_v2(aws_client:aws_client(), binary() | list(), map(), map(), proplists:proplist()) -> + {ok, list_thing_principals_v2_response(), tuple()} | + {error, any()} | + {error, list_thing_principals_v2_errors(), tuple()}. +list_thing_principals_v2(Client, ThingName, QueryMap, HeadersMap, Options0) + when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> + Path = ["/things/", aws_util:encode_uri(ThingName), "/principals-v2"], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary} + | Options2], + + Headers = [], + + Query0_ = + [ + {<<"maxResults">>, maps:get(<<"maxResults">>, QueryMap, undefined)}, + {<<"nextToken">>, maps:get(<<"nextToken">>, QueryMap, undefined)}, + {<<"thingPrincipalType">>, maps:get(<<"thingPrincipalType">>, QueryMap, undefined)} + ], + Query_ = [H || {_, V} = H <- Query0_, V =/= undefined], + + request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). + %% @doc Information about the thing registration tasks. -spec list_thing_registration_task_reports(aws_client:aws_client(), binary() | list(), binary() | list()) -> {ok, list_thing_registration_task_reports_response(), tuple()} | @@ -19789,6 +20008,40 @@ update_thing_groups_for_thing(Client, Input0, Options0) -> request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). +%% @doc Updates a thing type. +-spec update_thing_type(aws_client:aws_client(), binary() | list(), update_thing_type_request()) -> + {ok, update_thing_type_response(), tuple()} | + {error, any()} | + {error, update_thing_type_errors(), tuple()}. +update_thing_type(Client, ThingTypeName, Input) -> + update_thing_type(Client, ThingTypeName, Input, []). + +-spec update_thing_type(aws_client:aws_client(), binary() | list(), update_thing_type_request(), proplists:proplist()) -> + {ok, update_thing_type_response(), tuple()} | + {error, any()} | + {error, update_thing_type_errors(), tuple()}. +update_thing_type(Client, ThingTypeName, Input0, Options0) -> + Method = patch, + Path = ["/thing-types/", aws_util:encode_uri(ThingTypeName), ""], + SuccessStatusCode = 200, + {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), + {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), + Options = [{send_body_as_binary, SendBodyAsBinary}, + {receive_body_as_binary, ReceiveBodyAsBinary}, + {append_sha256_content_hash, false} + | Options2], + + Headers = [], + Input1 = Input0, + + CustomHeaders = [], + Input2 = Input1, + + Query_ = [], + Input = Input2, + + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + %% @doc Updates a topic rule destination. %% %% You use this to change the status, endpoint URL, or diff --git a/src/aws_partnercentral_selling.erl b/src/aws_partnercentral_selling.erl index 3504e111..7090ab0a 100644 --- a/src/aws_partnercentral_selling.erl +++ b/src/aws_partnercentral_selling.erl @@ -5,53 +5,63 @@ %% %% AWS Partner Central API for Selling Reference Guide %% -%% Amazon Web Services (AWS) Partner Central API reference guide is designed -%% to help -%% AWS Partners: https://docs.aws.amazon.com/partners/programs/ -%% programmatically integrate their Customer Relationship Management (CRM) +%% This Amazon Web Services (AWS) Partner Central API reference is +%% designed to help AWS +%% Partners: http://aws.amazon.com/partners/programs/ integrate Customer +%% Relationship Management (CRM) %% systems with AWS Partner Central. %% -%% Through the Partner Central APIs, partners can automate and streamline -%% their interactions with AWS Partner Central, ensuring a more efficient and -%% effective engagement in joint business activities. +%% Partners can automate interactions with +%% AWS Partner Central, which helps to ensure effective engagements in joint +%% business activities. %% -%% The AWS Partner Central API service provides standard AWS API -%% functionality. You can directly use the API Actions: -%% https://docs.aws.amazon.com/partner-central/latest/selling-api/API_Operations.html, -%% or you can use an AWS SDK to access an API that's tailored to the -%% programming language or platform that you're using. For more -%% information about AWS application development, see Getting Started with -%% AWS: https://docs.aws.amazon.com/getting-started. For more information -%% about using AWS SDKs, see AWS SDKs: https://docs.aws.amazon.com/aws-sdk. +%% The API provides standard AWS API functionality. Access it by +%% either using API Actions: +%% https://docs.aws.amazon.com/partner-central/latest/selling-api/API_Operations.html +%% or by using an AWS SDK that's tailored to your +%% programming language or platform. For more information, see Getting +%% Started with +%% AWS: http://aws.amazon.com/getting-started and Tools to Build on AWS: +%% http://aws.amazon.com/developer/tools/. %% %% == Features offered by AWS Partner Central API == %% -%% Opportunity management: Facilitates the management of co-selling -%% opportunities with AWS using API actions such as `CreateOpportunity', -%% `UpdateOpportunity', `ListOpportunities', `GetOpportunity', -%% and `AssignOpportunity'. +%% Opportunity management: +%% Manages coselling opportunities through API actions such as +%% `CreateOpportunity', `UpdateOpportunity', +%% `ListOpportunities', `GetOpportunity', and +%% `AssignOpportunity'. %% -%% AWS referral management: Facilitates receiving referrals shared by AWS -%% using actions like `ListEngagementInvitations', -%% `GetEngagementInvitation', `StartEngagementByAcceptingInvitation', -%% and `RejectEngagementInvitation'. +%% AWS referral management: +%% Manages referrals shared by AWS using actions such as +%% `ListEngagementInvitations', +%% `GetEngagementInvitation', +%% `StartEngagementByAcceptingInvitation', and +%% `RejectEngagementInvitation'. %% -%% Entity association: Associate related entities such as AWS Products, -%% Partner Solutions, and AWS Marketplace Private Offers with opportunities -%% using the actions `AssociateOpportunity' and +%% Entity association: +%% Associates related entities such as AWS Products, +%% Partner Solutions, and AWS +%% Marketplace Private Offers with opportunities using the +%% actions `AssociateOpportunity', and %% `DisassociateOpportunity'. %% -%% View AWS opportunity details: Use the `GetAWSOpportunitySummary' -%% action to retrieve real-time summaries of AWS opportunities that are -%% linked to your opportunities. +%% View AWS opportunity +%% details: Retrieves real-time summaries of AWS +%% opportunities using the `GetAWSOpportunitySummary' +%% action. %% -%% List solutions: Provides list APIs for listing solutions partners offer -%% using `ListSolutions'. +%% List solutions: Provides +%% list APIs for listing partner offers using +%% `ListSolutions'. %% -%% Event subscription: Partners can subscribe to real-time updates on -%% opportunities by listening to events such as Opportunity Created, -%% Opportunity Updated, Engagement Invitation Accepted, Engagement Invitation -%% Rejected and Engagement Invitation Created using AWS EventBridge. +%% Event subscription: +%% Subscribe to real-time opportunity updates through AWS EventBridge by +%% using actions such as Opportunity Created, +%% Opportunity Updated, Engagement +%% Invitation Accepted, Engagement Invitation +%% Rejected, and Engagement Invitation +%% Created. -module(aws_partnercentral_selling). -export([assign_opportunity/2, @@ -593,7 +603,7 @@ %% start_engagement_from_opportunity_task_request() :: #{ %% <<"AwsSubmission">> := aws_submission(), %% <<"Catalog">> := string(), -%% <<"ClientToken">> := [string()], +%% <<"ClientToken">> := string(), %% <<"Identifier">> := string() %% } -type start_engagement_from_opportunity_task_request() :: #{binary() => any()}. @@ -737,7 +747,7 @@ %% Example: %% start_engagement_by_accepting_invitation_task_request() :: #{ %% <<"Catalog">> := string(), -%% <<"ClientToken">> := [string()], +%% <<"ClientToken">> := string(), %% <<"Identifier">> := string() %% } -type start_engagement_by_accepting_invitation_task_request() :: #{binary() => any()}. @@ -885,20 +895,20 @@ assign_opportunity(Client, Input, Options) %% and various %% related entities, enriching the context and details of the opportunity for %% better collaboration and -%% decision-making. +%% decision making. %% -%% You can associate an opportunity with the following types of entities: +%% You can associate an opportunity with the following entity types: %% %% Partner Solution: %% A software product or consulting practice created and delivered by -%% Partners. Partner Solutions help customers address specific business -%% challenges or achieve particular goals using Amazon Web Services services. +%% Partners. Partner Solutions help customers address business challenges +%% using Amazon Web Services services. %% -%% Amazon Web Services Product: -%% Amazon Web Services offers a wide range of products and services designed -%% to provide scalable, reliable, and cost-effective infrastructure -%% solutions. For the latest list of Amazon Web Services products, refer to -%% Amazon Web Services products: +%% Amazon Web Services Products: +%% Amazon Web Services offers many products and services that provide +%% scalable, reliable, and cost-effective infrastructure solutions. For the +%% latest list of Amazon Web Services products, see Amazon Web Services +%% products: %% https://github.com/aws-samples/partner-crm-integration-samples/blob/main/resources/aws_products.json. %% %% Amazon Web Services Marketplace private offer: @@ -907,24 +917,23 @@ assign_opportunity(Client, Input, Options) %% negotiate custom prices, payment schedules, and end user license terms %% through private offers, enabling Amazon Web Services customers to acquire %% software solutions tailored to their specific needs. For more information, -%% refer to Private offers in Amazon Web Services Marketplace: +%% see Private offers in Amazon Web Services Marketplace: %% https://docs.aws.amazon.com/marketplace/latest/buyerguide/buyer-private-offers.html. %% %% To obtain identifiers for these entities, use the following methods: %% %% Solution: Use the `ListSolutions' operation. %% -%% AWS products: For the latest list of Amazon Web Services products, refer -%% to -%% the Amazon Web Services products list. +%% AWS Products: For the latest list of Amazon Web Services products, see +%% Amazon Web Services products: +%% https://github.com/aws-samples/partner-crm-integration-samples/blob/main/resources/aws_products.json. %% -%% Amazon Web Services Marketplace private offer: Use the AWS Marketplace -%% Catalog API: -%% https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/welcome.html +%% Amazon Web Services Marketplace private offer: Use the Using the Amazon +%% Web Services Marketplace Catalog API: +%% https://docs.aws.amazon.com/marketplace/latest/APIReference/catalog-apis.html %% to list entities. Specifically, use the `ListEntities' operation to -%% retrieve a list of private offers. The request to the `ListEntities' -%% API returns the details of the private offers available to you. For more -%% information, refer to ListEntities: +%% retrieve a list of private offers. The request returns the details of +%% available private offers. For more information, see ListEntities: %% https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/API_ListEntities.html. -spec associate_opportunity(aws_client:aws_client(), associate_opportunity_request()) -> {ok, undefined, tuple()} | @@ -946,27 +955,26 @@ associate_opportunity(Client, Input, Options) %% Creates an `Opportunity' record in Partner Central. %% %% Use this operation to create -%% a potential business opportunity intended to be submitted to Amazon Web -%% Services. Creating an opportunity sets its `Lifecycle.ReviewStatus' to +%% a potential business opportunity for submission to Amazon Web Services. +%% Creating an opportunity sets `Lifecycle.ReviewStatus' to %% `Pending Submission'. %% -%% To fully submit an opportunity, follow these steps: +%% To submit an opportunity, follow these steps: %% %% To create the opportunity, use `CreateOpportunity'. %% %% To associate a solution with the opportunity, use %% `AssociateOpportunity'. %% -%% To submit the opportunity, use `SubmitOpportunity'. +%% To submit the opportunity, use `StartEngagementFromOpportunityTask'. %% %% After submission, you can't edit the opportunity until the review is -%% complete. However, opportunities in the -%% `Pending Submission' state still need all details completed. You can -%% update +%% complete. But opportunities in the +%% `Pending Submission' state must have complete details. You can update %% the opportunity while it's in the `Pending Submission' state. %% -%% There's a set of mandatory fields required to create opportunities, -%% but consider providing optional fields to +%% There's a set of mandatory fields to create opportunities, but +%% consider providing optional fields to %% enrich the opportunity record. -spec create_opportunity(aws_client:aws_client(), create_opportunity_request()) -> {ok, create_opportunity_response(), tuple()} | @@ -986,7 +994,7 @@ create_opportunity(Client, Input, Options) %% @doc %% Allows you to remove an existing association between an `Opportunity' -%% and related entities such as a Partner Solution, Amazon Web Services +%% and related entities, such as a Partner Solution, Amazon Web Services %% product, or an Amazon Web Services Marketplace offer. %% %% This operation is the counterpart to `AssociateOpportunity', and it @@ -999,8 +1007,8 @@ create_opportunity(Client, Input, Options) %% helps maintain clarity and accuracy to track %% and manage business opportunities. When you replace an entity, first %% attach the new entity and then disassociate the -%% one to be removed, especially if it's the last remaining related -%% entity that's required. +%% one to be removed, especially if it's the last remaining entity +%% that's required. -spec disassociate_opportunity(aws_client:aws_client(), disassociate_opportunity_request()) -> {ok, undefined, tuple()} | {error, any()} | @@ -1044,8 +1052,10 @@ get_aws_opportunity_summary(Client, Input, Options) %% @doc Retrieves the details of an engagement invitation shared by AWS with %% a partner. %% -%% The information includes key aspects such as the customer, project -%% details, and lifecycle information related to the engagement. +%% The information includes aspects such as customer, project details, and +%% lifecycle information. To connect an engagement invitation with an +%% opportunity, match the invitation’s `Payload.Project.Title' with +%% opportunity `Project.Title'. -spec get_engagement_invitation(aws_client:aws_client(), get_engagement_invitation_request()) -> {ok, get_engagement_invitation_response(), tuple()} | {error, any()} | @@ -1104,8 +1114,8 @@ list_engagement_invitations(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"ListEngagementInvitations">>, Input, Options). -%% @doc This request accepts a list of filters to use to -%% retrieve a specific subset of opportunities, as well as sort options. +%% @doc This request accepts a list of filters that retrieve opportunity +%% subsets as well as sort options. %% %% This feature is available to partners from %% Partner Central: https://partnercentral.awspartner.com/ @@ -1167,12 +1177,12 @@ list_solutions(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"ListSolutions">>, Input, Options). -%% @doc Use this action to reject an `EngagementInvitation' that has been -%% shared by AWS. +%% @doc This action rejects an `EngagementInvitation' that AWS +%% shared. %% -%% Rejecting the engagement invitation indicates that the partner does not -%% wish to pursue the opportunity, and all related data will be inaccessible -%% after the rejection. +%% Rejecting an invitation indicates that the partner doesn't want to +%% pursue the opportunity, and all related data will become inaccessible +%% thereafter. -spec reject_engagement_invitation(aws_client:aws_client(), reject_engagement_invitation_request()) -> {ok, undefined, tuple()} | {error, any()} | @@ -1192,9 +1202,9 @@ reject_engagement_invitation(Client, Input, Options) %% @doc This action starts the engagement by accepting an %% `EngagementInvitation'. %% -%% The task is asynchronous and involves several steps: accepting the +%% The task is asynchronous and involves the following steps: accepting the %% invitation, creating an opportunity in the partner’s account from the AWS -%% Opportunity, and copying over key details for tracking. Once completed, an +%% opportunity, and copying details for tracking. When completed, an %% `Opportunity Created' event is generated, indicating that the %% opportunity has been successfully created in the partner's account. -spec start_engagement_by_accepting_invitation_task(aws_client:aws_client(), start_engagement_by_accepting_invitation_task_request()) -> diff --git a/src/aws_pinpoint_sms_voice_v2.erl b/src/aws_pinpoint_sms_voice_v2.erl index 448b6921..0269a36c 100644 --- a/src/aws_pinpoint_sms_voice_v2.erl +++ b/src/aws_pinpoint_sms_voice_v2.erl @@ -112,6 +112,8 @@ delete_pool/3, delete_protect_configuration/2, delete_protect_configuration/3, + delete_protect_configuration_rule_set_number_override/2, + delete_protect_configuration_rule_set_number_override/3, delete_registration/2, delete_registration/3, delete_registration_attachment/2, @@ -176,14 +178,20 @@ get_resource_policy/3, list_pool_origination_identities/2, list_pool_origination_identities/3, + list_protect_configuration_rule_set_number_overrides/2, + list_protect_configuration_rule_set_number_overrides/3, list_registration_associations/2, list_registration_associations/3, list_tags_for_resource/2, list_tags_for_resource/3, put_keyword/2, put_keyword/3, + put_message_feedback/2, + put_message_feedback/3, put_opted_out_number/2, put_opted_out_number/3, + put_protect_configuration_rule_set_number_override/2, + put_protect_configuration_rule_set_number_override/3, put_registration_field_value/2, put_registration_field_value/3, put_resource_policy/2, @@ -206,6 +214,8 @@ send_voice_message/3, set_account_default_protect_configuration/2, set_account_default_protect_configuration/3, + set_default_message_feedback_enabled/2, + set_default_message_feedback_enabled/3, set_default_message_type/2, set_default_message_type/3, set_default_sender_id/2, @@ -601,6 +611,18 @@ %% } -type registration_denied_reason_information() :: #{binary() => any()}. +%% Example: +%% put_protect_configuration_rule_set_number_override_result() :: #{ +%% <<"Action">> => string(), +%% <<"CreatedTimestamp">> => [non_neg_integer()], +%% <<"DestinationPhoneNumber">> => string(), +%% <<"ExpirationTimestamp">> => [non_neg_integer()], +%% <<"IsoCountryCode">> => string(), +%% <<"ProtectConfigurationArn">> => string(), +%% <<"ProtectConfigurationId">> => string() +%% } +-type put_protect_configuration_rule_set_number_override_result() :: #{binary() => any()}. + %% Example: %% protect_configuration_country_rule_set_information() :: #{ %% <<"ProtectStatus">> => string() @@ -724,6 +746,7 @@ %% <<"ConfigurationSetArn">> => [string()], %% <<"ConfigurationSetName">> => string(), %% <<"CreatedTimestamp">> => [non_neg_integer()], +%% <<"DefaultMessageFeedbackEnabled">> => [boolean()], %% <<"DefaultMessageType">> => string(), %% <<"DefaultSenderId">> => string(), %% <<"EventDestinations">> => list(event_destination()()), @@ -954,6 +977,16 @@ %% } -type describe_protect_configurations_request() :: #{binary() => any()}. +%% Example: +%% put_protect_configuration_rule_set_number_override_request() :: #{ +%% <<"Action">> := string(), +%% <<"ClientToken">> => string(), +%% <<"DestinationPhoneNumber">> := string(), +%% <<"ExpirationTimestamp">> => [non_neg_integer()], +%% <<"ProtectConfigurationId">> := string() +%% } +-type put_protect_configuration_rule_set_number_override_request() :: #{binary() => any()}. + %% Example: %% update_event_destination_request() :: #{ %% <<"CloudWatchLogsDestination">> => cloud_watch_logs_destination(), @@ -1042,6 +1075,13 @@ %% } -type delete_account_default_protect_configuration_result() :: #{binary() => any()}. +%% Example: +%% put_message_feedback_result() :: #{ +%% <<"MessageFeedbackStatus">> => string(), +%% <<"MessageId">> => string() +%% } +-type put_message_feedback_result() :: #{binary() => any()}. + %% Example: %% registration_type_definition() :: #{ %% <<"DisplayHints">> => registration_type_display_hints(), @@ -1058,6 +1098,15 @@ %% } -type opted_out_number_information() :: #{binary() => any()}. +%% Example: +%% list_protect_configuration_rule_set_number_overrides_result() :: #{ +%% <<"NextToken">> => string(), +%% <<"ProtectConfigurationArn">> => string(), +%% <<"ProtectConfigurationId">> => string(), +%% <<"RuleSetNumberOverrides">> => list(protect_configuration_rule_set_number_override()()) +%% } +-type list_protect_configuration_rule_set_number_overrides_result() :: #{binary() => any()}. + %% Example: %% tag() :: #{ %% <<"Key">> => string(), @@ -1155,6 +1204,14 @@ %% } -type delete_default_sender_id_request() :: #{binary() => any()}. +%% Example: +%% set_default_message_feedback_enabled_result() :: #{ +%% <<"ConfigurationSetArn">> => [string()], +%% <<"ConfigurationSetName">> => string(), +%% <<"MessageFeedbackEnabled">> => [boolean()] +%% } +-type set_default_message_feedback_enabled_result() :: #{binary() => any()}. + %% Example: %% delete_voice_message_spend_limit_override_result() :: #{ %% <<"MonthlyLimit">> => float() @@ -1171,6 +1228,13 @@ %% } -type associate_origination_identity_result() :: #{binary() => any()}. +%% Example: +%% set_default_message_feedback_enabled_request() :: #{ +%% <<"ConfigurationSetName">> := string(), +%% <<"MessageFeedbackEnabled">> := [boolean()] +%% } +-type set_default_message_feedback_enabled_request() :: #{binary() => any()}. + %% Example: %% describe_opted_out_numbers_result() :: #{ %% <<"NextToken">> => string(), @@ -1420,6 +1484,13 @@ %% } -type describe_sender_ids_request() :: #{binary() => any()}. +%% Example: +%% delete_protect_configuration_rule_set_number_override_request() :: #{ +%% <<"DestinationPhoneNumber">> := string(), +%% <<"ProtectConfigurationId">> := string() +%% } +-type delete_protect_configuration_rule_set_number_override_request() :: #{binary() => any()}. + %% Example: %% describe_registration_attachments_result() :: #{ %% <<"NextToken">> => string(), @@ -1493,6 +1564,7 @@ %% <<"MaxPricePerMinute">> => string(), %% <<"MessageBody">> => string(), %% <<"MessageBodyTextType">> => string(), +%% <<"MessageFeedbackEnabled">> => [boolean()], %% <<"OriginationIdentity">> := string(), %% <<"ProtectConfigurationId">> => string(), %% <<"TimeToLive">> => integer(), @@ -1500,6 +1572,13 @@ %% } -type send_voice_message_request() :: #{binary() => any()}. +%% Example: +%% put_message_feedback_request() :: #{ +%% <<"MessageFeedbackStatus">> := string(), +%% <<"MessageId">> := string() +%% } +-type put_message_feedback_request() :: #{binary() => any()}. + %% Example: %% set_account_default_protect_configuration_result() :: #{ %% <<"DefaultProtectConfigurationArn">> => string(), @@ -1534,6 +1613,16 @@ %% } -type list_registration_associations_result() :: #{binary() => any()}. +%% Example: +%% protect_configuration_rule_set_number_override() :: #{ +%% <<"Action">> => string(), +%% <<"CreatedTimestamp">> => [non_neg_integer()], +%% <<"DestinationPhoneNumber">> => string(), +%% <<"ExpirationTimestamp">> => [non_neg_integer()], +%% <<"IsoCountryCode">> => string() +%% } +-type protect_configuration_rule_set_number_override() :: #{binary() => any()}. + %% Example: %% list_tags_for_resource_result() :: #{ %% <<"ResourceArn">> => string(), @@ -1656,6 +1745,7 @@ %% <<"Keyword">> => string(), %% <<"MaxPrice">> => string(), %% <<"MessageBody">> => string(), +%% <<"MessageFeedbackEnabled">> => [boolean()], %% <<"MessageType">> => string(), %% <<"OriginationIdentity">> => string(), %% <<"ProtectConfigurationId">> => string(), @@ -1814,6 +1904,13 @@ %% } -type throttling_exception() :: #{binary() => any()}. +%% Example: +%% protect_configuration_rule_set_number_override_filter_item() :: #{ +%% <<"Name">> => string(), +%% <<"Values">> => list(string()()) +%% } +-type protect_configuration_rule_set_number_override_filter_item() :: #{binary() => any()}. + %% Example: %% disassociate_origination_identity_request() :: #{ %% <<"ClientToken">> => string(), @@ -1955,6 +2052,15 @@ %% } -type keyword_information() :: #{binary() => any()}. +%% Example: +%% list_protect_configuration_rule_set_number_overrides_request() :: #{ +%% <<"Filters">> => list(protect_configuration_rule_set_number_override_filter_item()()), +%% <<"MaxResults">> => integer(), +%% <<"NextToken">> => string(), +%% <<"ProtectConfigurationId">> := string() +%% } +-type list_protect_configuration_rule_set_number_overrides_request() :: #{binary() => any()}. + %% Example: %% delete_registration_attachment_result() :: #{ %% <<"AttachmentStatus">> => string(), @@ -2183,6 +2289,7 @@ %% <<"ConfigurationSetArn">> => [string()], %% <<"ConfigurationSetName">> => string(), %% <<"CreatedTimestamp">> => [non_neg_integer()], +%% <<"DefaultMessageFeedbackEnabled">> => [boolean()], %% <<"DefaultMessageType">> => string(), %% <<"DefaultSenderId">> => string(), %% <<"EventDestinations">> => list(event_destination()()) @@ -2222,6 +2329,18 @@ %% } -type delete_default_message_type_result() :: #{binary() => any()}. +%% Example: +%% delete_protect_configuration_rule_set_number_override_result() :: #{ +%% <<"Action">> => string(), +%% <<"CreatedTimestamp">> => [non_neg_integer()], +%% <<"DestinationPhoneNumber">> => string(), +%% <<"ExpirationTimestamp">> => [non_neg_integer()], +%% <<"IsoCountryCode">> => string(), +%% <<"ProtectConfigurationArn">> => string(), +%% <<"ProtectConfigurationId">> => string() +%% } +-type delete_protect_configuration_rule_set_number_override_result() :: #{binary() => any()}. + %% Example: %% opt_out_list_information() :: #{ %% <<"CreatedTimestamp">> => [non_neg_integer()], @@ -2239,6 +2358,7 @@ %% <<"MaxPrice">> => string(), %% <<"MediaUrls">> => list(string()()), %% <<"MessageBody">> => string(), +%% <<"MessageFeedbackEnabled">> => [boolean()], %% <<"OriginationIdentity">> := string(), %% <<"ProtectConfigurationId">> => string(), %% <<"TimeToLive">> => integer() @@ -2446,6 +2566,13 @@ resource_not_found_exception() | conflict_exception(). +-type delete_protect_configuration_rule_set_number_override_errors() :: + throttling_exception() | + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception(). + -type delete_registration_errors() :: throttling_exception() | validation_exception() | @@ -2669,6 +2796,13 @@ internal_server_exception() | resource_not_found_exception(). +-type list_protect_configuration_rule_set_number_overrides_errors() :: + throttling_exception() | + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception(). + -type list_registration_associations_errors() :: throttling_exception() | validation_exception() | @@ -2692,6 +2826,13 @@ resource_not_found_exception() | conflict_exception(). +-type put_message_feedback_errors() :: + throttling_exception() | + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception(). + -type put_opted_out_number_errors() :: throttling_exception() | validation_exception() | @@ -2699,6 +2840,14 @@ internal_server_exception() | resource_not_found_exception(). +-type put_protect_configuration_rule_set_number_override_errors() :: + throttling_exception() | + validation_exception() | + access_denied_exception() | + internal_server_exception() | + service_quota_exceeded_exception() | + conflict_exception(). + -type put_registration_field_value_errors() :: throttling_exception() | validation_exception() | @@ -2790,6 +2939,13 @@ internal_server_exception() | resource_not_found_exception(). +-type set_default_message_feedback_enabled_errors() :: + throttling_exception() | + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception(). + -type set_default_message_type_errors() :: throttling_exception() | validation_exception() | @@ -3473,6 +3629,24 @@ delete_protect_configuration(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"DeleteProtectConfiguration">>, Input, Options). +%% @doc Permanently delete the protect configuration rule set number +%% override. +-spec delete_protect_configuration_rule_set_number_override(aws_client:aws_client(), delete_protect_configuration_rule_set_number_override_request()) -> + {ok, delete_protect_configuration_rule_set_number_override_result(), tuple()} | + {error, any()} | + {error, delete_protect_configuration_rule_set_number_override_errors(), tuple()}. +delete_protect_configuration_rule_set_number_override(Client, Input) + when is_map(Client), is_map(Input) -> + delete_protect_configuration_rule_set_number_override(Client, Input, []). + +-spec delete_protect_configuration_rule_set_number_override(aws_client:aws_client(), delete_protect_configuration_rule_set_number_override_request(), proplists:proplist()) -> + {ok, delete_protect_configuration_rule_set_number_override_result(), tuple()} | + {error, any()} | + {error, delete_protect_configuration_rule_set_number_override_errors(), tuple()}. +delete_protect_configuration_rule_set_number_override(Client, Input, Options) + when is_map(Client), is_map(Input), is_list(Options) -> + request(Client, <<"DeleteProtectConfigurationRuleSetNumberOverride">>, Input, Options). + %% @doc Permanently delete an existing registration from your account. -spec delete_registration(aws_client:aws_client(), delete_registration_request()) -> {ok, delete_registration_result(), tuple()} | @@ -4064,7 +4238,7 @@ describe_spend_limits(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"DescribeSpendLimits">>, Input, Options). -%% @doc Retrieves the specified verified destiona numbers. +%% @doc Retrieves the specified verified destination numbers. -spec describe_verified_destination_numbers(aws_client:aws_client(), describe_verified_destination_numbers_request()) -> {ok, describe_verified_destination_numbers_result(), tuple()} | {error, any()} | @@ -4195,7 +4369,25 @@ list_pool_origination_identities(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"ListPoolOriginationIdentities">>, Input, Options). -%% @doc Retreive all of the origination identies that are associated with a +%% @doc Retrieve all of the protect configuration rule set number overrides +%% that match the filters. +-spec list_protect_configuration_rule_set_number_overrides(aws_client:aws_client(), list_protect_configuration_rule_set_number_overrides_request()) -> + {ok, list_protect_configuration_rule_set_number_overrides_result(), tuple()} | + {error, any()} | + {error, list_protect_configuration_rule_set_number_overrides_errors(), tuple()}. +list_protect_configuration_rule_set_number_overrides(Client, Input) + when is_map(Client), is_map(Input) -> + list_protect_configuration_rule_set_number_overrides(Client, Input, []). + +-spec list_protect_configuration_rule_set_number_overrides(aws_client:aws_client(), list_protect_configuration_rule_set_number_overrides_request(), proplists:proplist()) -> + {ok, list_protect_configuration_rule_set_number_overrides_result(), tuple()} | + {error, any()} | + {error, list_protect_configuration_rule_set_number_overrides_errors(), tuple()}. +list_protect_configuration_rule_set_number_overrides(Client, Input, Options) + when is_map(Client), is_map(Input), is_list(Options) -> + request(Client, <<"ListProtectConfigurationRuleSetNumberOverrides">>, Input, Options). + +%% @doc Retrieve all of the origination identities that are associated with a %% registration. -spec list_registration_associations(aws_client:aws_client(), list_registration_associations_request()) -> {ok, list_registration_associations_result(), tuple()} | @@ -4261,6 +4453,33 @@ put_keyword(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"PutKeyword">>, Input, Options). +%% @doc Set the MessageFeedbackStatus as `RECEIVED' or `FAILED' for +%% the +%% passed in MessageId. +%% +%% If you use message feedback then you must update message feedback record. +%% When you receive a signal that a user has received the message you must +%% use +%% `PutMessageFeedback' to set the message feedback record as +%% `RECEIVED'; Otherwise, an hour after the message feedback record is +%% set +%% to `FAILED'. +-spec put_message_feedback(aws_client:aws_client(), put_message_feedback_request()) -> + {ok, put_message_feedback_result(), tuple()} | + {error, any()} | + {error, put_message_feedback_errors(), tuple()}. +put_message_feedback(Client, Input) + when is_map(Client), is_map(Input) -> + put_message_feedback(Client, Input, []). + +-spec put_message_feedback(aws_client:aws_client(), put_message_feedback_request(), proplists:proplist()) -> + {ok, put_message_feedback_result(), tuple()} | + {error, any()} | + {error, put_message_feedback_errors(), tuple()}. +put_message_feedback(Client, Input, Options) + when is_map(Client), is_map(Input), is_list(Options) -> + request(Client, <<"PutMessageFeedback">>, Input, Options). + %% @doc Creates an opted out destination phone number in the opt-out list. %% %% If the destination phone number isn't valid or if the specified @@ -4282,6 +4501,24 @@ put_opted_out_number(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"PutOptedOutNumber">>, Input, Options). +%% @doc Create or update a RuleSetNumberOverride and associate it with a +%% protect configuration. +-spec put_protect_configuration_rule_set_number_override(aws_client:aws_client(), put_protect_configuration_rule_set_number_override_request()) -> + {ok, put_protect_configuration_rule_set_number_override_result(), tuple()} | + {error, any()} | + {error, put_protect_configuration_rule_set_number_override_errors(), tuple()}. +put_protect_configuration_rule_set_number_override(Client, Input) + when is_map(Client), is_map(Input) -> + put_protect_configuration_rule_set_number_override(Client, Input, []). + +-spec put_protect_configuration_rule_set_number_override(aws_client:aws_client(), put_protect_configuration_rule_set_number_override_request(), proplists:proplist()) -> + {ok, put_protect_configuration_rule_set_number_override_result(), tuple()} | + {error, any()} | + {error, put_protect_configuration_rule_set_number_override_errors(), tuple()}. +put_protect_configuration_rule_set_number_override(Client, Input, Options) + when is_map(Client), is_map(Input), is_list(Options) -> + request(Client, <<"PutProtectConfigurationRuleSetNumberOverride">>, Input, Options). + %% @doc Creates or updates a field value for a registration. -spec put_registration_field_value(aws_client:aws_client(), put_registration_field_value_request()) -> {ok, put_registration_field_value_result(), tuple()} | @@ -4519,6 +4756,23 @@ set_account_default_protect_configuration(Client, Input, Options) when is_map(Client), is_map(Input), is_list(Options) -> request(Client, <<"SetAccountDefaultProtectConfiguration">>, Input, Options). +%% @doc Sets a configuration set's default for message feedback. +-spec set_default_message_feedback_enabled(aws_client:aws_client(), set_default_message_feedback_enabled_request()) -> + {ok, set_default_message_feedback_enabled_result(), tuple()} | + {error, any()} | + {error, set_default_message_feedback_enabled_errors(), tuple()}. +set_default_message_feedback_enabled(Client, Input) + when is_map(Client), is_map(Input) -> + set_default_message_feedback_enabled(Client, Input, []). + +-spec set_default_message_feedback_enabled(aws_client:aws_client(), set_default_message_feedback_enabled_request(), proplists:proplist()) -> + {ok, set_default_message_feedback_enabled_result(), tuple()} | + {error, any()} | + {error, set_default_message_feedback_enabled_errors(), tuple()}. +set_default_message_feedback_enabled(Client, Input, Options) + when is_map(Client), is_map(Input), is_list(Options) -> + request(Client, <<"SetDefaultMessageFeedbackEnabled">>, Input, Options). + %% @doc Sets the default message type on a configuration set. %% %% Choose the category of SMS messages that you plan to send from this diff --git a/src/aws_route53resolver.erl b/src/aws_route53resolver.erl index aab61c44..8c6551eb 100644 --- a/src/aws_route53resolver.erl +++ b/src/aws_route53resolver.erl @@ -272,9 +272,12 @@ %% <<"BlockOverrideDomain">> => string(), %% <<"BlockOverrideTtl">> => integer(), %% <<"BlockResponse">> => list(any()), -%% <<"FirewallDomainListId">> := string(), +%% <<"ConfidenceThreshold">> => list(any()), +%% <<"DnsThreatProtection">> => list(any()), +%% <<"FirewallDomainListId">> => string(), %% <<"FirewallDomainRedirectionAction">> => list(any()), %% <<"FirewallRuleGroupId">> := string(), +%% <<"FirewallThreatProtectionId">> => string(), %% <<"Name">> => string(), %% <<"Priority">> => integer(), %% <<"Qtype">> => string() @@ -412,8 +415,10 @@ %% <<"BlockOverrideDomain">> => string(), %% <<"BlockOverrideTtl">> => integer(), %% <<"BlockResponse">> => list(any()), +%% <<"ConfidenceThreshold">> => list(any()), %% <<"CreatorRequestId">> := string(), -%% <<"FirewallDomainListId">> := string(), +%% <<"DnsThreatProtection">> => list(any()), +%% <<"FirewallDomainListId">> => string(), %% <<"FirewallDomainRedirectionAction">> => list(any()), %% <<"FirewallRuleGroupId">> := string(), %% <<"Name">> := string(), @@ -946,11 +951,14 @@ %% <<"BlockOverrideDomain">> => string(), %% <<"BlockOverrideTtl">> => integer(), %% <<"BlockResponse">> => list(any()), +%% <<"ConfidenceThreshold">> => list(any()), %% <<"CreationTime">> => string(), %% <<"CreatorRequestId">> => string(), +%% <<"DnsThreatProtection">> => list(any()), %% <<"FirewallDomainListId">> => string(), %% <<"FirewallDomainRedirectionAction">> => list(any()), %% <<"FirewallRuleGroupId">> => string(), +%% <<"FirewallThreatProtectionId">> => string(), %% <<"ModificationTime">> => string(), %% <<"Name">> => string(), %% <<"Priority">> => integer(), @@ -1061,8 +1069,9 @@ %% Example: %% delete_firewall_rule_request() :: #{ -%% <<"FirewallDomainListId">> := string(), +%% <<"FirewallDomainListId">> => string(), %% <<"FirewallRuleGroupId">> := string(), +%% <<"FirewallThreatProtectionId">> => string(), %% <<"Qtype">> => string() %% } -type delete_firewall_rule_request() :: #{binary() => any()}. @@ -1655,6 +1664,7 @@ -type delete_firewall_rule_errors() :: throttling_exception() | + validation_exception() | access_denied_exception() | resource_not_found_exception() | internal_service_error_exception().