diff --git a/.latest-tag-aws-sdk-go b/.latest-tag-aws-sdk-go index dacc8be4..44f0286d 100644 --- a/.latest-tag-aws-sdk-go +++ b/.latest-tag-aws-sdk-go @@ -1 +1 @@ -release-2024-11-01 +release-2024-11-06 diff --git a/src/aws_codebuild.erl b/src/aws_codebuild.erl index 1d7eddb2..e798396c 100644 --- a/src/aws_codebuild.erl +++ b/src/aws_codebuild.erl @@ -1056,6 +1056,7 @@ %% update_fleet_input() :: #{ %% <<"arn">> := string(), %% <<"baseCapacity">> => integer(), +%% <<"computeConfiguration">> => compute_configuration(), %% <<"computeType">> => list(any()), %% <<"environmentType">> => list(any()), %% <<"fleetServiceRole">> => string(), @@ -1071,6 +1072,7 @@ %% Example: %% create_fleet_input() :: #{ %% <<"baseCapacity">> := integer(), +%% <<"computeConfiguration">> => compute_configuration(), %% <<"computeType">> := list(any()), %% <<"environmentType">> := list(any()), %% <<"fleetServiceRole">> => string(), @@ -1531,6 +1533,7 @@ %% fleet() :: #{ %% <<"arn">> => string(), %% <<"baseCapacity">> => integer(), +%% <<"computeConfiguration">> => compute_configuration(), %% <<"computeType">> => list(any()), %% <<"created">> => non_neg_integer(), %% <<"environmentType">> => list(any()), @@ -1572,6 +1575,7 @@ %% Example: %% project_environment() :: #{ %% <<"certificate">> => string(), +%% <<"computeConfiguration">> => compute_configuration(), %% <<"computeType">> => list(any()), %% <<"environmentVariables">> => list(environment_variable()()), %% <<"fleet">> => project_fleet(), @@ -1596,6 +1600,15 @@ %% } -type batch_get_report_groups_input() :: #{binary() => any()}. +%% Example: +%% compute_configuration() :: #{ +%% <<"disk">> => float(), +%% <<"machineType">> => list(any()), +%% <<"memory">> => float(), +%% <<"vCpu">> => float() +%% } +-type compute_configuration() :: #{binary() => any()}. + %% Example: %% report_group() :: #{ %% <<"arn">> => string(), diff --git a/src/aws_guardduty.erl b/src/aws_guardduty.erl index e4df0be5..55759c0b 100644 --- a/src/aws_guardduty.erl +++ b/src/aws_guardduty.erl @@ -781,6 +781,19 @@ -type lambda_details() :: #{binary() => any()}. +%% Example: +%% rds_limitless_db_details() :: #{ +%% <<"DbClusterIdentifier">> => string(), +%% <<"DbShardGroupArn">> => string(), +%% <<"DbShardGroupIdentifier">> => string(), +%% <<"DbShardGroupResourceId">> => string(), +%% <<"Engine">> => string(), +%% <<"EngineVersion">> => string(), +%% <<"Tags">> => list(tag()()) +%% } +-type rds_limitless_db_details() :: #{binary() => any()}. + + %% Example: %% describe_publishing_destination_response() :: #{ %% <<"DestinationId">> => string(), @@ -3126,6 +3139,7 @@ %% <<"LambdaDetails">> => lambda_details(), %% <<"RdsDbInstanceDetails">> => rds_db_instance_details(), %% <<"RdsDbUserDetails">> => rds_db_user_details(), +%% <<"RdsLimitlessDbDetails">> => rds_limitless_db_details(), %% <<"ResourceType">> => string(), %% <<"S3BucketDetails">> => list(s3_bucket_detail()()) %% } diff --git a/src/aws_lakeformation.erl b/src/aws_lakeformation.erl index 49c7ea3b..f62230f5 100644 --- a/src/aws_lakeformation.erl +++ b/src/aws_lakeformation.erl @@ -22,6 +22,8 @@ create_data_cells_filter/3, create_l_f_tag/2, create_l_f_tag/3, + create_l_f_tag_expression/2, + create_l_f_tag_expression/3, create_lake_formation_identity_center_configuration/2, create_lake_formation_identity_center_configuration/3, create_lake_formation_opt_in/2, @@ -30,6 +32,8 @@ delete_data_cells_filter/3, delete_l_f_tag/2, delete_l_f_tag/3, + delete_l_f_tag_expression/2, + delete_l_f_tag_expression/3, delete_lake_formation_identity_center_configuration/2, delete_lake_formation_identity_center_configuration/3, delete_lake_formation_opt_in/2, @@ -56,6 +60,8 @@ get_effective_permissions_for_path/3, get_l_f_tag/2, get_l_f_tag/3, + get_l_f_tag_expression/2, + get_l_f_tag_expression/3, get_query_state/2, get_query_state/3, get_query_statistics/2, @@ -76,6 +82,8 @@ grant_permissions/3, list_data_cells_filter/2, list_data_cells_filter/3, + list_l_f_tag_expressions/2, + list_l_f_tag_expressions/3, list_l_f_tags/2, list_l_f_tags/3, list_lake_formation_opt_ins/2, @@ -108,6 +116,8 @@ update_data_cells_filter/3, update_l_f_tag/2, update_l_f_tag/3, + update_l_f_tag_expression/2, + update_l_f_tag_expression/3, update_lake_formation_identity_center_configuration/2, update_lake_formation_identity_center_configuration/3, update_resource/2, @@ -209,6 +219,16 @@ -type list_resources_response() :: #{binary() => any()}. +%% Example: +%% l_f_tag_expression() :: #{ +%% <<"CatalogId">> => string(), +%% <<"Description">> => string(), +%% <<"Expression">> => list(l_f_tag()()), +%% <<"Name">> => string() +%% } +-type l_f_tag_expression() :: #{binary() => any()}. + + %% Example: %% describe_resource_response() :: #{ %% <<"ResourceInfo">> => resource_info() @@ -323,6 +343,7 @@ %% l_f_tag_policy_resource() :: #{ %% <<"CatalogId">> => string(), %% <<"Expression">> => list(l_f_tag()()), +%% <<"ExpressionName">> => string(), %% <<"ResourceType">> => list(any()) %% } -type l_f_tag_policy_resource() :: #{binary() => any()}. @@ -377,6 +398,15 @@ -type all_rows_wildcard() :: #{}. +%% Example: +%% list_l_f_tag_expressions_request() :: #{ +%% <<"CatalogId">> => string(), +%% <<"MaxResults">> => integer(), +%% <<"NextToken">> => string() +%% } +-type list_l_f_tag_expressions_request() :: #{binary() => any()}. + + %% Example: %% create_lake_formation_identity_center_configuration_request() :: #{ %% <<"CatalogId">> => string(), @@ -425,6 +455,16 @@ -type delete_l_f_tag_response() :: #{}. +%% Example: +%% create_l_f_tag_expression_request() :: #{ +%% <<"CatalogId">> => string(), +%% <<"Description">> => string(), +%% <<"Expression">> := list(l_f_tag()()), +%% <<"Name">> := string() +%% } +-type create_l_f_tag_expression_request() :: #{binary() => any()}. + + %% Example: %% tagged_table() :: #{ %% <<"LFTagOnDatabase">> => list(l_f_tag_pair()()), @@ -466,6 +506,16 @@ -type search_tables_by_l_f_tags_request() :: #{binary() => any()}. +%% Example: +%% update_l_f_tag_expression_request() :: #{ +%% <<"CatalogId">> => string(), +%% <<"Description">> => string(), +%% <<"Expression">> := list(l_f_tag()()), +%% <<"Name">> := string() +%% } +-type update_l_f_tag_expression_request() :: #{binary() => any()}. + + %% Example: %% transaction_canceled_exception() :: #{ %% <<"Message">> => string() @@ -563,6 +613,14 @@ -type transaction_commit_in_progress_exception() :: #{binary() => any()}. +%% Example: +%% list_l_f_tag_expressions_response() :: #{ +%% <<"LFTagExpressions">> => list(l_f_tag_expression()()), +%% <<"NextToken">> => string() +%% } +-type list_l_f_tag_expressions_response() :: #{binary() => any()}. + + %% Example: %% list_transactions_request() :: #{ %% <<"CatalogId">> => string(), @@ -646,6 +704,14 @@ -type data_cells_filter() :: #{binary() => any()}. +%% Example: +%% delete_l_f_tag_expression_request() :: #{ +%% <<"CatalogId">> => string(), +%% <<"Name">> := string() +%% } +-type delete_l_f_tag_expression_request() :: #{binary() => any()}. + + %% Example: %% throttled_exception() :: #{ %% <<"Message">> => string() @@ -850,6 +916,14 @@ -type add_object_input() :: #{binary() => any()}. +%% Example: +%% l_f_tag_expression_resource() :: #{ +%% <<"CatalogId">> => string(), +%% <<"Name">> => string() +%% } +-type l_f_tag_expression_resource() :: #{binary() => any()}. + + %% Example: %% transaction_description() :: #{ %% <<"TransactionEndTime">> => non_neg_integer(), @@ -869,6 +943,16 @@ -type get_resource_l_f_tags_request() :: #{binary() => any()}. +%% Example: +%% get_l_f_tag_expression_response() :: #{ +%% <<"CatalogId">> => string(), +%% <<"Description">> => string(), +%% <<"Expression">> => list(l_f_tag()()), +%% <<"Name">> => string() +%% } +-type get_l_f_tag_expression_response() :: #{binary() => any()}. + + %% Example: %% row_filter() :: #{ %% <<"AllRowsWildcard">> => all_rows_wildcard(), @@ -1233,6 +1317,10 @@ %% } -type put_data_lake_settings_request() :: #{binary() => any()}. +%% Example: +%% create_l_f_tag_expression_response() :: #{} +-type create_l_f_tag_expression_response() :: #{}. + %% Example: %% batch_revoke_permissions_request() :: #{ @@ -1397,6 +1485,14 @@ -type glue_encryption_exception() :: #{binary() => any()}. +%% Example: +%% get_l_f_tag_expression_request() :: #{ +%% <<"CatalogId">> => string(), +%% <<"Name">> := string() +%% } +-type get_l_f_tag_expression_request() :: #{binary() => any()}. + + %% Example: %% remove_l_f_tags_from_resource_request() :: #{ %% <<"CatalogId">> => string(), @@ -1462,6 +1558,10 @@ %% } -type deregister_resource_request() :: #{binary() => any()}. +%% Example: +%% update_l_f_tag_expression_response() :: #{} +-type update_l_f_tag_expression_response() :: #{}. + %% Example: %% list_table_storage_optimizers_request() :: #{ @@ -1489,6 +1589,10 @@ %% grant_permissions_response() :: #{} -type grant_permissions_response() :: #{}. +%% Example: +%% delete_l_f_tag_expression_response() :: #{} +-type delete_l_f_tag_expression_response() :: #{}. + %% Example: %% add_l_f_tags_to_resource_request() :: #{ @@ -1521,6 +1625,7 @@ %% <<"DataLocation">> => data_location_resource(), %% <<"Database">> => database_resource(), %% <<"LFTag">> => l_f_tag_key_resource(), +%% <<"LFTagExpression">> => l_f_tag_expression_resource(), %% <<"LFTagPolicy">> => l_f_tag_policy_resource(), %% <<"Table">> => table_resource(), %% <<"TableWithColumns">> => table_with_columns_resource() @@ -1584,6 +1689,14 @@ operation_timeout_exception() | entity_not_found_exception(). +-type create_l_f_tag_expression_errors() :: + access_denied_exception() | + invalid_input_exception() | + resource_number_limit_exceeded_exception() | + internal_service_exception() | + operation_timeout_exception() | + entity_not_found_exception(). + -type create_lake_formation_identity_center_configuration_errors() :: concurrent_modification_exception() | access_denied_exception() | @@ -1614,6 +1727,13 @@ operation_timeout_exception() | entity_not_found_exception(). +-type delete_l_f_tag_expression_errors() :: + access_denied_exception() | + invalid_input_exception() | + internal_service_exception() | + operation_timeout_exception() | + entity_not_found_exception(). + -type delete_lake_formation_identity_center_configuration_errors() :: concurrent_modification_exception() | access_denied_exception() | @@ -1704,6 +1824,13 @@ operation_timeout_exception() | entity_not_found_exception(). +-type get_l_f_tag_expression_errors() :: + access_denied_exception() | + invalid_input_exception() | + internal_service_exception() | + operation_timeout_exception() | + entity_not_found_exception(). + -type get_query_state_errors() :: access_denied_exception() | invalid_input_exception() | @@ -1775,6 +1902,13 @@ internal_service_exception() | operation_timeout_exception(). +-type list_l_f_tag_expressions_errors() :: + access_denied_exception() | + invalid_input_exception() | + internal_service_exception() | + operation_timeout_exception() | + entity_not_found_exception(). + -type list_l_f_tags_errors() :: access_denied_exception() | invalid_input_exception() | @@ -1878,6 +2012,14 @@ operation_timeout_exception() | entity_not_found_exception(). +-type update_l_f_tag_expression_errors() :: + access_denied_exception() | + invalid_input_exception() | + resource_number_limit_exceeded_exception() | + internal_service_exception() | + operation_timeout_exception() | + entity_not_found_exception(). + -type update_lake_formation_identity_center_configuration_errors() :: concurrent_modification_exception() | access_denied_exception() | @@ -2207,6 +2349,54 @@ create_l_f_tag(Client, Input0, Options0) -> request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). +%% @doc Creates a new LF-Tag expression with the provided name, description, +%% catalog ID, and +%% expression body. +%% +%% This call fails if a LF-Tag expression with the same name already exists +%% in +%% the caller’s account or if the underlying LF-Tags don't exist. To call +%% this API operation, +%% caller needs the following Lake Formation permissions: +%% +%% `CREATE_LF_TAG_EXPRESSION' on the root catalog resource. +%% +%% `GRANT_WITH_LF_TAG_EXPRESSION' on all underlying LF-Tag key:value +%% pairs +%% included in the expression. +-spec create_l_f_tag_expression(aws_client:aws_client(), create_l_f_tag_expression_request()) -> + {ok, create_l_f_tag_expression_response(), tuple()} | + {error, any()} | + {error, create_l_f_tag_expression_errors(), tuple()}. +create_l_f_tag_expression(Client, Input) -> + create_l_f_tag_expression(Client, Input, []). + +-spec create_l_f_tag_expression(aws_client:aws_client(), create_l_f_tag_expression_request(), proplists:proplist()) -> + {ok, create_l_f_tag_expression_response(), tuple()} | + {error, any()} | + {error, create_l_f_tag_expression_errors(), tuple()}. +create_l_f_tag_expression(Client, Input0, Options0) -> + Method = post, + Path = ["/CreateLFTagExpression"], + 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 an IAM Identity Center connection with Lake Formation to %% allow IAM Identity Center users and groups to access Data Catalog %% resources. @@ -2352,6 +2542,45 @@ delete_l_f_tag(Client, Input0, Options0) -> request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). +%% @doc Deletes the LF-Tag expression. +%% +%% The caller must be a data lake admin or have `DROP' permissions on the +%% LF-Tag expression. +%% Deleting a LF-Tag expression will also delete all `LFTagPolicy' +%% permissions referencing the LF-Tag expression. +-spec delete_l_f_tag_expression(aws_client:aws_client(), delete_l_f_tag_expression_request()) -> + {ok, delete_l_f_tag_expression_response(), tuple()} | + {error, any()} | + {error, delete_l_f_tag_expression_errors(), tuple()}. +delete_l_f_tag_expression(Client, Input) -> + delete_l_f_tag_expression(Client, Input, []). + +-spec delete_l_f_tag_expression(aws_client:aws_client(), delete_l_f_tag_expression_request(), proplists:proplist()) -> + {ok, delete_l_f_tag_expression_response(), tuple()} | + {error, any()} | + {error, delete_l_f_tag_expression_errors(), tuple()}. +delete_l_f_tag_expression(Client, Input0, Options0) -> + Method = post, + Path = ["/DeleteLFTagExpression"], + 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 an IAM Identity Center connection with Lake Formation. -spec delete_lake_formation_identity_center_configuration(aws_client:aws_client(), delete_lake_formation_identity_center_configuration_request()) -> {ok, delete_lake_formation_identity_center_configuration_response(), tuple()} | @@ -2820,6 +3049,43 @@ get_l_f_tag(Client, Input0, Options0) -> request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). +%% @doc Returns the details about the LF-Tag expression. +%% +%% The caller must be a data lake admin or must have `DESCRIBE' +%% permission on the LF-Tag expression resource. +-spec get_l_f_tag_expression(aws_client:aws_client(), get_l_f_tag_expression_request()) -> + {ok, get_l_f_tag_expression_response(), tuple()} | + {error, any()} | + {error, get_l_f_tag_expression_errors(), tuple()}. +get_l_f_tag_expression(Client, Input) -> + get_l_f_tag_expression(Client, Input, []). + +-spec get_l_f_tag_expression(aws_client:aws_client(), get_l_f_tag_expression_request(), proplists:proplist()) -> + {ok, get_l_f_tag_expression_response(), tuple()} | + {error, any()} | + {error, get_l_f_tag_expression_errors(), tuple()}. +get_l_f_tag_expression(Client, Input0, Options0) -> + Method = post, + Path = ["/GetLFTagExpression"], + 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 state of a query previously submitted. %% %% Clients are expected to poll `GetQueryState' to monitor the current @@ -3010,6 +3276,9 @@ get_temporary_glue_partition_credentials(Client, Input0, Options0) -> %% In order to vend such credentials, Lake Formation assumes the role %% associated with a registered location, for example an Amazon S3 bucket, %% with a scope down policy which restricts the access to a single prefix. +%% +%% To call this API, the role that the service assumes must have +%% `lakeformation:GetDataAccess' permission on the resource. -spec get_temporary_glue_table_credentials(aws_client:aws_client(), get_temporary_glue_table_credentials_request()) -> {ok, get_temporary_glue_table_credentials_response(), tuple()} | {error, any()} | @@ -3187,6 +3456,44 @@ list_data_cells_filter(Client, Input0, Options0) -> request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). +%% @doc Returns the LF-Tag expressions in caller’s account filtered based on +%% caller's permissions. +%% +%% Data Lake and read only admins implicitly can see all tag expressions in +%% their account, else caller needs DESCRIBE permissions on tag expression. +-spec list_l_f_tag_expressions(aws_client:aws_client(), list_l_f_tag_expressions_request()) -> + {ok, list_l_f_tag_expressions_response(), tuple()} | + {error, any()} | + {error, list_l_f_tag_expressions_errors(), tuple()}. +list_l_f_tag_expressions(Client, Input) -> + list_l_f_tag_expressions(Client, Input, []). + +-spec list_l_f_tag_expressions(aws_client:aws_client(), list_l_f_tag_expressions_request(), proplists:proplist()) -> + {ok, list_l_f_tag_expressions_response(), tuple()} | + {error, any()} | + {error, list_l_f_tag_expressions_errors(), tuple()}. +list_l_f_tag_expressions(Client, Input0, Options0) -> + Method = post, + Path = ["/ListLFTagExpressions"], + 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 LF-tags that the requester has permission to view. -spec list_l_f_tags(aws_client:aws_client(), list_l_f_tags_request()) -> {ok, list_l_f_tags_response(), tuple()} | @@ -3468,7 +3775,7 @@ put_data_lake_settings(Client, Input0, Options0) -> %% permission to use the service-linked role to access that location. %% %% ``` -%% ResourceArn = arn:aws:s3:::my-bucketUseServiceLinkedRole = +%% ResourceArn = arn:aws:s3:::my-bucket/UseServiceLinkedRole = %% true''' %% %% If `UseServiceLinkedRole' is not set to true, you must provide or set @@ -3813,6 +4120,45 @@ update_l_f_tag(Client, Input0, Options0) -> request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). +%% @doc Updates the name of the LF-Tag expression to the new description and +%% expression body provided. +%% +%% Updating a LF-Tag expression immediately changes the permission boundaries +%% of all existing `LFTagPolicy' permission grants that reference the +%% given LF-Tag expression. +-spec update_l_f_tag_expression(aws_client:aws_client(), update_l_f_tag_expression_request()) -> + {ok, update_l_f_tag_expression_response(), tuple()} | + {error, any()} | + {error, update_l_f_tag_expression_errors(), tuple()}. +update_l_f_tag_expression(Client, Input) -> + update_l_f_tag_expression(Client, Input, []). + +-spec update_l_f_tag_expression(aws_client:aws_client(), update_l_f_tag_expression_request(), proplists:proplist()) -> + {ok, update_l_f_tag_expression_response(), tuple()} | + {error, any()} | + {error, update_l_f_tag_expression_errors(), tuple()}. +update_l_f_tag_expression(Client, Input0, Options0) -> + Method = post, + Path = ["/UpdateLFTagExpression"], + 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 IAM Identity Center connection parameters. -spec update_lake_formation_identity_center_configuration(aws_client:aws_client(), update_lake_formation_identity_center_configuration_request()) -> {ok, update_lake_formation_identity_center_configuration_response(), tuple()} | diff --git a/src/aws_qapps.erl b/src/aws_qapps.erl index d4eae4d6..c92dd464 100644 --- a/src/aws_qapps.erl +++ b/src/aws_qapps.erl @@ -34,6 +34,12 @@ associate_library_item_review/3, associate_q_app_with_user/2, associate_q_app_with_user/3, + batch_create_category/2, + batch_create_category/3, + batch_delete_category/2, + batch_delete_category/3, + batch_update_category/2, + batch_update_category/3, create_library_item/2, create_library_item/3, create_q_app/2, @@ -57,6 +63,9 @@ get_q_app_session/6, import_document/2, import_document/3, + list_categories/2, + list_categories/4, + list_categories/5, list_library_items/2, list_library_items/4, list_library_items/5, @@ -186,6 +195,30 @@ -type disassociate_q_app_from_user_input() :: #{binary() => any()}. +%% Example: +%% batch_create_category_input() :: #{ +%% <<"categories">> := list(batch_create_category_input_category()()), +%% <<"instanceId">> := string() +%% } +-type batch_create_category_input() :: #{binary() => any()}. + + +%% Example: +%% list_categories_output() :: #{ +%% <<"categories">> => list(category()()) +%% } +-type list_categories_output() :: #{binary() => any()}. + + +%% Example: +%% category_input() :: #{ +%% <<"color">> => [string()], +%% <<"id">> => string(), +%% <<"title">> => [string()] +%% } +-type category_input() :: #{binary() => any()}. + + %% Example: %% app_definition_input() :: #{ %% <<"cards">> => list(list()()), @@ -438,6 +471,23 @@ -type q_query_card() :: #{binary() => any()}. +%% Example: +%% batch_delete_category_input() :: #{ +%% <<"categories">> := list(string()()), +%% <<"instanceId">> := string() +%% } +-type batch_delete_category_input() :: #{binary() => any()}. + + +%% Example: +%% batch_create_category_input_category() :: #{ +%% <<"color">> => [string()], +%% <<"id">> => string(), +%% <<"title">> => [string()] +%% } +-type batch_create_category_input_category() :: #{binary() => any()}. + + %% Example: %% q_plugin_card_input() :: #{ %% <<"id">> => string(), @@ -540,6 +590,13 @@ -type create_q_app_output() :: #{binary() => any()}. +%% Example: +%% list_categories_input() :: #{ +%% <<"instanceId">> := string() +%% } +-type list_categories_input() :: #{binary() => any()}. + + %% Example: %% internal_server_exception() :: #{ %% <<"message">> => [string()], @@ -668,6 +725,8 @@ %% Example: %% category() :: #{ +%% <<"appCount">> => [integer()], +%% <<"color">> => [string()], %% <<"id">> => string(), %% <<"title">> => [string()] %% } @@ -751,6 +810,14 @@ -type import_document_input() :: #{binary() => any()}. +%% Example: +%% batch_update_category_input() :: #{ +%% <<"categories">> := list(category_input()()), +%% <<"instanceId">> := string() +%% } +-type batch_update_category_input() :: #{binary() => any()}. + + %% Example: %% start_q_app_session_output() :: #{ %% <<"sessionArn">> => [string()], @@ -785,6 +852,33 @@ resource_not_found_exception() | unauthorized_exception(). +-type batch_create_category_errors() :: + throttling_exception() | + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception() | + conflict_exception() | + unauthorized_exception(). + +-type batch_delete_category_errors() :: + throttling_exception() | + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception() | + conflict_exception() | + unauthorized_exception(). + +-type batch_update_category_errors() :: + throttling_exception() | + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception() | + conflict_exception() | + unauthorized_exception(). + -type create_library_item_errors() :: throttling_exception() | validation_exception() | @@ -874,6 +968,14 @@ resource_not_found_exception() | unauthorized_exception(). +-type list_categories_errors() :: + throttling_exception() | + validation_exception() | + access_denied_exception() | + internal_server_exception() | + resource_not_found_exception() | + unauthorized_exception(). + -type list_library_items_errors() :: throttling_exception() | validation_exception() | @@ -1059,6 +1161,129 @@ associate_q_app_with_user(Client, Input0, Options0) -> request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). +%% @doc Creates Categories for the Amazon Q Business application environment +%% instance. +%% +%% Web experience users use Categories to tag and filter library items. For +%% more information, see Custom labels for Amazon Q Apps: +%% https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/qapps-custom-labels.html. +-spec batch_create_category(aws_client:aws_client(), batch_create_category_input()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, batch_create_category_errors(), tuple()}. +batch_create_category(Client, Input) -> + batch_create_category(Client, Input, []). + +-spec batch_create_category(aws_client:aws_client(), batch_create_category_input(), proplists:proplist()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, batch_create_category_errors(), tuple()}. +batch_create_category(Client, Input0, Options0) -> + Method = post, + Path = ["/catalog.createCategories"], + 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], + + HeadersMapping = [ + {<<"instance-id">>, <<"instanceId">>} + ], + {Headers, Input1} = aws_request:build_headers(HeadersMapping, Input0), + + CustomHeaders = [], + Input2 = Input1, + + Query_ = [], + Input = Input2, + + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%% @doc Deletes Categories for the Amazon Q Business application environment +%% instance. +%% +%% Web experience users use Categories to tag and filter library items. For +%% more information, see Custom labels for Amazon Q Apps: +%% https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/qapps-custom-labels.html. +-spec batch_delete_category(aws_client:aws_client(), batch_delete_category_input()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, batch_delete_category_errors(), tuple()}. +batch_delete_category(Client, Input) -> + batch_delete_category(Client, Input, []). + +-spec batch_delete_category(aws_client:aws_client(), batch_delete_category_input(), proplists:proplist()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, batch_delete_category_errors(), tuple()}. +batch_delete_category(Client, Input0, Options0) -> + Method = post, + Path = ["/catalog.deleteCategories"], + 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], + + HeadersMapping = [ + {<<"instance-id">>, <<"instanceId">>} + ], + {Headers, Input1} = aws_request:build_headers(HeadersMapping, Input0), + + CustomHeaders = [], + Input2 = Input1, + + Query_ = [], + Input = Input2, + + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + +%% @doc Updates Categories for the Amazon Q Business application environment +%% instance. +%% +%% Web experience users use Categories to tag and filter library items. For +%% more information, see Custom labels for Amazon Q Apps: +%% https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/qapps-custom-labels.html. +-spec batch_update_category(aws_client:aws_client(), batch_update_category_input()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, batch_update_category_errors(), tuple()}. +batch_update_category(Client, Input) -> + batch_update_category(Client, Input, []). + +-spec batch_update_category(aws_client:aws_client(), batch_update_category_input(), proplists:proplist()) -> + {ok, undefined, tuple()} | + {error, any()} | + {error, batch_update_category_errors(), tuple()}. +batch_update_category(Client, Input0, Options0) -> + Method = post, + Path = ["/catalog.updateCategories"], + 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], + + HeadersMapping = [ + {<<"instance-id">>, <<"instanceId">>} + ], + {Headers, Input1} = aws_request:build_headers(HeadersMapping, Input0), + + CustomHeaders = [], + Input2 = Input1, + + Query_ = [], + Input = Input2, + + request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). + %% @doc Creates a new library item for an Amazon Q App, allowing it to be %% discovered and %% used by other allowed users. @@ -1472,6 +1697,51 @@ import_document(Client, Input0, Options0) -> request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). +%% @doc Lists the categories of a Amazon Q Business application environment +%% instance. +%% +%% For more information, see Custom labels for Amazon Q Apps: +%% https://docs.aws.amazon.com/amazonq/latest/qbusiness-ug/qapps-custom-labels.html. +-spec list_categories(aws_client:aws_client(), binary() | list()) -> + {ok, list_categories_output(), tuple()} | + {error, any()} | + {error, list_categories_errors(), tuple()}. +list_categories(Client, InstanceId) + when is_map(Client) -> + list_categories(Client, InstanceId, #{}, #{}). + +-spec list_categories(aws_client:aws_client(), binary() | list(), map(), map()) -> + {ok, list_categories_output(), tuple()} | + {error, any()} | + {error, list_categories_errors(), tuple()}. +list_categories(Client, InstanceId, QueryMap, HeadersMap) + when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> + list_categories(Client, InstanceId, QueryMap, HeadersMap, []). + +-spec list_categories(aws_client:aws_client(), binary() | list(), map(), map(), proplists:proplist()) -> + {ok, list_categories_output(), tuple()} | + {error, any()} | + {error, list_categories_errors(), tuple()}. +list_categories(Client, InstanceId, QueryMap, HeadersMap, Options0) + when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> + Path = ["/catalog.listCategories"], + 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 = + [ + {<<"instance-id">>, InstanceId} + ], + Headers = [H || {_, V} = H <- Headers0, V =/= undefined], + + Query_ = [], + + request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). + %% @doc Lists the library items for Amazon Q Apps that are published and %% available for users in your Amazon Web Services account. -spec list_library_items(aws_client:aws_client(), binary() | list()) -> diff --git a/src/aws_verifiedpermissions.erl b/src/aws_verifiedpermissions.erl index edebc53f..903c4723 100644 --- a/src/aws_verifiedpermissions.erl +++ b/src/aws_verifiedpermissions.erl @@ -84,7 +84,9 @@ %% (create and update) operations. -module(aws_verifiedpermissions). --export([batch_is_authorized/2, +-export([batch_get_policy/2, + batch_get_policy/3, + batch_is_authorized/2, batch_is_authorized/3, batch_is_authorized_with_token/2, batch_is_authorized_with_token/3, @@ -310,6 +312,12 @@ %% } -type update_policy_store_output() :: #{binary() => any()}. +%% Example: +%% batch_get_policy_input() :: #{ +%% <<"requests">> := list(batch_get_policy_input_item()()) +%% } +-type batch_get_policy_input() :: #{binary() => any()}. + %% Example: %% batch_is_authorized_with_token_output_item() :: #{ %% <<"decision">> => list(any()), @@ -364,6 +372,15 @@ %% } -type create_policy_store_output() :: #{binary() => any()}. +%% Example: +%% batch_get_policy_error_item() :: #{ +%% <<"code">> => list(any()), +%% <<"message">> => [string()], +%% <<"policyId">> => [string()], +%% <<"policyStoreId">> => [string()] +%% } +-type batch_get_policy_error_item() :: #{binary() => any()}. + %% Example: %% batch_is_authorized_output() :: #{ %% <<"results">> => list(batch_is_authorized_output_item()()) @@ -839,6 +856,13 @@ %% } -type get_policy_template_output() :: #{binary() => any()}. +%% Example: +%% batch_get_policy_output() :: #{ +%% <<"errors">> => list(batch_get_policy_error_item()()), +%% <<"results">> => list(batch_get_policy_output_item()()) +%% } +-type batch_get_policy_output() :: #{binary() => any()}. + %% Example: %% create_policy_output() :: #{ %% <<"actions">> => list(action_identifier()()), @@ -962,6 +986,13 @@ %% } -type update_policy_output() :: #{binary() => any()}. +%% Example: +%% batch_get_policy_input_item() :: #{ +%% <<"policyId">> => string(), +%% <<"policyStoreId">> => string() +%% } +-type batch_get_policy_input_item() :: #{binary() => any()}. + %% Example: %% static_policy_definition_detail() :: #{ %% <<"description">> => string(), @@ -983,6 +1014,17 @@ %% } -type entity_item() :: #{binary() => any()}. +%% Example: +%% batch_get_policy_output_item() :: #{ +%% <<"createdDate">> => non_neg_integer(), +%% <<"definition">> => list(), +%% <<"lastUpdatedDate">> => non_neg_integer(), +%% <<"policyId">> => string(), +%% <<"policyStoreId">> => string(), +%% <<"policyType">> => list(any()) +%% } +-type batch_get_policy_output_item() :: #{binary() => any()}. + %% Example: %% list_policy_stores_output() :: #{ %% <<"nextToken">> => string(), @@ -1124,6 +1166,26 @@ %% API %%==================================================================== +%% @doc Retrieves information about a group (batch) of policies. +%% +%% The `BatchGetPolicy' operation doesn't have its own IAM +%% permission. To authorize this operation for Amazon Web Services +%% principals, include the permission +%% `verifiedpermissions:GetPolicy' in their IAM policies. +-spec batch_get_policy(aws_client:aws_client(), batch_get_policy_input()) -> + {ok, batch_get_policy_output(), tuple()} | + {error, any()}. +batch_get_policy(Client, Input) + when is_map(Client), is_map(Input) -> + batch_get_policy(Client, Input, []). + +-spec batch_get_policy(aws_client:aws_client(), batch_get_policy_input(), proplists:proplist()) -> + {ok, batch_get_policy_output(), tuple()} | + {error, any()}. +batch_get_policy(Client, Input, Options) + when is_map(Client), is_map(Input), is_list(Options) -> + request(Client, <<"BatchGetPolicy">>, Input, Options). + %% @doc Makes a series of decisions about multiple authorization requests for %% one principal or %% resource.