Current section
Files
Jump to
Current section
Files
src/aws_connectcases.erl
%% WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
%% See https://github.com/aws-beam/aws-codegen for more details.
%% @doc With Amazon Connect Cases, your agents can track and manage customer
%% issues that require
%% multiple interactions, follow-up tasks, and teams in your contact center.
%%
%% A case represents a
%% customer issue. It records the issue, the steps and interactions taken to
%% resolve the issue,
%% and the outcome. For more information, see Amazon Connect Cases:
%% https://docs.aws.amazon.com/connect/latest/adminguide/cases.html in the
%% Amazon Connect Administrator Guide.
-module(aws_connectcases).
-export([batch_get_field/3,
batch_get_field/4,
batch_put_field_options/4,
batch_put_field_options/5,
create_case/3,
create_case/4,
create_domain/2,
create_domain/3,
create_field/3,
create_field/4,
create_layout/3,
create_layout/4,
create_related_item/4,
create_related_item/5,
create_template/3,
create_template/4,
delete_domain/3,
delete_domain/4,
get_case/4,
get_case/5,
get_case_audit_events/4,
get_case_audit_events/5,
get_case_event_configuration/3,
get_case_event_configuration/4,
get_domain/3,
get_domain/4,
get_layout/4,
get_layout/5,
get_template/4,
get_template/5,
list_cases_for_contact/3,
list_cases_for_contact/4,
list_domains/2,
list_domains/3,
list_field_options/4,
list_field_options/5,
list_fields/3,
list_fields/4,
list_layouts/3,
list_layouts/4,
list_tags_for_resource/2,
list_tags_for_resource/4,
list_tags_for_resource/5,
list_templates/3,
list_templates/4,
put_case_event_configuration/3,
put_case_event_configuration/4,
search_cases/3,
search_cases/4,
search_related_items/4,
search_related_items/5,
tag_resource/3,
tag_resource/4,
untag_resource/3,
untag_resource/4,
update_case/4,
update_case/5,
update_field/4,
update_field/5,
update_layout/4,
update_layout/5,
update_template/4,
update_template/5]).
-include_lib("hackney/include/hackney_lib.hrl").
%% Example:
%% contact_filter() :: #{
%% <<"channel">> => list(string()()),
%% <<"contactArn">> => string()
%% }
-type contact_filter() :: #{binary() => any()}.
%% Example:
%% get_domain_request() :: #{}
-type get_domain_request() :: #{}.
%% Example:
%% delete_domain_response() :: #{}
-type delete_domain_response() :: #{}.
%% Example:
%% tag_resource_request() :: #{
%% <<"tags">> := map()
%% }
-type tag_resource_request() :: #{binary() => any()}.
%% Example:
%% update_layout_request() :: #{
%% <<"content">> => list(),
%% <<"name">> => string()
%% }
-type update_layout_request() :: #{binary() => any()}.
%% Example:
%% get_case_audit_events_response() :: #{
%% <<"auditEvents">> => list(audit_event()()),
%% <<"nextToken">> => string()
%% }
-type get_case_audit_events_response() :: #{binary() => any()}.
%% Example:
%% search_related_items_response() :: #{
%% <<"nextToken">> => string(),
%% <<"relatedItems">> := list(search_related_items_response_item()())
%% }
-type search_related_items_response() :: #{binary() => any()}.
%% Example:
%% list_fields_request() :: #{
%% <<"maxResults">> => integer(),
%% <<"nextToken">> => string()
%% }
-type list_fields_request() :: #{binary() => any()}.
%% Example:
%% search_cases_request() :: #{
%% <<"fields">> => list(field_identifier()()),
%% <<"filter">> => list(),
%% <<"maxResults">> => [integer()],
%% <<"nextToken">> => string(),
%% <<"searchTerm">> => [string()],
%% <<"sorts">> => list(sort()())
%% }
-type search_cases_request() :: #{binary() => any()}.
%% Example:
%% get_case_audit_events_request() :: #{
%% <<"maxResults">> => [integer()],
%% <<"nextToken">> => string()
%% }
-type get_case_audit_events_request() :: #{binary() => any()}.
%% Example:
%% list_templates_request() :: #{
%% <<"maxResults">> => integer(),
%% <<"nextToken">> => string(),
%% <<"status">> => list(string()())
%% }
-type list_templates_request() :: #{binary() => any()}.
%% Example:
%% create_case_request() :: #{
%% <<"clientToken">> => [string()],
%% <<"fields">> := list(field_value()()),
%% <<"performedBy">> => list(),
%% <<"templateId">> := string()
%% }
-type create_case_request() :: #{binary() => any()}.
%% Example:
%% field_option_error() :: #{
%% <<"errorCode">> => [string()],
%% <<"message">> => [string()],
%% <<"value">> => string()
%% }
-type field_option_error() :: #{binary() => any()}.
%% Example:
%% list_layouts_response() :: #{
%% <<"layouts">> := list(layout_summary()()),
%% <<"nextToken">> => string()
%% }
-type list_layouts_response() :: #{binary() => any()}.
%% Example:
%% domain_summary() :: #{
%% <<"domainArn">> => string(),
%% <<"domainId">> => string(),
%% <<"name">> => string()
%% }
-type domain_summary() :: #{binary() => any()}.
%% Example:
%% create_template_request() :: #{
%% <<"description">> => string(),
%% <<"layoutConfiguration">> => layout_configuration(),
%% <<"name">> := string(),
%% <<"requiredFields">> => list(required_field()()),
%% <<"status">> => string()
%% }
-type create_template_request() :: #{binary() => any()}.
%% Example:
%% get_template_response() :: #{
%% <<"description">> => string(),
%% <<"layoutConfiguration">> => layout_configuration(),
%% <<"name">> := string(),
%% <<"requiredFields">> => list(required_field()()),
%% <<"status">> := string(),
%% <<"tags">> => map(),
%% <<"templateArn">> := string(),
%% <<"templateId">> := string()
%% }
-type get_template_response() :: #{binary() => any()}.
%% Example:
%% batch_put_field_options_request() :: #{
%% <<"options">> := list(field_option()())
%% }
-type batch_put_field_options_request() :: #{binary() => any()}.
%% Example:
%% create_case_response() :: #{
%% <<"caseArn">> := string(),
%% <<"caseId">> := string()
%% }
-type create_case_response() :: #{binary() => any()}.
%% Example:
%% comment_filter() :: #{}
-type comment_filter() :: #{}.
%% Example:
%% list_field_options_request() :: #{
%% <<"maxResults">> => integer(),
%% <<"nextToken">> => string(),
%% <<"values">> => list(string()())
%% }
-type list_field_options_request() :: #{binary() => any()}.
%% Example:
%% create_layout_request() :: #{
%% <<"content">> := list(),
%% <<"name">> := string()
%% }
-type create_layout_request() :: #{binary() => any()}.
%% Example:
%% update_template_request() :: #{
%% <<"description">> => string(),
%% <<"layoutConfiguration">> => layout_configuration(),
%% <<"name">> => string(),
%% <<"requiredFields">> => list(required_field()()),
%% <<"status">> => string()
%% }
-type update_template_request() :: #{binary() => any()}.
%% Example:
%% list_cases_for_contact_response() :: #{
%% <<"cases">> := list(case_summary()()),
%% <<"nextToken">> => string()
%% }
-type list_cases_for_contact_response() :: #{binary() => any()}.
%% Example:
%% untag_resource_request() :: #{
%% <<"tagKeys">> := list(string()())
%% }
-type untag_resource_request() :: #{binary() => any()}.
%% Example:
%% create_field_response() :: #{
%% <<"fieldArn">> := string(),
%% <<"fieldId">> := string()
%% }
-type create_field_response() :: #{binary() => any()}.
%% Example:
%% get_case_response() :: #{
%% <<"fields">> := list(field_value()()),
%% <<"nextToken">> => string(),
%% <<"tags">> => map(),
%% <<"templateId">> := string()
%% }
-type get_case_response() :: #{binary() => any()}.
%% Example:
%% comment_content() :: #{
%% <<"body">> => string(),
%% <<"contentType">> => string()
%% }
-type comment_content() :: #{binary() => any()}.
%% Example:
%% required_field() :: #{
%% <<"fieldId">> => string()
%% }
-type required_field() :: #{binary() => any()}.
%% Example:
%% search_cases_response_item() :: #{
%% <<"caseId">> => string(),
%% <<"fields">> => list(field_value()()),
%% <<"tags">> => map(),
%% <<"templateId">> => string()
%% }
-type search_cases_response_item() :: #{binary() => any()}.
%% Example:
%% search_related_items_request() :: #{
%% <<"filters">> => list(list()()),
%% <<"maxResults">> => [integer()],
%% <<"nextToken">> => string()
%% }
-type search_related_items_request() :: #{binary() => any()}.
%% Example:
%% delete_domain_request() :: #{}
-type delete_domain_request() :: #{}.
%% Example:
%% basic_layout() :: #{
%% <<"moreInfo">> => layout_sections(),
%% <<"topPanel">> => layout_sections()
%% }
-type basic_layout() :: #{binary() => any()}.
%% Example:
%% empty_field_value() :: #{}
-type empty_field_value() :: #{}.
%% Example:
%% get_case_event_configuration_request() :: #{}
-type get_case_event_configuration_request() :: #{}.
%% Example:
%% conflict_exception() :: #{
%% <<"message">> => [string()]
%% }
-type conflict_exception() :: #{binary() => any()}.
%% Example:
%% resource_not_found_exception() :: #{
%% <<"message">> => [string()],
%% <<"resourceId">> => [string()],
%% <<"resourceType">> => [string()]
%% }
-type resource_not_found_exception() :: #{binary() => any()}.
%% Example:
%% create_domain_request() :: #{
%% <<"name">> := string()
%% }
-type create_domain_request() :: #{binary() => any()}.
%% Example:
%% batch_get_field_request() :: #{
%% <<"fields">> := list(field_identifier()())
%% }
-type batch_get_field_request() :: #{binary() => any()}.
%% Example:
%% get_case_event_configuration_response() :: #{
%% <<"eventBridge">> := event_bridge_configuration()
%% }
-type get_case_event_configuration_response() :: #{binary() => any()}.
%% Example:
%% audit_event_field() :: #{
%% <<"eventFieldId">> => string(),
%% <<"newValue">> => list(),
%% <<"oldValue">> => list()
%% }
-type audit_event_field() :: #{binary() => any()}.
%% Example:
%% get_case_request() :: #{
%% <<"fields">> := list(field_identifier()()),
%% <<"nextToken">> => string()
%% }
-type get_case_request() :: #{binary() => any()}.
%% Example:
%% service_quota_exceeded_exception() :: #{
%% <<"message">> => [string()]
%% }
-type service_quota_exceeded_exception() :: #{binary() => any()}.
%% Example:
%% search_related_items_response_item() :: #{
%% <<"associationTime">> => non_neg_integer(),
%% <<"content">> => list(),
%% <<"performedBy">> => list(),
%% <<"relatedItemId">> => string(),
%% <<"tags">> => map(),
%% <<"type">> => string()
%% }
-type search_related_items_response_item() :: #{binary() => any()}.
%% Example:
%% list_domains_response() :: #{
%% <<"domains">> := list(domain_summary()()),
%% <<"nextToken">> => string()
%% }
-type list_domains_response() :: #{binary() => any()}.
%% Example:
%% update_field_response() :: #{}
-type update_field_response() :: #{}.
%% Example:
%% template_summary() :: #{
%% <<"name">> => string(),
%% <<"status">> => string(),
%% <<"templateArn">> => string(),
%% <<"templateId">> => string()
%% }
-type template_summary() :: #{binary() => any()}.
%% Example:
%% create_field_request() :: #{
%% <<"description">> => string(),
%% <<"name">> := string(),
%% <<"type">> := string()
%% }
-type create_field_request() :: #{binary() => any()}.
%% Example:
%% batch_get_field_response() :: #{
%% <<"errors">> := list(field_error()()),
%% <<"fields">> := list(get_field_response()())
%% }
-type batch_get_field_response() :: #{binary() => any()}.
%% Example:
%% list_tags_for_resource_response() :: #{
%% <<"tags">> => map()
%% }
-type list_tags_for_resource_response() :: #{binary() => any()}.
%% Example:
%% create_layout_response() :: #{
%% <<"layoutArn">> := string(),
%% <<"layoutId">> := string()
%% }
-type create_layout_response() :: #{binary() => any()}.
%% Example:
%% put_case_event_configuration_response() :: #{}
-type put_case_event_configuration_response() :: #{}.
%% Example:
%% list_fields_response() :: #{
%% <<"fields">> := list(field_summary()()),
%% <<"nextToken">> => string()
%% }
-type list_fields_response() :: #{binary() => any()}.
%% Example:
%% sort() :: #{
%% <<"fieldId">> => string(),
%% <<"sortOrder">> => string()
%% }
-type sort() :: #{binary() => any()}.
%% Example:
%% contact() :: #{
%% <<"contactArn">> => string()
%% }
-type contact() :: #{binary() => any()}.
%% Example:
%% create_related_item_response() :: #{
%% <<"relatedItemArn">> := string(),
%% <<"relatedItemId">> := string()
%% }
-type create_related_item_response() :: #{binary() => any()}.
%% Example:
%% get_domain_response() :: #{
%% <<"createdTime">> := non_neg_integer(),
%% <<"domainArn">> := string(),
%% <<"domainId">> := string(),
%% <<"domainStatus">> := string(),
%% <<"name">> := string(),
%% <<"tags">> => map()
%% }
-type get_domain_response() :: #{binary() => any()}.
%% Example:
%% field_item() :: #{
%% <<"id">> => string()
%% }
-type field_item() :: #{binary() => any()}.
%% Example:
%% field_error() :: #{
%% <<"errorCode">> => [string()],
%% <<"id">> => string(),
%% <<"message">> => [string()]
%% }
-type field_error() :: #{binary() => any()}.
%% Example:
%% field_summary() :: #{
%% <<"fieldArn">> => string(),
%% <<"fieldId">> => string(),
%% <<"name">> => string(),
%% <<"namespace">> => string(),
%% <<"type">> => string()
%% }
-type field_summary() :: #{binary() => any()}.
%% Example:
%% list_layouts_request() :: #{
%% <<"maxResults">> => integer(),
%% <<"nextToken">> => string()
%% }
-type list_layouts_request() :: #{binary() => any()}.
%% Example:
%% update_template_response() :: #{}
-type update_template_response() :: #{}.
%% Example:
%% list_domains_request() :: #{
%% <<"maxResults">> => integer(),
%% <<"nextToken">> => string()
%% }
-type list_domains_request() :: #{binary() => any()}.
%% Example:
%% internal_server_exception() :: #{
%% <<"message">> => [string()],
%% <<"retryAfterSeconds">> => [integer()]
%% }
-type internal_server_exception() :: #{binary() => any()}.
%% Example:
%% event_included_data() :: #{
%% <<"caseData">> => case_event_included_data(),
%% <<"relatedItemData">> => related_item_event_included_data()
%% }
-type event_included_data() :: #{binary() => any()}.
%% Example:
%% update_case_request() :: #{
%% <<"fields">> := list(field_value()()),
%% <<"performedBy">> => list()
%% }
-type update_case_request() :: #{binary() => any()}.
%% Example:
%% event_bridge_configuration() :: #{
%% <<"enabled">> => [boolean()],
%% <<"includedData">> => event_included_data()
%% }
-type event_bridge_configuration() :: #{binary() => any()}.
%% Example:
%% get_layout_request() :: #{}
-type get_layout_request() :: #{}.
%% Example:
%% access_denied_exception() :: #{
%% <<"message">> => [string()]
%% }
-type access_denied_exception() :: #{binary() => any()}.
%% Example:
%% field_value() :: #{
%% <<"id">> => string(),
%% <<"value">> => list()
%% }
-type field_value() :: #{binary() => any()}.
%% Example:
%% update_field_request() :: #{
%% <<"description">> => string(),
%% <<"name">> => string()
%% }
-type update_field_request() :: #{binary() => any()}.
%% Example:
%% field_option() :: #{
%% <<"active">> => [boolean()],
%% <<"name">> => string(),
%% <<"value">> => string()
%% }
-type field_option() :: #{binary() => any()}.
%% Example:
%% layout_summary() :: #{
%% <<"layoutArn">> => string(),
%% <<"layoutId">> => string(),
%% <<"name">> => string()
%% }
-type layout_summary() :: #{binary() => any()}.
%% Example:
%% list_templates_response() :: #{
%% <<"nextToken">> => string(),
%% <<"templates">> := list(template_summary()())
%% }
-type list_templates_response() :: #{binary() => any()}.
%% Example:
%% put_case_event_configuration_request() :: #{
%% <<"eventBridge">> := event_bridge_configuration()
%% }
-type put_case_event_configuration_request() :: #{binary() => any()}.
%% Example:
%% layout_sections() :: #{
%% <<"sections">> => list(list()())
%% }
-type layout_sections() :: #{binary() => any()}.
%% Example:
%% get_template_request() :: #{}
-type get_template_request() :: #{}.
%% Example:
%% validation_exception() :: #{
%% <<"message">> => [string()]
%% }
-type validation_exception() :: #{binary() => any()}.
%% Example:
%% list_tags_for_resource_request() :: #{}
-type list_tags_for_resource_request() :: #{}.
%% Example:
%% throttling_exception() :: #{
%% <<"message">> => [string()]
%% }
-type throttling_exception() :: #{binary() => any()}.
%% Example:
%% create_domain_response() :: #{
%% <<"domainArn">> := string(),
%% <<"domainId">> := string(),
%% <<"domainStatus">> := string()
%% }
-type create_domain_response() :: #{binary() => any()}.
%% Example:
%% get_layout_response() :: #{
%% <<"content">> := list(),
%% <<"layoutArn">> := string(),
%% <<"layoutId">> := string(),
%% <<"name">> := string(),
%% <<"tags">> => map()
%% }
-type get_layout_response() :: #{binary() => any()}.
%% Example:
%% search_cases_response() :: #{
%% <<"cases">> := list(search_cases_response_item()()),
%% <<"nextToken">> => string()
%% }
-type search_cases_response() :: #{binary() => any()}.
%% Example:
%% batch_put_field_options_response() :: #{
%% <<"errors">> => list(field_option_error()())
%% }
-type batch_put_field_options_response() :: #{binary() => any()}.
%% Example:
%% update_case_response() :: #{}
-type update_case_response() :: #{}.
%% Example:
%% create_template_response() :: #{
%% <<"templateArn">> := string(),
%% <<"templateId">> := string()
%% }
-type create_template_response() :: #{binary() => any()}.
%% Example:
%% update_layout_response() :: #{}
-type update_layout_response() :: #{}.
%% Example:
%% field_identifier() :: #{
%% <<"id">> => string()
%% }
-type field_identifier() :: #{binary() => any()}.
%% Example:
%% list_field_options_response() :: #{
%% <<"nextToken">> => string(),
%% <<"options">> := list(field_option()())
%% }
-type list_field_options_response() :: #{binary() => any()}.
%% Example:
%% list_cases_for_contact_request() :: #{
%% <<"contactArn">> := string(),
%% <<"maxResults">> => [integer()],
%% <<"nextToken">> => string()
%% }
-type list_cases_for_contact_request() :: #{binary() => any()}.
%% Example:
%% create_related_item_request() :: #{
%% <<"content">> := list(),
%% <<"performedBy">> => list(),
%% <<"type">> := string()
%% }
-type create_related_item_request() :: #{binary() => any()}.
%% Example:
%% get_field_response() :: #{
%% <<"description">> => string(),
%% <<"fieldArn">> => string(),
%% <<"fieldId">> => string(),
%% <<"name">> => string(),
%% <<"namespace">> => string(),
%% <<"tags">> => map(),
%% <<"type">> => string()
%% }
-type get_field_response() :: #{binary() => any()}.
%% Example:
%% case_summary() :: #{
%% <<"caseId">> => string(),
%% <<"templateId">> => string()
%% }
-type case_summary() :: #{binary() => any()}.
%% Example:
%% field_group() :: #{
%% <<"fields">> => list(field_item()()),
%% <<"name">> => [string()]
%% }
-type field_group() :: #{binary() => any()}.
%% Example:
%% audit_event() :: #{
%% <<"eventId">> => string(),
%% <<"fields">> => list(audit_event_field()()),
%% <<"performedBy">> => audit_event_performed_by(),
%% <<"performedTime">> => non_neg_integer(),
%% <<"relatedItemType">> => string(),
%% <<"type">> => string()
%% }
-type audit_event() :: #{binary() => any()}.
%% Example:
%% case_event_included_data() :: #{
%% <<"fields">> => list(field_identifier()())
%% }
-type case_event_included_data() :: #{binary() => any()}.
%% Example:
%% layout_configuration() :: #{
%% <<"defaultLayout">> => string()
%% }
-type layout_configuration() :: #{binary() => any()}.
%% Example:
%% related_item_event_included_data() :: #{
%% <<"includeContent">> => [boolean()]
%% }
-type related_item_event_included_data() :: #{binary() => any()}.
%% Example:
%% contact_content() :: #{
%% <<"channel">> => string(),
%% <<"connectedToSystemTime">> => non_neg_integer(),
%% <<"contactArn">> => string()
%% }
-type contact_content() :: #{binary() => any()}.
%% Example:
%% audit_event_performed_by() :: #{
%% <<"iamPrincipalArn">> => string(),
%% <<"user">> => list()
%% }
-type audit_event_performed_by() :: #{binary() => any()}.
-type batch_get_field_errors() ::
throttling_exception() |
validation_exception() |
access_denied_exception() |
internal_server_exception() |
resource_not_found_exception().
-type batch_put_field_options_errors() ::
throttling_exception() |
validation_exception() |
access_denied_exception() |
internal_server_exception() |
service_quota_exceeded_exception() |
resource_not_found_exception().
-type create_case_errors() ::
throttling_exception() |
validation_exception() |
access_denied_exception() |
internal_server_exception() |
resource_not_found_exception() |
conflict_exception().
-type create_domain_errors() ::
throttling_exception() |
validation_exception() |
access_denied_exception() |
internal_server_exception() |
service_quota_exceeded_exception() |
conflict_exception().
-type create_field_errors() ::
throttling_exception() |
validation_exception() |
access_denied_exception() |
internal_server_exception() |
service_quota_exceeded_exception() |
resource_not_found_exception() |
conflict_exception().
-type create_layout_errors() ::
throttling_exception() |
validation_exception() |
access_denied_exception() |
internal_server_exception() |
service_quota_exceeded_exception() |
resource_not_found_exception() |
conflict_exception().
-type create_related_item_errors() ::
throttling_exception() |
validation_exception() |
access_denied_exception() |
internal_server_exception() |
service_quota_exceeded_exception() |
resource_not_found_exception().
-type create_template_errors() ::
throttling_exception() |
validation_exception() |
access_denied_exception() |
internal_server_exception() |
service_quota_exceeded_exception() |
resource_not_found_exception() |
conflict_exception().
-type delete_domain_errors() ::
throttling_exception() |
validation_exception() |
access_denied_exception() |
internal_server_exception() |
resource_not_found_exception() |
conflict_exception().
-type get_case_errors() ::
throttling_exception() |
validation_exception() |
access_denied_exception() |
internal_server_exception() |
resource_not_found_exception().
-type get_case_audit_events_errors() ::
throttling_exception() |
validation_exception() |
access_denied_exception() |
internal_server_exception() |
resource_not_found_exception().
-type get_case_event_configuration_errors() ::
throttling_exception() |
validation_exception() |
access_denied_exception() |
internal_server_exception() |
resource_not_found_exception().
-type get_domain_errors() ::
throttling_exception() |
validation_exception() |
access_denied_exception() |
internal_server_exception() |
resource_not_found_exception().
-type get_layout_errors() ::
throttling_exception() |
validation_exception() |
access_denied_exception() |
internal_server_exception() |
resource_not_found_exception().
-type get_template_errors() ::
throttling_exception() |
validation_exception() |
access_denied_exception() |
internal_server_exception() |
resource_not_found_exception().
-type list_cases_for_contact_errors() ::
throttling_exception() |
validation_exception() |
access_denied_exception() |
internal_server_exception() |
resource_not_found_exception().
-type list_domains_errors() ::
throttling_exception() |
validation_exception() |
access_denied_exception() |
internal_server_exception().
-type list_field_options_errors() ::
throttling_exception() |
validation_exception() |
access_denied_exception() |
internal_server_exception() |
resource_not_found_exception().
-type list_fields_errors() ::
throttling_exception() |
validation_exception() |
access_denied_exception() |
internal_server_exception() |
resource_not_found_exception().
-type list_layouts_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 list_templates_errors() ::
throttling_exception() |
validation_exception() |
access_denied_exception() |
internal_server_exception() |
resource_not_found_exception().
-type put_case_event_configuration_errors() ::
throttling_exception() |
validation_exception() |
access_denied_exception() |
internal_server_exception() |
resource_not_found_exception().
-type search_cases_errors() ::
throttling_exception() |
validation_exception() |
access_denied_exception() |
internal_server_exception() |
resource_not_found_exception().
-type search_related_items_errors() ::
throttling_exception() |
validation_exception() |
access_denied_exception() |
internal_server_exception() |
resource_not_found_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_case_errors() ::
throttling_exception() |
validation_exception() |
access_denied_exception() |
internal_server_exception() |
resource_not_found_exception().
-type update_field_errors() ::
throttling_exception() |
validation_exception() |
access_denied_exception() |
internal_server_exception() |
resource_not_found_exception() |
conflict_exception().
-type update_layout_errors() ::
throttling_exception() |
validation_exception() |
access_denied_exception() |
internal_server_exception() |
service_quota_exceeded_exception() |
resource_not_found_exception() |
conflict_exception().
-type update_template_errors() ::
throttling_exception() |
validation_exception() |
access_denied_exception() |
internal_server_exception() |
resource_not_found_exception() |
conflict_exception().
%%====================================================================
%% API
%%====================================================================
%% @doc Returns the description for the list of fields in the request
%% parameters.
-spec batch_get_field(aws_client:aws_client(), binary() | list(), batch_get_field_request()) ->
{ok, batch_get_field_response(), tuple()} |
{error, any()} |
{error, batch_get_field_errors(), tuple()}.
batch_get_field(Client, DomainId, Input) ->
batch_get_field(Client, DomainId, Input, []).
-spec batch_get_field(aws_client:aws_client(), binary() | list(), batch_get_field_request(), proplists:proplist()) ->
{ok, batch_get_field_response(), tuple()} |
{error, any()} |
{error, batch_get_field_errors(), tuple()}.
batch_get_field(Client, DomainId, Input0, Options0) ->
Method = post,
Path = ["/domains/", aws_util:encode_uri(DomainId), "/fields-batch"],
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 and updates a set of field options for a single select field
%% in a Cases
%% domain.
-spec batch_put_field_options(aws_client:aws_client(), binary() | list(), binary() | list(), batch_put_field_options_request()) ->
{ok, batch_put_field_options_response(), tuple()} |
{error, any()} |
{error, batch_put_field_options_errors(), tuple()}.
batch_put_field_options(Client, DomainId, FieldId, Input) ->
batch_put_field_options(Client, DomainId, FieldId, Input, []).
-spec batch_put_field_options(aws_client:aws_client(), binary() | list(), binary() | list(), batch_put_field_options_request(), proplists:proplist()) ->
{ok, batch_put_field_options_response(), tuple()} |
{error, any()} |
{error, batch_put_field_options_errors(), tuple()}.
batch_put_field_options(Client, DomainId, FieldId, Input0, Options0) ->
Method = put,
Path = ["/domains/", aws_util:encode_uri(DomainId), "/fields/", aws_util:encode_uri(FieldId), "/options"],
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
%% If you provide a value for `PerformedBy.UserArn' you must also have
%% connect:DescribeUser:
%% https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribeUser.html
%% permission on the User ARN resource that you provide
%%
%% Creates a case in the specified Cases domain.
%%
%% Case system and custom fields are taken
%% as an array id/value pairs with a declared data types.
%%
%% The following fields are required when creating a case:
%%
%% `customer_id' - You must provide the full customer profile ARN in this
%% format:
%%
%% ```
%% arn:aws:profile:your_AWS_Region:your_AWS_account
%% ID:domains/your_profiles_domain_name/profiles/profile_ID'''
%%
%% `title'
-spec create_case(aws_client:aws_client(), binary() | list(), create_case_request()) ->
{ok, create_case_response(), tuple()} |
{error, any()} |
{error, create_case_errors(), tuple()}.
create_case(Client, DomainId, Input) ->
create_case(Client, DomainId, Input, []).
-spec create_case(aws_client:aws_client(), binary() | list(), create_case_request(), proplists:proplist()) ->
{ok, create_case_response(), tuple()} |
{error, any()} |
{error, create_case_errors(), tuple()}.
create_case(Client, DomainId, Input0, Options0) ->
Method = post,
Path = ["/domains/", aws_util:encode_uri(DomainId), "/cases"],
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 a domain, which is a container for all case data, such as
%% cases, fields, templates
%% and layouts.
%%
%% Each Amazon Connect instance can be associated with only one Cases
%% domain.
%%
%% This will not associate your connect instance to Cases domain. Instead,
%% use the
%% Amazon Connect
%% CreateIntegrationAssociation:
%% https://docs.aws.amazon.com/connect/latest/APIReference/API_CreateIntegrationAssociation.html
%% API. You need specific IAM
%% permissions to successfully associate the Cases domain. For more
%% information, see
%% Onboard to Cases:
%% https://docs.aws.amazon.com/connect/latest/adminguide/required-permissions-iam-cases.html#onboard-cases-iam.
-spec create_domain(aws_client:aws_client(), create_domain_request()) ->
{ok, create_domain_response(), tuple()} |
{error, any()} |
{error, create_domain_errors(), tuple()}.
create_domain(Client, Input) ->
create_domain(Client, Input, []).
-spec create_domain(aws_client:aws_client(), create_domain_request(), proplists:proplist()) ->
{ok, create_domain_response(), tuple()} |
{error, any()} |
{error, create_domain_errors(), tuple()}.
create_domain(Client, Input0, Options0) ->
Method = post,
Path = ["/domains"],
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 a field in the Cases domain.
%%
%% This field is used to define the case object
%% model (that is, defines what data can be captured on cases) in a Cases
%% domain.
-spec create_field(aws_client:aws_client(), binary() | list(), create_field_request()) ->
{ok, create_field_response(), tuple()} |
{error, any()} |
{error, create_field_errors(), tuple()}.
create_field(Client, DomainId, Input) ->
create_field(Client, DomainId, Input, []).
-spec create_field(aws_client:aws_client(), binary() | list(), create_field_request(), proplists:proplist()) ->
{ok, create_field_response(), tuple()} |
{error, any()} |
{error, create_field_errors(), tuple()}.
create_field(Client, DomainId, Input0, Options0) ->
Method = post,
Path = ["/domains/", aws_util:encode_uri(DomainId), "/fields"],
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 a layout in the Cases domain.
%%
%% Layouts define the following configuration in
%% the top section and More Info tab of the Cases user interface:
%%
%% Fields to display to the users
%%
%% Field ordering
%%
%% Title and Status fields cannot be part of layouts since they are not
%% configurable.
-spec create_layout(aws_client:aws_client(), binary() | list(), create_layout_request()) ->
{ok, create_layout_response(), tuple()} |
{error, any()} |
{error, create_layout_errors(), tuple()}.
create_layout(Client, DomainId, Input) ->
create_layout(Client, DomainId, Input, []).
-spec create_layout(aws_client:aws_client(), binary() | list(), create_layout_request(), proplists:proplist()) ->
{ok, create_layout_response(), tuple()} |
{error, any()} |
{error, create_layout_errors(), tuple()}.
create_layout(Client, DomainId, Input0, Options0) ->
Method = post,
Path = ["/domains/", aws_util:encode_uri(DomainId), "/layouts"],
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 a related item (comments, tasks, and contacts) and associates
%% it with a
%% case.
%%
%% A Related Item is a resource that is associated with a case. It may or may
%% not have
%% an external identifier linking it to an external resource (for example, a
%% `contactArn'). All Related Items have their own internal identifier,
%% the
%% `relatedItemArn'. Examples of related items include `comments'
%% and `contacts'.
%%
%% If you provide a value for `performedBy.userArn' you must also have
%% DescribeUser:
%% https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribeUser.html
%% permission on the ARN of the user that you provide.
-spec create_related_item(aws_client:aws_client(), binary() | list(), binary() | list(), create_related_item_request()) ->
{ok, create_related_item_response(), tuple()} |
{error, any()} |
{error, create_related_item_errors(), tuple()}.
create_related_item(Client, CaseId, DomainId, Input) ->
create_related_item(Client, CaseId, DomainId, Input, []).
-spec create_related_item(aws_client:aws_client(), binary() | list(), binary() | list(), create_related_item_request(), proplists:proplist()) ->
{ok, create_related_item_response(), tuple()} |
{error, any()} |
{error, create_related_item_errors(), tuple()}.
create_related_item(Client, CaseId, DomainId, Input0, Options0) ->
Method = post,
Path = ["/domains/", aws_util:encode_uri(DomainId), "/cases/", aws_util:encode_uri(CaseId), "/related-items/"],
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 a template in the Cases domain.
%%
%% This template is used to define the case object
%% model (that is, to define what data can be captured on cases) in a Cases
%% domain. A template
%% must have a unique name within a domain, and it must reference existing
%% field IDs and layout
%% IDs. Additionally, multiple fields with same IDs are not allowed within
%% the same Template. A
%% template can be either Active or Inactive, as indicated by its status.
%% Inactive templates
%% cannot be used to create cases.
-spec create_template(aws_client:aws_client(), binary() | list(), create_template_request()) ->
{ok, create_template_response(), tuple()} |
{error, any()} |
{error, create_template_errors(), tuple()}.
create_template(Client, DomainId, Input) ->
create_template(Client, DomainId, Input, []).
-spec create_template(aws_client:aws_client(), binary() | list(), create_template_request(), proplists:proplist()) ->
{ok, create_template_response(), tuple()} |
{error, any()} |
{error, create_template_errors(), tuple()}.
create_template(Client, DomainId, Input0, Options0) ->
Method = post,
Path = ["/domains/", aws_util:encode_uri(DomainId), "/templates"],
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 Cases domain.
%%
%% After deleting your domain you must disassociate the deleted domain from
%% your Amazon Connect instance with another API call before being able to
%% use Cases again with this
%% Amazon Connect instance. See DeleteIntegrationAssociation:
%% https://docs.aws.amazon.com/connect/latest/APIReference/API_DeleteIntegrationAssociation.html.
-spec delete_domain(aws_client:aws_client(), binary() | list(), delete_domain_request()) ->
{ok, delete_domain_response(), tuple()} |
{error, any()} |
{error, delete_domain_errors(), tuple()}.
delete_domain(Client, DomainId, Input) ->
delete_domain(Client, DomainId, Input, []).
-spec delete_domain(aws_client:aws_client(), binary() | list(), delete_domain_request(), proplists:proplist()) ->
{ok, delete_domain_response(), tuple()} |
{error, any()} |
{error, delete_domain_errors(), tuple()}.
delete_domain(Client, DomainId, Input0, Options0) ->
Method = delete,
Path = ["/domains/", aws_util:encode_uri(DomainId), ""],
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 Returns information about a specific case if it exists.
-spec get_case(aws_client:aws_client(), binary() | list(), binary() | list(), get_case_request()) ->
{ok, get_case_response(), tuple()} |
{error, any()} |
{error, get_case_errors(), tuple()}.
get_case(Client, CaseId, DomainId, Input) ->
get_case(Client, CaseId, DomainId, Input, []).
-spec get_case(aws_client:aws_client(), binary() | list(), binary() | list(), get_case_request(), proplists:proplist()) ->
{ok, get_case_response(), tuple()} |
{error, any()} |
{error, get_case_errors(), tuple()}.
get_case(Client, CaseId, DomainId, Input0, Options0) ->
Method = post,
Path = ["/domains/", aws_util:encode_uri(DomainId), "/cases/", aws_util:encode_uri(CaseId), ""],
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 Returns the audit history about a specific case if it exists.
-spec get_case_audit_events(aws_client:aws_client(), binary() | list(), binary() | list(), get_case_audit_events_request()) ->
{ok, get_case_audit_events_response(), tuple()} |
{error, any()} |
{error, get_case_audit_events_errors(), tuple()}.
get_case_audit_events(Client, CaseId, DomainId, Input) ->
get_case_audit_events(Client, CaseId, DomainId, Input, []).
-spec get_case_audit_events(aws_client:aws_client(), binary() | list(), binary() | list(), get_case_audit_events_request(), proplists:proplist()) ->
{ok, get_case_audit_events_response(), tuple()} |
{error, any()} |
{error, get_case_audit_events_errors(), tuple()}.
get_case_audit_events(Client, CaseId, DomainId, Input0, Options0) ->
Method = post,
Path = ["/domains/", aws_util:encode_uri(DomainId), "/cases/", aws_util:encode_uri(CaseId), "/audit-history"],
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 Returns the case event publishing configuration.
-spec get_case_event_configuration(aws_client:aws_client(), binary() | list(), get_case_event_configuration_request()) ->
{ok, get_case_event_configuration_response(), tuple()} |
{error, any()} |
{error, get_case_event_configuration_errors(), tuple()}.
get_case_event_configuration(Client, DomainId, Input) ->
get_case_event_configuration(Client, DomainId, Input, []).
-spec get_case_event_configuration(aws_client:aws_client(), binary() | list(), get_case_event_configuration_request(), proplists:proplist()) ->
{ok, get_case_event_configuration_response(), tuple()} |
{error, any()} |
{error, get_case_event_configuration_errors(), tuple()}.
get_case_event_configuration(Client, DomainId, Input0, Options0) ->
Method = post,
Path = ["/domains/", aws_util:encode_uri(DomainId), "/case-event-configuration"],
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 Returns information about a specific domain if it exists.
-spec get_domain(aws_client:aws_client(), binary() | list(), get_domain_request()) ->
{ok, get_domain_response(), tuple()} |
{error, any()} |
{error, get_domain_errors(), tuple()}.
get_domain(Client, DomainId, Input) ->
get_domain(Client, DomainId, Input, []).
-spec get_domain(aws_client:aws_client(), binary() | list(), get_domain_request(), proplists:proplist()) ->
{ok, get_domain_response(), tuple()} |
{error, any()} |
{error, get_domain_errors(), tuple()}.
get_domain(Client, DomainId, Input0, Options0) ->
Method = post,
Path = ["/domains/", aws_util:encode_uri(DomainId), ""],
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 Returns the details for the requested layout.
-spec get_layout(aws_client:aws_client(), binary() | list(), binary() | list(), get_layout_request()) ->
{ok, get_layout_response(), tuple()} |
{error, any()} |
{error, get_layout_errors(), tuple()}.
get_layout(Client, DomainId, LayoutId, Input) ->
get_layout(Client, DomainId, LayoutId, Input, []).
-spec get_layout(aws_client:aws_client(), binary() | list(), binary() | list(), get_layout_request(), proplists:proplist()) ->
{ok, get_layout_response(), tuple()} |
{error, any()} |
{error, get_layout_errors(), tuple()}.
get_layout(Client, DomainId, LayoutId, Input0, Options0) ->
Method = post,
Path = ["/domains/", aws_util:encode_uri(DomainId), "/layouts/", aws_util:encode_uri(LayoutId), ""],
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 Returns the details for the requested template.
-spec get_template(aws_client:aws_client(), binary() | list(), binary() | list(), get_template_request()) ->
{ok, get_template_response(), tuple()} |
{error, any()} |
{error, get_template_errors(), tuple()}.
get_template(Client, DomainId, TemplateId, Input) ->
get_template(Client, DomainId, TemplateId, Input, []).
-spec get_template(aws_client:aws_client(), binary() | list(), binary() | list(), get_template_request(), proplists:proplist()) ->
{ok, get_template_response(), tuple()} |
{error, any()} |
{error, get_template_errors(), tuple()}.
get_template(Client, DomainId, TemplateId, Input0, Options0) ->
Method = post,
Path = ["/domains/", aws_util:encode_uri(DomainId), "/templates/", aws_util:encode_uri(TemplateId), ""],
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 Lists cases for a given contact.
-spec list_cases_for_contact(aws_client:aws_client(), binary() | list(), list_cases_for_contact_request()) ->
{ok, list_cases_for_contact_response(), tuple()} |
{error, any()} |
{error, list_cases_for_contact_errors(), tuple()}.
list_cases_for_contact(Client, DomainId, Input) ->
list_cases_for_contact(Client, DomainId, Input, []).
-spec list_cases_for_contact(aws_client:aws_client(), binary() | list(), list_cases_for_contact_request(), proplists:proplist()) ->
{ok, list_cases_for_contact_response(), tuple()} |
{error, any()} |
{error, list_cases_for_contact_errors(), tuple()}.
list_cases_for_contact(Client, DomainId, Input0, Options0) ->
Method = post,
Path = ["/domains/", aws_util:encode_uri(DomainId), "/list-cases-for-contact"],
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 Lists all cases domains in the Amazon Web Services account.
%%
%% Each list item is a condensed
%% summary object of the domain.
-spec list_domains(aws_client:aws_client(), list_domains_request()) ->
{ok, list_domains_response(), tuple()} |
{error, any()} |
{error, list_domains_errors(), tuple()}.
list_domains(Client, Input) ->
list_domains(Client, Input, []).
-spec list_domains(aws_client:aws_client(), list_domains_request(), proplists:proplist()) ->
{ok, list_domains_response(), tuple()} |
{error, any()} |
{error, list_domains_errors(), tuple()}.
list_domains(Client, Input0, Options0) ->
Method = post,
Path = ["/domains-list"],
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 = [
{<<"maxResults">>, <<"maxResults">>},
{<<"nextToken">>, <<"nextToken">>}
],
{Query_, Input} = aws_request:build_headers(QueryMapping, Input2),
request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode).
%% @doc Lists all of the field options for a field identifier in the domain.
-spec list_field_options(aws_client:aws_client(), binary() | list(), binary() | list(), list_field_options_request()) ->
{ok, list_field_options_response(), tuple()} |
{error, any()} |
{error, list_field_options_errors(), tuple()}.
list_field_options(Client, DomainId, FieldId, Input) ->
list_field_options(Client, DomainId, FieldId, Input, []).
-spec list_field_options(aws_client:aws_client(), binary() | list(), binary() | list(), list_field_options_request(), proplists:proplist()) ->
{ok, list_field_options_response(), tuple()} |
{error, any()} |
{error, list_field_options_errors(), tuple()}.
list_field_options(Client, DomainId, FieldId, Input0, Options0) ->
Method = post,
Path = ["/domains/", aws_util:encode_uri(DomainId), "/fields/", aws_util:encode_uri(FieldId), "/options-list"],
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 = [
{<<"maxResults">>, <<"maxResults">>},
{<<"nextToken">>, <<"nextToken">>},
{<<"values">>, <<"values">>}
],
{Query_, Input} = aws_request:build_headers(QueryMapping, Input2),
request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode).
%% @doc Lists all fields in a Cases domain.
-spec list_fields(aws_client:aws_client(), binary() | list(), list_fields_request()) ->
{ok, list_fields_response(), tuple()} |
{error, any()} |
{error, list_fields_errors(), tuple()}.
list_fields(Client, DomainId, Input) ->
list_fields(Client, DomainId, Input, []).
-spec list_fields(aws_client:aws_client(), binary() | list(), list_fields_request(), proplists:proplist()) ->
{ok, list_fields_response(), tuple()} |
{error, any()} |
{error, list_fields_errors(), tuple()}.
list_fields(Client, DomainId, Input0, Options0) ->
Method = post,
Path = ["/domains/", aws_util:encode_uri(DomainId), "/fields-list"],
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 = [
{<<"maxResults">>, <<"maxResults">>},
{<<"nextToken">>, <<"nextToken">>}
],
{Query_, Input} = aws_request:build_headers(QueryMapping, Input2),
request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode).
%% @doc Lists all layouts in the given cases domain.
%%
%% Each list item is a condensed summary object
%% of the layout.
-spec list_layouts(aws_client:aws_client(), binary() | list(), list_layouts_request()) ->
{ok, list_layouts_response(), tuple()} |
{error, any()} |
{error, list_layouts_errors(), tuple()}.
list_layouts(Client, DomainId, Input) ->
list_layouts(Client, DomainId, Input, []).
-spec list_layouts(aws_client:aws_client(), binary() | list(), list_layouts_request(), proplists:proplist()) ->
{ok, list_layouts_response(), tuple()} |
{error, any()} |
{error, list_layouts_errors(), tuple()}.
list_layouts(Client, DomainId, Input0, Options0) ->
Method = post,
Path = ["/domains/", aws_util:encode_uri(DomainId), "/layouts-list"],
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 = [
{<<"maxResults">>, <<"maxResults">>},
{<<"nextToken">>, <<"nextToken">>}
],
{Query_, Input} = aws_request:build_headers(QueryMapping, Input2),
request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode).
%% @doc Lists 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 = ["/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 Lists all of the templates in a Cases domain.
%%
%% Each list item is a condensed summary
%% object of the template.
-spec list_templates(aws_client:aws_client(), binary() | list(), list_templates_request()) ->
{ok, list_templates_response(), tuple()} |
{error, any()} |
{error, list_templates_errors(), tuple()}.
list_templates(Client, DomainId, Input) ->
list_templates(Client, DomainId, Input, []).
-spec list_templates(aws_client:aws_client(), binary() | list(), list_templates_request(), proplists:proplist()) ->
{ok, list_templates_response(), tuple()} |
{error, any()} |
{error, list_templates_errors(), tuple()}.
list_templates(Client, DomainId, Input0, Options0) ->
Method = post,
Path = ["/domains/", aws_util:encode_uri(DomainId), "/templates-list"],
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 = [
{<<"maxResults">>, <<"maxResults">>},
{<<"nextToken">>, <<"nextToken">>},
{<<"status">>, <<"status">>}
],
{Query_, Input} = aws_request:build_headers(QueryMapping, Input2),
request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode).
%% @doc Adds case event publishing configuration.
%%
%% For a complete list of fields you can add to the
%% event message, see Create case fields:
%% https://docs.aws.amazon.com/connect/latest/adminguide/case-fields.html in
%% the
%% Amazon Connect Administrator Guide
-spec put_case_event_configuration(aws_client:aws_client(), binary() | list(), put_case_event_configuration_request()) ->
{ok, put_case_event_configuration_response(), tuple()} |
{error, any()} |
{error, put_case_event_configuration_errors(), tuple()}.
put_case_event_configuration(Client, DomainId, Input) ->
put_case_event_configuration(Client, DomainId, Input, []).
-spec put_case_event_configuration(aws_client:aws_client(), binary() | list(), put_case_event_configuration_request(), proplists:proplist()) ->
{ok, put_case_event_configuration_response(), tuple()} |
{error, any()} |
{error, put_case_event_configuration_errors(), tuple()}.
put_case_event_configuration(Client, DomainId, Input0, Options0) ->
Method = put,
Path = ["/domains/", aws_util:encode_uri(DomainId), "/case-event-configuration"],
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 Searches for cases within their associated Cases domain.
%%
%% Search results are returned
%% as a paginated list of abridged case documents.
%%
%% For `customer_id' you must provide the full customer profile ARN in
%% this
%% format:
%% ```
%% arn:aws:profile:your AWS Region:your AWS account ID:domains/profiles
%% domain name/profiles/profile ID'''.
-spec search_cases(aws_client:aws_client(), binary() | list(), search_cases_request()) ->
{ok, search_cases_response(), tuple()} |
{error, any()} |
{error, search_cases_errors(), tuple()}.
search_cases(Client, DomainId, Input) ->
search_cases(Client, DomainId, Input, []).
-spec search_cases(aws_client:aws_client(), binary() | list(), search_cases_request(), proplists:proplist()) ->
{ok, search_cases_response(), tuple()} |
{error, any()} |
{error, search_cases_errors(), tuple()}.
search_cases(Client, DomainId, Input0, Options0) ->
Method = post,
Path = ["/domains/", aws_util:encode_uri(DomainId), "/cases-search"],
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 Searches for related items that are associated with a case.
%%
%% If no filters are provided, this returns all related items associated with
%% a
%% case.
-spec search_related_items(aws_client:aws_client(), binary() | list(), binary() | list(), search_related_items_request()) ->
{ok, search_related_items_response(), tuple()} |
{error, any()} |
{error, search_related_items_errors(), tuple()}.
search_related_items(Client, CaseId, DomainId, Input) ->
search_related_items(Client, CaseId, DomainId, Input, []).
-spec search_related_items(aws_client:aws_client(), binary() | list(), binary() | list(), search_related_items_request(), proplists:proplist()) ->
{ok, search_related_items_response(), tuple()} |
{error, any()} |
{error, search_related_items_errors(), tuple()}.
search_related_items(Client, CaseId, DomainId, Input0, Options0) ->
Method = post,
Path = ["/domains/", aws_util:encode_uri(DomainId), "/cases/", aws_util:encode_uri(CaseId), "/related-items-search"],
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 Adds tags to 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 = ["/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 Untags 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 = ["/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
%% If you provide a value for `PerformedBy.UserArn' you must also have
%% connect:DescribeUser:
%% https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribeUser.html
%% permission on the User ARN resource that you provide
%%
%% Updates the values of fields on a case.
%%
%% Fields to be updated are received as an array of
%% id/value pairs identical to the `CreateCase' input .
%%
%% If the action is successful, the service sends back an HTTP 200 response
%% with an empty
%% HTTP body.
-spec update_case(aws_client:aws_client(), binary() | list(), binary() | list(), update_case_request()) ->
{ok, update_case_response(), tuple()} |
{error, any()} |
{error, update_case_errors(), tuple()}.
update_case(Client, CaseId, DomainId, Input) ->
update_case(Client, CaseId, DomainId, Input, []).
-spec update_case(aws_client:aws_client(), binary() | list(), binary() | list(), update_case_request(), proplists:proplist()) ->
{ok, update_case_response(), tuple()} |
{error, any()} |
{error, update_case_errors(), tuple()}.
update_case(Client, CaseId, DomainId, Input0, Options0) ->
Method = put,
Path = ["/domains/", aws_util:encode_uri(DomainId), "/cases/", aws_util:encode_uri(CaseId), ""],
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 properties of an existing field.
-spec update_field(aws_client:aws_client(), binary() | list(), binary() | list(), update_field_request()) ->
{ok, update_field_response(), tuple()} |
{error, any()} |
{error, update_field_errors(), tuple()}.
update_field(Client, DomainId, FieldId, Input) ->
update_field(Client, DomainId, FieldId, Input, []).
-spec update_field(aws_client:aws_client(), binary() | list(), binary() | list(), update_field_request(), proplists:proplist()) ->
{ok, update_field_response(), tuple()} |
{error, any()} |
{error, update_field_errors(), tuple()}.
update_field(Client, DomainId, FieldId, Input0, Options0) ->
Method = put,
Path = ["/domains/", aws_util:encode_uri(DomainId), "/fields/", aws_util:encode_uri(FieldId), ""],
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 attributes of an existing layout.
%%
%% If the action is successful, the service sends back an HTTP 200 response
%% with an empty
%% HTTP body.
%%
%% A `ValidationException' is returned when you add non-existent
%% `fieldIds' to a layout.
%%
%% Title and Status fields cannot be part of layouts because they are not
%% configurable.
-spec update_layout(aws_client:aws_client(), binary() | list(), binary() | list(), update_layout_request()) ->
{ok, update_layout_response(), tuple()} |
{error, any()} |
{error, update_layout_errors(), tuple()}.
update_layout(Client, DomainId, LayoutId, Input) ->
update_layout(Client, DomainId, LayoutId, Input, []).
-spec update_layout(aws_client:aws_client(), binary() | list(), binary() | list(), update_layout_request(), proplists:proplist()) ->
{ok, update_layout_response(), tuple()} |
{error, any()} |
{error, update_layout_errors(), tuple()}.
update_layout(Client, DomainId, LayoutId, Input0, Options0) ->
Method = put,
Path = ["/domains/", aws_util:encode_uri(DomainId), "/layouts/", aws_util:encode_uri(LayoutId), ""],
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 attributes of an existing template.
%%
%% The template attributes that can be
%% modified include `name', `description',
%% `layoutConfiguration', `requiredFields', and `status'. At
%% least one of these attributes must not be null. If a null value is
%% provided for a given
%% attribute, that attribute is ignored and its current value is preserved.
-spec update_template(aws_client:aws_client(), binary() | list(), binary() | list(), update_template_request()) ->
{ok, update_template_response(), tuple()} |
{error, any()} |
{error, update_template_errors(), tuple()}.
update_template(Client, DomainId, TemplateId, Input) ->
update_template(Client, DomainId, TemplateId, Input, []).
-spec update_template(aws_client:aws_client(), binary() | list(), binary() | list(), update_template_request(), proplists:proplist()) ->
{ok, update_template_response(), tuple()} |
{error, any()} |
{error, update_template_errors(), tuple()}.
update_template(Client, DomainId, TemplateId, Input0, Options0) ->
Method = put,
Path = ["/domains/", aws_util:encode_uri(DomainId), "/templates/", aws_util:encode_uri(TemplateId), ""],
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 => <<"cases">>},
Host = build_host(<<"cases">>, 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).