diff --git a/Cargo.toml b/Cargo.toml index 9e841d6fafd6..179b3547ba2d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,10 +2,10 @@ resolver = "2" exclude = [ "examples/webassembly", - "examples/lambda", - "examples/test-utils", - "examples/cross_service", "examples/examples", + "examples/cross_service", + "examples/test-utils", + "examples/lambda", "tests/webassembly", "tests/no-default-features" ] @@ -151,6 +151,7 @@ members = [ "sdk/devopsguru", "sdk/directconnect", "sdk/directory", + "sdk/directoryservicedata", "sdk/dlm", "sdk/docdb", "sdk/docdbelastic", diff --git a/aws-models/cost-explorer.json b/aws-models/cost-explorer.json index 2800a9bc06c0..a70595c61bb0 100644 --- a/aws-models/cost-explorer.json +++ b/aws-models/cost-explorer.json @@ -1020,7 +1020,7 @@ "DimensionValue": { "target": "com.amazonaws.costexplorer#GenericString", "traits": { - "smithy.api#documentation": "

The dimension for the anomaly (for example, an Amazon Web Service in a service\n monitor).

" + "smithy.api#documentation": "

The dimension for the anomaly (for example, an Amazon Web Servicesservice in a service\n monitor).

" } }, "RootCauses": { @@ -3021,6 +3021,26 @@ "smithy.api#documentation": "

The field that contains a list of disk (local storage) metrics that are associated\n with the current instance.

" } }, + "com.amazonaws.costexplorer#DynamoDBCapacityDetails": { + "type": "structure", + "members": { + "CapacityUnits": { + "target": "com.amazonaws.costexplorer#GenericString", + "traits": { + "smithy.api#documentation": "

The capacity unit of the recommended reservation.

" + } + }, + "Region": { + "target": "com.amazonaws.costexplorer#GenericString", + "traits": { + "smithy.api#documentation": "

The Amazon Web Services Region of the recommended reservation.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The DynamoDB reservations that Amazon Web Services recommends that you purchase.

" + } + }, "com.amazonaws.costexplorer#EBSResourceUtilization": { "type": "structure", "members": { @@ -4398,7 +4418,7 @@ "Context": { "target": "com.amazonaws.costexplorer#Context", "traits": { - "smithy.api#documentation": "

The context for the call to GetDimensionValues. This can be\n RESERVATIONS or COST_AND_USAGE. The default value is\n COST_AND_USAGE. If the context is set to RESERVATIONS, the\n resulting dimension values can be used in the GetReservationUtilization\n operation. If the context is set to COST_AND_USAGE, the resulting dimension\n values can be used in the GetCostAndUsage operation.

\n

If you set the context to COST_AND_USAGE, you can use the following\n dimensions for searching:

\n \n

If you set the context to RESERVATIONS, you can use the following\n dimensions for searching:

\n \n

If you set the context to SAVINGS_PLANS, you can use the following\n dimensions for searching:

\n " + "smithy.api#documentation": "

The context for the call to GetDimensionValues. This can be\n RESERVATIONS or COST_AND_USAGE. The default value is\n COST_AND_USAGE. If the context is set to RESERVATIONS, the\n resulting dimension values can be used in the GetReservationUtilization\n operation. If the context is set to COST_AND_USAGE, the resulting dimension\n values can be used in the GetCostAndUsage operation.

\n

If you set the context to COST_AND_USAGE, you can use the following\n dimensions for searching:

\n \n

If you set the context to RESERVATIONS, you can use the following\n dimensions for searching:

\n \n

If you set the context to SAVINGS_PLANS, you can use the following\n dimensions for searching:

\n " } }, "Filter": { @@ -7304,19 +7324,19 @@ "AverageUtilization": { "target": "com.amazonaws.costexplorer#GenericString", "traits": { - "smithy.api#documentation": "

The average utilization of your instances. Amazon Web Services uses this to calculate\n your recommended reservation purchases.

" + "smithy.api#documentation": "

The average utilization of your recommendations. Amazon Web Services uses this to\n calculate your recommended reservation purchases.

" } }, "EstimatedBreakEvenInMonths": { "target": "com.amazonaws.costexplorer#GenericString", "traits": { - "smithy.api#documentation": "

How long Amazon Web Services estimates that it takes for this instance to start saving\n you money, in months.

" + "smithy.api#documentation": "

How long Amazon Web Services estimates that it takes for this recommendation to start\n saving you money, in months.

" } }, "CurrencyCode": { "target": "com.amazonaws.costexplorer#GenericString", "traits": { - "smithy.api#documentation": "

The currency code that Amazon Web Services used to calculate the costs for this\n instance.

" + "smithy.api#documentation": "

The currency code that Amazon Web Services used to calculate the costs for this\n recommendation.

" } }, "EstimatedMonthlySavingsAmount": { @@ -7346,13 +7366,43 @@ "UpfrontCost": { "target": "com.amazonaws.costexplorer#GenericString", "traits": { - "smithy.api#documentation": "

How much purchasing this instance costs you upfront.

" + "smithy.api#documentation": "

How much purchasing this recommendation costs you upfront.

" } }, "RecurringStandardMonthlyCost": { "target": "com.amazonaws.costexplorer#GenericString", "traits": { - "smithy.api#documentation": "

How much purchasing this instance costs you on a monthly basis.

" + "smithy.api#documentation": "

How much purchasing this recommendation costs you on a monthly basis.

" + } + }, + "ReservedCapacityDetails": { + "target": "com.amazonaws.costexplorer#ReservedCapacityDetails", + "traits": { + "smithy.api#documentation": "

Details about the reservations that Amazon Web Services recommends that you\n purchase.

" + } + }, + "RecommendedNumberOfCapacityUnitsToPurchase": { + "target": "com.amazonaws.costexplorer#GenericString", + "traits": { + "smithy.api#documentation": "

The number of reserved capacity units that Amazon Web Services recommends that you\n purchase.

" + } + }, + "MinimumNumberOfCapacityUnitsUsedPerHour": { + "target": "com.amazonaws.costexplorer#GenericString", + "traits": { + "smithy.api#documentation": "

The minimum number of provisioned capacity units that you used in an hour during the\n historical period. Amazon Web Services uses this to calculate your recommended\n reservation purchases.

" + } + }, + "MaximumNumberOfCapacityUnitsUsedPerHour": { + "target": "com.amazonaws.costexplorer#GenericString", + "traits": { + "smithy.api#documentation": "

The maximum number of provisioned capacity units that you used in an hour during the\n historical period. Amazon Web Services uses this to calculate your recommended\n reservation purchases.

" + } + }, + "AverageNumberOfCapacityUnitsUsedPerHour": { + "target": "com.amazonaws.costexplorer#GenericString", + "traits": { + "smithy.api#documentation": "

The average number of provisioned capacity units that you used in an hour during the\n historical period. Amazon Web Services uses this to calculate your recommended\n reservation purchases.

" } } }, @@ -7462,6 +7512,20 @@ "target": "com.amazonaws.costexplorer#ReservationUtilizationGroup" } }, + "com.amazonaws.costexplorer#ReservedCapacityDetails": { + "type": "structure", + "members": { + "DynamoDBCapacityDetails": { + "target": "com.amazonaws.costexplorer#DynamoDBCapacityDetails", + "traits": { + "smithy.api#documentation": "

The DynamoDB reservations that Amazon Web Services recommends that you purchase.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Details about the reservations that Amazon Web Services recommends that you\n purchase.

" + } + }, "com.amazonaws.costexplorer#ReservedHours": { "type": "string" }, @@ -7777,7 +7841,7 @@ "Service": { "target": "com.amazonaws.costexplorer#GenericString", "traits": { - "smithy.api#documentation": "

The Amazon Web Service name that's associated with the cost anomaly.

" + "smithy.api#documentation": "

The Amazon Web Servicesservice name that's associated with the cost anomaly.

" } }, "Region": { @@ -7806,7 +7870,7 @@ } }, "traits": { - "smithy.api#documentation": "

The combination of Amazon Web Service, linked account, linked account name,\n Region, and usage type where a cost anomaly is observed. The linked account name will\n only be available when the account name can be identified.

" + "smithy.api#documentation": "

The combination of Amazon Web Servicesservice, linked account, linked account name,\n Region, and usage type where a cost anomaly is observed. The linked account name will\n only be available when the account name can be identified.

" } }, "com.amazonaws.costexplorer#RootCauses": { diff --git a/aws-models/directory-service-data.json b/aws-models/directory-service-data.json new file mode 100644 index 000000000000..04f9162bda5b --- /dev/null +++ b/aws-models/directory-service-data.json @@ -0,0 +1,3464 @@ +{ + "smithy": "2.0", + "shapes": { + "com.amazonaws.directoryservicedata#AccessDeniedException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.directoryservicedata#ExceptionMessage" + }, + "Reason": { + "target": "com.amazonaws.directoryservicedata#AccessDeniedReason", + "traits": { + "smithy.api#documentation": "

Reason the request was unauthorized.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

You don't have permission to perform the request or access the directory. It can also\n occur when the DirectoryId doesn't exist or the user, member, or group might be\n outside of your organizational unit (OU).

\n

Make sure that you have the authentication and authorization to perform the action.\n Review the directory information in the request, and make sure that the object isn't outside\n of your OU.

", + "smithy.api#error": "client", + "smithy.api#httpError": 403 + } + }, + "com.amazonaws.directoryservicedata#AccessDeniedReason": { + "type": "enum", + "members": { + "IAM_AUTH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "IAM_AUTH" + } + }, + "DIRECTORY_AUTH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DIRECTORY_AUTH" + } + }, + "DATA_DISABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DATA_DISABLED" + } + } + } + }, + "com.amazonaws.directoryservicedata#AddGroupMember": { + "type": "operation", + "input": { + "target": "com.amazonaws.directoryservicedata#AddGroupMemberRequest" + }, + "output": { + "target": "com.amazonaws.directoryservicedata#AddGroupMemberResult" + }, + "errors": [ + { + "target": "com.amazonaws.directoryservicedata#AccessDeniedException" + }, + { + "target": "com.amazonaws.directoryservicedata#ConflictException" + }, + { + "target": "com.amazonaws.directoryservicedata#DirectoryUnavailableException" + }, + { + "target": "com.amazonaws.directoryservicedata#InternalServerException" + }, + { + "target": "com.amazonaws.directoryservicedata#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.directoryservicedata#ThrottlingException" + }, + { + "target": "com.amazonaws.directoryservicedata#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Adds an existing user, group, or computer as a group member.

", + "smithy.api#http": { + "uri": "/GroupMemberships/AddGroupMember", + "method": "POST" + } + } + }, + "com.amazonaws.directoryservicedata#AddGroupMemberRequest": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservicedata#DirectoryId", + "traits": { + "smithy.api#documentation": "

The identifier (ID) of the directory that's associated with the group.

", + "smithy.api#httpQuery": "DirectoryId", + "smithy.api#required": {} + } + }, + "GroupName": { + "target": "com.amazonaws.directoryservicedata#GroupName", + "traits": { + "smithy.api#documentation": "

The name of the group.

", + "smithy.api#required": {} + } + }, + "MemberName": { + "target": "com.amazonaws.directoryservicedata#MemberName", + "traits": { + "smithy.api#documentation": "

The SAMAccountName of the user, group, or computer to add as a group member.\n

", + "smithy.api#required": {} + } + }, + "MemberRealm": { + "target": "com.amazonaws.directoryservicedata#Realm", + "traits": { + "smithy.api#documentation": "

The domain name that's associated with the group member. This parameter is required only\n when adding a member outside of your Managed Microsoft AD domain to a group inside of your\n Managed Microsoft AD domain. This parameter defaults to the Managed Microsoft AD domain.

\n \n

This parameter is case insensitive.

\n
" + } + }, + "ClientToken": { + "target": "com.amazonaws.directoryservicedata#ClientToken", + "traits": { + "smithy.api#documentation": "

A unique and case-sensitive identifier that you provide to make sure the idempotency of\n the request, so multiple identical calls have the same effect as one single call.

\n

A client token is valid for 8 hours after the first request that uses it completes. After\n 8 hours, any request with the same client token is treated as a new request. If the request\n succeeds, any future uses of that token will be idempotent for another 8 hours.

\n

If you submit a request with the same client token but change one of the other parameters\n within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

\n \n

This parameter is optional when using the CLI or SDK.

\n
", + "smithy.api#idempotencyToken": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.directoryservicedata#AddGroupMemberResult": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.directoryservicedata#AttributeValue": { + "type": "union", + "members": { + "S": { + "target": "com.amazonaws.directoryservicedata#StringAttributeValue", + "traits": { + "smithy.api#documentation": "

Indicates that the attribute type value is a string. For example:

\n

\n \"S\": \"S Group\"\n

" + } + }, + "N": { + "target": "com.amazonaws.directoryservicedata#NumberAttributeValue", + "traits": { + "smithy.api#documentation": "

Indicates that the attribute type value is a number. For example:

\n

\n \"N\": \"16\"\n

" + } + }, + "BOOL": { + "target": "com.amazonaws.directoryservicedata#BooleanAttributeValue", + "traits": { + "smithy.api#documentation": "

Indicates that the attribute type value is a boolean. For example:

\n

\n \"BOOL\": true\n

" + } + }, + "SS": { + "target": "com.amazonaws.directoryservicedata#StringSetAttributeValue", + "traits": { + "smithy.api#documentation": "

Indicates that the attribute type value is a string set. For example:

\n

\n \"SS\": [\"sample_service_class/host.sample.com:1234/sample_service_name_1\",\n \"sample_service_class/host.sample.com:1234/sample_service_name_2\"]\n

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The data type for an attribute. Each attribute value is described as a name-value pair.\n The name is the AD schema name, and the value is the data itself. For a list of supported\n attributes, see Directory Service Data Attributes.\n

" + } + }, + "com.amazonaws.directoryservicedata#Attributes": { + "type": "map", + "key": { + "target": "com.amazonaws.directoryservicedata#LdapDisplayName" + }, + "value": { + "target": "com.amazonaws.directoryservicedata#AttributeValue" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 25 + } + } + }, + "com.amazonaws.directoryservicedata#BooleanAttributeValue": { + "type": "boolean", + "traits": { + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.directoryservicedata#ClientToken": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 128 + }, + "smithy.api#pattern": "^[\\x00-\\x7F]+$" + } + }, + "com.amazonaws.directoryservicedata#ConflictException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.directoryservicedata#ExceptionMessage" + } + }, + "traits": { + "smithy.api#documentation": "

This error will occur when you try to create a resource that conflicts with an existing\n object. It can also occur when adding a member to a group that the member is already\n in.

\n

This error can be caused by a request sent within the 8-hour idempotency window with the\n same client token but different input parameters. Client tokens should not be re-used across\n different requests. After 8 hours, any request with the same client token is treated as a new\n request.

", + "smithy.api#error": "client", + "smithy.api#httpError": 409 + } + }, + "com.amazonaws.directoryservicedata#CreateGroup": { + "type": "operation", + "input": { + "target": "com.amazonaws.directoryservicedata#CreateGroupRequest" + }, + "output": { + "target": "com.amazonaws.directoryservicedata#CreateGroupResult" + }, + "errors": [ + { + "target": "com.amazonaws.directoryservicedata#AccessDeniedException" + }, + { + "target": "com.amazonaws.directoryservicedata#ConflictException" + }, + { + "target": "com.amazonaws.directoryservicedata#DirectoryUnavailableException" + }, + { + "target": "com.amazonaws.directoryservicedata#InternalServerException" + }, + { + "target": "com.amazonaws.directoryservicedata#ThrottlingException" + }, + { + "target": "com.amazonaws.directoryservicedata#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Creates a new group.

", + "smithy.api#http": { + "uri": "/Groups/CreateGroup", + "method": "POST" + } + } + }, + "com.amazonaws.directoryservicedata#CreateGroupRequest": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservicedata#DirectoryId", + "traits": { + "smithy.api#documentation": "

The identifier (ID) of the directory that's associated with the group.

", + "smithy.api#httpQuery": "DirectoryId", + "smithy.api#required": {} + } + }, + "SAMAccountName": { + "target": "com.amazonaws.directoryservicedata#GroupName", + "traits": { + "smithy.api#documentation": "

The name of the group.

", + "smithy.api#required": {} + } + }, + "GroupType": { + "target": "com.amazonaws.directoryservicedata#GroupType", + "traits": { + "smithy.api#documentation": "

The AD group type. For details, see Active Directory security group type.

" + } + }, + "GroupScope": { + "target": "com.amazonaws.directoryservicedata#GroupScope", + "traits": { + "smithy.api#documentation": "

The scope of the AD group. For details, see Active Directory security group scope.

" + } + }, + "OtherAttributes": { + "target": "com.amazonaws.directoryservicedata#Attributes", + "traits": { + "smithy.api#documentation": "

An expression that defines one or more attributes with the data type and value of each\n attribute.

" + } + }, + "ClientToken": { + "target": "com.amazonaws.directoryservicedata#ClientToken", + "traits": { + "smithy.api#documentation": "

A unique and case-sensitive identifier that you provide to make sure the idempotency of\n the request, so multiple identical calls have the same effect as one single call.

\n

A client token is valid for 8 hours after the first request that uses it completes. After\n 8 hours, any request with the same client token is treated as a new request. If the request\n succeeds, any future uses of that token will be idempotent for another 8 hours.

\n

If you submit a request with the same client token but change one of the other parameters\n within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

\n \n

This parameter is optional when using the CLI or SDK.

\n
", + "smithy.api#idempotencyToken": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.directoryservicedata#CreateGroupResult": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservicedata#DirectoryId", + "traits": { + "smithy.api#documentation": "

The identifier (ID) of the directory that's associated with the group.

" + } + }, + "SAMAccountName": { + "target": "com.amazonaws.directoryservicedata#GroupName", + "traits": { + "smithy.api#documentation": "

The name of the group.

" + } + }, + "SID": { + "target": "com.amazonaws.directoryservicedata#SID", + "traits": { + "smithy.api#documentation": "

The unique security identifier (SID) of the group.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.directoryservicedata#CreateUser": { + "type": "operation", + "input": { + "target": "com.amazonaws.directoryservicedata#CreateUserRequest" + }, + "output": { + "target": "com.amazonaws.directoryservicedata#CreateUserResult" + }, + "errors": [ + { + "target": "com.amazonaws.directoryservicedata#AccessDeniedException" + }, + { + "target": "com.amazonaws.directoryservicedata#ConflictException" + }, + { + "target": "com.amazonaws.directoryservicedata#DirectoryUnavailableException" + }, + { + "target": "com.amazonaws.directoryservicedata#InternalServerException" + }, + { + "target": "com.amazonaws.directoryservicedata#ThrottlingException" + }, + { + "target": "com.amazonaws.directoryservicedata#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Creates a new user.

", + "smithy.api#http": { + "uri": "/Users/CreateUser", + "method": "POST" + } + } + }, + "com.amazonaws.directoryservicedata#CreateUserRequest": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservicedata#DirectoryId", + "traits": { + "smithy.api#documentation": "

The identifier (ID) of the directory that’s associated with the user.

", + "smithy.api#httpQuery": "DirectoryId", + "smithy.api#required": {} + } + }, + "SAMAccountName": { + "target": "com.amazonaws.directoryservicedata#UserName", + "traits": { + "smithy.api#documentation": "

The name of the user.

", + "smithy.api#required": {} + } + }, + "EmailAddress": { + "target": "com.amazonaws.directoryservicedata#EmailAddress", + "traits": { + "smithy.api#documentation": "

The email address of the user.

" + } + }, + "GivenName": { + "target": "com.amazonaws.directoryservicedata#GivenName", + "traits": { + "smithy.api#documentation": "

The first name of the user.

" + } + }, + "Surname": { + "target": "com.amazonaws.directoryservicedata#Surname", + "traits": { + "smithy.api#documentation": "

The last name of the user.

" + } + }, + "OtherAttributes": { + "target": "com.amazonaws.directoryservicedata#Attributes", + "traits": { + "smithy.api#documentation": "

An expression that defines one or more attribute names with the data type and value of\n each attribute. A key is an attribute name, and the value is a list of maps. For a list of\n supported attributes, see Directory Service Data Attributes.

\n \n

Attribute names are case insensitive.

\n
" + } + }, + "ClientToken": { + "target": "com.amazonaws.directoryservicedata#ClientToken", + "traits": { + "smithy.api#documentation": "

A unique and case-sensitive identifier that you provide to make sure the idempotency of\n the request, so multiple identical calls have the same effect as one single call.

\n

A client token is valid for 8 hours after the first request that uses it completes. After\n 8 hours, any request with the same client token is treated as a new request. If the request\n succeeds, any future uses of that token will be idempotent for another 8 hours.

\n

If you submit a request with the same client token but change one of the other parameters\n within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

\n \n

This parameter is optional when using the CLI or SDK.

\n
", + "smithy.api#idempotencyToken": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.directoryservicedata#CreateUserResult": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservicedata#DirectoryId", + "traits": { + "smithy.api#documentation": "

The identifier (ID) of the directory where the address block is added.

" + } + }, + "SID": { + "target": "com.amazonaws.directoryservicedata#SID", + "traits": { + "smithy.api#documentation": "

The unique security identifier (SID) of the user.

" + } + }, + "SAMAccountName": { + "target": "com.amazonaws.directoryservicedata#UserName", + "traits": { + "smithy.api#documentation": "

The name of the user.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.directoryservicedata#DeleteGroup": { + "type": "operation", + "input": { + "target": "com.amazonaws.directoryservicedata#DeleteGroupRequest" + }, + "output": { + "target": "com.amazonaws.directoryservicedata#DeleteGroupResult" + }, + "errors": [ + { + "target": "com.amazonaws.directoryservicedata#AccessDeniedException" + }, + { + "target": "com.amazonaws.directoryservicedata#ConflictException" + }, + { + "target": "com.amazonaws.directoryservicedata#DirectoryUnavailableException" + }, + { + "target": "com.amazonaws.directoryservicedata#InternalServerException" + }, + { + "target": "com.amazonaws.directoryservicedata#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.directoryservicedata#ThrottlingException" + }, + { + "target": "com.amazonaws.directoryservicedata#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Deletes a group.

", + "smithy.api#http": { + "uri": "/Groups/DeleteGroup", + "method": "POST" + } + } + }, + "com.amazonaws.directoryservicedata#DeleteGroupRequest": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservicedata#DirectoryId", + "traits": { + "smithy.api#documentation": "

The identifier (ID) of the directory that's associated with the group.

", + "smithy.api#httpQuery": "DirectoryId", + "smithy.api#required": {} + } + }, + "SAMAccountName": { + "target": "com.amazonaws.directoryservicedata#GroupName", + "traits": { + "smithy.api#documentation": "

The name of the group.

", + "smithy.api#required": {} + } + }, + "ClientToken": { + "target": "com.amazonaws.directoryservicedata#ClientToken", + "traits": { + "smithy.api#documentation": "

A unique and case-sensitive identifier that you provide to make sure the idempotency of\n the request, so multiple identical calls have the same effect as one single call.

\n

A client token is valid for 8 hours after the first request that uses it completes. After\n 8 hours, any request with the same client token is treated as a new request. If the request\n succeeds, any future uses of that token will be idempotent for another 8 hours.

\n

If you submit a request with the same client token but change one of the other parameters\n within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

\n \n

This parameter is optional when using the CLI or SDK.

\n
", + "smithy.api#idempotencyToken": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.directoryservicedata#DeleteGroupResult": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.directoryservicedata#DeleteUser": { + "type": "operation", + "input": { + "target": "com.amazonaws.directoryservicedata#DeleteUserRequest" + }, + "output": { + "target": "com.amazonaws.directoryservicedata#DeleteUserResult" + }, + "errors": [ + { + "target": "com.amazonaws.directoryservicedata#AccessDeniedException" + }, + { + "target": "com.amazonaws.directoryservicedata#ConflictException" + }, + { + "target": "com.amazonaws.directoryservicedata#DirectoryUnavailableException" + }, + { + "target": "com.amazonaws.directoryservicedata#InternalServerException" + }, + { + "target": "com.amazonaws.directoryservicedata#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.directoryservicedata#ThrottlingException" + }, + { + "target": "com.amazonaws.directoryservicedata#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Deletes a user.

", + "smithy.api#http": { + "uri": "/Users/DeleteUser", + "method": "POST" + } + } + }, + "com.amazonaws.directoryservicedata#DeleteUserRequest": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservicedata#DirectoryId", + "traits": { + "smithy.api#documentation": "

The identifier (ID) of the directory that's associated with the user.

", + "smithy.api#httpQuery": "DirectoryId", + "smithy.api#required": {} + } + }, + "SAMAccountName": { + "target": "com.amazonaws.directoryservicedata#UserName", + "traits": { + "smithy.api#documentation": "

The name of the user.

", + "smithy.api#required": {} + } + }, + "ClientToken": { + "target": "com.amazonaws.directoryservicedata#ClientToken", + "traits": { + "smithy.api#documentation": "

A unique and case-sensitive identifier that you provide to make sure the idempotency of\n the request, so multiple identical calls have the same effect as one single call.

\n

A client token is valid for 8 hours after the first request that uses it completes. After\n 8 hours, any request with the same client token is treated as a new request. If the request\n succeeds, any future uses of that token will be idempotent for another 8 hours.

\n

If you submit a request with the same client token but change one of the other parameters\n within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

\n \n

This parameter is optional when using the CLI or SDK.

\n
", + "smithy.api#idempotencyToken": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.directoryservicedata#DeleteUserResult": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.directoryservicedata#DescribeGroup": { + "type": "operation", + "input": { + "target": "com.amazonaws.directoryservicedata#DescribeGroupRequest" + }, + "output": { + "target": "com.amazonaws.directoryservicedata#DescribeGroupResult" + }, + "errors": [ + { + "target": "com.amazonaws.directoryservicedata#AccessDeniedException" + }, + { + "target": "com.amazonaws.directoryservicedata#DirectoryUnavailableException" + }, + { + "target": "com.amazonaws.directoryservicedata#InternalServerException" + }, + { + "target": "com.amazonaws.directoryservicedata#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.directoryservicedata#ThrottlingException" + }, + { + "target": "com.amazonaws.directoryservicedata#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns information about a specific group.

", + "smithy.api#http": { + "uri": "/Groups/DescribeGroup", + "method": "POST" + }, + "smithy.api#readonly": {}, + "smithy.test#smokeTests": [ + { + "id": "DescribeGroupFailure", + "params": { + "DirectoryId": "d-1111111111", + "SAMAccountName": "test-group" + }, + "expect": { + "failure": { + "errorId": "com.amazonaws.directoryservicedata#AccessDeniedException" + } + }, + "vendorParamsShape": "aws.test#AwsVendorParams", + "vendorParams": { + "region": "us-west-2" + } + } + ] + } + }, + "com.amazonaws.directoryservicedata#DescribeGroupRequest": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservicedata#DirectoryId", + "traits": { + "smithy.api#documentation": "

The Identifier (ID) of the directory associated with the group.

", + "smithy.api#httpQuery": "DirectoryId", + "smithy.api#required": {} + } + }, + "Realm": { + "target": "com.amazonaws.directoryservicedata#Realm", + "traits": { + "smithy.api#documentation": "

The domain name that's associated with the group.

\n \n

This parameter is optional, so you can return groups outside of your Managed Microsoft AD\n domain. When no value is defined, only your Managed Microsoft AD groups are returned.

\n

This value is case insensitive.

\n
" + } + }, + "SAMAccountName": { + "target": "com.amazonaws.directoryservicedata#GroupName", + "traits": { + "smithy.api#documentation": "

The name of the group.

", + "smithy.api#required": {} + } + }, + "OtherAttributes": { + "target": "com.amazonaws.directoryservicedata#LdapDisplayNameList", + "traits": { + "smithy.api#documentation": "

One or more attributes to be returned for the group. For a list of supported attributes,\n see Directory Service Data Attributes.\n

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.directoryservicedata#DescribeGroupResult": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservicedata#DirectoryId", + "traits": { + "smithy.api#documentation": "

The identifier (ID) of the directory that's associated with the group.

" + } + }, + "Realm": { + "target": "com.amazonaws.directoryservicedata#Realm", + "traits": { + "smithy.api#documentation": "

The domain name that's associated with the group.

" + } + }, + "SID": { + "target": "com.amazonaws.directoryservicedata#SID", + "traits": { + "smithy.api#documentation": "

The unique security identifier (SID) of the group.

" + } + }, + "SAMAccountName": { + "target": "com.amazonaws.directoryservicedata#GroupName", + "traits": { + "smithy.api#documentation": "

The name of the group.

" + } + }, + "DistinguishedName": { + "target": "com.amazonaws.directoryservicedata#DistinguishedName", + "traits": { + "smithy.api#documentation": "

The distinguished name of the object.

" + } + }, + "GroupType": { + "target": "com.amazonaws.directoryservicedata#GroupType", + "traits": { + "smithy.api#documentation": "

The AD group type. For details, see Active Directory security group type.

" + } + }, + "GroupScope": { + "target": "com.amazonaws.directoryservicedata#GroupScope", + "traits": { + "smithy.api#documentation": "

The scope of the AD group. For details, see Active Directory security groups.

" + } + }, + "OtherAttributes": { + "target": "com.amazonaws.directoryservicedata#Attributes", + "traits": { + "smithy.api#documentation": "

The attribute values that are returned for the attribute names that are included in the\n request.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.directoryservicedata#DescribeUser": { + "type": "operation", + "input": { + "target": "com.amazonaws.directoryservicedata#DescribeUserRequest" + }, + "output": { + "target": "com.amazonaws.directoryservicedata#DescribeUserResult" + }, + "errors": [ + { + "target": "com.amazonaws.directoryservicedata#AccessDeniedException" + }, + { + "target": "com.amazonaws.directoryservicedata#DirectoryUnavailableException" + }, + { + "target": "com.amazonaws.directoryservicedata#InternalServerException" + }, + { + "target": "com.amazonaws.directoryservicedata#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.directoryservicedata#ThrottlingException" + }, + { + "target": "com.amazonaws.directoryservicedata#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns information about a specific user.

", + "smithy.api#http": { + "uri": "/Users/DescribeUser", + "method": "POST" + }, + "smithy.api#readonly": {}, + "smithy.test#smokeTests": [ + { + "id": "DescribeUserFailure", + "params": { + "DirectoryId": "d-1111111111", + "SAMAccountName": "test-user" + }, + "expect": { + "failure": { + "errorId": "com.amazonaws.directoryservicedata#AccessDeniedException" + } + }, + "vendorParamsShape": "aws.test#AwsVendorParams", + "vendorParams": { + "region": "us-west-2" + } + } + ] + } + }, + "com.amazonaws.directoryservicedata#DescribeUserRequest": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservicedata#DirectoryId", + "traits": { + "smithy.api#documentation": "

The identifier (ID) of the directory that's associated with the user.

", + "smithy.api#httpQuery": "DirectoryId", + "smithy.api#required": {} + } + }, + "SAMAccountName": { + "target": "com.amazonaws.directoryservicedata#UserName", + "traits": { + "smithy.api#documentation": "

The name of the user.

", + "smithy.api#required": {} + } + }, + "OtherAttributes": { + "target": "com.amazonaws.directoryservicedata#LdapDisplayNameList", + "traits": { + "smithy.api#documentation": "

One or more attribute names to be returned for the user. A key is an attribute name, and\n the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.

" + } + }, + "Realm": { + "target": "com.amazonaws.directoryservicedata#Realm", + "traits": { + "smithy.api#documentation": "

The domain name that's associated with the user.

\n \n

This parameter is optional, so you can return users outside your Managed Microsoft AD domain.\n When no value is defined, only your Managed Microsoft AD users are returned.

\n

This value is case insensitive.

\n
" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.directoryservicedata#DescribeUserResult": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservicedata#DirectoryId", + "traits": { + "smithy.api#documentation": "

The identifier (ID) of the directory that's associated with the user.

" + } + }, + "Realm": { + "target": "com.amazonaws.directoryservicedata#Realm", + "traits": { + "smithy.api#documentation": "

The domain name that's associated with the user.

" + } + }, + "SID": { + "target": "com.amazonaws.directoryservicedata#SID", + "traits": { + "smithy.api#documentation": "

The unique security identifier (SID) of the user.

" + } + }, + "SAMAccountName": { + "target": "com.amazonaws.directoryservicedata#UserName", + "traits": { + "smithy.api#documentation": "

The name of the user.

" + } + }, + "DistinguishedName": { + "target": "com.amazonaws.directoryservicedata#DistinguishedName", + "traits": { + "smithy.api#documentation": "

The distinguished name of the object.

" + } + }, + "UserPrincipalName": { + "target": "com.amazonaws.directoryservicedata#UserPrincipalName", + "traits": { + "smithy.api#documentation": "

The UPN that is an Internet-style login name for a user and is based on the Internet\n standard RFC 822. The UPN is shorter\n than the distinguished name and easier to remember.

" + } + }, + "EmailAddress": { + "target": "com.amazonaws.directoryservicedata#EmailAddress", + "traits": { + "smithy.api#documentation": "

The email address of the user.

" + } + }, + "GivenName": { + "target": "com.amazonaws.directoryservicedata#GivenName", + "traits": { + "smithy.api#documentation": "

The first name of the user.

" + } + }, + "Surname": { + "target": "com.amazonaws.directoryservicedata#Surname", + "traits": { + "smithy.api#documentation": "

The last name of the user.

" + } + }, + "Enabled": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "

Indicates whether the user account is active.

" + } + }, + "OtherAttributes": { + "target": "com.amazonaws.directoryservicedata#Attributes", + "traits": { + "smithy.api#documentation": "

The attribute values that are returned for the attribute names that are included in the\n request.

\n \n

Attribute names are case insensitive.

\n
" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.directoryservicedata#DirectoryId": { + "type": "string", + "traits": { + "smithy.api#pattern": "^d-[0-9a-f]{10}$" + } + }, + "com.amazonaws.directoryservicedata#DirectoryServiceData": { + "type": "service", + "version": "2023-05-31", + "operations": [ + { + "target": "com.amazonaws.directoryservicedata#AddGroupMember" + }, + { + "target": "com.amazonaws.directoryservicedata#CreateGroup" + }, + { + "target": "com.amazonaws.directoryservicedata#CreateUser" + }, + { + "target": "com.amazonaws.directoryservicedata#DeleteGroup" + }, + { + "target": "com.amazonaws.directoryservicedata#DeleteUser" + }, + { + "target": "com.amazonaws.directoryservicedata#DescribeGroup" + }, + { + "target": "com.amazonaws.directoryservicedata#DescribeUser" + }, + { + "target": "com.amazonaws.directoryservicedata#DisableUser" + }, + { + "target": "com.amazonaws.directoryservicedata#ListGroupMembers" + }, + { + "target": "com.amazonaws.directoryservicedata#ListGroups" + }, + { + "target": "com.amazonaws.directoryservicedata#ListGroupsForMember" + }, + { + "target": "com.amazonaws.directoryservicedata#ListUsers" + }, + { + "target": "com.amazonaws.directoryservicedata#RemoveGroupMember" + }, + { + "target": "com.amazonaws.directoryservicedata#SearchGroups" + }, + { + "target": "com.amazonaws.directoryservicedata#SearchUsers" + }, + { + "target": "com.amazonaws.directoryservicedata#UpdateGroup" + }, + { + "target": "com.amazonaws.directoryservicedata#UpdateUser" + } + ], + "traits": { + "aws.api#service": { + "sdkId": "Directory Service Data", + "arnNamespace": "ds", + "cloudFormationName": "DirectoryServiceData", + "cloudTrailEventSource": "ds.amazonaws.com", + "endpointPrefix": "ds-data" + }, + "aws.auth#sigv4": { + "name": "ds-data" + }, + "aws.protocols#restJson1": {}, + "smithy.api#documentation": "

Amazon Web Services Directory Service Data is an extension of Directory Service. This API reference provides detailed information\n about Directory Service Data operations and object types.

\n

With Directory Service Data, you can create, read, update, and delete users, groups, and memberships from\n your Managed Microsoft AD without additional costs and without deploying dedicated management\n instances. You can also perform built-in object management tasks across directories without\n direct network connectivity, which simplifies provisioning and access management to achieve\n fully automated deployments. Directory Service Data supports user and group write operations, such as\n CreateUser and CreateGroup, within the organizational unit (OU) of\n your Managed Microsoft AD. Directory Service Data supports read operations, such as ListUsers and\n ListGroups, on all users, groups, and group memberships within your\n Managed Microsoft AD and across trusted realms. Directory Service Data supports adding and removing group members in\n your OU and the Amazon Web Services Delegated Groups OU, so you can grant and deny access to specific roles\n and permissions. For more information, see Manage users and\n groups in the Directory Service Administration Guide.

\n \n

Directory management operations and configuration changes made against the Directory Service\n API will also reflect in Directory Service Data API with eventual consistency. You can expect a short delay\n between management changes, such as adding a new directory trust and calling the Directory Service Data API\n for the newly created trusted realm.

\n
\n

Directory Service Data connects to your Managed Microsoft AD domain controllers and performs operations on\n underlying directory objects. When you create your Managed Microsoft AD, you choose subnets for domain\n controllers that Directory Service creates on your behalf. If a domain controller is unavailable, Directory Service Data\n uses an available domain controller. As a result, you might notice eventual consistency while\n objects replicate from one domain controller to another domain controller. For more\n information, see What\n gets created in the Directory Service Administration Guide.\n Directory limits vary by Managed Microsoft AD edition:

\n \n

Directory Service Data only supports the Managed Microsoft AD directory type and is only available in the primary\n Amazon Web Services Region. For more information, see Managed Microsoft AD\n and Primary vs additional Regions in the Directory Service Administration\n Guide.

", + "smithy.api#title": "AWS Directory Service Data", + "smithy.api#xmlNamespace": { + "uri": "http://directoryservicedata.amazonaws.com/doc/2023-05-31/" + }, + "smithy.rules#endpointRuleSet": { + "version": "1.0", + "parameters": { + "Region": { + "builtIn": "AWS::Region", + "required": false, + "documentation": "The AWS region used to dispatch the request.", + "type": "String" + }, + "UseDualStack": { + "builtIn": "AWS::UseDualStack", + "required": true, + "default": false, + "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", + "type": "Boolean" + }, + "UseFIPS": { + "builtIn": "AWS::UseFIPS", + "required": true, + "default": false, + "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", + "type": "Boolean" + }, + "Endpoint": { + "builtIn": "SDK::Endpoint", + "required": false, + "documentation": "Override the endpoint used to send this request", + "type": "String" + } + }, + "rules": [ + { + "conditions": [ + { + "fn": "isSet", + "argv": [ + { + "ref": "Endpoint" + } + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + } + ], + "error": "Invalid Configuration: FIPS and custom endpoint are not supported", + "type": "error" + }, + { + "conditions": [], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", + "type": "error" + }, + { + "conditions": [], + "endpoint": { + "url": { + "ref": "Endpoint" + }, + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "rules": [ + { + "conditions": [ + { + "fn": "isSet", + "argv": [ + { + "ref": "Region" + } + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "aws.partition", + "argv": [ + { + "ref": "Region" + } + ], + "assign": "PartitionResult" + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + }, + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsFIPS" + ] + } + ] + }, + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsDualStack" + ] + } + ] + } + ], + "rules": [ + { + "conditions": [], + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://ds-data-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "error": "FIPS and DualStack are enabled, but this partition does not support one or both", + "type": "error" + } + ], + "type": "tree" + }, + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseFIPS" + }, + true + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsFIPS" + ] + }, + true + ] + } + ], + "rules": [ + { + "conditions": [], + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://ds-data-fips.{Region}.{PartitionResult#dnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "error": "FIPS is enabled but this partition does not support FIPS", + "type": "error" + } + ], + "type": "tree" + }, + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + { + "ref": "UseDualStack" + }, + true + ] + } + ], + "rules": [ + { + "conditions": [ + { + "fn": "booleanEquals", + "argv": [ + true, + { + "fn": "getAttr", + "argv": [ + { + "ref": "PartitionResult" + }, + "supportsDualStack" + ] + } + ] + } + ], + "rules": [ + { + "conditions": [], + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://ds-data.{Region}.{PartitionResult#dualStackDnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "error": "DualStack is enabled but this partition does not support DualStack", + "type": "error" + } + ], + "type": "tree" + }, + { + "conditions": [], + "rules": [ + { + "conditions": [], + "endpoint": { + "url": "https://ds-data.{Region}.{PartitionResult#dnsSuffix}", + "properties": {}, + "headers": {} + }, + "type": "endpoint" + } + ], + "type": "tree" + } + ], + "type": "tree" + } + ], + "type": "tree" + }, + { + "conditions": [], + "error": "Invalid Configuration: Missing Region", + "type": "error" + } + ], + "type": "tree" + } + ] + }, + "smithy.rules#endpointTests": { + "testCases": [ + { + "documentation": "For region us-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://ds-data-fips.us-east-1.api.aws" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region us-east-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://ds-data-fips.us-east-1.amazonaws.com" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region us-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://ds-data.us-east-1.api.aws" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region us-east-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://ds-data.us-east-1.amazonaws.com" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For region cn-north-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://ds-data-fips.cn-north-1.api.amazonwebservices.com.cn" + } + }, + "params": { + "Region": "cn-north-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region cn-north-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://ds-data-fips.cn-north-1.amazonaws.com.cn" + } + }, + "params": { + "Region": "cn-north-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region cn-north-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://ds-data.cn-north-1.api.amazonwebservices.com.cn" + } + }, + "params": { + "Region": "cn-north-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region cn-north-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://ds-data.cn-north-1.amazonaws.com.cn" + } + }, + "params": { + "Region": "cn-north-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://ds-data-fips.us-gov-east-1.api.aws" + } + }, + "params": { + "Region": "us-gov-east-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://ds-data-fips.us-gov-east-1.amazonaws.com" + } + }, + "params": { + "Region": "us-gov-east-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "endpoint": { + "url": "https://ds-data.us-gov-east-1.api.aws" + } + }, + "params": { + "Region": "us-gov-east-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://ds-data.us-gov-east-1.amazonaws.com" + } + }, + "params": { + "Region": "us-gov-east-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "error": "FIPS and DualStack are enabled, but this partition does not support one or both" + }, + "params": { + "Region": "us-iso-east-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://ds-data-fips.us-iso-east-1.c2s.ic.gov" + } + }, + "params": { + "Region": "us-iso-east-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "error": "DualStack is enabled but this partition does not support DualStack" + }, + "params": { + "Region": "us-iso-east-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://ds-data.us-iso-east-1.c2s.ic.gov" + } + }, + "params": { + "Region": "us-iso-east-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "error": "FIPS and DualStack are enabled, but this partition does not support one or both" + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": true, + "UseDualStack": true + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://ds-data-fips.us-isob-east-1.sc2s.sgov.gov" + } + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": true, + "UseDualStack": false + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "error": "DualStack is enabled but this partition does not support DualStack" + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": false, + "UseDualStack": true + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack disabled", + "expect": { + "endpoint": { + "url": "https://ds-data.us-isob-east-1.sc2s.sgov.gov" + } + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": false, + "UseDualStack": false + } + }, + { + "documentation": "For custom endpoint with region set and fips disabled and dualstack disabled", + "expect": { + "endpoint": { + "url": "https://example.com" + } + }, + "params": { + "Region": "us-east-1", + "UseFIPS": false, + "UseDualStack": false, + "Endpoint": "https://example.com" + } + }, + { + "documentation": "For custom endpoint with region not set and fips disabled and dualstack disabled", + "expect": { + "endpoint": { + "url": "https://example.com" + } + }, + "params": { + "UseFIPS": false, + "UseDualStack": false, + "Endpoint": "https://example.com" + } + }, + { + "documentation": "For custom endpoint with fips enabled and dualstack disabled", + "expect": { + "error": "Invalid Configuration: FIPS and custom endpoint are not supported" + }, + "params": { + "Region": "us-east-1", + "UseFIPS": true, + "UseDualStack": false, + "Endpoint": "https://example.com" + } + }, + { + "documentation": "For custom endpoint with fips disabled and dualstack enabled", + "expect": { + "error": "Invalid Configuration: Dualstack and custom endpoint are not supported" + }, + "params": { + "Region": "us-east-1", + "UseFIPS": false, + "UseDualStack": true, + "Endpoint": "https://example.com" + } + }, + { + "documentation": "Missing region", + "expect": { + "error": "Invalid Configuration: Missing Region" + } + } + ], + "version": "1.0" + } + } + }, + "com.amazonaws.directoryservicedata#DirectoryUnavailableException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.directoryservicedata#ExceptionMessage" + }, + "Reason": { + "target": "com.amazonaws.directoryservicedata#DirectoryUnavailableReason", + "traits": { + "smithy.api#documentation": "

Reason the request failed for the specified directory.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The request could not be completed due to a problem in the configuration or current state\n of the specified directory.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400, + "smithy.api#retryable": {} + } + }, + "com.amazonaws.directoryservicedata#DirectoryUnavailableReason": { + "type": "enum", + "members": { + "INVALID_DIRECTORY_STATE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "INVALID_DIRECTORY_STATE" + } + }, + "DIRECTORY_TIMEOUT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DIRECTORY_TIMEOUT" + } + }, + "DIRECTORY_RESOURCES_EXCEEDED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DIRECTORY_RESOURCES_EXCEEDED" + } + }, + "NO_DISK_SPACE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NO_DISK_SPACE" + } + }, + "TRUST_AUTH_FAILURE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "TRUST_AUTH_FAILURE" + } + } + } + }, + "com.amazonaws.directoryservicedata#DisableUser": { + "type": "operation", + "input": { + "target": "com.amazonaws.directoryservicedata#DisableUserRequest" + }, + "output": { + "target": "com.amazonaws.directoryservicedata#DisableUserResult" + }, + "errors": [ + { + "target": "com.amazonaws.directoryservicedata#AccessDeniedException" + }, + { + "target": "com.amazonaws.directoryservicedata#ConflictException" + }, + { + "target": "com.amazonaws.directoryservicedata#DirectoryUnavailableException" + }, + { + "target": "com.amazonaws.directoryservicedata#InternalServerException" + }, + { + "target": "com.amazonaws.directoryservicedata#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.directoryservicedata#ThrottlingException" + }, + { + "target": "com.amazonaws.directoryservicedata#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Deactivates an active user account. For information about how to enable an inactive user\n account, see ResetUserPassword\n in the Directory Service API Reference.

", + "smithy.api#http": { + "uri": "/Users/DisableUser", + "method": "POST" + } + } + }, + "com.amazonaws.directoryservicedata#DisableUserRequest": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservicedata#DirectoryId", + "traits": { + "smithy.api#documentation": "

The identifier (ID) of the directory that's associated with the user.

", + "smithy.api#httpQuery": "DirectoryId", + "smithy.api#required": {} + } + }, + "SAMAccountName": { + "target": "com.amazonaws.directoryservicedata#UserName", + "traits": { + "smithy.api#documentation": "

The name of the user.

", + "smithy.api#required": {} + } + }, + "ClientToken": { + "target": "com.amazonaws.directoryservicedata#ClientToken", + "traits": { + "smithy.api#documentation": "

A unique and case-sensitive identifier that you provide to make sure the idempotency of\n the request, so multiple identical calls have the same effect as one single call.

\n

A client token is valid for 8 hours after the first request that uses it completes. After\n 8 hours, any request with the same client token is treated as a new request. If the request\n succeeds, any future uses of that token will be idempotent for another 8 hours.

\n

If you submit a request with the same client token but change one of the other parameters\n within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

\n \n

This parameter is optional when using the CLI or SDK.

\n
", + "smithy.api#idempotencyToken": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.directoryservicedata#DisableUserResult": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.directoryservicedata#DistinguishedName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 256 + }, + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.directoryservicedata#EmailAddress": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 256 + }, + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.directoryservicedata#ExceptionMessage": { + "type": "string" + }, + "com.amazonaws.directoryservicedata#GivenName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 64 + }, + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.directoryservicedata#Group": { + "type": "structure", + "members": { + "SID": { + "target": "com.amazonaws.directoryservicedata#SID", + "traits": { + "smithy.api#documentation": "

The unique security identifier (SID) of the group.

" + } + }, + "SAMAccountName": { + "target": "com.amazonaws.directoryservicedata#GroupName", + "traits": { + "smithy.api#documentation": "

The name of the group.

", + "smithy.api#required": {} + } + }, + "DistinguishedName": { + "target": "com.amazonaws.directoryservicedata#DistinguishedName", + "traits": { + "smithy.api#documentation": "

The distinguished name of the object.

" + } + }, + "GroupType": { + "target": "com.amazonaws.directoryservicedata#GroupType", + "traits": { + "smithy.api#documentation": "

The AD group type. For details, see Active Directory security group type.

" + } + }, + "GroupScope": { + "target": "com.amazonaws.directoryservicedata#GroupScope", + "traits": { + "smithy.api#documentation": "

The scope of the AD group. For details, see Active Directory security groups\n

" + } + }, + "OtherAttributes": { + "target": "com.amazonaws.directoryservicedata#Attributes", + "traits": { + "smithy.api#documentation": "

An expression of one or more attributes, data types, and the values of a group.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

A group object that contains identifying information and attributes for a specified\n group.

" + } + }, + "com.amazonaws.directoryservicedata#GroupList": { + "type": "list", + "member": { + "target": "com.amazonaws.directoryservicedata#Group" + } + }, + "com.amazonaws.directoryservicedata#GroupName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 64 + }, + "smithy.api#pattern": "^[^:;|=+\"*?<>/\\\\,\\[\\]@]+$" + } + }, + "com.amazonaws.directoryservicedata#GroupScope": { + "type": "enum", + "members": { + "DOMAIN_LOCAL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DomainLocal" + } + }, + "GLOBAL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Global" + } + }, + "UNIVERSAL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Universal" + } + }, + "BUILTIN_LOCAL": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "BuiltinLocal" + } + } + } + }, + "com.amazonaws.directoryservicedata#GroupSummary": { + "type": "structure", + "members": { + "SID": { + "target": "com.amazonaws.directoryservicedata#SID", + "traits": { + "smithy.api#documentation": "

The unique security identifier (SID) of the group.

", + "smithy.api#required": {} + } + }, + "SAMAccountName": { + "target": "com.amazonaws.directoryservicedata#GroupName", + "traits": { + "smithy.api#documentation": "

The name of the group.

", + "smithy.api#required": {} + } + }, + "GroupType": { + "target": "com.amazonaws.directoryservicedata#GroupType", + "traits": { + "smithy.api#documentation": "

The AD group type. For details, see Active Directory security group type.

", + "smithy.api#required": {} + } + }, + "GroupScope": { + "target": "com.amazonaws.directoryservicedata#GroupScope", + "traits": { + "smithy.api#documentation": "

The scope of the AD group. For details, see Active Directory security groups.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

A structure containing a subset of fields of a group object from a directory.

" + } + }, + "com.amazonaws.directoryservicedata#GroupSummaryList": { + "type": "list", + "member": { + "target": "com.amazonaws.directoryservicedata#GroupSummary" + } + }, + "com.amazonaws.directoryservicedata#GroupType": { + "type": "enum", + "members": { + "DISTRIBUTION": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Distribution" + } + }, + "SECURITY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Security" + } + } + } + }, + "com.amazonaws.directoryservicedata#InternalServerException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.directoryservicedata#ExceptionMessage" + } + }, + "traits": { + "smithy.api#documentation": "

The operation didn't succeed because an internal error occurred. Try again later.

", + "smithy.api#error": "server", + "smithy.api#httpError": 500, + "smithy.api#retryable": {} + } + }, + "com.amazonaws.directoryservicedata#LdapDisplayName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 63 + }, + "smithy.api#pattern": "^[A-Za-z*][A-Za-z-*]*$" + } + }, + "com.amazonaws.directoryservicedata#LdapDisplayNameList": { + "type": "list", + "member": { + "target": "com.amazonaws.directoryservicedata#LdapDisplayName" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 25 + } + } + }, + "com.amazonaws.directoryservicedata#ListGroupMembers": { + "type": "operation", + "input": { + "target": "com.amazonaws.directoryservicedata#ListGroupMembersRequest" + }, + "output": { + "target": "com.amazonaws.directoryservicedata#ListGroupMembersResult" + }, + "errors": [ + { + "target": "com.amazonaws.directoryservicedata#AccessDeniedException" + }, + { + "target": "com.amazonaws.directoryservicedata#DirectoryUnavailableException" + }, + { + "target": "com.amazonaws.directoryservicedata#InternalServerException" + }, + { + "target": "com.amazonaws.directoryservicedata#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.directoryservicedata#ThrottlingException" + }, + { + "target": "com.amazonaws.directoryservicedata#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns member information for the specified group.

\n

This operation supports pagination with the use of the NextToken request and\n response parameters. If more results are available, the\n ListGroupMembers.NextToken member contains a token that you pass in the next\n call to ListGroupMembers. This retrieves the next set of items.

\n

You can also specify a maximum number of return results with the MaxResults\n parameter.

", + "smithy.api#http": { + "uri": "/GroupMemberships/ListGroupMembers", + "method": "POST" + }, + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults", + "items": "Members" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.directoryservicedata#ListGroupMembersRequest": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservicedata#DirectoryId", + "traits": { + "smithy.api#documentation": "

The identifier (ID) of the directory that's associated with the group.

", + "smithy.api#httpQuery": "DirectoryId", + "smithy.api#required": {} + } + }, + "Realm": { + "target": "com.amazonaws.directoryservicedata#Realm", + "traits": { + "smithy.api#documentation": "

The domain name that's associated with the group.

\n \n

This parameter is optional, so you can return members from a group outside of your\n Managed Microsoft AD domain. When no value is defined, only members of your Managed Microsoft AD groups are\n returned.

\n

This value is case insensitive.

\n
" + } + }, + "MemberRealm": { + "target": "com.amazonaws.directoryservicedata#Realm", + "traits": { + "smithy.api#documentation": "

The domain name that's associated with the group member. This parameter defaults to the\n Managed Microsoft AD domain.

\n \n

This parameter is optional and case insensitive.

\n
" + } + }, + "SAMAccountName": { + "target": "com.amazonaws.directoryservicedata#GroupName", + "traits": { + "smithy.api#documentation": "

The name of the group.

", + "smithy.api#required": {} + } + }, + "NextToken": { + "target": "com.amazonaws.directoryservicedata#NextToken", + "traits": { + "smithy.api#documentation": "

An encoded paging token for paginated calls that can be passed back to retrieve the next\n page.

" + } + }, + "MaxResults": { + "target": "com.amazonaws.directoryservicedata#MaxResults", + "traits": { + "smithy.api#documentation": "

The maximum number of results to be returned per request.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.directoryservicedata#ListGroupMembersResult": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservicedata#DirectoryId", + "traits": { + "smithy.api#documentation": "

Identifier (ID) of the directory associated with the group.

" + } + }, + "Realm": { + "target": "com.amazonaws.directoryservicedata#Realm", + "traits": { + "smithy.api#documentation": "

The domain name that's associated with the group.

" + } + }, + "MemberRealm": { + "target": "com.amazonaws.directoryservicedata#Realm", + "traits": { + "smithy.api#documentation": "

The domain name that's associated with the member.

" + } + }, + "Members": { + "target": "com.amazonaws.directoryservicedata#MemberList", + "traits": { + "smithy.api#documentation": "

The member information that the request returns.

" + } + }, + "NextToken": { + "target": "com.amazonaws.directoryservicedata#NextToken", + "traits": { + "smithy.api#documentation": "

An encoded paging token for paginated calls that can be passed back to retrieve the next\n page.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.directoryservicedata#ListGroups": { + "type": "operation", + "input": { + "target": "com.amazonaws.directoryservicedata#ListGroupsRequest" + }, + "output": { + "target": "com.amazonaws.directoryservicedata#ListGroupsResult" + }, + "errors": [ + { + "target": "com.amazonaws.directoryservicedata#AccessDeniedException" + }, + { + "target": "com.amazonaws.directoryservicedata#DirectoryUnavailableException" + }, + { + "target": "com.amazonaws.directoryservicedata#InternalServerException" + }, + { + "target": "com.amazonaws.directoryservicedata#ThrottlingException" + }, + { + "target": "com.amazonaws.directoryservicedata#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns group information for the specified directory.

\n

This operation supports pagination with the use of the NextToken request and\n response parameters. If more results are available, the ListGroups.NextToken\n member contains a token that you pass in the next call to ListGroups. This\n retrieves the next set of items.

\n

You can also specify a maximum number of return results with the MaxResults\n parameter.

", + "smithy.api#http": { + "uri": "/Groups/ListGroups", + "method": "POST" + }, + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults", + "items": "Groups" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.directoryservicedata#ListGroupsForMember": { + "type": "operation", + "input": { + "target": "com.amazonaws.directoryservicedata#ListGroupsForMemberRequest" + }, + "output": { + "target": "com.amazonaws.directoryservicedata#ListGroupsForMemberResult" + }, + "errors": [ + { + "target": "com.amazonaws.directoryservicedata#AccessDeniedException" + }, + { + "target": "com.amazonaws.directoryservicedata#DirectoryUnavailableException" + }, + { + "target": "com.amazonaws.directoryservicedata#InternalServerException" + }, + { + "target": "com.amazonaws.directoryservicedata#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.directoryservicedata#ThrottlingException" + }, + { + "target": "com.amazonaws.directoryservicedata#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns group information for the specified member.

\n

This operation supports pagination with the use of the NextToken request and\n response parameters. If more results are available, the\n ListGroupsForMember.NextToken member contains a token that you pass in the next\n call to ListGroupsForMember. This retrieves the next set of items.

\n

You can also specify a maximum number of return results with the MaxResults\n parameter.

", + "smithy.api#http": { + "uri": "/GroupMemberships/ListGroupsForMember", + "method": "POST" + }, + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults", + "items": "Groups" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.directoryservicedata#ListGroupsForMemberRequest": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservicedata#DirectoryId", + "traits": { + "smithy.api#documentation": "

The identifier (ID) of the directory that's associated with the member.

", + "smithy.api#httpQuery": "DirectoryId", + "smithy.api#required": {} + } + }, + "Realm": { + "target": "com.amazonaws.directoryservicedata#Realm", + "traits": { + "smithy.api#documentation": "

The domain name that's associated with the group.

\n \n

This parameter is optional, so you can return groups outside of your Managed Microsoft AD\n domain. When no value is defined, only your Managed Microsoft AD groups are returned.

\n

This value is case insensitive and defaults to your Managed Microsoft AD domain.

\n
" + } + }, + "MemberRealm": { + "target": "com.amazonaws.directoryservicedata#Realm", + "traits": { + "smithy.api#documentation": "

The domain name that's associated with the group member.

\n \n

This parameter is optional, so you can limit your results to the group members in a\n specific domain.

\n

This parameter is case insensitive and defaults to Realm\n

\n
" + } + }, + "SAMAccountName": { + "target": "com.amazonaws.directoryservicedata#MemberName", + "traits": { + "smithy.api#documentation": "

The SAMAccountName of the user, group, or computer that's a member of the\n group.

", + "smithy.api#required": {} + } + }, + "NextToken": { + "target": "com.amazonaws.directoryservicedata#NextToken", + "traits": { + "smithy.api#documentation": "

An encoded paging token for paginated calls that can be passed back to retrieve the next\n page.

" + } + }, + "MaxResults": { + "target": "com.amazonaws.directoryservicedata#MaxResults", + "traits": { + "smithy.api#documentation": "

The maximum number of results to be returned per request.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.directoryservicedata#ListGroupsForMemberResult": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservicedata#DirectoryId", + "traits": { + "smithy.api#documentation": "

The identifier (ID) of the directory that's associated with the member.

" + } + }, + "Realm": { + "target": "com.amazonaws.directoryservicedata#Realm", + "traits": { + "smithy.api#documentation": "

The domain that's associated with the group.

" + } + }, + "MemberRealm": { + "target": "com.amazonaws.directoryservicedata#Realm", + "traits": { + "smithy.api#documentation": "

The domain that's associated with the member.

" + } + }, + "Groups": { + "target": "com.amazonaws.directoryservicedata#GroupSummaryList", + "traits": { + "smithy.api#documentation": "

The group information that the request returns.

" + } + }, + "NextToken": { + "target": "com.amazonaws.directoryservicedata#NextToken", + "traits": { + "smithy.api#documentation": "

An encoded paging token for paginated calls that can be passed back to retrieve the next\n page.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.directoryservicedata#ListGroupsRequest": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservicedata#DirectoryId", + "traits": { + "smithy.api#documentation": "

The identifier (ID) of the directory that's associated with the group.

", + "smithy.api#httpQuery": "DirectoryId", + "smithy.api#required": {} + } + }, + "Realm": { + "target": "com.amazonaws.directoryservicedata#Realm", + "traits": { + "smithy.api#documentation": "

The domain name associated with the directory.

\n \n

This parameter is optional, so you can return groups outside of your Managed Microsoft AD\n domain. When no value is defined, only your Managed Microsoft AD groups are returned.

\n

This value is case insensitive.

\n
" + } + }, + "NextToken": { + "target": "com.amazonaws.directoryservicedata#NextToken", + "traits": { + "smithy.api#documentation": "

An encoded paging token for paginated calls that can be passed back to retrieve the next\n page.

" + } + }, + "MaxResults": { + "target": "com.amazonaws.directoryservicedata#MaxResults", + "traits": { + "smithy.api#documentation": "

The maximum number of results to be returned per request.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.directoryservicedata#ListGroupsResult": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservicedata#DirectoryId", + "traits": { + "smithy.api#documentation": "

The identifier (ID) of the directory that's associated with the group.

" + } + }, + "Realm": { + "target": "com.amazonaws.directoryservicedata#Realm", + "traits": { + "smithy.api#documentation": "

The domain name associated with the group.

" + } + }, + "Groups": { + "target": "com.amazonaws.directoryservicedata#GroupSummaryList", + "traits": { + "smithy.api#documentation": "

The group information that the request returns.

" + } + }, + "NextToken": { + "target": "com.amazonaws.directoryservicedata#NextToken", + "traits": { + "smithy.api#documentation": "

An encoded paging token for paginated calls that can be passed back to retrieve the next\n page.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.directoryservicedata#ListUsers": { + "type": "operation", + "input": { + "target": "com.amazonaws.directoryservicedata#ListUsersRequest" + }, + "output": { + "target": "com.amazonaws.directoryservicedata#ListUsersResult" + }, + "errors": [ + { + "target": "com.amazonaws.directoryservicedata#AccessDeniedException" + }, + { + "target": "com.amazonaws.directoryservicedata#DirectoryUnavailableException" + }, + { + "target": "com.amazonaws.directoryservicedata#InternalServerException" + }, + { + "target": "com.amazonaws.directoryservicedata#ThrottlingException" + }, + { + "target": "com.amazonaws.directoryservicedata#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns user information for the specified directory.

\n

This operation supports pagination with the use of the NextToken request and\n response parameters. If more results are available, the ListUsers.NextToken\n member contains a token that you pass in the next call to ListUsers. This\n retrieves the next set of items.

\n

You can also specify a maximum number of return results with the MaxResults\n parameter.

", + "smithy.api#http": { + "uri": "/Users/ListUsers", + "method": "POST" + }, + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults", + "items": "Users" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.directoryservicedata#ListUsersRequest": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservicedata#DirectoryId", + "traits": { + "smithy.api#documentation": "

The identifier (ID) of the directory that's associated with the user.

", + "smithy.api#httpQuery": "DirectoryId", + "smithy.api#required": {} + } + }, + "Realm": { + "target": "com.amazonaws.directoryservicedata#Realm", + "traits": { + "smithy.api#documentation": "

The domain name that's associated with the user.

\n \n

This parameter is optional, so you can return users outside of your Managed Microsoft AD\n domain. When no value is defined, only your Managed Microsoft AD users are returned.

\n

This value is case insensitive.

\n
" + } + }, + "NextToken": { + "target": "com.amazonaws.directoryservicedata#NextToken", + "traits": { + "smithy.api#documentation": "

An encoded paging token for paginated calls that can be passed back to retrieve the next\n page.

" + } + }, + "MaxResults": { + "target": "com.amazonaws.directoryservicedata#MaxResults", + "traits": { + "smithy.api#documentation": "

The maximum number of results to be returned per request.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.directoryservicedata#ListUsersResult": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservicedata#DirectoryId", + "traits": { + "smithy.api#documentation": "

The identifier (ID) of the directory that's associated with the user.

" + } + }, + "Realm": { + "target": "com.amazonaws.directoryservicedata#Realm", + "traits": { + "smithy.api#documentation": "

The domain that's associated with the user.

" + } + }, + "Users": { + "target": "com.amazonaws.directoryservicedata#UserSummaryList", + "traits": { + "smithy.api#documentation": "

The user information that the request returns.

" + } + }, + "NextToken": { + "target": "com.amazonaws.directoryservicedata#NextToken", + "traits": { + "smithy.api#documentation": "

An encoded paging token for paginated calls that can be passed back to retrieve the next\n page.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.directoryservicedata#MaxResults": { + "type": "integer", + "traits": { + "smithy.api#range": { + "min": 1, + "max": 250 + } + } + }, + "com.amazonaws.directoryservicedata#Member": { + "type": "structure", + "members": { + "SID": { + "target": "com.amazonaws.directoryservicedata#SID", + "traits": { + "smithy.api#documentation": "

The unique security identifier (SID) of the group member.

", + "smithy.api#required": {} + } + }, + "SAMAccountName": { + "target": "com.amazonaws.directoryservicedata#MemberName", + "traits": { + "smithy.api#documentation": "

The name of the group member.

", + "smithy.api#required": {} + } + }, + "MemberType": { + "target": "com.amazonaws.directoryservicedata#MemberType", + "traits": { + "smithy.api#documentation": "

The AD type of the member object.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

A member object that contains identifying information for a specified member.

" + } + }, + "com.amazonaws.directoryservicedata#MemberList": { + "type": "list", + "member": { + "target": "com.amazonaws.directoryservicedata#Member" + } + }, + "com.amazonaws.directoryservicedata#MemberName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 63 + }, + "smithy.api#pattern": "^[^:;|=+\"*?<>/\\\\,\\[\\]@]+$" + } + }, + "com.amazonaws.directoryservicedata#MemberType": { + "type": "enum", + "members": { + "USER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "USER" + } + }, + "GROUP": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "GROUP" + } + }, + "COMPUTER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "COMPUTER" + } + } + } + }, + "com.amazonaws.directoryservicedata#NextToken": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 6144 + }, + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.directoryservicedata#NumberAttributeValue": { + "type": "long", + "traits": { + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.directoryservicedata#Realm": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 255 + }, + "smithy.api#pattern": "^([a-zA-Z0-9]+[\\\\.-])+([a-zA-Z0-9])+[.]?$" + } + }, + "com.amazonaws.directoryservicedata#RemoveGroupMember": { + "type": "operation", + "input": { + "target": "com.amazonaws.directoryservicedata#RemoveGroupMemberRequest" + }, + "output": { + "target": "com.amazonaws.directoryservicedata#RemoveGroupMemberResult" + }, + "errors": [ + { + "target": "com.amazonaws.directoryservicedata#AccessDeniedException" + }, + { + "target": "com.amazonaws.directoryservicedata#ConflictException" + }, + { + "target": "com.amazonaws.directoryservicedata#DirectoryUnavailableException" + }, + { + "target": "com.amazonaws.directoryservicedata#InternalServerException" + }, + { + "target": "com.amazonaws.directoryservicedata#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.directoryservicedata#ThrottlingException" + }, + { + "target": "com.amazonaws.directoryservicedata#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Removes a member from a group.

", + "smithy.api#http": { + "uri": "/GroupMemberships/RemoveGroupMember", + "method": "POST" + } + } + }, + "com.amazonaws.directoryservicedata#RemoveGroupMemberRequest": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservicedata#DirectoryId", + "traits": { + "smithy.api#documentation": "

The identifier (ID) of the directory that's associated with the member.

", + "smithy.api#httpQuery": "DirectoryId", + "smithy.api#required": {} + } + }, + "GroupName": { + "target": "com.amazonaws.directoryservicedata#GroupName", + "traits": { + "smithy.api#documentation": "

The name of the group.

", + "smithy.api#required": {} + } + }, + "MemberName": { + "target": "com.amazonaws.directoryservicedata#MemberName", + "traits": { + "smithy.api#documentation": "

The SAMAccountName of the user, group, or computer to remove from the group.\n

", + "smithy.api#required": {} + } + }, + "MemberRealm": { + "target": "com.amazonaws.directoryservicedata#Realm", + "traits": { + "smithy.api#documentation": "

The domain name that's associated with the group member. This parameter defaults to the\n Managed Microsoft AD domain.

\n \n

This parameter is optional and case insensitive.

\n
" + } + }, + "ClientToken": { + "target": "com.amazonaws.directoryservicedata#ClientToken", + "traits": { + "smithy.api#documentation": "

A unique and case-sensitive identifier that you provide to make sure the idempotency of\n the request, so multiple identical calls have the same effect as one single call.

\n

A client token is valid for 8 hours after the first request that uses it completes. After\n 8 hours, any request with the same client token is treated as a new request. If the request\n succeeds, any future uses of that token will be idempotent for another 8 hours.

\n

If you submit a request with the same client token but change one of the other parameters\n within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

\n \n

This parameter is optional when using the CLI or SDK.

\n
", + "smithy.api#idempotencyToken": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.directoryservicedata#RemoveGroupMemberResult": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.directoryservicedata#ResourceNotFoundException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.directoryservicedata#ExceptionMessage" + } + }, + "traits": { + "smithy.api#documentation": "

The resource couldn't be found.

", + "smithy.api#error": "client", + "smithy.api#httpError": 404 + } + }, + "com.amazonaws.directoryservicedata#SID": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 256 + } + } + }, + "com.amazonaws.directoryservicedata#SearchGroups": { + "type": "operation", + "input": { + "target": "com.amazonaws.directoryservicedata#SearchGroupsRequest" + }, + "output": { + "target": "com.amazonaws.directoryservicedata#SearchGroupsResult" + }, + "errors": [ + { + "target": "com.amazonaws.directoryservicedata#AccessDeniedException" + }, + { + "target": "com.amazonaws.directoryservicedata#DirectoryUnavailableException" + }, + { + "target": "com.amazonaws.directoryservicedata#InternalServerException" + }, + { + "target": "com.amazonaws.directoryservicedata#ThrottlingException" + }, + { + "target": "com.amazonaws.directoryservicedata#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Searches the specified directory for a group. You can find groups that match the\n SearchString parameter with the value of their attributes included in the\n SearchString parameter.

\n

This operation supports pagination with the use of the NextToken request and\n response parameters. If more results are available, the SearchGroups.NextToken\n member contains a token that you pass in the next call to SearchGroups. This\n retrieves the next set of items.

\n

You can also specify a maximum number of return results with the MaxResults\n parameter.

", + "smithy.api#http": { + "uri": "/Groups/SearchGroups", + "method": "POST" + }, + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults", + "items": "Groups" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.directoryservicedata#SearchGroupsRequest": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservicedata#DirectoryId", + "traits": { + "smithy.api#documentation": "

The identifier (ID) of the directory that's associated with the group.

", + "smithy.api#httpQuery": "DirectoryId", + "smithy.api#required": {} + } + }, + "SearchString": { + "target": "com.amazonaws.directoryservicedata#SearchString", + "traits": { + "smithy.api#documentation": "

The attribute value that you want to search for.

\n \n

Wildcard (*) searches aren't supported. For a list of supported\n attributes, see Directory Service Data\n Attributes.

\n
", + "smithy.api#required": {} + } + }, + "SearchAttributes": { + "target": "com.amazonaws.directoryservicedata#LdapDisplayNameList", + "traits": { + "smithy.api#documentation": "

One or more data attributes that are used to search for a group. For a list of supported\n attributes, see Directory Service Data Attributes.\n

", + "smithy.api#required": {} + } + }, + "Realm": { + "target": "com.amazonaws.directoryservicedata#Realm", + "traits": { + "smithy.api#documentation": "

The domain name that's associated with the group.

\n \n

This parameter is optional, so you can return groups outside of your Managed Microsoft AD\n domain. When no value is defined, only your Managed Microsoft AD groups are returned.

\n

This value is case insensitive.

\n
" + } + }, + "NextToken": { + "target": "com.amazonaws.directoryservicedata#NextToken", + "traits": { + "smithy.api#documentation": "

An encoded paging token for paginated calls that can be passed back to retrieve the next\n page.

" + } + }, + "MaxResults": { + "target": "com.amazonaws.directoryservicedata#MaxResults", + "traits": { + "smithy.api#documentation": "

The maximum number of results to be returned per request.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.directoryservicedata#SearchGroupsResult": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservicedata#DirectoryId", + "traits": { + "smithy.api#documentation": "

The identifier (ID) of the directory that's associated with the group.

" + } + }, + "Realm": { + "target": "com.amazonaws.directoryservicedata#Realm", + "traits": { + "smithy.api#documentation": "

The domain that's associated with the group.

" + } + }, + "Groups": { + "target": "com.amazonaws.directoryservicedata#GroupList", + "traits": { + "smithy.api#documentation": "

The group information that the request returns.

" + } + }, + "NextToken": { + "target": "com.amazonaws.directoryservicedata#NextToken", + "traits": { + "smithy.api#documentation": "

An encoded paging token for paginated calls that can be passed back to retrieve the next\n page.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.directoryservicedata#SearchString": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 64 + }, + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.directoryservicedata#SearchUsers": { + "type": "operation", + "input": { + "target": "com.amazonaws.directoryservicedata#SearchUsersRequest" + }, + "output": { + "target": "com.amazonaws.directoryservicedata#SearchUsersResult" + }, + "errors": [ + { + "target": "com.amazonaws.directoryservicedata#AccessDeniedException" + }, + { + "target": "com.amazonaws.directoryservicedata#DirectoryUnavailableException" + }, + { + "target": "com.amazonaws.directoryservicedata#InternalServerException" + }, + { + "target": "com.amazonaws.directoryservicedata#ThrottlingException" + }, + { + "target": "com.amazonaws.directoryservicedata#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Searches the specified directory for a user. You can find users that match the\n SearchString parameter with the value of their attributes included in the\n SearchString parameter.

\n

This operation supports pagination with the use of the NextToken request and\n response parameters. If more results are available, the SearchUsers.NextToken\n member contains a token that you pass in the next call to SearchUsers. This\n retrieves the next set of items.

\n

You can also specify a maximum number of return results with the MaxResults\n parameter.

", + "smithy.api#http": { + "uri": "/Users/SearchUsers", + "method": "POST" + }, + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "pageSize": "MaxResults", + "items": "Users" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.directoryservicedata#SearchUsersRequest": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservicedata#DirectoryId", + "traits": { + "smithy.api#documentation": "

The identifier (ID) of the directory that's associated with the user.

", + "smithy.api#httpQuery": "DirectoryId", + "smithy.api#required": {} + } + }, + "Realm": { + "target": "com.amazonaws.directoryservicedata#Realm", + "traits": { + "smithy.api#documentation": "

The domain name that's associated with the user.

\n \n

This parameter is optional, so you can return users outside of your Managed Microsoft AD\n domain. When no value is defined, only your Managed Microsoft AD users are returned.

\n

This value is case insensitive.

\n
" + } + }, + "SearchString": { + "target": "com.amazonaws.directoryservicedata#SearchString", + "traits": { + "smithy.api#documentation": "

The attribute value that you want to search for.

\n \n

Wildcard (*) searches aren't supported. For a list of supported\n attributes, see Directory Service Data\n Attributes.

\n
", + "smithy.api#required": {} + } + }, + "SearchAttributes": { + "target": "com.amazonaws.directoryservicedata#LdapDisplayNameList", + "traits": { + "smithy.api#documentation": "

One or more data attributes that are used to search for a user. For a list of supported\n attributes, see Directory Service Data Attributes.\n

", + "smithy.api#required": {} + } + }, + "NextToken": { + "target": "com.amazonaws.directoryservicedata#NextToken", + "traits": { + "smithy.api#documentation": "

An encoded paging token for paginated calls that can be passed back to retrieve the next\n page.

" + } + }, + "MaxResults": { + "target": "com.amazonaws.directoryservicedata#MaxResults", + "traits": { + "smithy.api#documentation": "

The maximum number of results to be returned per request.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.directoryservicedata#SearchUsersResult": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservicedata#DirectoryId", + "traits": { + "smithy.api#documentation": "

The identifier (ID) of the directory where the address block is added.

" + } + }, + "Realm": { + "target": "com.amazonaws.directoryservicedata#Realm", + "traits": { + "smithy.api#documentation": "

The domain that's associated with the user.

" + } + }, + "Users": { + "target": "com.amazonaws.directoryservicedata#UserList", + "traits": { + "smithy.api#documentation": "

The user information that the request returns.

" + } + }, + "NextToken": { + "target": "com.amazonaws.directoryservicedata#NextToken", + "traits": { + "smithy.api#documentation": "

An encoded paging token for paginated calls that can be passed back to retrieve the next\n page.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.directoryservicedata#StringAttributeValue": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1024 + }, + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.directoryservicedata#StringSetAttributeValue": { + "type": "list", + "member": { + "target": "com.amazonaws.directoryservicedata#StringAttributeValue" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 25 + }, + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.directoryservicedata#Surname": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 64 + }, + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.directoryservicedata#ThrottlingException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.directoryservicedata#ExceptionMessage", + "traits": { + "smithy.api#required": {} + } + }, + "RetryAfterSeconds": { + "target": "smithy.api#Integer", + "traits": { + "smithy.api#documentation": "

The recommended amount of seconds to retry after a throttling exception.

", + "smithy.api#httpHeader": "Retry-After" + } + } + }, + "traits": { + "smithy.api#documentation": "

The limit on the number of requests per second has been exceeded.

", + "smithy.api#error": "client", + "smithy.api#httpError": 429, + "smithy.api#retryable": { + "throttling": true + } + } + }, + "com.amazonaws.directoryservicedata#UpdateGroup": { + "type": "operation", + "input": { + "target": "com.amazonaws.directoryservicedata#UpdateGroupRequest" + }, + "output": { + "target": "com.amazonaws.directoryservicedata#UpdateGroupResult" + }, + "errors": [ + { + "target": "com.amazonaws.directoryservicedata#AccessDeniedException" + }, + { + "target": "com.amazonaws.directoryservicedata#ConflictException" + }, + { + "target": "com.amazonaws.directoryservicedata#DirectoryUnavailableException" + }, + { + "target": "com.amazonaws.directoryservicedata#InternalServerException" + }, + { + "target": "com.amazonaws.directoryservicedata#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.directoryservicedata#ThrottlingException" + }, + { + "target": "com.amazonaws.directoryservicedata#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Updates group information.

", + "smithy.api#http": { + "uri": "/Groups/UpdateGroup", + "method": "POST" + } + } + }, + "com.amazonaws.directoryservicedata#UpdateGroupRequest": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservicedata#DirectoryId", + "traits": { + "smithy.api#documentation": "

The identifier (ID) of the directory that's associated with the group.

", + "smithy.api#httpQuery": "DirectoryId", + "smithy.api#required": {} + } + }, + "SAMAccountName": { + "target": "com.amazonaws.directoryservicedata#GroupName", + "traits": { + "smithy.api#documentation": "

The name of the group.

", + "smithy.api#required": {} + } + }, + "GroupType": { + "target": "com.amazonaws.directoryservicedata#GroupType", + "traits": { + "smithy.api#documentation": "

The AD group type. For details, see Active Directory security group type.

" + } + }, + "GroupScope": { + "target": "com.amazonaws.directoryservicedata#GroupScope", + "traits": { + "smithy.api#documentation": "

The scope of the AD group. For details, see Active Directory security groups.

" + } + }, + "OtherAttributes": { + "target": "com.amazonaws.directoryservicedata#Attributes", + "traits": { + "smithy.api#documentation": "

An expression that defines one or more attributes with the data type and the value of\n each attribute.

" + } + }, + "UpdateType": { + "target": "com.amazonaws.directoryservicedata#UpdateType", + "traits": { + "smithy.api#documentation": "

The type of update to be performed. If no value exists for the attribute, use\n ADD. Otherwise, use REPLACE to change an attribute value or\n REMOVE to clear the attribute value.

" + } + }, + "ClientToken": { + "target": "com.amazonaws.directoryservicedata#ClientToken", + "traits": { + "smithy.api#documentation": "

A unique and case-sensitive identifier that you provide to make sure the idempotency of\n the request, so multiple identical calls have the same effect as one single call.

\n

A client token is valid for 8 hours after the first request that uses it completes. After\n 8 hours, any request with the same client token is treated as a new request. If the request\n succeeds, any future uses of that token will be idempotent for another 8 hours.

\n

If you submit a request with the same client token but change one of the other parameters\n within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

\n \n

This parameter is optional when using the CLI or SDK.

\n
", + "smithy.api#idempotencyToken": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.directoryservicedata#UpdateGroupResult": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.directoryservicedata#UpdateType": { + "type": "enum", + "members": { + "ADD": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ADD" + } + }, + "REPLACE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "REPLACE" + } + }, + "REMOVE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "REMOVE" + } + } + } + }, + "com.amazonaws.directoryservicedata#UpdateUser": { + "type": "operation", + "input": { + "target": "com.amazonaws.directoryservicedata#UpdateUserRequest" + }, + "output": { + "target": "com.amazonaws.directoryservicedata#UpdateUserResult" + }, + "errors": [ + { + "target": "com.amazonaws.directoryservicedata#AccessDeniedException" + }, + { + "target": "com.amazonaws.directoryservicedata#ConflictException" + }, + { + "target": "com.amazonaws.directoryservicedata#DirectoryUnavailableException" + }, + { + "target": "com.amazonaws.directoryservicedata#InternalServerException" + }, + { + "target": "com.amazonaws.directoryservicedata#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.directoryservicedata#ThrottlingException" + }, + { + "target": "com.amazonaws.directoryservicedata#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Updates user information.

", + "smithy.api#http": { + "uri": "/Users/UpdateUser", + "method": "POST" + } + } + }, + "com.amazonaws.directoryservicedata#UpdateUserRequest": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservicedata#DirectoryId", + "traits": { + "smithy.api#documentation": "

The identifier (ID) of the directory that's associated with the user.

", + "smithy.api#httpQuery": "DirectoryId", + "smithy.api#required": {} + } + }, + "SAMAccountName": { + "target": "com.amazonaws.directoryservicedata#UserName", + "traits": { + "smithy.api#documentation": "

The name of the user.

", + "smithy.api#required": {} + } + }, + "EmailAddress": { + "target": "com.amazonaws.directoryservicedata#EmailAddress", + "traits": { + "smithy.api#documentation": "

The email address of the user.

" + } + }, + "GivenName": { + "target": "com.amazonaws.directoryservicedata#GivenName", + "traits": { + "smithy.api#documentation": "

The first name of the user.

" + } + }, + "Surname": { + "target": "com.amazonaws.directoryservicedata#Surname", + "traits": { + "smithy.api#documentation": "

The last name of the user.

" + } + }, + "OtherAttributes": { + "target": "com.amazonaws.directoryservicedata#Attributes", + "traits": { + "smithy.api#documentation": "

An expression that defines one or more attribute names with the data type and value of\n each attribute. A key is an attribute name, and the value is a list of maps. For a list of\n supported attributes, see Directory Service Data Attributes.

\n \n

Attribute names are case insensitive.

\n
" + } + }, + "UpdateType": { + "target": "com.amazonaws.directoryservicedata#UpdateType", + "traits": { + "smithy.api#documentation": "

The type of update to be performed. If no value exists for the attribute, use\n ADD. Otherwise, use REPLACE to change an attribute value or\n REMOVE to clear the attribute value.

" + } + }, + "ClientToken": { + "target": "com.amazonaws.directoryservicedata#ClientToken", + "traits": { + "smithy.api#documentation": "

A unique and case-sensitive identifier that you provide to make sure the idempotency of\n the request, so multiple identical calls have the same effect as one single call.

\n

A client token is valid for 8 hours after the first request that uses it completes. After\n 8 hours, any request with the same client token is treated as a new request. If the request\n succeeds, any future uses of that token will be idempotent for another 8 hours.

\n

If you submit a request with the same client token but change one of the other parameters\n within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

\n \n

This parameter is optional when using the CLI or SDK.

\n
", + "smithy.api#idempotencyToken": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.directoryservicedata#UpdateUserResult": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.directoryservicedata#User": { + "type": "structure", + "members": { + "SID": { + "target": "com.amazonaws.directoryservicedata#SID", + "traits": { + "smithy.api#documentation": "

The unique security identifier (SID) of the user.

" + } + }, + "SAMAccountName": { + "target": "com.amazonaws.directoryservicedata#UserName", + "traits": { + "smithy.api#documentation": "

The name of the user.

", + "smithy.api#required": {} + } + }, + "DistinguishedName": { + "target": "com.amazonaws.directoryservicedata#DistinguishedName", + "traits": { + "smithy.api#documentation": "

The distinguished name of the object.

" + } + }, + "UserPrincipalName": { + "target": "com.amazonaws.directoryservicedata#UserPrincipalName", + "traits": { + "smithy.api#documentation": "

The UPN that is an internet-style login name for a user and based on the internet\n standard RFC 822. The UPN is shorter\n than the distinguished name and easier to remember.

" + } + }, + "EmailAddress": { + "target": "com.amazonaws.directoryservicedata#EmailAddress", + "traits": { + "smithy.api#documentation": "

The email address of the user.

" + } + }, + "GivenName": { + "target": "com.amazonaws.directoryservicedata#GivenName", + "traits": { + "smithy.api#documentation": "

The first name of the user.

" + } + }, + "Surname": { + "target": "com.amazonaws.directoryservicedata#Surname", + "traits": { + "smithy.api#documentation": "

The last name of the user.

" + } + }, + "Enabled": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "

Indicates whether the user account is active.

" + } + }, + "OtherAttributes": { + "target": "com.amazonaws.directoryservicedata#Attributes", + "traits": { + "smithy.api#documentation": "

An expression that includes one or more attributes, data types, and values of a\n user.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

A user object that contains identifying information and attributes for a specified user.\n

" + } + }, + "com.amazonaws.directoryservicedata#UserList": { + "type": "list", + "member": { + "target": "com.amazonaws.directoryservicedata#User" + } + }, + "com.amazonaws.directoryservicedata#UserName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 20 + }, + "smithy.api#pattern": "^[\\w\\-.]+$" + } + }, + "com.amazonaws.directoryservicedata#UserPrincipalName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 256 + }, + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.directoryservicedata#UserSummary": { + "type": "structure", + "members": { + "SID": { + "target": "com.amazonaws.directoryservicedata#SID", + "traits": { + "smithy.api#documentation": "

The unique security identifier (SID) of the user.

", + "smithy.api#required": {} + } + }, + "SAMAccountName": { + "target": "com.amazonaws.directoryservicedata#UserName", + "traits": { + "smithy.api#documentation": "

The name of the user.

", + "smithy.api#required": {} + } + }, + "GivenName": { + "target": "com.amazonaws.directoryservicedata#GivenName", + "traits": { + "smithy.api#documentation": "

The first name of the user.

" + } + }, + "Surname": { + "target": "com.amazonaws.directoryservicedata#Surname", + "traits": { + "smithy.api#documentation": "

The last name of the user.

" + } + }, + "Enabled": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "

Indicates whether the user account is active.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

A structure containing a subset of the fields of a user object from a directory.

" + } + }, + "com.amazonaws.directoryservicedata#UserSummaryList": { + "type": "list", + "member": { + "target": "com.amazonaws.directoryservicedata#UserSummary" + } + }, + "com.amazonaws.directoryservicedata#ValidationException": { + "type": "structure", + "members": { + "Message": { + "target": "com.amazonaws.directoryservicedata#ExceptionMessage" + }, + "Reason": { + "target": "com.amazonaws.directoryservicedata#ValidationExceptionReason", + "traits": { + "smithy.api#documentation": "

Reason the request failed validation.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The request isn't valid. Review the details in the error message to update the invalid\n parameters or values in your request.

", + "smithy.api#error": "client", + "smithy.api#httpError": 400 + } + }, + "com.amazonaws.directoryservicedata#ValidationExceptionReason": { + "type": "enum", + "members": { + "INVALID_REALM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "INVALID_REALM" + } + }, + "INVALID_DIRECTORY_TYPE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "INVALID_DIRECTORY_TYPE" + } + }, + "INVALID_SECONDARY_REGION": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "INVALID_SECONDARY_REGION" + } + }, + "INVALID_NEXT_TOKEN": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "INVALID_NEXT_TOKEN" + } + }, + "INVALID_ATTRIBUTE_VALUE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "INVALID_ATTRIBUTE_VALUE" + } + }, + "INVALID_ATTRIBUTE_NAME": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "INVALID_ATTRIBUTE_NAME" + } + }, + "INVALID_ATTRIBUTE_FOR_USER": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "INVALID_ATTRIBUTE_FOR_USER" + } + }, + "INVALID_ATTRIBUTE_FOR_GROUP": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "INVALID_ATTRIBUTE_FOR_GROUP" + } + }, + "INVALID_ATTRIBUTE_FOR_SEARCH": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "INVALID_ATTRIBUTE_FOR_SEARCH" + } + }, + "INVALID_ATTRIBUTE_FOR_MODIFY": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "INVALID_ATTRIBUTE_FOR_MODIFY" + } + }, + "DUPLICATE_ATTRIBUTE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "DUPLICATE_ATTRIBUTE" + } + }, + "MISSING_ATTRIBUTE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "MISSING_ATTRIBUTE" + } + }, + "ATTRIBUTE_EXISTS": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "ATTRIBUTE_EXISTS" + } + }, + "LDAP_SIZE_LIMIT_EXCEEDED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LDAP_SIZE_LIMIT_EXCEEDED" + } + }, + "LDAP_UNSUPPORTED_OPERATION": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LDAP_UNSUPPORTED_OPERATION" + } + } + } + } + } +} \ No newline at end of file diff --git a/aws-models/directory-service.json b/aws-models/directory-service.json index f7c9f940be47..abef873a0e03 100644 --- a/aws-models/directory-service.json +++ b/aws-models/directory-service.json @@ -98,7 +98,7 @@ } }, "traits": { - "smithy.api#documentation": "

Client authentication is not available in this region at this time.

", + "smithy.api#documentation": "

You do not have sufficient access to perform this action.

", "smithy.api#error": "client" } }, @@ -167,7 +167,7 @@ "target": "com.amazonaws.directoryservice#UpdateSecurityGroupForDirectoryControllers", "traits": { "smithy.api#default": false, - "smithy.api#documentation": "

If set to true, updates the inbound and outbound rules of the security group that has\n the description: \"Amazon Web Services created security group for directory ID\n directory controllers.\" Following are the new rules:

\n

Inbound:

\n \n

\n

Outbound:

\n \n

These security rules impact an internal network interface that is not exposed\n publicly.

" + "smithy.api#documentation": "

If set to true, updates the inbound and outbound rules of the security group that has\n the description: \"Amazon Web Services created security group for directory ID\n directory controllers.\" Following are the new rules:

\n

Inbound:

\n \n

\n

Outbound:

\n \n

These security rules impact an internal network interface that is not exposed\n publicly.

" } } }, @@ -1630,7 +1630,7 @@ "TrustPassword": { "target": "com.amazonaws.directoryservice#TrustPassword", "traits": { - "smithy.api#documentation": "

The trust password. The must be the same password that was used when creating the trust\n relationship on the external domain.

", + "smithy.api#documentation": "

The trust password. The trust password must be the same password that was used when creating the trust\n relationship on the external domain.

", "smithy.api#required": {} } }, @@ -1699,6 +1699,41 @@ "smithy.api#pattern": "^(?!.*\\\\|.*\"|.*\\/|.*\\[|.*\\]|.*:|.*;|.*\\||.*=|.*,|.*\\+|.*\\*|.*\\?|.*<|.*>|.*@).*$" } }, + "com.amazonaws.directoryservice#DataAccessStatus": { + "type": "enum", + "members": { + "DISABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Disabled" + } + }, + "DISABLING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Disabling" + } + }, + "ENABLED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Enabled" + } + }, + "ENABLING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Enabling" + } + }, + "FAILED": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Failed" + } + } + } + }, "com.amazonaws.directoryservice#DeleteAssociatedConditionalForwarder": { "type": "boolean", "traits": { @@ -2442,6 +2477,64 @@ "smithy.api#output": {} } }, + "com.amazonaws.directoryservice#DescribeDirectoryDataAccess": { + "type": "operation", + "input": { + "target": "com.amazonaws.directoryservice#DescribeDirectoryDataAccessRequest" + }, + "output": { + "target": "com.amazonaws.directoryservice#DescribeDirectoryDataAccessResult" + }, + "errors": [ + { + "target": "com.amazonaws.directoryservice#AccessDeniedException" + }, + { + "target": "com.amazonaws.directoryservice#ClientException" + }, + { + "target": "com.amazonaws.directoryservice#DirectoryDoesNotExistException" + }, + { + "target": "com.amazonaws.directoryservice#ServiceException" + }, + { + "target": "com.amazonaws.directoryservice#UnsupportedOperationException" + } + ], + "traits": { + "smithy.api#documentation": "

Obtains status of directory data access enablement through the Directory Service Data API for the specified directory.

" + } + }, + "com.amazonaws.directoryservice#DescribeDirectoryDataAccessRequest": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservice#DirectoryId", + "traits": { + "smithy.api#documentation": "

The directory identifier.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.directoryservice#DescribeDirectoryDataAccessResult": { + "type": "structure", + "members": { + "DataAccessStatus": { + "target": "com.amazonaws.directoryservice#DataAccessStatus", + "traits": { + "smithy.api#documentation": "

The current status of data access through the Directory Service Data API.

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.directoryservice#DescribeDomainControllers": { "type": "operation", "input": { @@ -2849,7 +2942,7 @@ "NextToken": { "target": "com.amazonaws.directoryservice#NextToken", "traits": { - "smithy.api#documentation": "

If not null, token that indicates that more results are available. Pass this value for the NextToken parameter in a subsequent call to DescribeSettings to retrieve the next set of items.

" + "smithy.api#documentation": "

If not null, token that indicates that more results are available. \n Pass this value for the NextToken parameter in a subsequent \n call to DescribeSettings to retrieve the next set of items.

" } } }, @@ -3526,7 +3619,7 @@ "Type": { "target": "com.amazonaws.directoryservice#DirectoryType", "traits": { - "smithy.api#documentation": "

The directory size.

" + "smithy.api#documentation": "

The directory type.

" } }, "VpcSettings": { @@ -3846,6 +3939,9 @@ { "target": "com.amazonaws.directoryservice#DescribeDirectories" }, + { + "target": "com.amazonaws.directoryservice#DescribeDirectoryDataAccess" + }, { "target": "com.amazonaws.directoryservice#DescribeDomainControllers" }, @@ -3876,6 +3972,9 @@ { "target": "com.amazonaws.directoryservice#DisableClientAuthentication" }, + { + "target": "com.amazonaws.directoryservice#DisableDirectoryDataAccess" + }, { "target": "com.amazonaws.directoryservice#DisableLDAPS" }, @@ -3888,6 +3987,9 @@ { "target": "com.amazonaws.directoryservice#EnableClientAuthentication" }, + { + "target": "com.amazonaws.directoryservice#EnableDirectoryDataAccess" + }, { "target": "com.amazonaws.directoryservice#EnableLDAPS" }, @@ -5063,6 +5165,12 @@ "traits": { "smithy.api#enumValue": "Failed" } + }, + "UPDATING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Updating" + } } } }, @@ -5106,7 +5214,7 @@ } }, "traits": { - "smithy.api#documentation": "

The specified directory is unavailable or could not be found.

", + "smithy.api#documentation": "

The specified directory is unavailable.

", "smithy.api#error": "client" } }, @@ -5209,7 +5317,7 @@ "Type": { "target": "com.amazonaws.directoryservice#ClientAuthenticationType", "traits": { - "smithy.api#documentation": "

The type of client authentication to disable. Currently, only the parameter, SmartCard is supported.

", + "smithy.api#documentation": "

The type of client authentication to disable. Currently the only parameter \"SmartCard\" is supported.

", "smithy.api#required": {} } } @@ -5225,6 +5333,63 @@ "smithy.api#output": {} } }, + "com.amazonaws.directoryservice#DisableDirectoryDataAccess": { + "type": "operation", + "input": { + "target": "com.amazonaws.directoryservice#DisableDirectoryDataAccessRequest" + }, + "output": { + "target": "com.amazonaws.directoryservice#DisableDirectoryDataAccessResult" + }, + "errors": [ + { + "target": "com.amazonaws.directoryservice#AccessDeniedException" + }, + { + "target": "com.amazonaws.directoryservice#ClientException" + }, + { + "target": "com.amazonaws.directoryservice#DirectoryDoesNotExistException" + }, + { + "target": "com.amazonaws.directoryservice#DirectoryInDesiredStateException" + }, + { + "target": "com.amazonaws.directoryservice#DirectoryUnavailableException" + }, + { + "target": "com.amazonaws.directoryservice#ServiceException" + }, + { + "target": "com.amazonaws.directoryservice#UnsupportedOperationException" + } + ], + "traits": { + "smithy.api#documentation": "

Deactivates access to directory data via the Directory Service Data API for the specified directory.

" + } + }, + "com.amazonaws.directoryservice#DisableDirectoryDataAccessRequest": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservice#DirectoryId", + "traits": { + "smithy.api#documentation": "

The directory identifier.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.directoryservice#DisableDirectoryDataAccessResult": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.directoryservice#DisableLDAPS": { "type": "operation", "input": { @@ -5546,6 +5711,12 @@ "traits": { "smithy.api#enumValue": "Failed" } + }, + "UPDATING": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "Updating" + } } } }, @@ -5622,6 +5793,63 @@ "smithy.api#output": {} } }, + "com.amazonaws.directoryservice#EnableDirectoryDataAccess": { + "type": "operation", + "input": { + "target": "com.amazonaws.directoryservice#EnableDirectoryDataAccessRequest" + }, + "output": { + "target": "com.amazonaws.directoryservice#EnableDirectoryDataAccessResult" + }, + "errors": [ + { + "target": "com.amazonaws.directoryservice#AccessDeniedException" + }, + { + "target": "com.amazonaws.directoryservice#ClientException" + }, + { + "target": "com.amazonaws.directoryservice#DirectoryDoesNotExistException" + }, + { + "target": "com.amazonaws.directoryservice#DirectoryInDesiredStateException" + }, + { + "target": "com.amazonaws.directoryservice#DirectoryUnavailableException" + }, + { + "target": "com.amazonaws.directoryservice#ServiceException" + }, + { + "target": "com.amazonaws.directoryservice#UnsupportedOperationException" + } + ], + "traits": { + "smithy.api#documentation": "

Enables access to directory data via the Directory Service Data API for the specified directory.

" + } + }, + "com.amazonaws.directoryservice#EnableDirectoryDataAccessRequest": { + "type": "structure", + "members": { + "DirectoryId": { + "target": "com.amazonaws.directoryservice#DirectoryId", + "traits": { + "smithy.api#documentation": "

The directory identifier.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.directoryservice#EnableDirectoryDataAccessResult": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.directoryservice#EnableLDAPS": { "type": "operation", "input": { @@ -7069,7 +7297,7 @@ "target": "com.amazonaws.directoryservice#RadiusRetries", "traits": { "smithy.api#default": 0, - "smithy.api#documentation": "

The maximum number of times that communication with the RADIUS server is\n attempted.

" + "smithy.api#documentation": "

The maximum number of times that communication with the RADIUS server is retried after the initial attempt.

" } }, "SharedSecret": { @@ -7141,7 +7369,7 @@ "traits": { "smithy.api#range": { "min": 1, - "max": 20 + "max": 50 } } }, @@ -7708,7 +7936,7 @@ } ], "traits": { - "smithy.api#documentation": "

Resets the password for any user in your Managed Microsoft AD or Simple AD\n directory.

\n

You can reset the password for any user in your directory with the following\n exceptions:

\n " + "smithy.api#documentation": "

Resets the password for any user in your Managed Microsoft AD or Simple AD\n directory. Disabled users will become enabled and can be authenticated following the API call.

\n

You can reset the password for any user in your directory with the following\n exceptions:

\n " } }, "com.amazonaws.directoryservice#ResetUserPasswordRequest": { @@ -8654,14 +8882,14 @@ "Key": { "target": "com.amazonaws.directoryservice#TagKey", "traits": { - "smithy.api#documentation": "

Required name of the tag. The string value can be Unicode characters and cannot be\n prefixed with \"aws:\". The string can contain only the set of Unicode letters, digits,\n white-space, '_', '.', '/', '=', '+', '-' (Java regex:\n \"^([\\\\p{L}\\\\p{Z}\\\\p{N}_.:/=+\\\\-]*)$\").

", + "smithy.api#documentation": "

Required name of the tag. The string value can be Unicode characters and cannot be\n prefixed with \"aws:\". The string can contain only the set of Unicode letters, digits,\n white-space, '_', '.', '/', '=', '+', '-', ':', '@'(Java regex:\n \"^([\\\\p{L}\\\\p{Z}\\\\p{N}_.:/=+\\\\-]*)$\").

", "smithy.api#required": {} } }, "Value": { "target": "com.amazonaws.directoryservice#TagValue", "traits": { - "smithy.api#documentation": "

The optional value of the tag. The string value can be Unicode characters. The string\n can contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-'\n (Java regex: \"^([\\\\p{L}\\\\p{Z}\\\\p{N}_.:/=+\\\\-]*)$\").

", + "smithy.api#documentation": "

The optional value of the tag. The string value can be Unicode characters. The string\n can contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-', ':', '@'\n (Java regex: \"^([\\\\p{L}\\\\p{Z}\\\\p{N}_.:/=+\\\\-]*)$\").

", "smithy.api#required": {} } } diff --git a/aws-models/guardduty.json b/aws-models/guardduty.json index 8343b777698a..3e052ca8466c 100644 --- a/aws-models/guardduty.json +++ b/aws-models/guardduty.json @@ -4674,6 +4674,13 @@ "smithy.api#documentation": "

The name of the task group that's associated with the task.

", "smithy.api#jsonName": "group" } + }, + "LaunchType": { + "target": "com.amazonaws.guardduty#String", + "traits": { + "smithy.api#documentation": "

A capacity on which the task is running. For example, Fargate and EC2.

", + "smithy.api#jsonName": "launchType" + } } }, "traits": { @@ -8774,7 +8781,7 @@ "target": "com.amazonaws.guardduty#SourceIps", "traits": { "smithy.api#documentation": "

The IP of the Kubernetes API caller and the IPs of any proxies or load balancers between\n the caller and the API endpoint.

", - "smithy.api#jsonName": "sourceIps" + "smithy.api#jsonName": "sourceIPs" } }, "UserAgent": { diff --git a/aws-models/mailmanager.json b/aws-models/mailmanager.json index 39fb5641d2c9..49bd9a0ebebe 100644 --- a/aws-models/mailmanager.json +++ b/aws-models/mailmanager.json @@ -4415,7 +4415,7 @@ }, "aws.protocols#awsJson1_0": {}, "smithy.api#cors": {}, - "smithy.api#documentation": "AWS SES Mail Manager API\n

\n AWS SES Mail Manager API contains operations and data types\n that comprise the Mail Manager feature of Amazon Simple Email Service.

\n

Mail Manager is a set of Amazon SES email gateway features designed to help you strengthen\n your organization's email infrastructure, simplify email workflow management, and\n streamline email compliance control. To learn more, see the Mail Manager chapter in the Amazon SES Developer\n Guide.

", + "smithy.api#documentation": "Amazon SES Mail Manager API\n

The Amazon SES Mail Manager API contains operations and data types\n that comprise the Mail Manager feature of Amazon Simple Email Service (SES).

\n

Mail Manager is a set of Amazon SES email gateway features designed to help you strengthen\n your organization's email infrastructure, simplify email workflow management, and\n streamline email compliance control. To learn more, see the Mail Manager chapter in the Amazon SES Developer\n Guide.

", "smithy.api#externalDocumentation": { "API Reference": "https://w.amazon.com/bin/view/AWS/Border" }, @@ -5120,6 +5120,12 @@ "smithy.api#documentation": "

The textual body content of an email message.

" } }, + "com.amazonaws.mailmanager#MimeHeaderAttribute": { + "type": "string", + "traits": { + "smithy.api#pattern": "^X-[a-zA-Z0-9-]{1,256}$" + } + }, "com.amazonaws.mailmanager#NameOrArn": { "type": "string", "traits": { @@ -6400,6 +6406,12 @@ "traits": { "smithy.api#documentation": "

The email attribute to evaluate in a string condition expression.

" } + }, + "MimeHeaderAttribute": { + "target": "com.amazonaws.mailmanager#MimeHeaderAttribute", + "traits": { + "smithy.api#documentation": "

The email MIME X-Header attribute to evaluate in a string condition expression.

" + } } }, "traits": { @@ -7083,10 +7095,19 @@ "target": "smithy.api#String" } }, + "com.amazonaws.mailmanager#StringValue": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 2048 + } + } + }, "com.amazonaws.mailmanager#StringValueList": { "type": "list", "member": { - "target": "smithy.api#String" + "target": "com.amazonaws.mailmanager#StringValue" }, "traits": { "smithy.api#length": { @@ -7658,7 +7679,7 @@ } ], "traits": { - "smithy.api#documentation": "

>Update attributes of an already provisioned rule set.

", + "smithy.api#documentation": "

Update attributes of an already provisioned rule set.

", "smithy.api#idempotent": {} } }, diff --git a/aws-models/rds.json b/aws-models/rds.json index 347818e57919..ebc1c71fb854 100644 --- a/aws-models/rds.json +++ b/aws-models/rds.json @@ -27805,7 +27805,7 @@ } ], "traits": { - "smithy.api#documentation": "

Creates a new DB instance from a DB snapshot. The target database is created from the source database restore point with most\n of the source's original configuration, including the default security group and DB parameter group. By default, the new DB\n instance is created as a Single-AZ deployment, except when the instance is a SQL Server instance that has an option group\n associated with mirroring. In this case, the instance becomes a Multi-AZ deployment, not a Single-AZ deployment.

\n

If you want to replace your original DB instance with the new, restored DB instance, then rename your original DB instance\n before you call the RestoreDBInstanceFromDBSnapshot operation. RDS doesn't allow two DB instances with the same name. After you\n have renamed your original DB instance with a different identifier, then you can pass the original name of the DB instance as\n the DBInstanceIdentifier in the call to the RestoreDBInstanceFromDBSnapshot operation. The result is that you replace the original\n DB instance with the DB instance created from the snapshot.

\n

If you are restoring from a shared manual DB snapshot, the DBSnapshotIdentifier\n must be the ARN of the shared DB snapshot.

\n \n

This command doesn't apply to Aurora MySQL and Aurora PostgreSQL. For Aurora, use RestoreDBClusterFromSnapshot.

\n
", + "smithy.api#documentation": "

Creates a new DB instance from a DB snapshot. The target database is created from the source database restore point with most\n of the source's original configuration, including the default security group and DB parameter group. By default, the new DB\n instance is created as a Single-AZ deployment, except when the instance is a SQL Server instance that has an option group\n associated with mirroring. In this case, the instance becomes a Multi-AZ deployment, not a Single-AZ deployment.

\n

If you want to replace your original DB instance with the new, restored DB instance, then rename your original DB instance\n before you call the RestoreDBInstanceFromDBSnapshot operation. RDS doesn't allow two DB instances with the same name. After you\n have renamed your original DB instance with a different identifier, then you can pass the original name of the DB instance as\n the DBInstanceIdentifier in the call to the RestoreDBInstanceFromDBSnapshot operation. The result is that you replace the original\n DB instance with the DB instance created from the snapshot.

\n

If you are restoring from a shared manual DB snapshot, the DBSnapshotIdentifier\n must be the ARN of the shared DB snapshot.

\n

To restore from a DB snapshot with an unsupported engine version, you must first upgrade the \n engine version of the snapshot. For more information about upgrading a RDS for MySQL DB snapshot engine version, see Upgrading a MySQL DB snapshot engine version. \n For more information about upgrading a RDS for PostgreSQL DB snapshot engine version, Upgrading a PostgreSQL DB snapshot engine version.

\n \n

This command doesn't apply to Aurora MySQL and Aurora PostgreSQL. For Aurora, use RestoreDBClusterFromSnapshot.

\n
", "smithy.api#examples": [ { "title": "To restore a DB instance from a DB snapshot", diff --git a/aws-models/s3.json b/aws-models/s3.json index ea40691cde7a..f8a2be8c1a80 100644 --- a/aws-models/s3.json +++ b/aws-models/s3.json @@ -18326,7 +18326,7 @@ "target": "com.amazonaws.s3#CompleteMultipartUploadOutput" }, "traits": { - "smithy.api#documentation": "

Completes a multipart upload by assembling previously uploaded parts.

\n

You first initiate the multipart upload and then upload all parts using the UploadPart\n operation or the UploadPartCopy\n operation. After successfully uploading all relevant parts of an upload, you call this\n CompleteMultipartUpload operation to complete the upload. Upon receiving this request, Amazon S3 concatenates all the parts\n in ascending order by part number to create a new object. In the CompleteMultipartUpload \n request, you must provide the parts list and ensure that the parts list is complete.\n The CompleteMultipartUpload API operation concatenates the parts that you provide in the list. For each part in the list,\n you must provide the PartNumber value and the ETag value that are returned after that part\n was uploaded.

\n

The processing of a CompleteMultipartUpload request could take several minutes to\n finalize. After Amazon S3 begins processing the request, it sends an HTTP response header that\n specifies a 200 OK response. While processing is in progress, Amazon S3 periodically sends white\n space characters to keep the connection from timing out. A request could fail after the\n initial 200 OK response has been sent. This means that a 200 OK response can\n contain either a success or an error. The error response might be embedded in the 200 OK response. \n If you call this API operation directly, make sure to design\n your application to parse the contents of the response and handle it appropriately. If you\n use Amazon Web Services SDKs, SDKs handle this condition. The SDKs detect the embedded error and apply\n error handling per your configuration settings (including automatically retrying the\n request as appropriate). If the condition persists, the SDKs throw an exception (or, for\n the SDKs that don't use exceptions, they return an error).

\n

Note that if CompleteMultipartUpload fails, applications should be prepared\n to retry any failed requests (including 500 error responses). For more information, see Amazon S3 Error Best\n Practices.

\n \n

You can't use Content-Type: application/x-www-form-urlencoded for the \n CompleteMultipartUpload requests. Also, if you don't provide a\n Content-Type header, CompleteMultipartUpload can still return a 200\n OK response.

\n
\n

For more information about multipart uploads, see Uploading Objects Using Multipart\n Upload in the Amazon S3\n User Guide.

\n \n

\n Directory buckets - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format https://bucket_name.s3express-az_id.region.amazonaws.com/key-name\n . Path-style requests are not supported. For more information, see Regional and Zonal endpoints in the\n Amazon S3 User Guide.

\n
\n
\n
Permissions
\n
\n \n
\n
Special errors
\n
\n \n
\n
HTTP Host header syntax
\n
\n

\n Directory buckets - The HTTP Host header syntax is \n Bucket_name.s3express-az_id.region.amazonaws.com.

\n
\n
\n

The following operations are related to CompleteMultipartUpload:

\n ", + "smithy.api#documentation": "

Completes a multipart upload by assembling previously uploaded parts.

\n

You first initiate the multipart upload and then upload all parts using the UploadPart\n operation or the UploadPartCopy\n operation. After successfully uploading all relevant parts of an upload, you call this\n CompleteMultipartUpload operation to complete the upload. Upon receiving this request, Amazon S3 concatenates all the parts\n in ascending order by part number to create a new object. In the CompleteMultipartUpload \n request, you must provide the parts list and ensure that the parts list is complete.\n The CompleteMultipartUpload API operation concatenates the parts that you provide in the list. For each part in the list,\n you must provide the PartNumber value and the ETag value that are returned after that part\n was uploaded.

\n

The processing of a CompleteMultipartUpload request could take several minutes to\n finalize. After Amazon S3 begins processing the request, it sends an HTTP response header that\n specifies a 200 OK response. While processing is in progress, Amazon S3 periodically sends white\n space characters to keep the connection from timing out. A request could fail after the\n initial 200 OK response has been sent. This means that a 200 OK response can\n contain either a success or an error. The error response might be embedded in the 200 OK response. \n If you call this API operation directly, make sure to design\n your application to parse the contents of the response and handle it appropriately. If you\n use Amazon Web Services SDKs, SDKs handle this condition. The SDKs detect the embedded error and apply\n error handling per your configuration settings (including automatically retrying the\n request as appropriate). If the condition persists, the SDKs throw an exception (or, for\n the SDKs that don't use exceptions, they return an error).

\n

Note that if CompleteMultipartUpload fails, applications should be prepared\n to retry any failed requests (including 500 error responses). For more information, see Amazon S3 Error Best\n Practices.

\n \n

You can't use Content-Type: application/x-www-form-urlencoded for the \n CompleteMultipartUpload requests. Also, if you don't provide a\n Content-Type header, CompleteMultipartUpload can still return a 200\n OK response.

\n
\n

For more information about multipart uploads, see Uploading Objects Using Multipart\n Upload in the Amazon S3\n User Guide.

\n \n

\n Directory buckets - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format https://bucket_name.s3express-az_id.region.amazonaws.com/key-name\n . Path-style requests are not supported. For more information, see Regional and Zonal endpoints in the\n Amazon S3 User Guide.

\n
\n
\n
Permissions
\n
\n \n
\n
Special errors
\n
\n \n
\n
HTTP Host header syntax
\n
\n

\n Directory buckets - The HTTP Host header syntax is \n Bucket_name.s3express-az_id.region.amazonaws.com.

\n
\n
\n

The following operations are related to CompleteMultipartUpload:

\n ", "smithy.api#http": { "method": "POST", "uri": "/{Bucket}/{Key+}", @@ -18395,7 +18395,7 @@ "ServerSideEncryption": { "target": "com.amazonaws.s3#ServerSideEncryption", "traits": { - "smithy.api#documentation": "

The server-side encryption algorithm used when storing this object in Amazon S3 (for example,\n AES256, aws:kms).

\n \n

For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

\n
", + "smithy.api#documentation": "

The server-side encryption algorithm used when storing this object in Amazon S3 (for example,\n AES256, aws:kms).

", "smithy.api#httpHeader": "x-amz-server-side-encryption" } }, @@ -18409,14 +18409,14 @@ "SSEKMSKeyId": { "target": "com.amazonaws.s3#SSEKMSKeyId", "traits": { - "smithy.api#documentation": "

If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key\n that was used for the object.

\n \n

This functionality is not supported for directory buckets.

\n
", + "smithy.api#documentation": "

If present, indicates the ID of the KMS key that was used for object encryption.

", "smithy.api#httpHeader": "x-amz-server-side-encryption-aws-kms-key-id" } }, "BucketKeyEnabled": { "target": "com.amazonaws.s3#BucketKeyEnabled", "traits": { - "smithy.api#documentation": "

Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption\n with Key Management Service (KMS) keys (SSE-KMS).

\n \n

This functionality is not supported for directory buckets.

\n
", + "smithy.api#documentation": "

Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption\n with Key Management Service (KMS) keys (SSE-KMS).

", "smithy.api#httpHeader": "x-amz-server-side-encryption-bucket-key-enabled" } }, @@ -18701,7 +18701,7 @@ } ], "traits": { - "smithy.api#documentation": "

Creates a copy of an object that is already stored in Amazon S3.

\n \n

You can store individual objects of up to 5 TB in Amazon S3. You create a copy of your\n object up to 5 GB in size in a single atomic action using this API. However, to copy an\n object greater than 5 GB, you must use the multipart upload Upload Part - Copy\n (UploadPartCopy) API. For more information, see Copy Object Using the\n REST Multipart Upload API.

\n
\n

You can copy individual objects between general purpose buckets, between directory buckets, and \n between general purpose buckets and directory buckets.

\n \n \n \n

Both the\n Region that you want to copy the object from and the Region that you want to copy the\n object to must be enabled for your account. For more information about how to enable a Region for your account, see Enable \n or disable a Region for standalone accounts in the\n Amazon Web Services Account Management Guide.

\n \n

Amazon S3 transfer acceleration does not support cross-Region copies. If you request a\n cross-Region copy using a transfer acceleration endpoint, you get a 400 Bad\n Request error. For more information, see Transfer\n Acceleration.

\n
\n
\n
Authentication and authorization
\n
\n

All CopyObject requests must be authenticated and signed by using IAM credentials (access key ID and secret access key for the IAM identities). All headers with the x-amz- prefix, including\n x-amz-copy-source, must be signed. For more information, see REST Authentication.

\n

\n Directory buckets - You must use the IAM credentials to authenticate and authorize your access to the CopyObject API operation, instead of using the \n temporary security credentials through the CreateSession API operation.

\n

Amazon Web Services CLI or SDKs handles authentication and authorization on your behalf.

\n
\n
Permissions
\n
\n

You must have\n read access to the source object and write\n access to the destination bucket.

\n \n
\n
Response and special errors
\n
\n

When the request is an HTTP 1.1 request, the response is chunk encoded. When\n the request is not an HTTP 1.1 request, the response would not contain the\n Content-Length. You always need to read the entire response body\n to check if the copy succeeds.

\n \n
\n
Charge
\n
\n

The copy request charge is based on the storage class and Region that you specify for\n the destination object. The request can also result in a data retrieval charge for the\n source if the source storage class bills for data retrieval. If the copy source is in a different region, the data transfer is billed to the copy source account. For pricing information, see\n Amazon S3 pricing.

\n
\n
HTTP Host header syntax
\n
\n

\n Directory buckets - The HTTP Host header syntax is \n Bucket_name.s3express-az_id.region.amazonaws.com.

\n
\n
\n

The following operations are related to CopyObject:

\n ", + "smithy.api#documentation": "

Creates a copy of an object that is already stored in Amazon S3.

\n \n

You can store individual objects of up to 5 TB in Amazon S3. You create a copy of your\n object up to 5 GB in size in a single atomic action using this API. However, to copy an\n object greater than 5 GB, you must use the multipart upload Upload Part - Copy\n (UploadPartCopy) API. For more information, see Copy Object Using the\n REST Multipart Upload API.

\n
\n

You can copy individual objects between general purpose buckets, between directory buckets, and \n between general purpose buckets and directory buckets.

\n \n \n \n

Both the\n Region that you want to copy the object from and the Region that you want to copy the\n object to must be enabled for your account. For more information about how to enable a Region for your account, see Enable \n or disable a Region for standalone accounts in the\n Amazon Web Services Account Management Guide.

\n \n

Amazon S3 transfer acceleration does not support cross-Region copies. If you request a\n cross-Region copy using a transfer acceleration endpoint, you get a 400 Bad\n Request error. For more information, see Transfer\n Acceleration.

\n
\n
\n
Authentication and authorization
\n
\n

All CopyObject requests must be authenticated and signed by using IAM credentials (access key ID and secret access key for the IAM identities). All headers with the x-amz- prefix, including\n x-amz-copy-source, must be signed. For more information, see REST Authentication.

\n

\n Directory buckets - You must use the IAM credentials to authenticate and authorize your access to the CopyObject API operation, instead of using the \n temporary security credentials through the CreateSession API operation.

\n

Amazon Web Services CLI or SDKs handles authentication and authorization on your behalf.

\n
\n
Permissions
\n
\n

You must have\n read access to the source object and write\n access to the destination bucket.

\n \n
\n
Response and special errors
\n
\n

When the request is an HTTP 1.1 request, the response is chunk encoded. When\n the request is not an HTTP 1.1 request, the response would not contain the\n Content-Length. You always need to read the entire response body\n to check if the copy succeeds.

\n \n
\n
Charge
\n
\n

The copy request charge is based on the storage class and Region that you specify for\n the destination object. The request can also result in a data retrieval charge for the\n source if the source storage class bills for data retrieval. If the copy source is in a different region, the data transfer is billed to the copy source account. For pricing information, see\n Amazon S3 pricing.

\n
\n
HTTP Host header syntax
\n
\n

\n Directory buckets - The HTTP Host header syntax is \n Bucket_name.s3express-az_id.region.amazonaws.com.

\n
\n
\n

The following operations are related to CopyObject:

\n ", "smithy.api#examples": [ { "title": "To copy an object", @@ -18765,7 +18765,7 @@ "ServerSideEncryption": { "target": "com.amazonaws.s3#ServerSideEncryption", "traits": { - "smithy.api#documentation": "

The server-side encryption algorithm used when you store this object in Amazon S3 (for example,\n AES256, aws:kms, aws:kms:dsse).

\n \n

For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

\n
", + "smithy.api#documentation": "

The server-side encryption algorithm used when you store this object in Amazon S3 (for example,\n AES256, aws:kms, aws:kms:dsse).

", "smithy.api#httpHeader": "x-amz-server-side-encryption" } }, @@ -18786,21 +18786,21 @@ "SSEKMSKeyId": { "target": "com.amazonaws.s3#SSEKMSKeyId", "traits": { - "smithy.api#documentation": "

If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key\n that was used for the object.

\n \n

This functionality is not supported for directory buckets.

\n
", + "smithy.api#documentation": "

If present, indicates the ID of the KMS key that was used for object encryption.

", "smithy.api#httpHeader": "x-amz-server-side-encryption-aws-kms-key-id" } }, "SSEKMSEncryptionContext": { "target": "com.amazonaws.s3#SSEKMSEncryptionContext", "traits": { - "smithy.api#documentation": "

If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The\n value of this header is a base64-encoded UTF-8 string holding JSON with the encryption\n context key-value pairs.

\n \n

This functionality is not supported for directory buckets.

\n
", + "smithy.api#documentation": "

If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The\n value of this header is a base64-encoded UTF-8 string holding JSON with the encryption\n context key-value pairs.

", "smithy.api#httpHeader": "x-amz-server-side-encryption-context" } }, "BucketKeyEnabled": { "target": "com.amazonaws.s3#BucketKeyEnabled", "traits": { - "smithy.api#documentation": "

Indicates whether the copied object uses an S3 Bucket Key for server-side encryption\n with Key Management Service (KMS) keys (SSE-KMS).

\n \n

This functionality is not supported for directory buckets.

\n
", + "smithy.api#documentation": "

Indicates whether the copied object uses an S3 Bucket Key for server-side encryption\n with Key Management Service (KMS) keys (SSE-KMS).

", "smithy.api#httpHeader": "x-amz-server-side-encryption-bucket-key-enabled" } }, @@ -18987,7 +18987,7 @@ "ServerSideEncryption": { "target": "com.amazonaws.s3#ServerSideEncryption", "traits": { - "smithy.api#documentation": "

The server-side encryption algorithm used when storing this object in Amazon S3 (for example,\n AES256, aws:kms, aws:kms:dsse). Unrecognized or unsupported values won’t write a destination object and will receive a 400 Bad Request response.

\n

Amazon S3 automatically encrypts all new objects that are copied to an S3 bucket.\n When copying an object, if you don't specify encryption information in your copy\n request, the encryption setting of the target object is set to the default\n encryption configuration of the destination bucket. By default, all buckets have a\n base level of encryption configuration that uses server-side encryption with Amazon S3\n managed keys (SSE-S3). If the destination bucket has a default encryption\n configuration that uses server-side encryption with Key Management Service (KMS) keys\n (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), or\n server-side encryption with customer-provided encryption keys (SSE-C), Amazon S3 uses\n the corresponding KMS key, or a customer-provided key to encrypt the target\n object copy.

\n

When you perform a CopyObject operation, if you want to use a\n different type of encryption setting for the target object, you can specify \n appropriate encryption-related headers to encrypt the target object with an Amazon S3 managed key, a\n KMS key, or a customer-provided key. If the encryption setting in\n your request is different from the default encryption configuration of the\n destination bucket, the encryption setting in your request takes precedence.

\n

With server-side\n encryption, Amazon S3 encrypts your data as it writes your data to disks in its data\n centers and decrypts the data when you access it. For more information about server-side encryption, see Using\n Server-Side Encryption in the\n Amazon S3 User Guide.

\n \n

For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

\n
", + "smithy.api#documentation": "

The server-side encryption algorithm used when storing this object in Amazon S3. Unrecognized or unsupported values won’t write a destination object and will receive a 400 Bad Request response.

\n

Amazon S3 automatically encrypts all new objects that are copied to an S3 bucket.\n When copying an object, if you don't specify encryption information in your copy\n request, the encryption setting of the target object is set to the default\n encryption configuration of the destination bucket. By default, all buckets have a\n base level of encryption configuration that uses server-side encryption with Amazon S3\n managed keys (SSE-S3). If the destination bucket has a different default encryption\n configuration, Amazon S3 uses\n the corresponding encryption key to encrypt the target\n object copy.

\n

With server-side\n encryption, Amazon S3 encrypts your data as it writes your data to disks in its data\n centers and decrypts the data when you access it. For more information about server-side encryption, see Using\n Server-Side Encryption in the\n Amazon S3 User Guide.

\n

\n General purpose buckets \n

\n \n

\n Directory buckets \n

\n ", "smithy.api#httpHeader": "x-amz-server-side-encryption" } }, @@ -19029,21 +19029,21 @@ "SSEKMSKeyId": { "target": "com.amazonaws.s3#SSEKMSKeyId", "traits": { - "smithy.api#documentation": "

Specifies the KMS ID (Key ID, Key ARN, or Key Alias) to use for object encryption. All GET and PUT requests for an\n object protected by KMS will fail if they're not made via SSL or using SigV4. For\n information about configuring any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see\n Specifying the\n Signature Version in Request Authentication in the\n Amazon S3 User Guide.

\n \n

This functionality is not supported when the destination bucket is a directory bucket.

\n
", + "smithy.api#documentation": "

Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. All GET and PUT requests for an\n object protected by KMS will fail if they're not made via SSL or using SigV4. For\n information about configuring any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see\n Specifying the\n Signature Version in Request Authentication in the\n Amazon S3 User Guide.

\n

\n Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the \n x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS \n symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. \nAmazon Web Services managed key (aws/s3) isn't supported. \n

", "smithy.api#httpHeader": "x-amz-server-side-encryption-aws-kms-key-id" } }, "SSEKMSEncryptionContext": { "target": "com.amazonaws.s3#SSEKMSEncryptionContext", "traits": { - "smithy.api#documentation": "

Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of\n this header is a base64-encoded UTF-8 string holding JSON with the encryption context\n key-value pairs. This value must be explicitly added to specify encryption context for \n CopyObject requests.

\n \n

This functionality is not supported when the destination bucket is a directory bucket.

\n
", + "smithy.api#documentation": "

Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for the destination object encryption. The value of\n this header is a base64-encoded UTF-8 string holding JSON with the encryption context\n key-value pairs.

\n

\n General purpose buckets - This value must be explicitly added to specify encryption context for \n CopyObject requests if you want an additional encryption context for your destination object. The additional encryption context of the source object won't be copied to the destination object. For more information, see Encryption context in the Amazon S3 User Guide.

\n

\n Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

", "smithy.api#httpHeader": "x-amz-server-side-encryption-context" } }, "BucketKeyEnabled": { "target": "com.amazonaws.s3#BucketKeyEnabled", "traits": { - "smithy.api#documentation": "

Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with\n server-side encryption using Key Management Service (KMS) keys (SSE-KMS). If a target object uses SSE-KMS, you can enable an S3 Bucket Key for the\n object.

\n

Setting this header to\n true causes Amazon S3 to use an S3 Bucket Key for object encryption with\n SSE-KMS. Specifying this header with a COPY action doesn’t affect bucket-level settings for S3\n Bucket Key.

\n

For more information, see Amazon S3 Bucket Keys in the\n Amazon S3 User Guide.

\n \n

This functionality is not supported when the destination bucket is a directory bucket.

\n
", + "smithy.api#documentation": "

Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with\n server-side encryption using Key Management Service (KMS) keys (SSE-KMS). If a target object uses SSE-KMS, you can enable an S3 Bucket Key for the\n object.

\n

Setting this header to\n true causes Amazon S3 to use an S3 Bucket Key for object encryption with\n SSE-KMS. Specifying this header with a COPY action doesn’t affect bucket-level settings for S3\n Bucket Key.

\n

For more information, see Amazon S3 Bucket Keys in the\n Amazon S3 User Guide.

\n \n

\n Directory buckets - S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets \nto directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

\n
", "smithy.api#httpHeader": "x-amz-server-side-encryption-bucket-key-enabled" } }, @@ -19435,7 +19435,7 @@ "target": "com.amazonaws.s3#CreateMultipartUploadOutput" }, "traits": { - "smithy.api#documentation": "

This action initiates a multipart upload and returns an upload ID. This upload ID is\n used to associate all of the parts in the specific multipart upload. You specify this\n upload ID in each of your subsequent upload part requests (see UploadPart). You also include this\n upload ID in the final request to either complete or abort the multipart upload\n request. For more information about multipart uploads, see Multipart Upload Overview in the Amazon S3 User Guide.

\n \n

After you initiate a multipart upload and upload one or more parts, to stop being\n charged for storing the uploaded parts, you must either complete or abort the multipart\n upload. Amazon S3 frees up the space used to store the parts and stops charging you for\n storing them only after you either complete or abort a multipart upload.

\n
\n

If you have configured a lifecycle rule to abort incomplete multipart uploads, the created multipart \n upload must be completed within the number of days specified in the bucket lifecycle\n configuration. Otherwise, the incomplete multipart upload becomes eligible for an abort\n action and Amazon S3 aborts the multipart upload. For more information, see Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle\n Configuration.

\n \n \n \n
\n
Request signing
\n
\n

For request signing, multipart upload is just a series of regular requests. You initiate\n a multipart upload, send one or more requests to upload parts, and then complete the\n multipart upload process. You sign each request individually. There is nothing special\n about signing multipart upload requests. For more information about signing, see Authenticating Requests (Amazon Web Services Signature Version 4) in the Amazon S3 User Guide.

\n
\n
Permissions
\n
\n \n
\n
Encryption
\n
\n \n
\n
HTTP Host header syntax
\n
\n

\n Directory buckets - The HTTP Host header syntax is \n Bucket_name.s3express-az_id.region.amazonaws.com.

\n
\n
\n

The following operations are related to CreateMultipartUpload:

\n ", + "smithy.api#documentation": "

This action initiates a multipart upload and returns an upload ID. This upload ID is\n used to associate all of the parts in the specific multipart upload. You specify this\n upload ID in each of your subsequent upload part requests (see UploadPart). You also include this\n upload ID in the final request to either complete or abort the multipart upload\n request. For more information about multipart uploads, see Multipart Upload Overview in the Amazon S3 User Guide.

\n \n

After you initiate a multipart upload and upload one or more parts, to stop being\n charged for storing the uploaded parts, you must either complete or abort the multipart\n upload. Amazon S3 frees up the space used to store the parts and stops charging you for\n storing them only after you either complete or abort a multipart upload.

\n
\n

If you have configured a lifecycle rule to abort incomplete multipart uploads, the created multipart \n upload must be completed within the number of days specified in the bucket lifecycle\n configuration. Otherwise, the incomplete multipart upload becomes eligible for an abort\n action and Amazon S3 aborts the multipart upload. For more information, see Aborting Incomplete Multipart Uploads Using a Bucket Lifecycle\n Configuration.

\n \n \n \n
\n
Request signing
\n
\n

For request signing, multipart upload is just a series of regular requests. You initiate\n a multipart upload, send one or more requests to upload parts, and then complete the\n multipart upload process. You sign each request individually. There is nothing special\n about signing multipart upload requests. For more information about signing, see Authenticating Requests (Amazon Web Services Signature Version 4) in the Amazon S3 User Guide.

\n
\n
Permissions
\n
\n \n
\n
Encryption
\n
\n \n
\n
HTTP Host header syntax
\n
\n

\n Directory buckets - The HTTP Host header syntax is \n Bucket_name.s3express-az_id.region.amazonaws.com.

\n
\n
\n

The following operations are related to CreateMultipartUpload:

\n ", "smithy.api#examples": [ { "title": "To initiate a multipart upload", @@ -19497,7 +19497,7 @@ "ServerSideEncryption": { "target": "com.amazonaws.s3#ServerSideEncryption", "traits": { - "smithy.api#documentation": "

The server-side encryption algorithm used when you store this object in Amazon S3 (for example,\n AES256, aws:kms).

\n \n

For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

\n
", + "smithy.api#documentation": "

The server-side encryption algorithm used when you store this object in Amazon S3 (for example,\n AES256, aws:kms).

", "smithy.api#httpHeader": "x-amz-server-side-encryption" } }, @@ -19518,21 +19518,21 @@ "SSEKMSKeyId": { "target": "com.amazonaws.s3#SSEKMSKeyId", "traits": { - "smithy.api#documentation": "

If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key\n that was used for the object.

\n \n

This functionality is not supported for directory buckets.

\n
", + "smithy.api#documentation": "

If present, indicates the ID of the KMS key that was used for object encryption.

", "smithy.api#httpHeader": "x-amz-server-side-encryption-aws-kms-key-id" } }, "SSEKMSEncryptionContext": { "target": "com.amazonaws.s3#SSEKMSEncryptionContext", "traits": { - "smithy.api#documentation": "

If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The\n value of this header is a base64-encoded UTF-8 string holding JSON with the encryption\n context key-value pairs.

\n \n

This functionality is not supported for directory buckets.

\n
", + "smithy.api#documentation": "

If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of\n this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs.

", "smithy.api#httpHeader": "x-amz-server-side-encryption-context" } }, "BucketKeyEnabled": { "target": "com.amazonaws.s3#BucketKeyEnabled", "traits": { - "smithy.api#documentation": "

Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption\n with Key Management Service (KMS) keys (SSE-KMS).

\n \n

This functionality is not supported for directory buckets.

\n
", + "smithy.api#documentation": "

Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption\n with Key Management Service (KMS) keys (SSE-KMS).

", "smithy.api#httpHeader": "x-amz-server-side-encryption-bucket-key-enabled" } }, @@ -19667,7 +19667,7 @@ "ServerSideEncryption": { "target": "com.amazonaws.s3#ServerSideEncryption", "traits": { - "smithy.api#documentation": "

The server-side encryption algorithm used when you store this object in Amazon S3 (for example,\n AES256, aws:kms).

\n \n

For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

\n
", + "smithy.api#documentation": "

The server-side encryption algorithm used when you store this object in Amazon S3 (for example,\n AES256, aws:kms).

\n ", "smithy.api#httpHeader": "x-amz-server-side-encryption" } }, @@ -19709,21 +19709,21 @@ "SSEKMSKeyId": { "target": "com.amazonaws.s3#SSEKMSKeyId", "traits": { - "smithy.api#documentation": "

Specifies the ID (Key ID, Key ARN, or Key Alias) of the symmetric encryption customer managed key to use for object encryption.

\n \n

This functionality is not supported for directory buckets.

\n
", + "smithy.api#documentation": "

Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same\n account that's issuing the command, you must use the full Key ARN not the Key ID.

\n

\n General purpose buckets - If you specify x-amz-server-side-encryption with aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS \n key to use. If you specify\n x-amz-server-side-encryption:aws:kms or\n x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key\n (aws/s3) to protect the data.

\n

\n Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the \n x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS \n symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. \nAmazon Web Services managed key (aws/s3) isn't supported. \n

", "smithy.api#httpHeader": "x-amz-server-side-encryption-aws-kms-key-id" } }, "SSEKMSEncryptionContext": { "target": "com.amazonaws.s3#SSEKMSEncryptionContext", "traits": { - "smithy.api#documentation": "

Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of\n this header is a base64-encoded UTF-8 string holding JSON with the encryption context\n key-value pairs.

\n \n

This functionality is not supported for directory buckets.

\n
", + "smithy.api#documentation": "

Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of\n this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs.

\n

\n Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

", "smithy.api#httpHeader": "x-amz-server-side-encryption-context" } }, "BucketKeyEnabled": { "target": "com.amazonaws.s3#BucketKeyEnabled", "traits": { - "smithy.api#documentation": "

Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with\n server-side encryption using Key Management Service (KMS) keys (SSE-KMS). Setting this header to\n true causes Amazon S3 to use an S3 Bucket Key for object encryption with\n SSE-KMS.

\n

Specifying this header with an object action doesn’t affect bucket-level settings for S3\n Bucket Key.

\n \n

This functionality is not supported for directory buckets.

\n
", + "smithy.api#documentation": "

Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with\n server-side encryption using Key Management Service (KMS) keys (SSE-KMS).

\n

\n General purpose buckets - Setting this header to\n true causes Amazon S3 to use an S3 Bucket Key for object encryption with\n SSE-KMS. Also, specifying this header with a PUT action doesn't affect bucket-level settings for S3\n Bucket Key.

\n

\n Directory buckets - S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets \nto directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or \n the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

", "smithy.api#httpHeader": "x-amz-server-side-encryption-bucket-key-enabled" } }, @@ -19794,7 +19794,7 @@ } ], "traits": { - "smithy.api#documentation": "

Creates a session that establishes temporary security credentials to support fast authentication and authorization for the Zonal endpoint APIs on directory buckets. \n For more information about Zonal endpoint APIs that include the Availability Zone in the request endpoint, see \n S3 Express One Zone APIs in the Amazon S3 User Guide. \n

\n

To make Zonal endpoint API requests on a directory bucket, use the CreateSession\n API operation. Specifically, you grant s3express:CreateSession permission to a\n bucket in a bucket policy or an IAM identity-based policy. Then, you use IAM credentials to make the\n CreateSession API request on the bucket, which returns temporary security\n credentials that include the access key ID, secret access key, session token, and\n expiration. These credentials have associated permissions to access the Zonal endpoint APIs. After\n the session is created, you don’t need to use other policies to grant permissions to each\n Zonal endpoint API individually. Instead, in your Zonal endpoint API requests, you sign your requests by\n applying the temporary security credentials of the session to the request headers and\n following the SigV4 protocol for authentication. You also apply the session token to the\n x-amz-s3session-token request header for authorization. Temporary security\n credentials are scoped to the bucket and expire after 5 minutes. After the expiration time,\n any calls that you make with those credentials will fail. You must use IAM credentials\n again to make a CreateSession API request that generates a new set of\n temporary credentials for use. Temporary credentials cannot be extended or refreshed beyond\n the original specified interval.

\n

If you use Amazon Web Services SDKs, SDKs handle the session token refreshes automatically to avoid\n service interruptions when a session expires. We recommend that you use the Amazon Web Services SDKs to\n initiate and manage requests to the CreateSession API. For more information, see Performance guidelines and design patterns in the\n Amazon S3 User Guide.

\n \n \n \n
\n
Permissions
\n
\n

To obtain temporary security credentials, you must create a bucket policy or an IAM identity-based policy that\n grants s3express:CreateSession permission to the bucket. In a\n policy, you can have the s3express:SessionMode condition key to\n control who can create a ReadWrite or ReadOnly session.\n For more information about ReadWrite or ReadOnly\n sessions, see \n x-amz-create-session-mode\n . For example policies, see\n Example bucket policies for S3 Express One Zone and Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone in the\n Amazon S3 User Guide.

\n

To grant cross-account access to Zonal endpoint APIs, the bucket policy should also grant both accounts the s3express:CreateSession permission.

\n
\n
HTTP Host header syntax
\n
\n

\n Directory buckets - The HTTP Host header syntax is \n Bucket_name.s3express-az_id.region.amazonaws.com.

\n
\n
", + "smithy.api#documentation": "

Creates a session that establishes temporary security credentials to support fast authentication and authorization for the Zonal endpoint API operations on directory buckets. \n For more information about Zonal endpoint API operations that include the Availability Zone in the request endpoint, see \n S3 Express One Zone APIs in the Amazon S3 User Guide. \n

\n

To make Zonal endpoint API requests on a directory bucket, use the CreateSession\n API operation. Specifically, you grant s3express:CreateSession permission to a\n bucket in a bucket policy or an IAM identity-based policy. Then, you use IAM credentials to make the\n CreateSession API request on the bucket, which returns temporary security\n credentials that include the access key ID, secret access key, session token, and\n expiration. These credentials have associated permissions to access the Zonal endpoint API operations. After\n the session is created, you don’t need to use other policies to grant permissions to each\n Zonal endpoint API individually. Instead, in your Zonal endpoint API requests, you sign your requests by\n applying the temporary security credentials of the session to the request headers and\n following the SigV4 protocol for authentication. You also apply the session token to the\n x-amz-s3session-token request header for authorization. Temporary security\n credentials are scoped to the bucket and expire after 5 minutes. After the expiration time,\n any calls that you make with those credentials will fail. You must use IAM credentials\n again to make a CreateSession API request that generates a new set of\n temporary credentials for use. Temporary credentials cannot be extended or refreshed beyond\n the original specified interval.

\n

If you use Amazon Web Services SDKs, SDKs handle the session token refreshes automatically to avoid\n service interruptions when a session expires. We recommend that you use the Amazon Web Services SDKs to\n initiate and manage requests to the CreateSession API. For more information, see Performance guidelines and design patterns in the\n Amazon S3 User Guide.

\n \n \n \n
\n
Permissions
\n
\n

To obtain temporary security credentials, you must create a bucket policy or an IAM identity-based policy that\n grants s3express:CreateSession permission to the bucket. In a\n policy, you can have the s3express:SessionMode condition key to\n control who can create a ReadWrite or ReadOnly session.\n For more information about ReadWrite or ReadOnly\n sessions, see \n x-amz-create-session-mode\n . For example policies, see\n Example bucket policies for S3 Express One Zone and Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone in the\n Amazon S3 User Guide.

\n

To grant cross-account access to Zonal endpoint API operations, the bucket policy should also grant both accounts the s3express:CreateSession permission.

\n

If you want to encrypt objects with SSE-KMS, you must also have the kms:GenerateDataKey and the kms:Decrypt permissions in IAM identity-based policies and KMS key policies for the target KMS key.

\n
\n
Encryption
\n
\n

For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your \n CreateSession requests or PUT object requests. Then, new objects \n are automatically encrypted with the desired encryption settings. For more\n information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

\n

For Zonal endpoint (object-level) API operations except CopyObject and UploadPartCopy, \nyou authenticate and authorize requests through CreateSession for low latency. \n To encrypt new objects in a directory bucket with SSE-KMS, you must specify SSE-KMS as the directory bucket's default encryption configuration with a KMS key (specifically, a customer managed key). Then, when a session is created for Zonal endpoint API operations, new objects are automatically encrypted and decrypted with SSE-KMS and S3 Bucket Keys during the session.

\n \n

\n Only 1 customer managed key is supported per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported. \n After you specify SSE-KMS as your bucket's default encryption configuration with a customer managed key, you can't change the customer managed key for the bucket's SSE-KMS configuration.\n

\n
\n

In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, \n you can't override the values of the encryption settings (x-amz-server-side-encryption, x-amz-server-side-encryption-aws-kms-key-id, x-amz-server-side-encryption-context, and x-amz-server-side-encryption-bucket-key-enabled) from the CreateSession request. \n You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and \n Amazon S3 will use the encryption settings values from the CreateSession request to protect new objects in the directory bucket. \n

\n \n

When you use the CLI or the Amazon Web Services SDKs, for CreateSession, the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the \n CreateSession request. It's not supported to override the encryption settings values in the CreateSession request. \n Also, in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), \n it's not supported to override the values of the encryption settings from the CreateSession request. \n\n

\n
\n
\n
HTTP Host header syntax
\n
\n

\n Directory buckets - The HTTP Host header syntax is \n Bucket_name.s3express-az_id.region.amazonaws.com.

\n
\n
", "smithy.api#http": { "method": "GET", "uri": "/{Bucket}?session", @@ -19810,6 +19810,34 @@ "com.amazonaws.s3#CreateSessionOutput": { "type": "structure", "members": { + "ServerSideEncryption": { + "target": "com.amazonaws.s3#ServerSideEncryption", + "traits": { + "smithy.api#documentation": "

The server-side encryption algorithm used when you store objects in the directory bucket.

", + "smithy.api#httpHeader": "x-amz-server-side-encryption" + } + }, + "SSEKMSKeyId": { + "target": "com.amazonaws.s3#SSEKMSKeyId", + "traits": { + "smithy.api#documentation": "

If you specify x-amz-server-side-encryption with aws:kms, this header indicates the ID of the KMS \n symmetric encryption customer managed key that was used for object encryption.

", + "smithy.api#httpHeader": "x-amz-server-side-encryption-aws-kms-key-id" + } + }, + "SSEKMSEncryptionContext": { + "target": "com.amazonaws.s3#SSEKMSEncryptionContext", + "traits": { + "smithy.api#documentation": "

If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of\n this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. \n This value is stored as object metadata and automatically gets\n passed on to Amazon Web Services KMS for future GetObject \n operations on this object.

", + "smithy.api#httpHeader": "x-amz-server-side-encryption-context" + } + }, + "BucketKeyEnabled": { + "target": "com.amazonaws.s3#BucketKeyEnabled", + "traits": { + "smithy.api#documentation": "

Indicates whether to use an S3 Bucket Key for server-side encryption\n with KMS keys (SSE-KMS).

", + "smithy.api#httpHeader": "x-amz-server-side-encryption-bucket-key-enabled" + } + }, "Credentials": { "target": "com.amazonaws.s3#SessionCredentials", "traits": { @@ -19829,7 +19857,7 @@ "SessionMode": { "target": "com.amazonaws.s3#SessionMode", "traits": { - "smithy.api#documentation": "

Specifies the mode of the session that will be created, either ReadWrite or\n ReadOnly. By default, a ReadWrite session is created. A\n ReadWrite session is capable of executing all the Zonal endpoint APIs on a\n directory bucket. A ReadOnly session is constrained to execute the following\n Zonal endpoint APIs: GetObject, HeadObject, ListObjectsV2,\n GetObjectAttributes, ListParts, and\n ListMultipartUploads.

", + "smithy.api#documentation": "

Specifies the mode of the session that will be created, either ReadWrite or\n ReadOnly. By default, a ReadWrite session is created. A\n ReadWrite session is capable of executing all the Zonal endpoint API operations on a\n directory bucket. A ReadOnly session is constrained to execute the following\n Zonal endpoint API operations: GetObject, HeadObject, ListObjectsV2,\n GetObjectAttributes, ListParts, and\n ListMultipartUploads.

", "smithy.api#httpHeader": "x-amz-create-session-mode" } }, @@ -19843,6 +19871,34 @@ "name": "Bucket" } } + }, + "ServerSideEncryption": { + "target": "com.amazonaws.s3#ServerSideEncryption", + "traits": { + "smithy.api#documentation": "

The server-side encryption algorithm to use when you store objects in the directory bucket.

\n

For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). By default, Amazon S3 encrypts data with SSE-S3. \n For more\n information, see Protecting data with server-side encryption in the Amazon S3 User Guide.

", + "smithy.api#httpHeader": "x-amz-server-side-encryption" + } + }, + "SSEKMSKeyId": { + "target": "com.amazonaws.s3#SSEKMSKeyId", + "traits": { + "smithy.api#documentation": "

If you specify x-amz-server-side-encryption with aws:kms, you must specify the \n x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS \n symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Also, if the KMS key doesn't exist in the same\n account that't issuing the command, you must use the full Key ARN not the Key ID.

\n

Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. \nAmazon Web Services managed key (aws/s3) isn't supported. \n

", + "smithy.api#httpHeader": "x-amz-server-side-encryption-aws-kms-key-id" + } + }, + "SSEKMSEncryptionContext": { + "target": "com.amazonaws.s3#SSEKMSEncryptionContext", + "traits": { + "smithy.api#documentation": "

Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for object encryption. The value of\n this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. \n This value is stored as object metadata and automatically gets passed on\n to Amazon Web Services KMS for future GetObject operations on\n this object.

\n

\n General purpose buckets - This value must be explicitly added during CopyObject operations if you want an additional encryption context for your object. For more information, see Encryption context in the Amazon S3 User Guide.

\n

\n Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

", + "smithy.api#httpHeader": "x-amz-server-side-encryption-context" + } + }, + "BucketKeyEnabled": { + "target": "com.amazonaws.s3#BucketKeyEnabled", + "traits": { + "smithy.api#documentation": "

Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with\n server-side encryption using KMS keys (SSE-KMS).

\n

S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets \nto directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or \n the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

", + "smithy.api#httpHeader": "x-amz-server-side-encryption-bucket-key-enabled" + } } }, "traits": { @@ -20077,7 +20133,7 @@ "target": "smithy.api#Unit" }, "traits": { - "smithy.api#documentation": "\n

This operation is not supported by directory buckets.

\n
\n

This implementation of the DELETE action resets the default encryption for the bucket as\n server-side encryption with Amazon S3 managed keys (SSE-S3). For information about the bucket\n default encryption feature, see Amazon S3 Bucket Default Encryption\n in the Amazon S3 User Guide.

\n

To use this operation, you must have permissions to perform the\n s3:PutEncryptionConfiguration action. The bucket owner has this permission\n by default. The bucket owner can grant this permission to others. For more information\n about permissions, see Permissions Related to Bucket Subresource Operations and Managing\n Access Permissions to your Amazon S3 Resources in the\n Amazon S3 User Guide.

\n

The following operations are related to DeleteBucketEncryption:

\n ", + "smithy.api#documentation": "

This implementation of the DELETE action resets the default encryption for the bucket as\n server-side encryption with Amazon S3 managed keys (SSE-S3).

\n \n \n \n
\n
Permissions
\n
\n \n
\n
HTTP Host header syntax
\n
\n

\n Directory buckets - The HTTP Host header syntax is s3express-control.region.amazonaws.com.

\n
\n
\n

The following operations are related to DeleteBucketEncryption:

\n ", "smithy.api#http": { "method": "DELETE", "uri": "/{Bucket}?encryption", @@ -20096,7 +20152,7 @@ "Bucket": { "target": "com.amazonaws.s3#BucketName", "traits": { - "smithy.api#documentation": "

The name of the bucket containing the server-side encryption configuration to\n delete.

", + "smithy.api#documentation": "

The name of the bucket containing the server-side encryption configuration to\n delete.

\n

\n Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name\n . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format \n bucket_base_name--az_id--x-s3 (for example, \n DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide\n

", "smithy.api#httpLabel": {}, "smithy.api#required": {}, "smithy.rules#contextParam": { @@ -20107,7 +20163,7 @@ "ExpectedBucketOwner": { "target": "com.amazonaws.s3#AccountId", "traits": { - "smithy.api#documentation": "

The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

", + "smithy.api#documentation": "

The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

\n \n

For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code \n501 Not Implemented.

\n
", "smithy.api#httpHeader": "x-amz-expected-bucket-owner" } } @@ -21573,7 +21629,7 @@ } }, "traits": { - "smithy.api#documentation": "

Optional configuration to replicate existing source bucket objects. For more\n information, see Replicating Existing Objects in the Amazon S3 User Guide.\n

" + "smithy.api#documentation": "

Optional configuration to replicate existing source bucket objects. \n

\n \n

This parameter is no longer supported. To replicate existing objects, see Replicating existing objects with S3 Batch Replication in the Amazon S3 User Guide.

\n
" } }, "com.amazonaws.s3#ExistingObjectReplicationStatus": { @@ -22035,7 +22091,7 @@ "target": "com.amazonaws.s3#GetBucketEncryptionOutput" }, "traits": { - "smithy.api#documentation": "\n

This operation is not supported by directory buckets.

\n
\n

Returns the default encryption configuration for an Amazon S3 bucket. By default, all buckets\n have a default encryption configuration that uses server-side encryption with Amazon S3 managed\n keys (SSE-S3). For information about the bucket default encryption feature, see Amazon S3 Bucket\n Default Encryption in the Amazon S3 User Guide.

\n

To use this operation, you must have permission to perform the\n s3:GetEncryptionConfiguration action. The bucket owner has this permission\n by default. The bucket owner can grant this permission to others. For more information\n about permissions, see Permissions Related to Bucket Subresource Operations and Managing\n Access Permissions to Your Amazon S3 Resources.

\n

The following operations are related to GetBucketEncryption:

\n ", + "smithy.api#documentation": "

Returns the default encryption configuration for an Amazon S3 bucket. By default, all buckets\n have a default encryption configuration that uses server-side encryption with Amazon S3 managed\n keys (SSE-S3).

\n \n \n \n
\n
Permissions
\n
\n \n
\n
HTTP Host header syntax
\n
\n

\n Directory buckets - The HTTP Host header syntax is s3express-control.region.amazonaws.com.

\n
\n
\n

The following operations are related to GetBucketEncryption:

\n ", "smithy.api#http": { "method": "GET", "uri": "/{Bucket}?encryption", @@ -22068,7 +22124,7 @@ "Bucket": { "target": "com.amazonaws.s3#BucketName", "traits": { - "smithy.api#documentation": "

The name of the bucket from which the server-side encryption configuration is\n retrieved.

", + "smithy.api#documentation": "

The name of the bucket from which the server-side encryption configuration is\n retrieved.

\n

\n Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name\n . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format \n bucket_base_name--az_id--x-s3 (for example, \n DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide\n

", "smithy.api#httpLabel": {}, "smithy.api#required": {}, "smithy.rules#contextParam": { @@ -22079,7 +22135,7 @@ "ExpectedBucketOwner": { "target": "com.amazonaws.s3#AccountId", "traits": { - "smithy.api#documentation": "

The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

", + "smithy.api#documentation": "

The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

\n \n

For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code \n501 Not Implemented.

\n
", "smithy.api#httpHeader": "x-amz-expected-bucket-owner" } } @@ -23221,7 +23277,7 @@ "SHA1" ] }, - "smithy.api#documentation": "

Retrieves an object from Amazon S3.

\n

In the GetObject request, specify the full key name for the object.

\n

\n General purpose buckets - Both the virtual-hosted-style requests and the path-style requests are supported. For a virtual hosted-style request example, if you have\n the object photos/2006/February/sample.jpg, specify the object key name as\n /photos/2006/February/sample.jpg. For a path-style request example, if you\n have the object photos/2006/February/sample.jpg in the bucket named\n examplebucket, specify the object key name as\n /examplebucket/photos/2006/February/sample.jpg. For more information about\n request types, see HTTP Host\n Header Bucket Specification in the Amazon S3 User Guide.

\n

\n Directory buckets - Only virtual-hosted-style requests are supported. For a virtual hosted-style request example, if you have the object photos/2006/February/sample.jpg in the bucket named examplebucket--use1-az5--x-s3, specify the object key name as /photos/2006/February/sample.jpg. Also, when you make requests to this API operation, your requests are sent to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format https://bucket_name.s3express-az_id.region.amazonaws.com/key-name\n . Path-style requests are not supported. For more information, see Regional and Zonal endpoints in the\n Amazon S3 User Guide.

\n
\n
Permissions
\n
\n \n
\n
Storage classes
\n
\n

If the object you are retrieving is stored in the S3 Glacier Flexible Retrieval storage class, the \n S3 Glacier Deep Archive storage class, the S3 Intelligent-Tiering Archive Access tier, or the \n S3 Intelligent-Tiering Deep Archive Access tier, before you can retrieve the object you must first restore a\n copy using RestoreObject. Otherwise, this operation returns an\n InvalidObjectState error. For information about restoring archived objects,\n see Restoring\n Archived Objects in the Amazon S3 User Guide.

\n

\n Directory buckets - For directory buckets, only the S3 Express One Zone storage class is supported to store newly created objects. \nUnsupported storage class values won't write a destination object and will respond with the HTTP status code 400 Bad Request.

\n
\n
Encryption
\n
\n

Encryption request headers, like x-amz-server-side-encryption, should not\n be sent for the GetObject requests, if your object uses server-side encryption with Amazon S3 managed encryption keys (SSE-S3), server-side encryption with Key Management Service (KMS)\n keys (SSE-KMS), or dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS). If you include the header in your GetObject requests for the object that uses \n these types of keys, you’ll get an HTTP 400 Bad Request error.

\n
\n
Overriding response header values through the request
\n
\n

There are times when you want to override certain response header values of a\n GetObject response. For example, you might override the\n Content-Disposition response header value through your GetObject\n request.

\n

You can override values for a set of response headers. These modified response header values are included only in a successful response, that is, when the HTTP status code 200 OK is returned. \n The headers you can override using the following query parameters in the request are a subset of the headers that Amazon S3 accepts when you create an object. \n

\n

The response headers that you can override for the\n GetObject response are Cache-Control, Content-Disposition, \n Content-Encoding, Content-Language, Content-Type, and Expires.

\n

To override values for a set of response headers in the\n GetObject response, you can use the following query\n parameters in the request.

\n \n \n

When you use these parameters, you must sign the request by using either an Authorization header or a\n presigned URL. These parameters cannot be used with an\n unsigned (anonymous) request.

\n
\n
\n
HTTP Host header syntax
\n
\n

\n Directory buckets - The HTTP Host header syntax is \n Bucket_name.s3express-az_id.region.amazonaws.com.

\n
\n
\n

The following operations are related to GetObject:

\n ", + "smithy.api#documentation": "

Retrieves an object from Amazon S3.

\n

In the GetObject request, specify the full key name for the object.

\n

\n General purpose buckets - Both the virtual-hosted-style requests and the path-style requests are supported. For a virtual hosted-style request example, if you have\n the object photos/2006/February/sample.jpg, specify the object key name as\n /photos/2006/February/sample.jpg. For a path-style request example, if you\n have the object photos/2006/February/sample.jpg in the bucket named\n examplebucket, specify the object key name as\n /examplebucket/photos/2006/February/sample.jpg. For more information about\n request types, see HTTP Host\n Header Bucket Specification in the Amazon S3 User Guide.

\n

\n Directory buckets - Only virtual-hosted-style requests are supported. For a virtual hosted-style request example, if you have the object photos/2006/February/sample.jpg in the bucket named examplebucket--use1-az5--x-s3, specify the object key name as /photos/2006/February/sample.jpg. Also, when you make requests to this API operation, your requests are sent to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format https://bucket_name.s3express-az_id.region.amazonaws.com/key-name\n . Path-style requests are not supported. For more information, see Regional and Zonal endpoints in the\n Amazon S3 User Guide.

\n
\n
Permissions
\n
\n \n
\n
Storage classes
\n
\n

If the object you are retrieving is stored in the S3 Glacier Flexible Retrieval storage class, the \n S3 Glacier Deep Archive storage class, the S3 Intelligent-Tiering Archive Access tier, or the \n S3 Intelligent-Tiering Deep Archive Access tier, before you can retrieve the object you must first restore a\n copy using RestoreObject. Otherwise, this operation returns an\n InvalidObjectState error. For information about restoring archived objects,\n see Restoring\n Archived Objects in the Amazon S3 User Guide.

\n

\n Directory buckets - For directory buckets, only the S3 Express One Zone storage class is supported to store newly created objects. \nUnsupported storage class values won't write a destination object and will respond with the HTTP status code 400 Bad Request.

\n
\n
Encryption
\n
\n

Encryption request headers, like x-amz-server-side-encryption, should not\n be sent for the GetObject requests, if your object uses server-side encryption with Amazon S3 managed encryption keys (SSE-S3), server-side encryption with Key Management Service (KMS)\n keys (SSE-KMS), or dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS). If you include the header in your GetObject requests for the object that uses \n these types of keys, you’ll get an HTTP 400 Bad Request error.

\n

\n Directory buckets - For directory buckets, there are only two supported options for server-side encryption: SSE-S3 and SSE-KMS. SSE-C isn't supported. For more\n information, see Protecting data with server-side encryption in the Amazon S3 User Guide.

\n
\n
Overriding response header values through the request
\n
\n

There are times when you want to override certain response header values of a\n GetObject response. For example, you might override the\n Content-Disposition response header value through your GetObject\n request.

\n

You can override values for a set of response headers. These modified response header values are included only in a successful response, that is, when the HTTP status code 200 OK is returned. \n The headers you can override using the following query parameters in the request are a subset of the headers that Amazon S3 accepts when you create an object. \n

\n

The response headers that you can override for the\n GetObject response are Cache-Control, Content-Disposition, \n Content-Encoding, Content-Language, Content-Type, and Expires.

\n

To override values for a set of response headers in the\n GetObject response, you can use the following query\n parameters in the request.

\n \n \n

When you use these parameters, you must sign the request by using either an Authorization header or a\n presigned URL. These parameters cannot be used with an\n unsigned (anonymous) request.

\n
\n
\n
HTTP Host header syntax
\n
\n

\n Directory buckets - The HTTP Host header syntax is \n Bucket_name.s3express-az_id.region.amazonaws.com.

\n
\n
\n

The following operations are related to GetObject:

\n ", "smithy.api#http": { "method": "GET", "uri": "/{Bucket}/{Key+}?x-id=GetObject", @@ -23393,7 +23449,7 @@ } ], "traits": { - "smithy.api#documentation": "

Retrieves all the metadata from an object without returning the object itself. This\n operation is useful if you're interested only in an object's metadata.

\n

\n GetObjectAttributes combines the functionality of HeadObject\n and ListParts. All of the data returned with each of those individual calls\n can be returned with a single call to GetObjectAttributes.

\n \n

\n Directory buckets - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format https://bucket_name.s3express-az_id.region.amazonaws.com/key-name\n . Path-style requests are not supported. For more information, see Regional and Zonal endpoints in the\n Amazon S3 User Guide.

\n
\n
\n
Permissions
\n
\n \n
\n
Encryption
\n
\n \n

Encryption request headers, like x-amz-server-side-encryption,\n should not be sent for HEAD requests if your object uses server-side\n encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side\n encryption with Amazon Web Services KMS keys (DSSE-KMS), or server-side encryption with Amazon S3\n managed encryption keys (SSE-S3). The x-amz-server-side-encryption header is used when you PUT an object to S3 and want to specify the encryption method. \n If you include this header in a GET request for an object that uses these types of keys, \n you’ll get an HTTP 400 Bad Request error. It's because the encryption method can't be changed when you retrieve the object.

\n
\n

If you encrypt an object by using server-side encryption with customer-provided\n encryption keys (SSE-C) when you store the object in Amazon S3, then when you retrieve the\n metadata from the object, you must use the following headers to provide the encryption key for the server to be able to retrieve the object's metadata. The headers are:

\n \n

For more information about SSE-C, see Server-Side Encryption\n (Using Customer-Provided Encryption Keys) in the Amazon S3\n User Guide.

\n \n

\n Directory bucket permissions - For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

\n
\n
\n
Versioning
\n
\n

\n Directory buckets - S3 Versioning isn't enabled and supported for directory buckets. For this API operation, only the null value of the version ID is supported by directory buckets. You can only specify null \n to the versionId query parameter in the request.

\n
\n
Conditional request headers
\n
\n

Consider the following when using request headers:

\n \n
\n
HTTP Host header syntax
\n
\n

\n Directory buckets - The HTTP Host header syntax is \n Bucket_name.s3express-az_id.region.amazonaws.com.

\n
\n
\n

The following actions are related to GetObjectAttributes:

\n ", + "smithy.api#documentation": "

Retrieves all the metadata from an object without returning the object itself. This\n operation is useful if you're interested only in an object's metadata.

\n

\n GetObjectAttributes combines the functionality of HeadObject\n and ListParts. All of the data returned with each of those individual calls\n can be returned with a single call to GetObjectAttributes.

\n \n

\n Directory buckets - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format https://bucket_name.s3express-az_id.region.amazonaws.com/key-name\n . Path-style requests are not supported. For more information, see Regional and Zonal endpoints in the\n Amazon S3 User Guide.

\n
\n
\n
Permissions
\n
\n \n
\n
Encryption
\n
\n \n

Encryption request headers, like x-amz-server-side-encryption,\n should not be sent for HEAD requests if your object uses server-side\n encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side\n encryption with Amazon Web Services KMS keys (DSSE-KMS), or server-side encryption with Amazon S3\n managed encryption keys (SSE-S3). The x-amz-server-side-encryption header is used when you PUT an object to S3 and want to specify the encryption method. \n If you include this header in a GET request for an object that uses these types of keys, \n you’ll get an HTTP 400 Bad Request error. It's because the encryption method can't be changed when you retrieve the object.

\n
\n

If you encrypt an object by using server-side encryption with customer-provided\n encryption keys (SSE-C) when you store the object in Amazon S3, then when you retrieve the\n metadata from the object, you must use the following headers to provide the encryption key for the server to be able to retrieve the object's metadata. The headers are:

\n \n

For more information about SSE-C, see Server-Side Encryption\n (Using Customer-Provided Encryption Keys) in the Amazon S3\n User Guide.

\n \n

\n Directory bucket permissions - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your \n CreateSession requests or PUT object requests. Then, new objects \n are automatically encrypted with the desired encryption settings. For more\n information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

\n
\n
\n
Versioning
\n
\n

\n Directory buckets - S3 Versioning isn't enabled and supported for directory buckets. For this API operation, only the null value of the version ID is supported by directory buckets. You can only specify null \n to the versionId query parameter in the request.

\n
\n
Conditional request headers
\n
\n

Consider the following when using request headers:

\n \n
\n
HTTP Host header syntax
\n
\n

\n Directory buckets - The HTTP Host header syntax is \n Bucket_name.s3express-az_id.region.amazonaws.com.

\n
\n
\n

The following actions are related to GetObjectAttributes:

\n ", "smithy.api#http": { "method": "GET", "uri": "/{Bucket}/{Key+}?attributes", @@ -23902,7 +23958,7 @@ "ServerSideEncryption": { "target": "com.amazonaws.s3#ServerSideEncryption", "traits": { - "smithy.api#documentation": "

The server-side encryption algorithm used when you store this object in Amazon S3 (for example,\n AES256, aws:kms, aws:kms:dsse).

\n \n

For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

\n
", + "smithy.api#documentation": "

The server-side encryption algorithm used when you store this object in Amazon S3.

", "smithy.api#httpHeader": "x-amz-server-side-encryption" } }, @@ -23930,14 +23986,14 @@ "SSEKMSKeyId": { "target": "com.amazonaws.s3#SSEKMSKeyId", "traits": { - "smithy.api#documentation": "

If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key\n that was used for the object.

\n \n

This functionality is not supported for directory buckets.

\n
", + "smithy.api#documentation": "

If present, indicates the ID of the KMS key that was used for object encryption.

", "smithy.api#httpHeader": "x-amz-server-side-encryption-aws-kms-key-id" } }, "BucketKeyEnabled": { "target": "com.amazonaws.s3#BucketKeyEnabled", "traits": { - "smithy.api#documentation": "

Indicates whether the object uses an S3 Bucket Key for server-side encryption\n with Key Management Service (KMS) keys (SSE-KMS).

\n \n

This functionality is not supported for directory buckets.

\n
", + "smithy.api#documentation": "

Indicates whether the object uses an S3 Bucket Key for server-side encryption\n with Key Management Service (KMS) keys (SSE-KMS).

", "smithy.api#httpHeader": "x-amz-server-side-encryption-bucket-key-enabled" } }, @@ -24154,7 +24210,7 @@ "ChecksumMode": { "target": "com.amazonaws.s3#ChecksumMode", "traits": { - "smithy.api#documentation": "

To retrieve the checksum, this mode must be enabled.

\n

In addition, if you enable checksum mode and the object is uploaded with a \n checksum \n and encrypted with an Key Management Service (KMS) key, you must have permission to use the \n kms:Decrypt action to retrieve the checksum.

", + "smithy.api#documentation": "

To retrieve the checksum, this mode must be enabled.

\n

\n General purpose buckets - In addition, if you enable checksum mode and the object is uploaded with a \n checksum \n and encrypted with an Key Management Service (KMS) key, you must have permission to use the \n kms:Decrypt action to retrieve the checksum.

", "smithy.api#httpHeader": "x-amz-checksum-mode" } } @@ -24768,7 +24824,7 @@ } ], "traits": { - "smithy.api#documentation": "

The HEAD operation retrieves metadata from an object without returning the\n object itself. This operation is useful if you're interested only in an object's metadata.

\n \n

A HEAD request has the same options as a GET operation on an\n object. The response is identical to the GET response except that there is no\n response body. Because of this, if the HEAD request generates an error, it\n returns a generic code, such as 400 Bad Request, 403 Forbidden, 404 Not\n Found, 405 Method Not Allowed, 412 Precondition Failed, or 304 Not Modified. \n It's not possible to retrieve the exact exception of these error codes.

\n
\n

Request headers are limited to 8 KB in size. For more information, see Common\n Request Headers.

\n
\n
Permissions
\n
\n

\n \n
\n
Encryption
\n
\n \n

Encryption request headers, like x-amz-server-side-encryption,\n should not be sent for HEAD requests if your object uses server-side\n encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side\n encryption with Amazon Web Services KMS keys (DSSE-KMS), or server-side encryption with Amazon S3\n managed encryption keys (SSE-S3). The x-amz-server-side-encryption header is used when you PUT an object to S3 and want to specify the encryption method. \n If you include this header in a HEAD request for an object that uses these types of keys, \n you’ll get an HTTP 400 Bad Request error. It's because the encryption method can't be changed when you retrieve the object.

\n
\n

If you encrypt an object by using server-side encryption with customer-provided\n encryption keys (SSE-C) when you store the object in Amazon S3, then when you retrieve the\n metadata from the object, you must use the following headers to provide the encryption key for the server to be able to retrieve the object's metadata. The headers are:

\n \n

For more information about SSE-C, see Server-Side Encryption\n (Using Customer-Provided Encryption Keys) in the Amazon S3\n User Guide.

\n \n

\n Directory bucket permissions - For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

\n
\n
\n
Versioning
\n
\n \n \n
    \n
  • \n

    \n Directory buckets - Delete marker is not supported by directory buckets.

    \n
  • \n
  • \n

    \n Directory buckets - S3 Versioning isn't enabled and supported for directory buckets. For this API operation, only the null value of the version ID is supported by directory buckets. You can only specify null \n to the versionId query parameter in the request.

    \n
  • \n
\n
\n
\n
HTTP Host header syntax
\n
\n

\n Directory buckets - The HTTP Host header syntax is \n Bucket_name.s3express-az_id.region.amazonaws.com.

\n \n

For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format https://bucket_name.s3express-az_id.region.amazonaws.com/key-name\n . Path-style requests are not supported. For more information, see Regional and Zonal endpoints in the\n Amazon S3 User Guide.

\n
\n
\n
\n

The following actions are related to HeadObject:

\n ", + "smithy.api#documentation": "

The HEAD operation retrieves metadata from an object without returning the\n object itself. This operation is useful if you're interested only in an object's metadata.

\n \n

A HEAD request has the same options as a GET operation on an\n object. The response is identical to the GET response except that there is no\n response body. Because of this, if the HEAD request generates an error, it\n returns a generic code, such as 400 Bad Request, 403 Forbidden, 404 Not\n Found, 405 Method Not Allowed, 412 Precondition Failed, or 304 Not Modified. \n It's not possible to retrieve the exact exception of these error codes.

\n
\n

Request headers are limited to 8 KB in size. For more information, see Common\n Request Headers.

\n
\n
Permissions
\n
\n

\n \n
\n
Encryption
\n
\n \n

Encryption request headers, like x-amz-server-side-encryption,\n should not be sent for HEAD requests if your object uses server-side\n encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side\n encryption with Amazon Web Services KMS keys (DSSE-KMS), or server-side encryption with Amazon S3\n managed encryption keys (SSE-S3). The x-amz-server-side-encryption header is used when you PUT an object to S3 and want to specify the encryption method. \n If you include this header in a HEAD request for an object that uses these types of keys, \n you’ll get an HTTP 400 Bad Request error. It's because the encryption method can't be changed when you retrieve the object.

\n
\n

If you encrypt an object by using server-side encryption with customer-provided\n encryption keys (SSE-C) when you store the object in Amazon S3, then when you retrieve the\n metadata from the object, you must use the following headers to provide the encryption key for the server to be able to retrieve the object's metadata. The headers are:

\n \n

For more information about SSE-C, see Server-Side Encryption\n (Using Customer-Provided Encryption Keys) in the Amazon S3\n User Guide.

\n \n

\n Directory bucket - For directory buckets, there are only two supported options for server-side encryption: SSE-S3 and SSE-KMS. SSE-C isn't supported. For more\n information, see Protecting data with server-side encryption in the Amazon S3 User Guide.

\n
\n
\n
Versioning
\n
\n \n \n
    \n
  • \n

    \n Directory buckets - Delete marker is not supported by directory buckets.

    \n
  • \n
  • \n

    \n Directory buckets - S3 Versioning isn't enabled and supported for directory buckets. For this API operation, only the null value of the version ID is supported by directory buckets. You can only specify null \n to the versionId query parameter in the request.

    \n
  • \n
\n
\n
\n
HTTP Host header syntax
\n
\n

\n Directory buckets - The HTTP Host header syntax is \n Bucket_name.s3express-az_id.region.amazonaws.com.

\n \n

For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format https://bucket_name.s3express-az_id.region.amazonaws.com/key-name\n . Path-style requests are not supported. For more information, see Regional and Zonal endpoints in the\n Amazon S3 User Guide.

\n
\n
\n
\n

The following actions are related to HeadObject:

\n ", "smithy.api#http": { "method": "HEAD", "uri": "/{Bucket}/{Key+}", @@ -24959,7 +25015,7 @@ "ServerSideEncryption": { "target": "com.amazonaws.s3#ServerSideEncryption", "traits": { - "smithy.api#documentation": "

The server-side encryption algorithm used when you store this object in Amazon S3 (for example,\n AES256, aws:kms, aws:kms:dsse).

\n \n

For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

\n
", + "smithy.api#documentation": "

The server-side encryption algorithm used when you store this object in Amazon S3 (for example,\n AES256, aws:kms, aws:kms:dsse).

", "smithy.api#httpHeader": "x-amz-server-side-encryption" } }, @@ -24987,14 +25043,14 @@ "SSEKMSKeyId": { "target": "com.amazonaws.s3#SSEKMSKeyId", "traits": { - "smithy.api#documentation": "

If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key\n that was used for the object.

\n \n

This functionality is not supported for directory buckets.

\n
", + "smithy.api#documentation": "

If present, indicates the ID of the KMS key that was used for object encryption.

", "smithy.api#httpHeader": "x-amz-server-side-encryption-aws-kms-key-id" } }, "BucketKeyEnabled": { "target": "com.amazonaws.s3#BucketKeyEnabled", "traits": { - "smithy.api#documentation": "

Indicates whether the object uses an S3 Bucket Key for server-side encryption\n with Key Management Service (KMS) keys (SSE-KMS).

\n \n

This functionality is not supported for directory buckets.

\n
", + "smithy.api#documentation": "

Indicates whether the object uses an S3 Bucket Key for server-side encryption\n with Key Management Service (KMS) keys (SSE-KMS).

", "smithy.api#httpHeader": "x-amz-server-side-encryption-bucket-key-enabled" } }, @@ -25204,7 +25260,7 @@ "ChecksumMode": { "target": "com.amazonaws.s3#ChecksumMode", "traits": { - "smithy.api#documentation": "

To retrieve the checksum, this parameter must be enabled.

\n

In addition, if you enable checksum mode and the object is uploaded with a \n checksum \n and encrypted with an Key Management Service (KMS) key, you must have permission to use the \n kms:Decrypt action to retrieve the checksum.

", + "smithy.api#documentation": "

To retrieve the checksum, this parameter must be enabled.

\n

\n General purpose buckets - If you enable checksum mode and the object is uploaded with a \n checksum \n and encrypted with an Key Management Service (KMS) key, you must have permission to use the \n kms:Decrypt action to retrieve the checksum.

\n

\n Directory buckets - If you enable ChecksumMode and the object is encrypted with\n Amazon Web Services Key Management Service (Amazon Web Services KMS), you must also have the\n kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies and KMS key policies for the KMS key to retrieve the checksum of the object.

", "smithy.api#httpHeader": "x-amz-checksum-mode" } } @@ -29569,7 +29625,7 @@ "requestAlgorithmMember": "ChecksumAlgorithm", "requestChecksumRequired": true }, - "smithy.api#documentation": "\n

This operation is not supported by directory buckets.

\n
\n

This action uses the encryption subresource to configure default encryption\n and Amazon S3 Bucket Keys for an existing bucket.

\n

By default, all buckets have a default encryption configuration that uses server-side\n encryption with Amazon S3 managed keys (SSE-S3). You can optionally configure default encryption\n for a bucket by using server-side encryption with Key Management Service (KMS) keys (SSE-KMS) or\n dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS). If you specify default encryption by using\n SSE-KMS, you can also configure Amazon S3 Bucket\n Keys. If you use PutBucketEncryption to set your default bucket encryption to SSE-KMS, you should verify that your KMS key ID is correct. Amazon S3 does not validate the KMS key ID provided in PutBucketEncryption requests.

\n \n

If you're specifying a customer managed KMS key, we recommend using a fully qualified\n KMS key ARN. If you use a KMS key alias instead, then KMS resolves the key within the\n requester’s account. This behavior can result in data that's encrypted with a KMS key\n that belongs to the requester, and not the bucket owner.

\n

Also, this action requires Amazon Web Services Signature Version 4. For more information, see \n Authenticating Requests (Amazon Web Services Signature Version 4).

\n
\n

To use this operation, you must have permission to perform the\n s3:PutEncryptionConfiguration action. The bucket owner has this permission\n by default. The bucket owner can grant this permission to others. For more information\n about permissions, see Permissions Related to Bucket Subresource Operations and Managing\n Access Permissions to Your Amazon S3 Resources in the\n Amazon S3 User Guide.

\n

The following operations are related to PutBucketEncryption:

\n ", + "smithy.api#documentation": "

This operation configures default encryption \n and Amazon S3 Bucket Keys for an existing bucket.

\n \n

\n Directory buckets - For directory buckets, you must make requests for this API operation to the Regional endpoint. These endpoints support path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name\n . Virtual-hosted-style requests aren't supported. \nFor more information, see Regional and Zonal endpoints in the\n Amazon S3 User Guide.

\n
\n

By default, all buckets have a default encryption configuration that uses server-side\n encryption with Amazon S3 managed keys (SSE-S3).

\n \n \n \n \n

If you're specifying a customer managed KMS key, we recommend using a fully qualified\n KMS key ARN. If you use a KMS key alias instead, then KMS resolves the key within the\n requester’s account. This behavior can result in data that's encrypted with a KMS key\n that belongs to the requester, and not the bucket owner.

\n

Also, this action requires Amazon Web Services Signature Version 4. For more information, see \n Authenticating Requests (Amazon Web Services Signature Version 4).

\n
\n
\n
Permissions
\n
\n \n
\n
HTTP Host header syntax
\n
\n

\n Directory buckets - The HTTP Host header syntax is s3express-control.region.amazonaws.com.

\n
\n
\n

The following operations are related to PutBucketEncryption:

\n ", "smithy.api#http": { "method": "PUT", "uri": "/{Bucket}?encryption", @@ -29588,7 +29644,7 @@ "Bucket": { "target": "com.amazonaws.s3#BucketName", "traits": { - "smithy.api#documentation": "

Specifies default encryption for a bucket using server-side encryption with different\n key options. By default, all buckets have a default encryption configuration that uses\n server-side encryption with Amazon S3 managed keys (SSE-S3). You can optionally configure\n default encryption for a bucket by using server-side encryption with an Amazon Web Services KMS key\n (SSE-KMS) or a customer-provided key (SSE-C). For information about the bucket default\n encryption feature, see Amazon S3 Bucket Default Encryption\n in the Amazon S3 User Guide.

", + "smithy.api#documentation": "

Specifies default encryption for a bucket using server-side encryption with different\n key options.

\n

\n Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name\n . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format \n bucket_base_name--az_id--x-s3 (for example, \n DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide\n

", "smithy.api#httpLabel": {}, "smithy.api#required": {}, "smithy.rules#contextParam": { @@ -29599,14 +29655,14 @@ "ContentMD5": { "target": "com.amazonaws.s3#ContentMD5", "traits": { - "smithy.api#documentation": "

The base64-encoded 128-bit MD5 digest of the server-side encryption\n configuration.

\n

For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

", + "smithy.api#documentation": "

The base64-encoded 128-bit MD5 digest of the server-side encryption\n configuration.

\n

For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

\n \n

This functionality is not supported for directory buckets.

\n
", "smithy.api#httpHeader": "Content-MD5" } }, "ChecksumAlgorithm": { "target": "com.amazonaws.s3#ChecksumAlgorithm", "traits": { - "smithy.api#documentation": "

Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any\n additional functionality if you don't use the SDK. When you send this header, there must be a corresponding x-amz-checksum or\n x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request. For more\n information, see Checking object integrity in\n the Amazon S3 User Guide.

\n

If you provide an individual checksum, Amazon S3 ignores any provided\n ChecksumAlgorithm parameter.

", + "smithy.api#documentation": "

Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any\n additional functionality if you don't use the SDK. When you send this header, there must be a corresponding x-amz-checksum or\n x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request. For more\n information, see Checking object integrity in\n the Amazon S3 User Guide.

\n

If you provide an individual checksum, Amazon S3 ignores any provided\n ChecksumAlgorithm parameter.

\n \n

For directory buckets, when you use Amazon Web Services SDKs, CRC32 is the default checksum algorithm that's used for performance.

\n
", "smithy.api#httpHeader": "x-amz-sdk-checksum-algorithm" } }, @@ -29621,7 +29677,7 @@ "ExpectedBucketOwner": { "target": "com.amazonaws.s3#AccountId", "traits": { - "smithy.api#documentation": "

The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

", + "smithy.api#documentation": "

The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

\n \n

For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code \n501 Not Implemented.

\n
", "smithy.api#httpHeader": "x-amz-expected-bucket-owner" } } @@ -30739,7 +30795,7 @@ "aws.protocols#httpChecksum": { "requestAlgorithmMember": "ChecksumAlgorithm" }, - "smithy.api#documentation": "

Adds an object to a bucket.

\n \n \n \n

Amazon S3 is a distributed system. If it receives multiple write requests for the same object\n simultaneously, it overwrites all but the last object written. However, Amazon S3 provides features that can modify this behavior:

\n \n
\n
Permissions
\n
\n \n
\n
Data integrity with Content-MD5
\n
\n \n
\n
HTTP Host header syntax
\n
\n

\n Directory buckets - The HTTP Host header syntax is \n Bucket_name.s3express-az_id.region.amazonaws.com.

\n
\n
\n

For more information about related Amazon S3 APIs, see the following:

\n ", + "smithy.api#documentation": "

Adds an object to a bucket.

\n \n \n \n

Amazon S3 is a distributed system. If it receives multiple write requests for the same object\n simultaneously, it overwrites all but the last object written. However, Amazon S3 provides features that can modify this behavior:

\n \n
\n
Permissions
\n
\n \n
\n
Data integrity with Content-MD5
\n
\n \n
\n
HTTP Host header syntax
\n
\n

\n Directory buckets - The HTTP Host header syntax is \n Bucket_name.s3express-az_id.region.amazonaws.com.

\n
\n
\n

For more information about related Amazon S3 APIs, see the following:

\n ", "smithy.api#examples": [ { "title": "To create an object.", @@ -31268,7 +31324,7 @@ "ServerSideEncryption": { "target": "com.amazonaws.s3#ServerSideEncryption", "traits": { - "smithy.api#documentation": "

The server-side encryption algorithm used when you store this object in Amazon S3 (for example,\n AES256, aws:kms, aws:kms:dsse).

\n \n

For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

\n
", + "smithy.api#documentation": "

The server-side encryption algorithm used when you store this object in Amazon S3.

", "smithy.api#httpHeader": "x-amz-server-side-encryption" } }, @@ -31296,21 +31352,21 @@ "SSEKMSKeyId": { "target": "com.amazonaws.s3#SSEKMSKeyId", "traits": { - "smithy.api#documentation": "

If x-amz-server-side-encryption has a valid value of aws:kms\n or aws:kms:dsse, this header indicates the ID of the Key Management Service (KMS)\n symmetric encryption customer managed key that was used for the object.

\n \n

This functionality is not supported for directory buckets.

\n
", + "smithy.api#documentation": "

If present, indicates the ID of the KMS key that was used for object encryption.

", "smithy.api#httpHeader": "x-amz-server-side-encryption-aws-kms-key-id" } }, "SSEKMSEncryptionContext": { "target": "com.amazonaws.s3#SSEKMSEncryptionContext", "traits": { - "smithy.api#documentation": "

If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The\n value of this header is a base64-encoded UTF-8 string holding JSON with the encryption\n context key-value pairs. This value is stored as object metadata and automatically gets\n passed on to Amazon Web Services KMS for future GetObject or CopyObject\n operations on this object.

\n \n

This functionality is not supported for directory buckets.

\n
", + "smithy.api#documentation": "

If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of\n this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. \n This value is stored as object metadata and automatically gets\n passed on to Amazon Web Services KMS for future GetObject \n operations on this object.

", "smithy.api#httpHeader": "x-amz-server-side-encryption-context" } }, "BucketKeyEnabled": { "target": "com.amazonaws.s3#BucketKeyEnabled", "traits": { - "smithy.api#documentation": "

Indicates whether the uploaded object uses an S3 Bucket Key for server-side encryption\n with Key Management Service (KMS) keys (SSE-KMS).

\n \n

This functionality is not supported for directory buckets.

\n
", + "smithy.api#documentation": "

Indicates whether the uploaded object uses an S3 Bucket Key for server-side encryption\n with Key Management Service (KMS) keys (SSE-KMS).

", "smithy.api#httpHeader": "x-amz-server-side-encryption-bucket-key-enabled" } }, @@ -31501,7 +31557,7 @@ "ServerSideEncryption": { "target": "com.amazonaws.s3#ServerSideEncryption", "traits": { - "smithy.api#documentation": "

The server-side encryption algorithm that was used when you store this object in Amazon S3 (for example,\n AES256, aws:kms, aws:kms:dsse).

\n

\n General purpose buckets - You have four mutually exclusive options to protect data using server-side encryption in\n Amazon S3, depending on how you choose to manage the encryption keys. Specifically, the\n encryption key options are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or\n DSSE-KMS), and customer-provided keys (SSE-C). Amazon S3 encrypts data with server-side\n encryption by using Amazon S3 managed keys (SSE-S3) by default. You can optionally tell Amazon S3 to\n encrypt data at rest by using server-side encryption with other key options. For more\n information, see Using Server-Side\n Encryption in the Amazon S3 User Guide.

\n

\n Directory buckets - For directory buckets, only the server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) value is supported.

", + "smithy.api#documentation": "

The server-side encryption algorithm that was used when you store this object in Amazon S3 (for example,\n AES256, aws:kms, aws:kms:dsse).

\n ", "smithy.api#httpHeader": "x-amz-server-side-encryption" } }, @@ -31543,21 +31599,21 @@ "SSEKMSKeyId": { "target": "com.amazonaws.s3#SSEKMSKeyId", "traits": { - "smithy.api#documentation": "

If x-amz-server-side-encryption has a valid value of aws:kms\n or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the Key Management Service (KMS)\n symmetric encryption customer managed key that was used for the object. If you specify\n x-amz-server-side-encryption:aws:kms or\n x-amz-server-side-encryption:aws:kms:dsse, but do not provide\n x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key\n (aws/s3) to protect the data. If the KMS key does not exist in the same\n account that's issuing the command, you must use the full ARN and not just the ID.

\n \n

This functionality is not supported for directory buckets.

\n
", + "smithy.api#documentation": "

Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same\n account that's issuing the command, you must use the full Key ARN not the Key ID.

\n

\n General purpose buckets - If you specify x-amz-server-side-encryption with aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS \n key to use. If you specify\n x-amz-server-side-encryption:aws:kms or\n x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key\n (aws/s3) to protect the data.

\n

\n Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the \n x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS \n symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. \nAmazon Web Services managed key (aws/s3) isn't supported. \n

", "smithy.api#httpHeader": "x-amz-server-side-encryption-aws-kms-key-id" } }, "SSEKMSEncryptionContext": { "target": "com.amazonaws.s3#SSEKMSEncryptionContext", "traits": { - "smithy.api#documentation": "

Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of\n this header is a base64-encoded UTF-8 string holding JSON with the encryption context\n key-value pairs. This value is stored as object metadata and automatically gets passed on\n to Amazon Web Services KMS for future GetObject or CopyObject operations on\n this object. This value must be explicitly added during CopyObject operations.

\n \n

This functionality is not supported for directory buckets.

\n
", + "smithy.api#documentation": "

Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for object encryption. The value of\n this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. \n This value is stored as object metadata and automatically gets passed on\n to Amazon Web Services KMS for future GetObject operations on\n this object.

\n

\n General purpose buckets - This value must be explicitly added during CopyObject operations if you want an additional encryption context for your object. For more information, see Encryption context in the Amazon S3 User Guide.

\n

\n Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

", "smithy.api#httpHeader": "x-amz-server-side-encryption-context" } }, "BucketKeyEnabled": { "target": "com.amazonaws.s3#BucketKeyEnabled", "traits": { - "smithy.api#documentation": "

Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with\n server-side encryption using Key Management Service (KMS) keys (SSE-KMS). Setting this header to\n true causes Amazon S3 to use an S3 Bucket Key for object encryption with\n SSE-KMS.

\n

Specifying this header with a PUT action doesn’t affect bucket-level settings for S3\n Bucket Key.

\n \n

This functionality is not supported for directory buckets.

\n
", + "smithy.api#documentation": "

Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with\n server-side encryption using Key Management Service (KMS) keys (SSE-KMS).

\n

\n General purpose buckets - Setting this header to\n true causes Amazon S3 to use an S3 Bucket Key for object encryption with\n SSE-KMS. Also, specifying this header with a PUT action doesn't affect bucket-level settings for S3\n Bucket Key.

\n

\n Directory buckets - S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets \nto directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or \n the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

", "smithy.api#httpHeader": "x-amz-server-side-encryption-bucket-key-enabled" } }, @@ -32185,7 +32241,7 @@ "ExistingObjectReplication": { "target": "com.amazonaws.s3#ExistingObjectReplication", "traits": { - "smithy.api#documentation": "

Optional configuration to replicate existing source bucket objects. For more\n information, see Replicating Existing Objects in the Amazon S3 User Guide.\n

" + "smithy.api#documentation": "

Optional configuration to replicate existing source bucket objects.\n

\n \n

This parameter is no longer supported. To replicate existing objects, see Replicating existing objects with S3 Batch Replication in the Amazon S3 User Guide.

\n
" } }, "Destination": { @@ -33063,19 +33119,19 @@ "SSEAlgorithm": { "target": "com.amazonaws.s3#ServerSideEncryption", "traits": { - "smithy.api#documentation": "

Server-side encryption algorithm to use for the default encryption.

", + "smithy.api#documentation": "

Server-side encryption algorithm to use for the default encryption.

\n \n

For directory buckets, there are only two supported values for server-side encryption: AES256 and aws:kms.

\n
", "smithy.api#required": {} } }, "KMSMasterKeyID": { "target": "com.amazonaws.s3#SSEKMSKeyId", "traits": { - "smithy.api#documentation": "

Amazon Web Services Key Management Service (KMS) customer Amazon Web Services KMS key ID to use for the default\n encryption. This parameter is allowed if and only if SSEAlgorithm is set to\n aws:kms or aws:kms:dsse.

\n

You can specify the key ID, key alias, or the Amazon Resource Name (ARN) of the KMS\n key.

\n \n

If you use a key ID, you can run into a LogDestination undeliverable error when creating\n a VPC flow log.

\n

If you are using encryption with cross-account or Amazon Web Services service operations you must use\n a fully qualified KMS key ARN. For more information, see Using encryption for cross-account operations.

\n \n

Amazon S3 only supports symmetric encryption KMS keys. For more information, see Asymmetric keys in Amazon Web Services KMS in the Amazon Web Services Key Management Service\n Developer Guide.

\n
" + "smithy.api#documentation": "

Amazon Web Services Key Management Service (KMS) customer managed key ID to use for the default\n encryption.

\n \n \n \n

You can specify the key ID, key alias, or the Amazon Resource Name (ARN) of the KMS\n key.

\n \n

If you are using encryption with cross-account or Amazon Web Services service operations, you must use\n a fully qualified KMS key ARN. For more information, see Using encryption for cross-account operations.

\n \n \n \n \n

Amazon S3 only supports symmetric encryption KMS keys. For more information, see Asymmetric keys in Amazon Web Services KMS in the Amazon Web Services Key Management Service\n Developer Guide.

\n
" } } }, "traits": { - "smithy.api#documentation": "

Describes the default server-side encryption to apply to new objects in the bucket. If a\n PUT Object request doesn't specify any server-side encryption, this default encryption will\n be applied. If you don't specify a customer managed key at configuration, Amazon S3 automatically creates\n an Amazon Web Services KMS key in your Amazon Web Services account the first time that you add an object encrypted\n with SSE-KMS to a bucket. By default, Amazon S3 uses this KMS key for SSE-KMS. For more\n information, see PUT Bucket encryption in\n the Amazon S3 API Reference.

\n \n

If you're specifying a customer managed KMS key, we recommend using a fully qualified\n KMS key ARN. If you use a KMS key alias instead, then KMS resolves the key within the\n requester’s account. This behavior can result in data that's encrypted with a KMS key\n that belongs to the requester, and not the bucket owner.

\n
" + "smithy.api#documentation": "

Describes the default server-side encryption to apply to new objects in the bucket. If a\n PUT Object request doesn't specify any server-side encryption, this default encryption will\n be applied. For more\n information, see PutBucketEncryption.

\n \n \n " } }, "com.amazonaws.s3#ServerSideEncryptionConfiguration": { @@ -33107,12 +33163,12 @@ "BucketKeyEnabled": { "target": "com.amazonaws.s3#BucketKeyEnabled", "traits": { - "smithy.api#documentation": "

Specifies whether Amazon S3 should use an S3 Bucket Key with server-side encryption using KMS\n (SSE-KMS) for new objects in the bucket. Existing objects are not affected. Setting the\n BucketKeyEnabled element to true causes Amazon S3 to use an S3\n Bucket Key. By default, S3 Bucket Key is not enabled.

\n

For more information, see Amazon S3 Bucket Keys in the\n Amazon S3 User Guide.

" + "smithy.api#documentation": "

Specifies whether Amazon S3 should use an S3 Bucket Key with server-side encryption using KMS\n (SSE-KMS) for new objects in the bucket. Existing objects are not affected. Setting the\n BucketKeyEnabled element to true causes Amazon S3 to use an S3\n Bucket Key.

\n \n \n " } } }, "traits": { - "smithy.api#documentation": "

Specifies the default server-side encryption configuration.

\n \n

If you're specifying a customer managed KMS key, we recommend using a fully qualified\n KMS key ARN. If you use a KMS key alias instead, then KMS resolves the key within the\n requester’s account. This behavior can result in data that's encrypted with a KMS key\n that belongs to the requester, and not the bucket owner.

\n
" + "smithy.api#documentation": "

Specifies the default server-side encryption configuration.

\n \n \n " } }, "com.amazonaws.s3#ServerSideEncryptionRules": { @@ -33164,7 +33220,7 @@ } }, "traits": { - "smithy.api#documentation": "

The established temporary security credentials of the session.

\n \n

\n Directory buckets - These session credentials are only supported for the authentication and authorization of Zonal endpoint APIs on directory buckets.

\n
" + "smithy.api#documentation": "

The established temporary security credentials of the session.

\n \n

\n Directory buckets - These session credentials are only supported for the authentication and authorization of Zonal endpoint API operations on directory buckets.

\n
" } }, "com.amazonaws.s3#SessionExpiration": { @@ -33768,7 +33824,7 @@ "aws.protocols#httpChecksum": { "requestAlgorithmMember": "ChecksumAlgorithm" }, - "smithy.api#documentation": "

Uploads a part in a multipart upload.

\n \n

In this operation, you provide new data as a part of an object in your request. However, you have an option\n to specify your existing Amazon S3 object as a data source for the part you are uploading. To\n upload a part from an existing object, you use the UploadPartCopy operation.\n

\n
\n

You must initiate a multipart upload (see CreateMultipartUpload)\n before you can upload any part. In response to your initiate request, Amazon S3 returns an\n upload ID, a unique identifier that you must include in your upload part request.

\n

Part numbers can be any number from 1 to 10,000, inclusive. A part number uniquely\n identifies a part and also defines its position within the object being created. If you\n upload a new part using the same part number that was used with a previous part, the\n previously uploaded part is overwritten.

\n

For information about maximum and minimum part sizes and other multipart upload\n specifications, see Multipart upload limits in the Amazon S3 User Guide.

\n \n

After you initiate multipart upload and upload\n one or more parts, you must either complete or abort multipart upload in order to stop\n getting charged for storage of the uploaded parts. Only after you either complete or abort\n multipart upload, Amazon S3 frees up the parts storage and stops charging you for the parts\n storage.

\n
\n

For more information on multipart uploads, go to Multipart Upload Overview in the\n Amazon S3 User Guide .

\n \n

\n Directory buckets - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format https://bucket_name.s3express-az_id.region.amazonaws.com/key-name\n . Path-style requests are not supported. For more information, see Regional and Zonal endpoints in the\n Amazon S3 User Guide.

\n
\n
\n
Permissions
\n
\n \n
\n
Data integrity
\n
\n

\n General purpose bucket - To ensure that data is not corrupted traversing the network, specify the\n Content-MD5 header in the upload part request. Amazon S3 checks the part data against the provided MD5 value. If they do not match, Amazon S3 returns an error. If the upload request is signed with Signature Version 4, then Amazon Web Services S3 uses the\n x-amz-content-sha256 header as a checksum instead of\n Content-MD5. For more information see Authenticating\n Requests: Using the Authorization Header (Amazon Web Services Signature Version 4).

\n \n

\n Directory buckets - MD5 is not supported by directory buckets. You can use checksum algorithms to check object integrity.

\n
\n
\n
Encryption
\n
\n \n

\n For more information, see Using Server-Side\n Encryption in the Amazon S3 User Guide.

\n
\n
Special errors
\n
\n \n
\n
HTTP Host header syntax
\n
\n

\n Directory buckets - The HTTP Host header syntax is \n Bucket_name.s3express-az_id.region.amazonaws.com.

\n
\n
\n

The following operations are related to UploadPart:

\n ", + "smithy.api#documentation": "

Uploads a part in a multipart upload.

\n \n

In this operation, you provide new data as a part of an object in your request. However, you have an option\n to specify your existing Amazon S3 object as a data source for the part you are uploading. To\n upload a part from an existing object, you use the UploadPartCopy operation.\n

\n
\n

You must initiate a multipart upload (see CreateMultipartUpload)\n before you can upload any part. In response to your initiate request, Amazon S3 returns an\n upload ID, a unique identifier that you must include in your upload part request.

\n

Part numbers can be any number from 1 to 10,000, inclusive. A part number uniquely\n identifies a part and also defines its position within the object being created. If you\n upload a new part using the same part number that was used with a previous part, the\n previously uploaded part is overwritten.

\n

For information about maximum and minimum part sizes and other multipart upload\n specifications, see Multipart upload limits in the Amazon S3 User Guide.

\n \n

After you initiate multipart upload and upload\n one or more parts, you must either complete or abort multipart upload in order to stop\n getting charged for storage of the uploaded parts. Only after you either complete or abort\n multipart upload, Amazon S3 frees up the parts storage and stops charging you for the parts\n storage.

\n
\n

For more information on multipart uploads, go to Multipart Upload Overview in the\n Amazon S3 User Guide .

\n \n

\n Directory buckets - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format https://bucket_name.s3express-az_id.region.amazonaws.com/key-name\n . Path-style requests are not supported. For more information, see Regional and Zonal endpoints in the\n Amazon S3 User Guide.

\n
\n
\n
Permissions
\n
\n \n
\n
Data integrity
\n
\n

\n General purpose bucket - To ensure that data is not corrupted traversing the network, specify the\n Content-MD5 header in the upload part request. Amazon S3 checks the part data against the provided MD5 value. If they do not match, Amazon S3 returns an error. If the upload request is signed with Signature Version 4, then Amazon Web Services S3 uses the\n x-amz-content-sha256 header as a checksum instead of\n Content-MD5. For more information see Authenticating\n Requests: Using the Authorization Header (Amazon Web Services Signature Version 4).

\n \n

\n Directory buckets - MD5 is not supported by directory buckets. You can use checksum algorithms to check object integrity.

\n
\n
\n
Encryption
\n
\n \n
\n
Special errors
\n
\n \n
\n
HTTP Host header syntax
\n
\n

\n Directory buckets - The HTTP Host header syntax is \n Bucket_name.s3express-az_id.region.amazonaws.com.

\n
\n
\n

The following operations are related to UploadPart:

\n ", "smithy.api#http": { "method": "PUT", "uri": "/{Bucket}/{Key+}?x-id=UploadPart", @@ -33785,7 +33841,7 @@ "target": "com.amazonaws.s3#UploadPartCopyOutput" }, "traits": { - "smithy.api#documentation": "

Uploads a part by copying data from an existing object as data source. To specify the\n data source, you add the request header x-amz-copy-source in your request. To specify \n a byte range, you add the request header x-amz-copy-source-range in your\n request.

\n

For information about maximum and minimum part sizes and other multipart upload\n specifications, see Multipart upload limits in the Amazon S3 User Guide.

\n \n

Instead of copying data from an existing object as part data, you might use the UploadPart\n action to upload new data as a part of an object in your request.

\n
\n

You must initiate a multipart upload before you can upload any part. In response to your\n initiate request, Amazon S3 returns the upload ID, a unique identifier that you must include in\n your upload part request.

\n

For conceptual information about multipart uploads, see Uploading\n Objects Using Multipart Upload in the\n Amazon S3 User Guide. For information about copying objects using a single atomic action vs. a multipart\n upload, see Operations on Objects in\n the Amazon S3 User Guide.

\n \n

\n Directory buckets - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format https://bucket_name.s3express-az_id.region.amazonaws.com/key-name\n . Path-style requests are not supported. For more information, see Regional and Zonal endpoints in the\n Amazon S3 User Guide.

\n
\n
\n
Authentication and authorization
\n
\n

All UploadPartCopy requests must be authenticated and signed by using IAM credentials (access key ID and secret access key for the IAM identities). All headers with the x-amz- prefix, including\n x-amz-copy-source, must be signed. For more information, see REST Authentication.

\n

\n Directory buckets - You must use IAM credentials to authenticate and authorize your access to the UploadPartCopy API operation, instead of using the \n temporary security credentials through the CreateSession API operation.

\n

Amazon Web Services CLI or SDKs handles authentication and authorization on your behalf.

\n
\n
Permissions
\n
\n

You must have READ access to the source object and WRITE\n access to the destination bucket.

\n \n
\n
Encryption
\n
\n \n
\n
Special errors
\n
\n \n
\n
HTTP Host header syntax
\n
\n

\n Directory buckets - The HTTP Host header syntax is \n Bucket_name.s3express-az_id.region.amazonaws.com.

\n
\n
\n

The following operations are related to UploadPartCopy:

\n ", + "smithy.api#documentation": "

Uploads a part by copying data from an existing object as data source. To specify the\n data source, you add the request header x-amz-copy-source in your request. To specify \n a byte range, you add the request header x-amz-copy-source-range in your\n request.

\n

For information about maximum and minimum part sizes and other multipart upload\n specifications, see Multipart upload limits in the Amazon S3 User Guide.

\n \n

Instead of copying data from an existing object as part data, you might use the UploadPart\n action to upload new data as a part of an object in your request.

\n
\n

You must initiate a multipart upload before you can upload any part. In response to your\n initiate request, Amazon S3 returns the upload ID, a unique identifier that you must include in\n your upload part request.

\n

For conceptual information about multipart uploads, see Uploading\n Objects Using Multipart Upload in the\n Amazon S3 User Guide. For information about copying objects using a single atomic action vs. a multipart\n upload, see Operations on Objects in\n the Amazon S3 User Guide.

\n \n

\n Directory buckets - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format https://bucket_name.s3express-az_id.region.amazonaws.com/key-name\n . Path-style requests are not supported. For more information, see Regional and Zonal endpoints in the\n Amazon S3 User Guide.

\n
\n
\n
Authentication and authorization
\n
\n

All UploadPartCopy requests must be authenticated and signed by using IAM credentials (access key ID and secret access key for the IAM identities). All headers with the x-amz- prefix, including\n x-amz-copy-source, must be signed. For more information, see REST Authentication.

\n

\n Directory buckets - You must use IAM credentials to authenticate and authorize your access to the UploadPartCopy API operation, instead of using the \n temporary security credentials through the CreateSession API operation.

\n

Amazon Web Services CLI or SDKs handles authentication and authorization on your behalf.

\n
\n
Permissions
\n
\n

You must have READ access to the source object and WRITE\n access to the destination bucket.

\n \n
\n
Encryption
\n
\n \n
\n
Special errors
\n
\n \n
\n
HTTP Host header syntax
\n
\n

\n Directory buckets - The HTTP Host header syntax is \n Bucket_name.s3express-az_id.region.amazonaws.com.

\n
\n
\n

The following operations are related to UploadPartCopy:

\n ", "smithy.api#http": { "method": "PUT", "uri": "/{Bucket}/{Key+}?x-id=UploadPartCopy", @@ -33818,7 +33874,7 @@ "ServerSideEncryption": { "target": "com.amazonaws.s3#ServerSideEncryption", "traits": { - "smithy.api#documentation": "

The server-side encryption algorithm used when you store this object in Amazon S3 (for example,\n AES256, aws:kms).

\n \n

For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

\n
", + "smithy.api#documentation": "

The server-side encryption algorithm used when you store this object in Amazon S3 (for example,\n AES256, aws:kms).

", "smithy.api#httpHeader": "x-amz-server-side-encryption" } }, @@ -33839,14 +33895,14 @@ "SSEKMSKeyId": { "target": "com.amazonaws.s3#SSEKMSKeyId", "traits": { - "smithy.api#documentation": "

If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key\n that was used for the object.

\n \n

This functionality is not supported for directory buckets.

\n
", + "smithy.api#documentation": "

If present, indicates the ID of the KMS key that was used for object encryption.

", "smithy.api#httpHeader": "x-amz-server-side-encryption-aws-kms-key-id" } }, "BucketKeyEnabled": { "target": "com.amazonaws.s3#BucketKeyEnabled", "traits": { - "smithy.api#documentation": "

Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption\n with Key Management Service (KMS) keys (SSE-KMS).

\n \n

This functionality is not supported for directory buckets.

\n
", + "smithy.api#documentation": "

Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption\n with Key Management Service (KMS) keys (SSE-KMS).

", "smithy.api#httpHeader": "x-amz-server-side-encryption-bucket-key-enabled" } }, @@ -34015,7 +34071,7 @@ "ServerSideEncryption": { "target": "com.amazonaws.s3#ServerSideEncryption", "traits": { - "smithy.api#documentation": "

The server-side encryption algorithm used when you store this object in Amazon S3 (for example,\n AES256, aws:kms).

\n \n

For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

\n
", + "smithy.api#documentation": "

The server-side encryption algorithm used when you store this object in Amazon S3 (for example,\n AES256, aws:kms).

", "smithy.api#httpHeader": "x-amz-server-side-encryption" } }, @@ -34071,14 +34127,14 @@ "SSEKMSKeyId": { "target": "com.amazonaws.s3#SSEKMSKeyId", "traits": { - "smithy.api#documentation": "

If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key\n that was used for the object.

\n \n

This functionality is not supported for directory buckets.

\n
", + "smithy.api#documentation": "

If present, indicates the ID of the KMS key that was used for object encryption.

", "smithy.api#httpHeader": "x-amz-server-side-encryption-aws-kms-key-id" } }, "BucketKeyEnabled": { "target": "com.amazonaws.s3#BucketKeyEnabled", "traits": { - "smithy.api#documentation": "

Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption\n with Key Management Service (KMS) keys (SSE-KMS).

\n \n

This functionality is not supported for directory buckets.

\n
", + "smithy.api#documentation": "

Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption\n with Key Management Service (KMS) keys (SSE-KMS).

", "smithy.api#httpHeader": "x-amz-server-side-encryption-bucket-key-enabled" } }, diff --git a/examples/cross_service/detect_faces/Cargo.toml b/examples/cross_service/detect_faces/Cargo.toml index 64a592614493..696455954ec5 100644 --- a/examples/cross_service/detect_faces/Cargo.toml +++ b/examples/cross_service/detect_faces/Cargo.toml @@ -8,7 +8,7 @@ publish = false [dependencies] aws-config= { version = "1.5.6", path = "../../../sdk/aws-config" } aws-sdk-rekognition= { version = "1.46.0", path = "../../../sdk/rekognition" } -aws-sdk-s3= { version = "1.50.0", path = "../../../sdk/s3" } +aws-sdk-s3= { version = "1.51.0", path = "../../../sdk/s3" } aws-smithy-types= { version = "1.2.6", path = "../../../sdk/aws-smithy-types", features = ["rt-tokio"] } [dependencies.tokio] diff --git a/examples/cross_service/detect_labels/Cargo.toml b/examples/cross_service/detect_labels/Cargo.toml index f2708b94c423..9f9f57fbaf50 100644 --- a/examples/cross_service/detect_labels/Cargo.toml +++ b/examples/cross_service/detect_labels/Cargo.toml @@ -10,7 +10,7 @@ kamadak-exif = "0.5.4" aws-config= { version = "1.5.6", path = "../../../sdk/aws-config" } aws-sdk-dynamodb= { version = "1.46.0", path = "../../../sdk/dynamodb" } aws-sdk-rekognition= { version = "1.46.0", path = "../../../sdk/rekognition" } -aws-sdk-s3= { version = "1.50.0", path = "../../../sdk/s3" } +aws-sdk-s3= { version = "1.51.0", path = "../../../sdk/s3" } aws-smithy-types= { version = "1.2.6", path = "../../../sdk/aws-smithy-types", features = ["rt-tokio"] } aws-types= { version = "1.3.3", path = "../../../sdk/aws-types" } diff --git a/examples/cross_service/photo_asset_management/Cargo.toml b/examples/cross_service/photo_asset_management/Cargo.toml index c339e7e3c69c..f0d38e98f525 100644 --- a/examples/cross_service/photo_asset_management/Cargo.toml +++ b/examples/cross_service/photo_asset_management/Cargo.toml @@ -33,7 +33,7 @@ tracing = "0.1.37" aws-config= { version = "1.5.6", path = "../../../sdk/aws-config" } aws-sdk-dynamodb= { version = "1.46.0", path = "../../../sdk/dynamodb" } aws-sdk-rekognition= { version = "1.46.0", path = "../../../sdk/rekognition" } -aws-sdk-s3= { version = "1.50.0", path = "../../../sdk/s3" } +aws-sdk-s3= { version = "1.51.0", path = "../../../sdk/s3" } aws-sdk-sns= { version = "1.44.0", path = "../../../sdk/sns" } aws-smithy-runtime= { version = "1.7.1", path = "../../../sdk/aws-smithy-runtime" } aws-smithy-types-convert= { version = "0.60.8", path = "../../../sdk/aws-smithy-types-convert", features = ["convert-chrono"] } diff --git a/examples/cross_service/telephone/Cargo.toml b/examples/cross_service/telephone/Cargo.toml index f9352402c3fd..8889985d9236 100644 --- a/examples/cross_service/telephone/Cargo.toml +++ b/examples/cross_service/telephone/Cargo.toml @@ -13,7 +13,7 @@ reqwest = "0.11.4" serde_json = "1.0" aws-config= { version = "1.5.6", path = "../../../sdk/aws-config" } aws-sdk-polly= { version = "1.45.0", path = "../../../sdk/polly" } -aws-sdk-s3= { version = "1.50.0", path = "../../../sdk/s3" } +aws-sdk-s3= { version = "1.51.0", path = "../../../sdk/s3" } aws-sdk-transcribe= { version = "1.44.0", path = "../../../sdk/transcribe" } aws-smithy-types= { version = "1.2.6", path = "../../../sdk/aws-smithy-types", features = ["rt-tokio"] } diff --git a/examples/examples/aurora/Cargo.toml b/examples/examples/aurora/Cargo.toml index a5db141c4ba8..86e5abcfd1e5 100644 --- a/examples/examples/aurora/Cargo.toml +++ b/examples/examples/aurora/Cargo.toml @@ -16,7 +16,7 @@ tracing = "0.1.37" aws-config= { version = "1.5.6", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] } aws-smithy-types= { version = "1.2.6", path = "../../../sdk/aws-smithy-types" } aws-smithy-runtime-api= { version = "1.7.2", path = "../../../sdk/aws-smithy-runtime-api" } -aws-sdk-rds= { version = "1.55.0", path = "../../../sdk/rds" } +aws-sdk-rds= { version = "1.55.1", path = "../../../sdk/rds" } [dependencies.phf] version = "0.11.2" diff --git a/examples/examples/concurrency/Cargo.toml b/examples/examples/concurrency/Cargo.toml index 5afb89b2b040..47c2d931339d 100644 --- a/examples/examples/concurrency/Cargo.toml +++ b/examples/examples/concurrency/Cargo.toml @@ -26,5 +26,5 @@ features = ["env-filter"] [dev-dependencies] fastrand = "1.8.0" aws-config= { version = "1.5.6", path = "../../../sdk/aws-config" } -aws-sdk-s3= { version = "1.50.0", path = "../../../sdk/s3" } +aws-sdk-s3= { version = "1.51.0", path = "../../../sdk/s3" } aws-sdk-sqs= { version = "1.43.0", path = "../../../sdk/sqs" } diff --git a/examples/examples/custom-root-certificates/Cargo.toml b/examples/examples/custom-root-certificates/Cargo.toml index 8041075f2ad3..bdbe07aec454 100644 --- a/examples/examples/custom-root-certificates/Cargo.toml +++ b/examples/examples/custom-root-certificates/Cargo.toml @@ -10,7 +10,7 @@ publish = false [dependencies] rustls = "0.21.9" aws-config= { version = "1.5.6", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] } -aws-sdk-s3= { version = "1.50.0", path = "../../../sdk/s3", default-features = false } +aws-sdk-s3= { version = "1.51.0", path = "../../../sdk/s3", default-features = false } aws-smithy-runtime= { version = "1.7.1", path = "../../../sdk/aws-smithy-runtime", features = ["tls-rustls"] } [dependencies.tokio] diff --git a/examples/examples/glue/Cargo.toml b/examples/examples/glue/Cargo.toml index 7fa926529153..3f9b21e70d8a 100644 --- a/examples/examples/glue/Cargo.toml +++ b/examples/examples/glue/Cargo.toml @@ -20,7 +20,7 @@ futures = "0.3.25" tracing-bunyan-formatter = "0.3.4" aws-config= { version = "1.5.6", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] } aws-sdk-glue= { version = "1.61.0", path = "../../../sdk/glue" } -aws-sdk-s3= { version = "1.50.0", path = "../../../sdk/s3" } +aws-sdk-s3= { version = "1.51.0", path = "../../../sdk/s3" } aws-http= { version = "0.60.6", path = "../../../sdk/aws-http" } aws-smithy-types= { version = "1.2.6", path = "../../../sdk/aws-smithy-types" } aws-types= { version = "1.3.3", path = "../../../sdk/aws-types" } diff --git a/examples/examples/iam/Cargo.toml b/examples/examples/iam/Cargo.toml index cb907bd94898..5bbd2a659dfc 100644 --- a/examples/examples/iam/Cargo.toml +++ b/examples/examples/iam/Cargo.toml @@ -24,7 +24,7 @@ lazy_static = "1.4.0" aws-config= { version = "1.5.6", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] } aws-credential-types= { version = "1.2.1", path = "../../../sdk/aws-credential-types", features = ["hardcoded-credentials"] } aws-sdk-iam= { version = "1.45.0", path = "../../../sdk/iam" } -aws-sdk-s3= { version = "1.50.0", path = "../../../sdk/s3" } +aws-sdk-s3= { version = "1.51.0", path = "../../../sdk/s3" } aws-sdk-sts= { version = "1.43.0", path = "../../../sdk/sts" } [dependencies.sdk-examples-test-utils] diff --git a/examples/examples/lambda/Cargo.toml b/examples/examples/lambda/Cargo.toml index 387730c54994..c4cb79d098df 100644 --- a/examples/examples/lambda/Cargo.toml +++ b/examples/examples/lambda/Cargo.toml @@ -15,7 +15,7 @@ aws-config= { version = "1.5.6", path = "../../../sdk/aws-config", features = [" aws-sdk-ec2= { version = "1.73.0", path = "../../../sdk/ec2" } aws-sdk-iam= { version = "1.45.0", path = "../../../sdk/iam" } aws-sdk-lambda= { version = "1.46.0", path = "../../../sdk/lambda" } -aws-sdk-s3= { version = "1.50.0", path = "../../../sdk/s3" } +aws-sdk-s3= { version = "1.51.0", path = "../../../sdk/s3" } aws-smithy-types= { version = "1.2.6", path = "../../../sdk/aws-smithy-types" } aws-types= { version = "1.3.3", path = "../../../sdk/aws-types" } diff --git a/examples/examples/localstack/Cargo.toml b/examples/examples/localstack/Cargo.toml index 5ff860f63800..78abf3ca0b52 100644 --- a/examples/examples/localstack/Cargo.toml +++ b/examples/examples/localstack/Cargo.toml @@ -7,7 +7,7 @@ publish = false [dependencies] aws-config= { version = "1.5.6", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] } -aws-sdk-s3= { version = "1.50.0", path = "../../../sdk/s3" } +aws-sdk-s3= { version = "1.51.0", path = "../../../sdk/s3" } [dependencies.tokio] version = "1" diff --git a/examples/examples/rds/Cargo.toml b/examples/examples/rds/Cargo.toml index 1043cfe36105..c5724c37a91b 100644 --- a/examples/examples/rds/Cargo.toml +++ b/examples/examples/rds/Cargo.toml @@ -16,7 +16,7 @@ secrecy = "0.8.0" tracing = "0.1.37" aws-config= { version = "1.5.6", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] } aws-smithy-runtime-api= { version = "1.7.2", path = "../../../sdk/aws-smithy-runtime-api" } -aws-sdk-rds= { version = "1.55.0", path = "../../../sdk/rds" } +aws-sdk-rds= { version = "1.55.1", path = "../../../sdk/rds" } [dependencies.clap] version = "~4.4" diff --git a/examples/examples/s3/Cargo.toml b/examples/examples/s3/Cargo.toml index cc697bf388c4..903ff9f3f948 100644 --- a/examples/examples/s3/Cargo.toml +++ b/examples/examples/s3/Cargo.toml @@ -24,7 +24,7 @@ tracing = "0.1.37" serde_json = "1" chrono = "0.4.38" aws-config= { version = "1.5.6", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] } -aws-sdk-s3= { version = "1.50.0", path = "../../../sdk/s3", features = ["rt-tokio"] } +aws-sdk-s3= { version = "1.51.0", path = "../../../sdk/s3", features = ["rt-tokio"] } aws-smithy-runtime= { version = "1.7.1", path = "../../../sdk/aws-smithy-runtime" } aws-smithy-runtime-api= { version = "1.7.2", path = "../../../sdk/aws-smithy-runtime-api", features = ["client"] } aws-smithy-types= { version = "1.2.6", path = "../../../sdk/aws-smithy-types", features = ["http-body-0-4-x"] } diff --git a/examples/examples/sdk-config/Cargo.toml b/examples/examples/sdk-config/Cargo.toml index 268bee5e96d7..65deaf5d7509 100644 --- a/examples/examples/sdk-config/Cargo.toml +++ b/examples/examples/sdk-config/Cargo.toml @@ -12,7 +12,7 @@ async_once = "0.2.6" tracing = "0.1.37" aws-config= { version = "1.5.6", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] } aws-credential-types= { version = "1.2.1", path = "../../../sdk/aws-credential-types" } -aws-sdk-s3= { version = "1.50.0", path = "../../../sdk/s3" } +aws-sdk-s3= { version = "1.51.0", path = "../../../sdk/s3" } [dependencies.tokio] version = "1.20.1" diff --git a/examples/examples/sending-presigned-requests/Cargo.toml b/examples/examples/sending-presigned-requests/Cargo.toml index 00e220ffead5..d4645a2c940f 100644 --- a/examples/examples/sending-presigned-requests/Cargo.toml +++ b/examples/examples/sending-presigned-requests/Cargo.toml @@ -12,7 +12,7 @@ hyper = "0.14" reqwest = "0.11" hyper-tls = "0.5.0" aws-config= { version = "1.5.6", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] } -aws-sdk-s3= { version = "1.50.0", path = "../../../sdk/s3" } +aws-sdk-s3= { version = "1.51.0", path = "../../../sdk/s3" } [dependencies.clap] version = "~4.4" diff --git a/examples/examples/testing/Cargo.toml b/examples/examples/testing/Cargo.toml index a4eda7d6f8bf..c0dcdbfe5061 100644 --- a/examples/examples/testing/Cargo.toml +++ b/examples/examples/testing/Cargo.toml @@ -17,7 +17,7 @@ mockall = "0.11.4" serde_json = "1" aws-config= { version = "1.5.6", path = "../../../sdk/aws-config", features = ["behavior-version-latest"] } aws-credential-types= { version = "1.2.1", path = "../../../sdk/aws-credential-types", features = ["hardcoded-credentials"] } -aws-sdk-s3= { version = "1.50.0", path = "../../../sdk/s3" } +aws-sdk-s3= { version = "1.51.0", path = "../../../sdk/s3" } aws-smithy-types= { version = "1.2.6", path = "../../../sdk/aws-smithy-types" } aws-smithy-runtime= { version = "1.7.1", path = "../../../sdk/aws-smithy-runtime", features = ["test-util"] } aws-smithy-runtime-api= { version = "1.7.2", path = "../../../sdk/aws-smithy-runtime-api", features = ["test-util"] } diff --git a/examples/lambda/calculator/Cargo.toml b/examples/lambda/calculator/Cargo.toml index e30fd8d5dcbb..3938bb46eaf3 100644 --- a/examples/lambda/calculator/Cargo.toml +++ b/examples/lambda/calculator/Cargo.toml @@ -16,7 +16,7 @@ serde = "1.0.164" aws-config= { version = "1.5.6", path = "../../../sdk/aws-config" } aws-sdk-ec2= { version = "1.73.0", path = "../../../sdk/ec2" } aws-sdk-lambda= { version = "1.46.0", path = "../../../sdk/lambda" } -aws-sdk-s3= { version = "1.50.0", path = "../../../sdk/s3" } +aws-sdk-s3= { version = "1.51.0", path = "../../../sdk/s3" } [dependencies.clap] version = "~4.4" diff --git a/index.md b/index.md index 0fce12c9c8eb..ca5f9063cbd2 100644 --- a/index.md +++ b/index.md @@ -56,6 +56,7 @@ The AWS SDK for Rust contains one crate for each AWS service, as well as [aws-co | AWS Device Farm | [aws-sdk-devicefarm](https://crates.io/crates/aws-sdk-devicefarm) ([docs](https://docs.rs/aws-sdk-devicefarm)) | | AWS Direct Connect | [aws-sdk-directconnect](https://crates.io/crates/aws-sdk-directconnect) ([docs](https://docs.rs/aws-sdk-directconnect)) | | AWS Directory Service | [aws-sdk-directory](https://crates.io/crates/aws-sdk-directory) ([docs](https://docs.rs/aws-sdk-directory)) | +| AWS Directory Service Data | [aws-sdk-directoryservicedata](https://crates.io/crates/aws-sdk-directoryservicedata) ([docs](https://docs.rs/aws-sdk-directoryservicedata)) | | AWS EC2 Instance Connect | [aws-sdk-ec2instanceconnect](https://crates.io/crates/aws-sdk-ec2instanceconnect) ([docs](https://docs.rs/aws-sdk-ec2instanceconnect)) | | AWS Elastic Beanstalk | [aws-sdk-elasticbeanstalk](https://crates.io/crates/aws-sdk-elasticbeanstalk) ([docs](https://docs.rs/aws-sdk-elasticbeanstalk)) | | AWS Elemental MediaConvert | [aws-sdk-mediaconvert](https://crates.io/crates/aws-sdk-mediaconvert) ([docs](https://docs.rs/aws-sdk-mediaconvert)) | diff --git a/sdk/costexplorer/Cargo.toml b/sdk/costexplorer/Cargo.toml index 6ab3ce83b047..756d4b2b0fcf 100644 --- a/sdk/costexplorer/Cargo.toml +++ b/sdk/costexplorer/Cargo.toml @@ -1,7 +1,7 @@ # Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. [package] name = "aws-sdk-costexplorer" -version = "1.45.0" +version = "1.46.0" authors = ["AWS Rust SDK Team ", "Russell Cohen "] description = "AWS SDK for AWS Cost Explorer Service" edition = "2021" diff --git a/sdk/costexplorer/README.md b/sdk/costexplorer/README.md index a924ba91310d..f5a8a90467c6 100644 --- a/sdk/costexplorer/README.md +++ b/sdk/costexplorer/README.md @@ -21,7 +21,7 @@ your project, add the following to your **Cargo.toml** file: ```toml [dependencies] aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -aws-sdk-costexplorer = "1.45.0" +aws-sdk-costexplorer = "1.46.0" tokio = { version = "1", features = ["full"] } ``` diff --git a/sdk/costexplorer/src/client/get_dimension_values.rs b/sdk/costexplorer/src/client/get_dimension_values.rs index 4c338f9a53fb..f848f8535952 100644 --- a/sdk/costexplorer/src/client/get_dimension_values.rs +++ b/sdk/costexplorer/src/client/get_dimension_values.rs @@ -6,7 +6,7 @@ impl super::Client { /// - [`search_string(impl Into)`](crate::operation::get_dimension_values::builders::GetDimensionValuesFluentBuilder::search_string) / [`set_search_string(Option)`](crate::operation::get_dimension_values::builders::GetDimensionValuesFluentBuilder::set_search_string):
required: **false**

The value that you want to search the filter values for.


/// - [`time_period(DateInterval)`](crate::operation::get_dimension_values::builders::GetDimensionValuesFluentBuilder::time_period) / [`set_time_period(Option)`](crate::operation::get_dimension_values::builders::GetDimensionValuesFluentBuilder::set_time_period):
required: **true**

The start date and end date for retrieving the dimension values. The start date is inclusive, but the end date is exclusive. For example, if start is 2017-01-01 and end is 2017-05-01, then the cost and usage data is retrieved from 2017-01-01 up to and including 2017-04-30 but not including 2017-05-01.


/// - [`dimension(Dimension)`](crate::operation::get_dimension_values::builders::GetDimensionValuesFluentBuilder::dimension) / [`set_dimension(Option)`](crate::operation::get_dimension_values::builders::GetDimensionValuesFluentBuilder::set_dimension):
required: **true**

The name of the dimension. Each Dimension is available for a different Context. For more information, see Context. LINK_ACCOUNT_NAME and SERVICE_CODE can only be used in CostCategoryRule.


- /// - [`context(Context)`](crate::operation::get_dimension_values::builders::GetDimensionValuesFluentBuilder::context) / [`set_context(Option)`](crate::operation::get_dimension_values::builders::GetDimensionValuesFluentBuilder::set_context):
required: **false**

The context for the call to GetDimensionValues. This can be RESERVATIONS or COST_AND_USAGE. The default value is COST_AND_USAGE. If the context is set to RESERVATIONS, the resulting dimension values can be used in the GetReservationUtilization operation. If the context is set to COST_AND_USAGE, the resulting dimension values can be used in the GetCostAndUsage operation.

If you set the context to COST_AND_USAGE, you can use the following dimensions for searching:

  • AZ - The Availability Zone. An example is us-east-1a.

  • BILLING_ENTITY - The Amazon Web Services seller that your account is with. Possible values are the following:

    - Amazon Web Services(Amazon Web Services): The entity that sells Amazon Web Services.

    - AISPL (Amazon Internet Services Pvt. Ltd.): The local Indian entity that's an acting reseller for Amazon Web Services in India.

    - Amazon Web Services Marketplace: The entity that supports the sale of solutions that are built on Amazon Web Services by third-party software providers.

  • CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux.

  • DEPLOYMENT_OPTION - The scope of Amazon Relational Database Service deployments. Valid values are SingleAZ and MultiAZ.

  • DATABASE_ENGINE - The Amazon Relational Database Service database. Examples are Aurora or MySQL.

  • INSTANCE_TYPE - The type of Amazon EC2 instance. An example is m4.xlarge.

  • INSTANCE_TYPE_FAMILY - A family of instance types optimized to fit different use cases. Examples are Compute Optimized (for example, C4, C5, C6g, and C7g), Memory Optimization (for example, R4, R5n, R5b, and R6g).

  • INVOICING_ENTITY - The name of the entity that issues the Amazon Web Services invoice.

  • LEGAL_ENTITY_NAME - The name of the organization that sells you Amazon Web Services services, such as Amazon Web Services.

  • LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the Amazon Web Services ID of the member account.

  • OPERATING_SYSTEM - The operating system. Examples are Windows or Linux.

  • OPERATION - The action performed. Examples include RunInstance and CreateBucket.

  • PLATFORM - The Amazon EC2 operating system. Examples are Windows or Linux.

  • PURCHASE_TYPE - The reservation type of the purchase that this usage is related to. Examples include On-Demand Instances and Standard Reserved Instances.

  • RESERVATION_ID - The unique identifier for an Amazon Web Services Reservation Instance.

  • SAVINGS_PLAN_ARN - The unique identifier for your Savings Plans.

  • SAVINGS_PLANS_TYPE - Type of Savings Plans (EC2 Instance or Compute).

  • SERVICE - The Amazon Web Services service such as Amazon DynamoDB.

  • TENANCY - The tenancy of a resource. Examples are shared or dedicated.

  • USAGE_TYPE - The type of usage. An example is DataTransfer-In-Bytes. The response for the GetDimensionValues operation includes a unit attribute. Examples include GB and Hrs.

  • USAGE_TYPE_GROUP - The grouping of common usage types. An example is Amazon EC2: CloudWatch – Alarms. The response for this operation includes a unit attribute.

  • REGION - The Amazon Web Services Region.

  • RECORD_TYPE - The different types of charges such as Reserved Instance (RI) fees, usage costs, tax refunds, and credits.

  • RESOURCE_ID - The unique identifier of the resource. ResourceId is an opt-in feature only available for last 14 days for EC2-Compute Service.

If you set the context to RESERVATIONS, you can use the following dimensions for searching:

  • AZ - The Availability Zone. An example is us-east-1a.

  • CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux.

  • DEPLOYMENT_OPTION - The scope of Amazon Relational Database Service deployments. Valid values are SingleAZ and MultiAZ.

  • INSTANCE_TYPE - The type of Amazon EC2 instance. An example is m4.xlarge.

  • LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the Amazon Web Services ID of the member account.

  • PLATFORM - The Amazon EC2 operating system. Examples are Windows or Linux.

  • REGION - The Amazon Web Services Region.

  • SCOPE (Utilization only) - The scope of a Reserved Instance (RI). Values are regional or a single Availability Zone.

  • TAG (Coverage only) - The tags that are associated with a Reserved Instance (RI).

  • TENANCY - The tenancy of a resource. Examples are shared or dedicated.

If you set the context to SAVINGS_PLANS, you can use the following dimensions for searching:

  • SAVINGS_PLANS_TYPE - Type of Savings Plans (EC2 Instance or Compute)

  • PAYMENT_OPTION - The payment option for the given Savings Plans (for example, All Upfront)

  • REGION - The Amazon Web Services Region.

  • INSTANCE_TYPE_FAMILY - The family of instances (For example, m5)

  • LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the Amazon Web Services ID of the member account.

  • SAVINGS_PLAN_ARN - The unique identifier for your Savings Plans.


+ /// - [`context(Context)`](crate::operation::get_dimension_values::builders::GetDimensionValuesFluentBuilder::context) / [`set_context(Option)`](crate::operation::get_dimension_values::builders::GetDimensionValuesFluentBuilder::set_context):
required: **false**

The context for the call to GetDimensionValues. This can be RESERVATIONS or COST_AND_USAGE. The default value is COST_AND_USAGE. If the context is set to RESERVATIONS, the resulting dimension values can be used in the GetReservationUtilization operation. If the context is set to COST_AND_USAGE, the resulting dimension values can be used in the GetCostAndUsage operation.

If you set the context to COST_AND_USAGE, you can use the following dimensions for searching:

  • AZ - The Availability Zone. An example is us-east-1a.

  • BILLING_ENTITY - The Amazon Web Services seller that your account is with. Possible values are the following:

    - Amazon Web Services(Amazon Web Services): The entity that sells Amazon Web Servicesservices.

    - AISPL (Amazon Internet Services Pvt. Ltd.): The local Indian entity that's an acting reseller for Amazon Web Servicesservices in India.

    - Amazon Web Services Marketplace: The entity that supports the sale of solutions that are built on Amazon Web Services by third-party software providers.

  • CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux.

  • DEPLOYMENT_OPTION - The scope of Amazon Relational Database Service deployments. Valid values are SingleAZ and MultiAZ.

  • DATABASE_ENGINE - The Amazon Relational Database Service database. Examples are Aurora or MySQL.

  • INSTANCE_TYPE - The type of Amazon EC2 instance. An example is m4.xlarge.

  • INSTANCE_TYPE_FAMILY - A family of instance types optimized to fit different use cases. Examples are Compute Optimized (for example, C4, C5, C6g, and C7g), Memory Optimization (for example, R4, R5n, R5b, and R6g).

  • INVOICING_ENTITY - The name of the entity that issues the Amazon Web Services invoice.

  • LEGAL_ENTITY_NAME - The name of the organization that sells you Amazon Web Services services, such as Amazon Web Services.

  • LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the Amazon Web Services ID of the member account.

  • OPERATING_SYSTEM - The operating system. Examples are Windows or Linux.

  • OPERATION - The action performed. Examples include RunInstance and CreateBucket.

  • PLATFORM - The Amazon EC2 operating system. Examples are Windows or Linux.

  • PURCHASE_TYPE - The reservation type of the purchase that this usage is related to. Examples include On-Demand Instances and Standard Reserved Instances.

  • RESERVATION_ID - The unique identifier for an Amazon Web Services Reservation Instance.

  • SAVINGS_PLAN_ARN - The unique identifier for your Savings Plans.

  • SAVINGS_PLANS_TYPE - Type of Savings Plans (EC2 Instance or Compute).

  • SERVICE - The Amazon Web Services service such as Amazon DynamoDB.

  • TENANCY - The tenancy of a resource. Examples are shared or dedicated.

  • USAGE_TYPE - The type of usage. An example is DataTransfer-In-Bytes. The response for the GetDimensionValues operation includes a unit attribute. Examples include GB and Hrs.

  • USAGE_TYPE_GROUP - The grouping of common usage types. An example is Amazon EC2: CloudWatch – Alarms. The response for this operation includes a unit attribute.

  • REGION - The Amazon Web Services Region.

  • RECORD_TYPE - The different types of charges such as Reserved Instance (RI) fees, usage costs, tax refunds, and credits.

  • RESOURCE_ID - The unique identifier of the resource. ResourceId is an opt-in feature only available for last 14 days for EC2-Compute Service.

If you set the context to RESERVATIONS, you can use the following dimensions for searching:

  • AZ - The Availability Zone. An example is us-east-1a.

  • CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux.

  • DEPLOYMENT_OPTION - The scope of Amazon Relational Database Service deployments. Valid values are SingleAZ and MultiAZ.

  • INSTANCE_TYPE - The type of Amazon EC2 instance. An example is m4.xlarge.

  • LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the Amazon Web Services ID of the member account.

  • PLATFORM - The Amazon EC2 operating system. Examples are Windows or Linux.

  • REGION - The Amazon Web Services Region.

  • SCOPE (Utilization only) - The scope of a Reserved Instance (RI). Values are regional or a single Availability Zone.

  • TAG (Coverage only) - The tags that are associated with a Reserved Instance (RI).

  • TENANCY - The tenancy of a resource. Examples are shared or dedicated.

If you set the context to SAVINGS_PLANS, you can use the following dimensions for searching:

  • SAVINGS_PLANS_TYPE - Type of Savings Plans (EC2 Instance or Compute)

  • PAYMENT_OPTION - The payment option for the given Savings Plans (for example, All Upfront)

  • REGION - The Amazon Web Services Region.

  • INSTANCE_TYPE_FAMILY - The family of instances (For example, m5)

  • LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the Amazon Web Services ID of the member account.

  • SAVINGS_PLAN_ARN - The unique identifier for your Savings Plans.


/// - [`filter(Expression)`](crate::operation::get_dimension_values::builders::GetDimensionValuesFluentBuilder::filter) / [`set_filter(Option)`](crate::operation::get_dimension_values::builders::GetDimensionValuesFluentBuilder::set_filter):
required: **false**

Use Expression to filter in various Cost Explorer APIs.

Not all Expression types are supported in each API. Refer to the documentation for each specific API to see what is supported.

There are two patterns:

  • Simple dimension values.

    • There are three types of simple dimension values: CostCategories, Tags, and Dimensions.

      • Specify the CostCategories field to define a filter that acts on Cost Categories.

      • Specify the Tags field to define a filter that acts on Cost Allocation Tags.

      • Specify the Dimensions field to define a filter that acts on the DimensionValues .

    • For each filter type, you can set the dimension name and values for the filters that you plan to use.

      • For example, you can filter for REGION==us-east-1 OR REGION==us-west-1. For GetRightsizingRecommendation, the Region is a full name (for example, REGION==US East (N. Virginia).

      • The corresponding Expression for this example is as follows: { "Dimensions": { "Key": "REGION", "Values": \[ "us-east-1", "us-west-1" \] } }

      • As shown in the previous example, lists of dimension values are combined with OR when applying the filter.

    • You can also set different match options to further control how the filter behaves. Not all APIs support match options. Refer to the documentation for each specific API to see what is supported.

      • For example, you can filter for linked account names that start with "a".

      • The corresponding Expression for this example is as follows: { "Dimensions": { "Key": "LINKED_ACCOUNT_NAME", "MatchOptions": \[ "STARTS_WITH" \], "Values": \[ "a" \] } }

  • Compound Expression types with logical operations.

    • You can use multiple Expression types and the logical operators AND/OR/NOT to create a list of one or more Expression objects. By doing this, you can filter by more advanced options.

    • For example, you can filter by ((REGION == us-east-1 OR REGION == us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer).

    • The corresponding Expression for this example is as follows: { "And": \[ {"Or": \[ {"Dimensions": { "Key": "REGION", "Values": \[ "us-east-1", "us-west-1" \] }}, {"Tags": { "Key": "TagName", "Values": \["Value1"\] } } \]}, {"Not": {"Dimensions": { "Key": "USAGE_TYPE", "Values": \["DataTransfer"\] }}} \] }

    Because each Expression can have only one operator, the service returns an error if more than one is specified. The following example shows an Expression object that creates an error: { "And": \[ ... \], "Dimensions": { "Key": "USAGE_TYPE", "Values": \[ "DataTransfer" \] } }

    The following is an example of the corresponding error message: "Expression has more than one roots. Only one root operator is allowed for each expression: And, Or, Not, Dimensions, Tags, CostCategories"

For the GetRightsizingRecommendation action, a combination of OR and NOT isn't supported. OR isn't supported between different dimensions, or dimensions and tags. NOT operators aren't supported. Dimensions are also limited to LINKED_ACCOUNT, REGION, or RIGHTSIZING_TYPE.

For the GetReservationPurchaseRecommendation action, only NOT is supported. AND and OR aren't supported. Dimensions are limited to LINKED_ACCOUNT.


/// - [`sort_by(SortDefinition)`](crate::operation::get_dimension_values::builders::GetDimensionValuesFluentBuilder::sort_by) / [`set_sort_by(Option>)`](crate::operation::get_dimension_values::builders::GetDimensionValuesFluentBuilder::set_sort_by):
required: **false**

The value that you want to sort the data by.

The key represents cost and usage metrics. The following values are supported:

  • BlendedCost

  • UnblendedCost

  • AmortizedCost

  • NetAmortizedCost

  • NetUnblendedCost

  • UsageQuantity

  • NormalizedUsageAmount

The supported values for the SortOrder key are ASCENDING or DESCENDING.

When you specify a SortBy paramater, the context must be COST_AND_USAGE. Further, when using SortBy, NextPageToken and SearchString aren't supported.


/// - [`max_results(i32)`](crate::operation::get_dimension_values::builders::GetDimensionValuesFluentBuilder::max_results) / [`set_max_results(Option)`](crate::operation::get_dimension_values::builders::GetDimensionValuesFluentBuilder::set_max_results):
required: **false**

This field is only used when SortBy is provided in the request. The maximum number of objects that are returned for this request. If MaxResults isn't specified with SortBy, the request returns 1000 results as the default value for this parameter.

For GetDimensionValues, MaxResults has an upper limit of 1000.


diff --git a/sdk/costexplorer/src/lib.rs b/sdk/costexplorer/src/lib.rs index 45923ebc4dff..ef3538184127 100644 --- a/sdk/costexplorer/src/lib.rs +++ b/sdk/costexplorer/src/lib.rs @@ -38,7 +38,7 @@ //! ```toml //! [dependencies] //! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -//! aws-sdk-costexplorer = "1.45.0" +//! aws-sdk-costexplorer = "1.46.0" //! tokio = { version = "1", features = ["full"] } //! ``` //! diff --git a/sdk/costexplorer/src/operation/get_dimension_values/_get_dimension_values_input.rs b/sdk/costexplorer/src/operation/get_dimension_values/_get_dimension_values_input.rs index eee385202378..1c21c84ad65f 100644 --- a/sdk/costexplorer/src/operation/get_dimension_values/_get_dimension_values_input.rs +++ b/sdk/costexplorer/src/operation/get_dimension_values/_get_dimension_values_input.rs @@ -16,8 +16,8 @@ pub struct GetDimensionValuesInput { ///

AZ - The Availability Zone. An example is us-east-1a.

///
  • ///

    BILLING_ENTITY - The Amazon Web Services seller that your account is with. Possible values are the following:

    - ///

    - Amazon Web Services(Amazon Web Services): The entity that sells Amazon Web Services.

    - ///

    - AISPL (Amazon Internet Services Pvt. Ltd.): The local Indian entity that's an acting reseller for Amazon Web Services in India.

    + ///

    - Amazon Web Services(Amazon Web Services): The entity that sells Amazon Web Servicesservices.

    + ///

    - AISPL (Amazon Internet Services Pvt. Ltd.): The local Indian entity that's an acting reseller for Amazon Web Servicesservices in India.

    ///

    - Amazon Web Services Marketplace: The entity that supports the sale of solutions that are built on Amazon Web Services by third-party software providers.

  • ///
  • ///

    CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux.

  • @@ -204,8 +204,8 @@ impl GetDimensionValuesInput { ///

    AZ - The Availability Zone. An example is us-east-1a.

    ///
  • ///

    BILLING_ENTITY - The Amazon Web Services seller that your account is with. Possible values are the following:

    - ///

    - Amazon Web Services(Amazon Web Services): The entity that sells Amazon Web Services.

    - ///

    - AISPL (Amazon Internet Services Pvt. Ltd.): The local Indian entity that's an acting reseller for Amazon Web Services in India.

    + ///

    - Amazon Web Services(Amazon Web Services): The entity that sells Amazon Web Servicesservices.

    + ///

    - AISPL (Amazon Internet Services Pvt. Ltd.): The local Indian entity that's an acting reseller for Amazon Web Servicesservices in India.

    ///

    - Amazon Web Services Marketplace: The entity that supports the sale of solutions that are built on Amazon Web Services by third-party software providers.

  • ///
  • ///

    CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux.

  • @@ -456,8 +456,8 @@ impl GetDimensionValuesInputBuilder { ///

    AZ - The Availability Zone. An example is us-east-1a.

    ///
  • ///

    BILLING_ENTITY - The Amazon Web Services seller that your account is with. Possible values are the following:

    - ///

    - Amazon Web Services(Amazon Web Services): The entity that sells Amazon Web Services.

    - ///

    - AISPL (Amazon Internet Services Pvt. Ltd.): The local Indian entity that's an acting reseller for Amazon Web Services in India.

    + ///

    - Amazon Web Services(Amazon Web Services): The entity that sells Amazon Web Servicesservices.

    + ///

    - AISPL (Amazon Internet Services Pvt. Ltd.): The local Indian entity that's an acting reseller for Amazon Web Servicesservices in India.

    ///

    - Amazon Web Services Marketplace: The entity that supports the sale of solutions that are built on Amazon Web Services by third-party software providers.

  • ///
  • ///

    CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux.

  • @@ -553,8 +553,8 @@ impl GetDimensionValuesInputBuilder { ///

    AZ - The Availability Zone. An example is us-east-1a.

    ///
  • ///

    BILLING_ENTITY - The Amazon Web Services seller that your account is with. Possible values are the following:

    - ///

    - Amazon Web Services(Amazon Web Services): The entity that sells Amazon Web Services.

    - ///

    - AISPL (Amazon Internet Services Pvt. Ltd.): The local Indian entity that's an acting reseller for Amazon Web Services in India.

    + ///

    - Amazon Web Services(Amazon Web Services): The entity that sells Amazon Web Servicesservices.

    + ///

    - AISPL (Amazon Internet Services Pvt. Ltd.): The local Indian entity that's an acting reseller for Amazon Web Servicesservices in India.

    ///

    - Amazon Web Services Marketplace: The entity that supports the sale of solutions that are built on Amazon Web Services by third-party software providers.

  • ///
  • ///

    CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux.

  • @@ -650,8 +650,8 @@ impl GetDimensionValuesInputBuilder { ///

    AZ - The Availability Zone. An example is us-east-1a.

    ///
  • ///

    BILLING_ENTITY - The Amazon Web Services seller that your account is with. Possible values are the following:

    - ///

    - Amazon Web Services(Amazon Web Services): The entity that sells Amazon Web Services.

    - ///

    - AISPL (Amazon Internet Services Pvt. Ltd.): The local Indian entity that's an acting reseller for Amazon Web Services in India.

    + ///

    - Amazon Web Services(Amazon Web Services): The entity that sells Amazon Web Servicesservices.

    + ///

    - AISPL (Amazon Internet Services Pvt. Ltd.): The local Indian entity that's an acting reseller for Amazon Web Servicesservices in India.

    ///

    - Amazon Web Services Marketplace: The entity that supports the sale of solutions that are built on Amazon Web Services by third-party software providers.

  • ///
  • ///

    CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux.

  • diff --git a/sdk/costexplorer/src/operation/get_dimension_values/builders.rs b/sdk/costexplorer/src/operation/get_dimension_values/builders.rs index bd3524fdaba4..33d77a0fe6c8 100644 --- a/sdk/costexplorer/src/operation/get_dimension_values/builders.rs +++ b/sdk/costexplorer/src/operation/get_dimension_values/builders.rs @@ -157,8 +157,8 @@ impl GetDimensionValuesFluentBuilder { ///

    AZ - The Availability Zone. An example is us-east-1a.

    ///
  • ///

    BILLING_ENTITY - The Amazon Web Services seller that your account is with. Possible values are the following:

    - ///

    - Amazon Web Services(Amazon Web Services): The entity that sells Amazon Web Services.

    - ///

    - AISPL (Amazon Internet Services Pvt. Ltd.): The local Indian entity that's an acting reseller for Amazon Web Services in India.

    + ///

    - Amazon Web Services(Amazon Web Services): The entity that sells Amazon Web Servicesservices.

    + ///

    - AISPL (Amazon Internet Services Pvt. Ltd.): The local Indian entity that's an acting reseller for Amazon Web Servicesservices in India.

    ///

    - Amazon Web Services Marketplace: The entity that supports the sale of solutions that are built on Amazon Web Services by third-party software providers.

  • ///
  • ///

    CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux.

  • @@ -254,8 +254,8 @@ impl GetDimensionValuesFluentBuilder { ///

    AZ - The Availability Zone. An example is us-east-1a.

    ///
  • ///

    BILLING_ENTITY - The Amazon Web Services seller that your account is with. Possible values are the following:

    - ///

    - Amazon Web Services(Amazon Web Services): The entity that sells Amazon Web Services.

    - ///

    - AISPL (Amazon Internet Services Pvt. Ltd.): The local Indian entity that's an acting reseller for Amazon Web Services in India.

    + ///

    - Amazon Web Services(Amazon Web Services): The entity that sells Amazon Web Servicesservices.

    + ///

    - AISPL (Amazon Internet Services Pvt. Ltd.): The local Indian entity that's an acting reseller for Amazon Web Servicesservices in India.

    ///

    - Amazon Web Services Marketplace: The entity that supports the sale of solutions that are built on Amazon Web Services by third-party software providers.

  • ///
  • ///

    CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux.

  • @@ -351,8 +351,8 @@ impl GetDimensionValuesFluentBuilder { ///

    AZ - The Availability Zone. An example is us-east-1a.

    ///
  • ///

    BILLING_ENTITY - The Amazon Web Services seller that your account is with. Possible values are the following:

    - ///

    - Amazon Web Services(Amazon Web Services): The entity that sells Amazon Web Services.

    - ///

    - AISPL (Amazon Internet Services Pvt. Ltd.): The local Indian entity that's an acting reseller for Amazon Web Services in India.

    + ///

    - Amazon Web Services(Amazon Web Services): The entity that sells Amazon Web Servicesservices.

    + ///

    - AISPL (Amazon Internet Services Pvt. Ltd.): The local Indian entity that's an acting reseller for Amazon Web Servicesservices in India.

    ///

    - Amazon Web Services Marketplace: The entity that supports the sale of solutions that are built on Amazon Web Services by third-party software providers.

  • ///
  • ///

    CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are Windows or Linux.

  • diff --git a/sdk/costexplorer/src/protocol_serde.rs b/sdk/costexplorer/src/protocol_serde.rs index 910d24099a14..5385c2007b1e 100644 --- a/sdk/costexplorer/src/protocol_serde.rs +++ b/sdk/costexplorer/src/protocol_serde.rs @@ -463,6 +463,8 @@ pub(crate) mod shape_keys; pub(crate) mod shape_match_options; +pub(crate) mod shape_reserved_capacity_details; + pub(crate) mod shape_target_instance; pub(crate) mod shape_values; @@ -471,6 +473,8 @@ pub(crate) mod shape_cost_category_split_charge_rule_parameter_values_list; pub(crate) mod shape_disk_resource_utilization; +pub(crate) mod shape_dynamo_db_capacity_details; + pub(crate) mod shape_ebs_resource_utilization; pub(crate) mod shape_ec2_instance_details; diff --git a/sdk/costexplorer/src/protocol_serde/shape_dynamo_db_capacity_details.rs b/sdk/costexplorer/src/protocol_serde/shape_dynamo_db_capacity_details.rs new file mode 100644 index 000000000000..6215220ceefa --- /dev/null +++ b/sdk/costexplorer/src/protocol_serde/shape_dynamo_db_capacity_details.rs @@ -0,0 +1,47 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_dynamo_db_capacity_details<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = crate::types::builders::DynamoDbCapacityDetailsBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "CapacityUnits" => { + builder = builder.set_capacity_units( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Region" => { + builder = builder.set_region( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(builder.build())) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} diff --git a/sdk/costexplorer/src/protocol_serde/shape_reservation_purchase_recommendation_detail.rs b/sdk/costexplorer/src/protocol_serde/shape_reservation_purchase_recommendation_detail.rs index 9dbf7bc2e918..eb779b1e1a43 100644 --- a/sdk/costexplorer/src/protocol_serde/shape_reservation_purchase_recommendation_detail.rs +++ b/sdk/costexplorer/src/protocol_serde/shape_reservation_purchase_recommendation_detail.rs @@ -143,6 +143,39 @@ where .transpose()?, ); } + "ReservedCapacityDetails" => { + builder = builder.set_reserved_capacity_details( + crate::protocol_serde::shape_reserved_capacity_details::de_reserved_capacity_details(tokens)?, + ); + } + "RecommendedNumberOfCapacityUnitsToPurchase" => { + builder = builder.set_recommended_number_of_capacity_units_to_purchase( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "MinimumNumberOfCapacityUnitsUsedPerHour" => { + builder = builder.set_minimum_number_of_capacity_units_used_per_hour( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "MaximumNumberOfCapacityUnitsUsedPerHour" => { + builder = builder.set_maximum_number_of_capacity_units_used_per_hour( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "AverageNumberOfCapacityUnitsUsedPerHour" => { + builder = builder.set_average_number_of_capacity_units_used_per_hour( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, }, other => { diff --git a/sdk/costexplorer/src/protocol_serde/shape_reserved_capacity_details.rs b/sdk/costexplorer/src/protocol_serde/shape_reserved_capacity_details.rs new file mode 100644 index 000000000000..b69c21b064da --- /dev/null +++ b/sdk/costexplorer/src/protocol_serde/shape_reserved_capacity_details.rs @@ -0,0 +1,38 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_reserved_capacity_details<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = crate::types::builders::ReservedCapacityDetailsBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "DynamoDBCapacityDetails" => { + builder = builder.set_dynamo_db_capacity_details( + crate::protocol_serde::shape_dynamo_db_capacity_details::de_dynamo_db_capacity_details(tokens)?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(builder.build())) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} diff --git a/sdk/costexplorer/src/types.rs b/sdk/costexplorer/src/types.rs index 50f0723c2da3..e3f217799c83 100644 --- a/sdk/costexplorer/src/types.rs +++ b/sdk/costexplorer/src/types.rs @@ -177,6 +177,10 @@ pub use crate::types::_reservation_purchase_recommendation_summary::ReservationP pub use crate::types::_reservation_purchase_recommendation_detail::ReservationPurchaseRecommendationDetail; +pub use crate::types::_reserved_capacity_details::ReservedCapacityDetails; + +pub use crate::types::_dynamo_db_capacity_details::DynamoDbCapacityDetails; + pub use crate::types::_instance_details::InstanceDetails; pub use crate::types::_memory_db_instance_details::MemoryDbInstanceDetails; @@ -329,6 +333,8 @@ mod _dimension_values_with_attributes; mod _disk_resource_utilization; +mod _dynamo_db_capacity_details; + mod _ebs_resource_utilization; mod _ec2_instance_details; @@ -415,6 +421,8 @@ mod _reservation_purchase_recommendation_summary; mod _reservation_utilization_group; +mod _reserved_capacity_details; + mod _resource_details; mod _resource_tag; diff --git a/sdk/costexplorer/src/types/_anomaly.rs b/sdk/costexplorer/src/types/_anomaly.rs index aee34c6391b3..c4416e4b4f7d 100644 --- a/sdk/costexplorer/src/types/_anomaly.rs +++ b/sdk/costexplorer/src/types/_anomaly.rs @@ -10,7 +10,7 @@ pub struct Anomaly { pub anomaly_start_date: ::std::option::Option<::std::string::String>, ///

    The last day the anomaly is detected.

    pub anomaly_end_date: ::std::option::Option<::std::string::String>, - ///

    The dimension for the anomaly (for example, an Amazon Web Service in a service monitor).

    + ///

    The dimension for the anomaly (for example, an Amazon Web Servicesservice in a service monitor).

    pub dimension_value: ::std::option::Option<::std::string::String>, ///

    The list of identified root causes for the anomaly.

    pub root_causes: ::std::option::Option<::std::vec::Vec>, @@ -37,7 +37,7 @@ impl Anomaly { pub fn anomaly_end_date(&self) -> ::std::option::Option<&str> { self.anomaly_end_date.as_deref() } - ///

    The dimension for the anomaly (for example, an Amazon Web Service in a service monitor).

    + ///

    The dimension for the anomaly (for example, an Amazon Web Servicesservice in a service monitor).

    pub fn dimension_value(&self) -> ::std::option::Option<&str> { self.dimension_value.as_deref() } @@ -130,17 +130,17 @@ impl AnomalyBuilder { pub fn get_anomaly_end_date(&self) -> &::std::option::Option<::std::string::String> { &self.anomaly_end_date } - ///

    The dimension for the anomaly (for example, an Amazon Web Service in a service monitor).

    + ///

    The dimension for the anomaly (for example, an Amazon Web Servicesservice in a service monitor).

    pub fn dimension_value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.dimension_value = ::std::option::Option::Some(input.into()); self } - ///

    The dimension for the anomaly (for example, an Amazon Web Service in a service monitor).

    + ///

    The dimension for the anomaly (for example, an Amazon Web Servicesservice in a service monitor).

    pub fn set_dimension_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.dimension_value = input; self } - ///

    The dimension for the anomaly (for example, an Amazon Web Service in a service monitor).

    + ///

    The dimension for the anomaly (for example, an Amazon Web Servicesservice in a service monitor).

    pub fn get_dimension_value(&self) -> &::std::option::Option<::std::string::String> { &self.dimension_value } diff --git a/sdk/costexplorer/src/types/_dynamo_db_capacity_details.rs b/sdk/costexplorer/src/types/_dynamo_db_capacity_details.rs new file mode 100644 index 000000000000..fb05eb72e40b --- /dev/null +++ b/sdk/costexplorer/src/types/_dynamo_db_capacity_details.rs @@ -0,0 +1,72 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

    The DynamoDB reservations that Amazon Web Services recommends that you purchase.

    +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct DynamoDbCapacityDetails { + ///

    The capacity unit of the recommended reservation.

    + pub capacity_units: ::std::option::Option<::std::string::String>, + ///

    The Amazon Web Services Region of the recommended reservation.

    + pub region: ::std::option::Option<::std::string::String>, +} +impl DynamoDbCapacityDetails { + ///

    The capacity unit of the recommended reservation.

    + pub fn capacity_units(&self) -> ::std::option::Option<&str> { + self.capacity_units.as_deref() + } + ///

    The Amazon Web Services Region of the recommended reservation.

    + pub fn region(&self) -> ::std::option::Option<&str> { + self.region.as_deref() + } +} +impl DynamoDbCapacityDetails { + /// Creates a new builder-style object to manufacture [`DynamoDbCapacityDetails`](crate::types::DynamoDbCapacityDetails). + pub fn builder() -> crate::types::builders::DynamoDbCapacityDetailsBuilder { + crate::types::builders::DynamoDbCapacityDetailsBuilder::default() + } +} + +/// A builder for [`DynamoDbCapacityDetails`](crate::types::DynamoDbCapacityDetails). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct DynamoDbCapacityDetailsBuilder { + pub(crate) capacity_units: ::std::option::Option<::std::string::String>, + pub(crate) region: ::std::option::Option<::std::string::String>, +} +impl DynamoDbCapacityDetailsBuilder { + ///

    The capacity unit of the recommended reservation.

    + pub fn capacity_units(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.capacity_units = ::std::option::Option::Some(input.into()); + self + } + ///

    The capacity unit of the recommended reservation.

    + pub fn set_capacity_units(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.capacity_units = input; + self + } + ///

    The capacity unit of the recommended reservation.

    + pub fn get_capacity_units(&self) -> &::std::option::Option<::std::string::String> { + &self.capacity_units + } + ///

    The Amazon Web Services Region of the recommended reservation.

    + pub fn region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.region = ::std::option::Option::Some(input.into()); + self + } + ///

    The Amazon Web Services Region of the recommended reservation.

    + pub fn set_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.region = input; + self + } + ///

    The Amazon Web Services Region of the recommended reservation.

    + pub fn get_region(&self) -> &::std::option::Option<::std::string::String> { + &self.region + } + /// Consumes the builder and constructs a [`DynamoDbCapacityDetails`](crate::types::DynamoDbCapacityDetails). + pub fn build(self) -> crate::types::DynamoDbCapacityDetails { + crate::types::DynamoDbCapacityDetails { + capacity_units: self.capacity_units, + region: self.region, + } + } +} diff --git a/sdk/costexplorer/src/types/_reservation_purchase_recommendation_detail.rs b/sdk/costexplorer/src/types/_reservation_purchase_recommendation_detail.rs index 3f0cc9724c40..f0210ddaf6d1 100644 --- a/sdk/costexplorer/src/types/_reservation_purchase_recommendation_detail.rs +++ b/sdk/costexplorer/src/types/_reservation_purchase_recommendation_detail.rs @@ -24,11 +24,11 @@ pub struct ReservationPurchaseRecommendationDetail { pub average_number_of_instances_used_per_hour: ::std::option::Option<::std::string::String>, ///

    The average number of normalized units that you used in an hour during the historical period. Amazon Web Services uses this to calculate your recommended reservation purchases.

    pub average_normalized_units_used_per_hour: ::std::option::Option<::std::string::String>, - ///

    The average utilization of your instances. Amazon Web Services uses this to calculate your recommended reservation purchases.

    + ///

    The average utilization of your recommendations. Amazon Web Services uses this to calculate your recommended reservation purchases.

    pub average_utilization: ::std::option::Option<::std::string::String>, - ///

    How long Amazon Web Services estimates that it takes for this instance to start saving you money, in months.

    + ///

    How long Amazon Web Services estimates that it takes for this recommendation to start saving you money, in months.

    pub estimated_break_even_in_months: ::std::option::Option<::std::string::String>, - ///

    The currency code that Amazon Web Services used to calculate the costs for this instance.

    + ///

    The currency code that Amazon Web Services used to calculate the costs for this recommendation.

    pub currency_code: ::std::option::Option<::std::string::String>, ///

    How much Amazon Web Services estimates that this specific recommendation might save you in a month.

    pub estimated_monthly_savings_amount: ::std::option::Option<::std::string::String>, @@ -38,10 +38,20 @@ pub struct ReservationPurchaseRecommendationDetail { pub estimated_monthly_on_demand_cost: ::std::option::Option<::std::string::String>, ///

    How much Amazon Web Services estimates that you might spend for all usage during the specified historical period if you had a reservation.

    pub estimated_reservation_cost_for_lookback_period: ::std::option::Option<::std::string::String>, - ///

    How much purchasing this instance costs you upfront.

    + ///

    How much purchasing this recommendation costs you upfront.

    pub upfront_cost: ::std::option::Option<::std::string::String>, - ///

    How much purchasing this instance costs you on a monthly basis.

    + ///

    How much purchasing this recommendation costs you on a monthly basis.

    pub recurring_standard_monthly_cost: ::std::option::Option<::std::string::String>, + ///

    Details about the reservations that Amazon Web Services recommends that you purchase.

    + pub reserved_capacity_details: ::std::option::Option, + ///

    The number of reserved capacity units that Amazon Web Services recommends that you purchase.

    + pub recommended_number_of_capacity_units_to_purchase: ::std::option::Option<::std::string::String>, + ///

    The minimum number of provisioned capacity units that you used in an hour during the historical period. Amazon Web Services uses this to calculate your recommended reservation purchases.

    + pub minimum_number_of_capacity_units_used_per_hour: ::std::option::Option<::std::string::String>, + ///

    The maximum number of provisioned capacity units that you used in an hour during the historical period. Amazon Web Services uses this to calculate your recommended reservation purchases.

    + pub maximum_number_of_capacity_units_used_per_hour: ::std::option::Option<::std::string::String>, + ///

    The average number of provisioned capacity units that you used in an hour during the historical period. Amazon Web Services uses this to calculate your recommended reservation purchases.

    + pub average_number_of_capacity_units_used_per_hour: ::std::option::Option<::std::string::String>, } impl ReservationPurchaseRecommendationDetail { ///

    The account that this Reserved Instance (RI) recommendation is for.

    @@ -84,15 +94,15 @@ impl ReservationPurchaseRecommendationDetail { pub fn average_normalized_units_used_per_hour(&self) -> ::std::option::Option<&str> { self.average_normalized_units_used_per_hour.as_deref() } - ///

    The average utilization of your instances. Amazon Web Services uses this to calculate your recommended reservation purchases.

    + ///

    The average utilization of your recommendations. Amazon Web Services uses this to calculate your recommended reservation purchases.

    pub fn average_utilization(&self) -> ::std::option::Option<&str> { self.average_utilization.as_deref() } - ///

    How long Amazon Web Services estimates that it takes for this instance to start saving you money, in months.

    + ///

    How long Amazon Web Services estimates that it takes for this recommendation to start saving you money, in months.

    pub fn estimated_break_even_in_months(&self) -> ::std::option::Option<&str> { self.estimated_break_even_in_months.as_deref() } - ///

    The currency code that Amazon Web Services used to calculate the costs for this instance.

    + ///

    The currency code that Amazon Web Services used to calculate the costs for this recommendation.

    pub fn currency_code(&self) -> ::std::option::Option<&str> { self.currency_code.as_deref() } @@ -112,14 +122,34 @@ impl ReservationPurchaseRecommendationDetail { pub fn estimated_reservation_cost_for_lookback_period(&self) -> ::std::option::Option<&str> { self.estimated_reservation_cost_for_lookback_period.as_deref() } - ///

    How much purchasing this instance costs you upfront.

    + ///

    How much purchasing this recommendation costs you upfront.

    pub fn upfront_cost(&self) -> ::std::option::Option<&str> { self.upfront_cost.as_deref() } - ///

    How much purchasing this instance costs you on a monthly basis.

    + ///

    How much purchasing this recommendation costs you on a monthly basis.

    pub fn recurring_standard_monthly_cost(&self) -> ::std::option::Option<&str> { self.recurring_standard_monthly_cost.as_deref() } + ///

    Details about the reservations that Amazon Web Services recommends that you purchase.

    + pub fn reserved_capacity_details(&self) -> ::std::option::Option<&crate::types::ReservedCapacityDetails> { + self.reserved_capacity_details.as_ref() + } + ///

    The number of reserved capacity units that Amazon Web Services recommends that you purchase.

    + pub fn recommended_number_of_capacity_units_to_purchase(&self) -> ::std::option::Option<&str> { + self.recommended_number_of_capacity_units_to_purchase.as_deref() + } + ///

    The minimum number of provisioned capacity units that you used in an hour during the historical period. Amazon Web Services uses this to calculate your recommended reservation purchases.

    + pub fn minimum_number_of_capacity_units_used_per_hour(&self) -> ::std::option::Option<&str> { + self.minimum_number_of_capacity_units_used_per_hour.as_deref() + } + ///

    The maximum number of provisioned capacity units that you used in an hour during the historical period. Amazon Web Services uses this to calculate your recommended reservation purchases.

    + pub fn maximum_number_of_capacity_units_used_per_hour(&self) -> ::std::option::Option<&str> { + self.maximum_number_of_capacity_units_used_per_hour.as_deref() + } + ///

    The average number of provisioned capacity units that you used in an hour during the historical period. Amazon Web Services uses this to calculate your recommended reservation purchases.

    + pub fn average_number_of_capacity_units_used_per_hour(&self) -> ::std::option::Option<&str> { + self.average_number_of_capacity_units_used_per_hour.as_deref() + } } impl ReservationPurchaseRecommendationDetail { /// Creates a new builder-style object to manufacture [`ReservationPurchaseRecommendationDetail`](crate::types::ReservationPurchaseRecommendationDetail). @@ -151,6 +181,11 @@ pub struct ReservationPurchaseRecommendationDetailBuilder { pub(crate) estimated_reservation_cost_for_lookback_period: ::std::option::Option<::std::string::String>, pub(crate) upfront_cost: ::std::option::Option<::std::string::String>, pub(crate) recurring_standard_monthly_cost: ::std::option::Option<::std::string::String>, + pub(crate) reserved_capacity_details: ::std::option::Option, + pub(crate) recommended_number_of_capacity_units_to_purchase: ::std::option::Option<::std::string::String>, + pub(crate) minimum_number_of_capacity_units_used_per_hour: ::std::option::Option<::std::string::String>, + pub(crate) maximum_number_of_capacity_units_used_per_hour: ::std::option::Option<::std::string::String>, + pub(crate) average_number_of_capacity_units_used_per_hour: ::std::option::Option<::std::string::String>, } impl ReservationPurchaseRecommendationDetailBuilder { ///

    The account that this Reserved Instance (RI) recommendation is for.

    @@ -293,45 +328,45 @@ impl ReservationPurchaseRecommendationDetailBuilder { pub fn get_average_normalized_units_used_per_hour(&self) -> &::std::option::Option<::std::string::String> { &self.average_normalized_units_used_per_hour } - ///

    The average utilization of your instances. Amazon Web Services uses this to calculate your recommended reservation purchases.

    + ///

    The average utilization of your recommendations. Amazon Web Services uses this to calculate your recommended reservation purchases.

    pub fn average_utilization(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.average_utilization = ::std::option::Option::Some(input.into()); self } - ///

    The average utilization of your instances. Amazon Web Services uses this to calculate your recommended reservation purchases.

    + ///

    The average utilization of your recommendations. Amazon Web Services uses this to calculate your recommended reservation purchases.

    pub fn set_average_utilization(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.average_utilization = input; self } - ///

    The average utilization of your instances. Amazon Web Services uses this to calculate your recommended reservation purchases.

    + ///

    The average utilization of your recommendations. Amazon Web Services uses this to calculate your recommended reservation purchases.

    pub fn get_average_utilization(&self) -> &::std::option::Option<::std::string::String> { &self.average_utilization } - ///

    How long Amazon Web Services estimates that it takes for this instance to start saving you money, in months.

    + ///

    How long Amazon Web Services estimates that it takes for this recommendation to start saving you money, in months.

    pub fn estimated_break_even_in_months(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.estimated_break_even_in_months = ::std::option::Option::Some(input.into()); self } - ///

    How long Amazon Web Services estimates that it takes for this instance to start saving you money, in months.

    + ///

    How long Amazon Web Services estimates that it takes for this recommendation to start saving you money, in months.

    pub fn set_estimated_break_even_in_months(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.estimated_break_even_in_months = input; self } - ///

    How long Amazon Web Services estimates that it takes for this instance to start saving you money, in months.

    + ///

    How long Amazon Web Services estimates that it takes for this recommendation to start saving you money, in months.

    pub fn get_estimated_break_even_in_months(&self) -> &::std::option::Option<::std::string::String> { &self.estimated_break_even_in_months } - ///

    The currency code that Amazon Web Services used to calculate the costs for this instance.

    + ///

    The currency code that Amazon Web Services used to calculate the costs for this recommendation.

    pub fn currency_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.currency_code = ::std::option::Option::Some(input.into()); self } - ///

    The currency code that Amazon Web Services used to calculate the costs for this instance.

    + ///

    The currency code that Amazon Web Services used to calculate the costs for this recommendation.

    pub fn set_currency_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.currency_code = input; self } - ///

    The currency code that Amazon Web Services used to calculate the costs for this instance.

    + ///

    The currency code that Amazon Web Services used to calculate the costs for this recommendation.

    pub fn get_currency_code(&self) -> &::std::option::Option<::std::string::String> { &self.currency_code } @@ -391,34 +426,104 @@ impl ReservationPurchaseRecommendationDetailBuilder { pub fn get_estimated_reservation_cost_for_lookback_period(&self) -> &::std::option::Option<::std::string::String> { &self.estimated_reservation_cost_for_lookback_period } - ///

    How much purchasing this instance costs you upfront.

    + ///

    How much purchasing this recommendation costs you upfront.

    pub fn upfront_cost(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.upfront_cost = ::std::option::Option::Some(input.into()); self } - ///

    How much purchasing this instance costs you upfront.

    + ///

    How much purchasing this recommendation costs you upfront.

    pub fn set_upfront_cost(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.upfront_cost = input; self } - ///

    How much purchasing this instance costs you upfront.

    + ///

    How much purchasing this recommendation costs you upfront.

    pub fn get_upfront_cost(&self) -> &::std::option::Option<::std::string::String> { &self.upfront_cost } - ///

    How much purchasing this instance costs you on a monthly basis.

    + ///

    How much purchasing this recommendation costs you on a monthly basis.

    pub fn recurring_standard_monthly_cost(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.recurring_standard_monthly_cost = ::std::option::Option::Some(input.into()); self } - ///

    How much purchasing this instance costs you on a monthly basis.

    + ///

    How much purchasing this recommendation costs you on a monthly basis.

    pub fn set_recurring_standard_monthly_cost(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.recurring_standard_monthly_cost = input; self } - ///

    How much purchasing this instance costs you on a monthly basis.

    + ///

    How much purchasing this recommendation costs you on a monthly basis.

    pub fn get_recurring_standard_monthly_cost(&self) -> &::std::option::Option<::std::string::String> { &self.recurring_standard_monthly_cost } + ///

    Details about the reservations that Amazon Web Services recommends that you purchase.

    + pub fn reserved_capacity_details(mut self, input: crate::types::ReservedCapacityDetails) -> Self { + self.reserved_capacity_details = ::std::option::Option::Some(input); + self + } + ///

    Details about the reservations that Amazon Web Services recommends that you purchase.

    + pub fn set_reserved_capacity_details(mut self, input: ::std::option::Option) -> Self { + self.reserved_capacity_details = input; + self + } + ///

    Details about the reservations that Amazon Web Services recommends that you purchase.

    + pub fn get_reserved_capacity_details(&self) -> &::std::option::Option { + &self.reserved_capacity_details + } + ///

    The number of reserved capacity units that Amazon Web Services recommends that you purchase.

    + pub fn recommended_number_of_capacity_units_to_purchase(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.recommended_number_of_capacity_units_to_purchase = ::std::option::Option::Some(input.into()); + self + } + ///

    The number of reserved capacity units that Amazon Web Services recommends that you purchase.

    + pub fn set_recommended_number_of_capacity_units_to_purchase(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.recommended_number_of_capacity_units_to_purchase = input; + self + } + ///

    The number of reserved capacity units that Amazon Web Services recommends that you purchase.

    + pub fn get_recommended_number_of_capacity_units_to_purchase(&self) -> &::std::option::Option<::std::string::String> { + &self.recommended_number_of_capacity_units_to_purchase + } + ///

    The minimum number of provisioned capacity units that you used in an hour during the historical period. Amazon Web Services uses this to calculate your recommended reservation purchases.

    + pub fn minimum_number_of_capacity_units_used_per_hour(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.minimum_number_of_capacity_units_used_per_hour = ::std::option::Option::Some(input.into()); + self + } + ///

    The minimum number of provisioned capacity units that you used in an hour during the historical period. Amazon Web Services uses this to calculate your recommended reservation purchases.

    + pub fn set_minimum_number_of_capacity_units_used_per_hour(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.minimum_number_of_capacity_units_used_per_hour = input; + self + } + ///

    The minimum number of provisioned capacity units that you used in an hour during the historical period. Amazon Web Services uses this to calculate your recommended reservation purchases.

    + pub fn get_minimum_number_of_capacity_units_used_per_hour(&self) -> &::std::option::Option<::std::string::String> { + &self.minimum_number_of_capacity_units_used_per_hour + } + ///

    The maximum number of provisioned capacity units that you used in an hour during the historical period. Amazon Web Services uses this to calculate your recommended reservation purchases.

    + pub fn maximum_number_of_capacity_units_used_per_hour(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.maximum_number_of_capacity_units_used_per_hour = ::std::option::Option::Some(input.into()); + self + } + ///

    The maximum number of provisioned capacity units that you used in an hour during the historical period. Amazon Web Services uses this to calculate your recommended reservation purchases.

    + pub fn set_maximum_number_of_capacity_units_used_per_hour(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.maximum_number_of_capacity_units_used_per_hour = input; + self + } + ///

    The maximum number of provisioned capacity units that you used in an hour during the historical period. Amazon Web Services uses this to calculate your recommended reservation purchases.

    + pub fn get_maximum_number_of_capacity_units_used_per_hour(&self) -> &::std::option::Option<::std::string::String> { + &self.maximum_number_of_capacity_units_used_per_hour + } + ///

    The average number of provisioned capacity units that you used in an hour during the historical period. Amazon Web Services uses this to calculate your recommended reservation purchases.

    + pub fn average_number_of_capacity_units_used_per_hour(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.average_number_of_capacity_units_used_per_hour = ::std::option::Option::Some(input.into()); + self + } + ///

    The average number of provisioned capacity units that you used in an hour during the historical period. Amazon Web Services uses this to calculate your recommended reservation purchases.

    + pub fn set_average_number_of_capacity_units_used_per_hour(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.average_number_of_capacity_units_used_per_hour = input; + self + } + ///

    The average number of provisioned capacity units that you used in an hour during the historical period. Amazon Web Services uses this to calculate your recommended reservation purchases.

    + pub fn get_average_number_of_capacity_units_used_per_hour(&self) -> &::std::option::Option<::std::string::String> { + &self.average_number_of_capacity_units_used_per_hour + } /// Consumes the builder and constructs a [`ReservationPurchaseRecommendationDetail`](crate::types::ReservationPurchaseRecommendationDetail). pub fn build(self) -> crate::types::ReservationPurchaseRecommendationDetail { crate::types::ReservationPurchaseRecommendationDetail { @@ -441,6 +546,11 @@ impl ReservationPurchaseRecommendationDetailBuilder { estimated_reservation_cost_for_lookback_period: self.estimated_reservation_cost_for_lookback_period, upfront_cost: self.upfront_cost, recurring_standard_monthly_cost: self.recurring_standard_monthly_cost, + reserved_capacity_details: self.reserved_capacity_details, + recommended_number_of_capacity_units_to_purchase: self.recommended_number_of_capacity_units_to_purchase, + minimum_number_of_capacity_units_used_per_hour: self.minimum_number_of_capacity_units_used_per_hour, + maximum_number_of_capacity_units_used_per_hour: self.maximum_number_of_capacity_units_used_per_hour, + average_number_of_capacity_units_used_per_hour: self.average_number_of_capacity_units_used_per_hour, } } } diff --git a/sdk/costexplorer/src/types/_reserved_capacity_details.rs b/sdk/costexplorer/src/types/_reserved_capacity_details.rs new file mode 100644 index 000000000000..a02fde2939d5 --- /dev/null +++ b/sdk/costexplorer/src/types/_reserved_capacity_details.rs @@ -0,0 +1,50 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

    Details about the reservations that Amazon Web Services recommends that you purchase.

    +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ReservedCapacityDetails { + ///

    The DynamoDB reservations that Amazon Web Services recommends that you purchase.

    + pub dynamo_db_capacity_details: ::std::option::Option, +} +impl ReservedCapacityDetails { + ///

    The DynamoDB reservations that Amazon Web Services recommends that you purchase.

    + pub fn dynamo_db_capacity_details(&self) -> ::std::option::Option<&crate::types::DynamoDbCapacityDetails> { + self.dynamo_db_capacity_details.as_ref() + } +} +impl ReservedCapacityDetails { + /// Creates a new builder-style object to manufacture [`ReservedCapacityDetails`](crate::types::ReservedCapacityDetails). + pub fn builder() -> crate::types::builders::ReservedCapacityDetailsBuilder { + crate::types::builders::ReservedCapacityDetailsBuilder::default() + } +} + +/// A builder for [`ReservedCapacityDetails`](crate::types::ReservedCapacityDetails). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ReservedCapacityDetailsBuilder { + pub(crate) dynamo_db_capacity_details: ::std::option::Option, +} +impl ReservedCapacityDetailsBuilder { + ///

    The DynamoDB reservations that Amazon Web Services recommends that you purchase.

    + pub fn dynamo_db_capacity_details(mut self, input: crate::types::DynamoDbCapacityDetails) -> Self { + self.dynamo_db_capacity_details = ::std::option::Option::Some(input); + self + } + ///

    The DynamoDB reservations that Amazon Web Services recommends that you purchase.

    + pub fn set_dynamo_db_capacity_details(mut self, input: ::std::option::Option) -> Self { + self.dynamo_db_capacity_details = input; + self + } + ///

    The DynamoDB reservations that Amazon Web Services recommends that you purchase.

    + pub fn get_dynamo_db_capacity_details(&self) -> &::std::option::Option { + &self.dynamo_db_capacity_details + } + /// Consumes the builder and constructs a [`ReservedCapacityDetails`](crate::types::ReservedCapacityDetails). + pub fn build(self) -> crate::types::ReservedCapacityDetails { + crate::types::ReservedCapacityDetails { + dynamo_db_capacity_details: self.dynamo_db_capacity_details, + } + } +} diff --git a/sdk/costexplorer/src/types/_root_cause.rs b/sdk/costexplorer/src/types/_root_cause.rs index 811d4245aceb..881be9bd0ccb 100644 --- a/sdk/costexplorer/src/types/_root_cause.rs +++ b/sdk/costexplorer/src/types/_root_cause.rs @@ -1,10 +1,10 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -///

    The combination of Amazon Web Service, linked account, linked account name, Region, and usage type where a cost anomaly is observed. The linked account name will only be available when the account name can be identified.

    +///

    The combination of Amazon Web Servicesservice, linked account, linked account name, Region, and usage type where a cost anomaly is observed. The linked account name will only be available when the account name can be identified.

    #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] pub struct RootCause { - ///

    The Amazon Web Service name that's associated with the cost anomaly.

    + ///

    The Amazon Web Servicesservice name that's associated with the cost anomaly.

    pub service: ::std::option::Option<::std::string::String>, ///

    The Amazon Web Services Region that's associated with the cost anomaly.

    pub region: ::std::option::Option<::std::string::String>, @@ -16,7 +16,7 @@ pub struct RootCause { pub linked_account_name: ::std::option::Option<::std::string::String>, } impl RootCause { - ///

    The Amazon Web Service name that's associated with the cost anomaly.

    + ///

    The Amazon Web Servicesservice name that's associated with the cost anomaly.

    pub fn service(&self) -> ::std::option::Option<&str> { self.service.as_deref() } @@ -55,17 +55,17 @@ pub struct RootCauseBuilder { pub(crate) linked_account_name: ::std::option::Option<::std::string::String>, } impl RootCauseBuilder { - ///

    The Amazon Web Service name that's associated with the cost anomaly.

    + ///

    The Amazon Web Servicesservice name that's associated with the cost anomaly.

    pub fn service(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.service = ::std::option::Option::Some(input.into()); self } - ///

    The Amazon Web Service name that's associated with the cost anomaly.

    + ///

    The Amazon Web Servicesservice name that's associated with the cost anomaly.

    pub fn set_service(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.service = input; self } - ///

    The Amazon Web Service name that's associated with the cost anomaly.

    + ///

    The Amazon Web Servicesservice name that's associated with the cost anomaly.

    pub fn get_service(&self) -> &::std::option::Option<::std::string::String> { &self.service } diff --git a/sdk/costexplorer/src/types/builders.rs b/sdk/costexplorer/src/types/builders.rs index 43f604d183b7..0b29d2547e9a 100644 --- a/sdk/costexplorer/src/types/builders.rs +++ b/sdk/costexplorer/src/types/builders.rs @@ -115,6 +115,10 @@ pub use crate::types::_reservation_purchase_recommendation_summary::ReservationP pub use crate::types::_reservation_purchase_recommendation_detail::ReservationPurchaseRecommendationDetailBuilder; +pub use crate::types::_reserved_capacity_details::ReservedCapacityDetailsBuilder; + +pub use crate::types::_dynamo_db_capacity_details::DynamoDbCapacityDetailsBuilder; + pub use crate::types::_instance_details::InstanceDetailsBuilder; pub use crate::types::_memory_db_instance_details::MemoryDbInstanceDetailsBuilder; diff --git a/sdk/directory/Cargo.toml b/sdk/directory/Cargo.toml index e71caba90887..f4cd162fd3df 100644 --- a/sdk/directory/Cargo.toml +++ b/sdk/directory/Cargo.toml @@ -1,7 +1,7 @@ # Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. [package] name = "aws-sdk-directory" -version = "1.44.0" +version = "1.45.0" authors = ["AWS Rust SDK Team ", "Russell Cohen "] description = "AWS SDK for AWS Directory Service" edition = "2021" diff --git a/sdk/directory/README.md b/sdk/directory/README.md index c5a73c050ce7..3a9d0dd91963 100644 --- a/sdk/directory/README.md +++ b/sdk/directory/README.md @@ -14,7 +14,7 @@ your project, add the following to your **Cargo.toml** file: ```toml [dependencies] aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -aws-sdk-directory = "1.44.0" +aws-sdk-directory = "1.45.0" tokio = { version = "1", features = ["full"] } ``` diff --git a/sdk/directory/src/client.rs b/sdk/directory/src/client.rs index 5f60a8f2475e..3ab2bc934a01 100644 --- a/sdk/directory/src/client.rs +++ b/sdk/directory/src/client.rs @@ -213,6 +213,8 @@ mod describe_conditional_forwarders; mod describe_directories; +mod describe_directory_data_access; + mod describe_domain_controllers; mod describe_event_topics; @@ -233,6 +235,8 @@ mod describe_update_directory; mod disable_client_authentication; +mod disable_directory_data_access; + mod disable_ldaps; mod disable_radius; @@ -241,6 +245,8 @@ mod disable_sso; mod enable_client_authentication; +mod enable_directory_data_access; + mod enable_ldaps; mod enable_radius; diff --git a/sdk/directory/src/client/add_ip_routes.rs b/sdk/directory/src/client/add_ip_routes.rs index 71d634adb6c9..8d539a74463f 100644 --- a/sdk/directory/src/client/add_ip_routes.rs +++ b/sdk/directory/src/client/add_ip_routes.rs @@ -5,7 +5,7 @@ impl super::Client { /// - The fluent builder is configurable: /// - [`directory_id(impl Into)`](crate::operation::add_ip_routes::builders::AddIpRoutesFluentBuilder::directory_id) / [`set_directory_id(Option)`](crate::operation::add_ip_routes::builders::AddIpRoutesFluentBuilder::set_directory_id):
    required: **true**

    Identifier (ID) of the directory to which to add the address block.


    /// - [`ip_routes(IpRoute)`](crate::operation::add_ip_routes::builders::AddIpRoutesFluentBuilder::ip_routes) / [`set_ip_routes(Option>)`](crate::operation::add_ip_routes::builders::AddIpRoutesFluentBuilder::set_ip_routes):
    required: **true**

    IP address blocks, using CIDR format, of the traffic to route. This is often the IP address block of the DNS server used for your self-managed domain.


    - /// - [`update_security_group_for_directory_controllers(bool)`](crate::operation::add_ip_routes::builders::AddIpRoutesFluentBuilder::update_security_group_for_directory_controllers) / [`set_update_security_group_for_directory_controllers(Option)`](crate::operation::add_ip_routes::builders::AddIpRoutesFluentBuilder::set_update_security_group_for_directory_controllers):
    required: **false**

    If set to true, updates the inbound and outbound rules of the security group that has the description: "Amazon Web Services created security group for directory ID directory controllers." Following are the new rules:

    Inbound:

    • Type: Custom UDP Rule, Protocol: UDP, Range: 88, Source: 0.0.0.0/0

    • Type: Custom UDP Rule, Protocol: UDP, Range: 123, Source: 0.0.0.0/0

    • Type: Custom UDP Rule, Protocol: UDP, Range: 138, Source: 0.0.0.0/0

    • Type: Custom UDP Rule, Protocol: UDP, Range: 389, Source: 0.0.0.0/0

    • Type: Custom UDP Rule, Protocol: UDP, Range: 464, Source: 0.0.0.0/0

    • Type: Custom UDP Rule, Protocol: UDP, Range: 445, Source: 0.0.0.0/0

    • Type: Custom TCP Rule, Protocol: TCP, Range: 88, Source: 0.0.0.0/0

    • Type: Custom TCP Rule, Protocol: TCP, Range: 135, Source: 0.0.0.0/0

    • Type: Custom TCP Rule, Protocol: TCP, Range: 445, Source: 0.0.0.0/0

    • Type: Custom TCP Rule, Protocol: TCP, Range: 464, Source: 0.0.0.0/0

    • Type: Custom TCP Rule, Protocol: TCP, Range: 636, Source: 0.0.0.0/0

    • Type: Custom TCP Rule, Protocol: TCP, Range: 1024-65535, Source: 0.0.0.0/0

    • Type: Custom TCP Rule, Protocol: TCP, Range: 3268-33269, Source: 0.0.0.0/0

    • Type: DNS (UDP), Protocol: UDP, Range: 53, Source: 0.0.0.0/0

    • Type: DNS (TCP), Protocol: TCP, Range: 53, Source: 0.0.0.0/0

    • Type: LDAP, Protocol: TCP, Range: 389, Source: 0.0.0.0/0

    • Type: All ICMP, Protocol: All, Range: N/A, Source: 0.0.0.0/0

    Outbound:

    • Type: All traffic, Protocol: All, Range: All, Destination: 0.0.0.0/0

    These security rules impact an internal network interface that is not exposed publicly.


    + /// - [`update_security_group_for_directory_controllers(bool)`](crate::operation::add_ip_routes::builders::AddIpRoutesFluentBuilder::update_security_group_for_directory_controllers) / [`set_update_security_group_for_directory_controllers(Option)`](crate::operation::add_ip_routes::builders::AddIpRoutesFluentBuilder::set_update_security_group_for_directory_controllers):
    required: **false**

    If set to true, updates the inbound and outbound rules of the security group that has the description: "Amazon Web Services created security group for directory ID directory controllers." Following are the new rules:

    Inbound:

    • Type: Custom UDP Rule, Protocol: UDP, Range: 88, Source: Managed Microsoft AD VPC IPv4 CIDR

    • Type: Custom UDP Rule, Protocol: UDP, Range: 123, Source: Managed Microsoft AD VPC IPv4 CIDR

    • Type: Custom UDP Rule, Protocol: UDP, Range: 138, Source: Managed Microsoft AD VPC IPv4 CIDR

    • Type: Custom UDP Rule, Protocol: UDP, Range: 389, Source: Managed Microsoft AD VPC IPv4 CIDR

    • Type: Custom UDP Rule, Protocol: UDP, Range: 464, Source: Managed Microsoft AD VPC IPv4 CIDR

    • Type: Custom UDP Rule, Protocol: UDP, Range: 445, Source: Managed Microsoft AD VPC IPv4 CIDR

    • Type: Custom TCP Rule, Protocol: TCP, Range: 88, Source: Managed Microsoft AD VPC IPv4 CIDR

    • Type: Custom TCP Rule, Protocol: TCP, Range: 135, Source: Managed Microsoft AD VPC IPv4 CIDR

    • Type: Custom TCP Rule, Protocol: TCP, Range: 445, Source: Managed Microsoft AD VPC IPv4 CIDR

    • Type: Custom TCP Rule, Protocol: TCP, Range: 464, Source: Managed Microsoft AD VPC IPv4 CIDR

    • Type: Custom TCP Rule, Protocol: TCP, Range: 636, Source: Managed Microsoft AD VPC IPv4 CIDR

    • Type: Custom TCP Rule, Protocol: TCP, Range: 1024-65535, Source: Managed Microsoft AD VPC IPv4 CIDR

    • Type: Custom TCP Rule, Protocol: TCP, Range: 3268-33269, Source: Managed Microsoft AD VPC IPv4 CIDR

    • Type: DNS (UDP), Protocol: UDP, Range: 53, Source: Managed Microsoft AD VPC IPv4 CIDR

    • Type: DNS (TCP), Protocol: TCP, Range: 53, Source: Managed Microsoft AD VPC IPv4 CIDR

    • Type: LDAP, Protocol: TCP, Range: 389, Source: Managed Microsoft AD VPC IPv4 CIDR

    • Type: All ICMP, Protocol: All, Range: N/A, Source: Managed Microsoft AD VPC IPv4 CIDR

    Outbound:

    • Type: All traffic, Protocol: All, Range: All, Destination: 0.0.0.0/0

    These security rules impact an internal network interface that is not exposed publicly.


    /// - On success, responds with [`AddIpRoutesOutput`](crate::operation::add_ip_routes::AddIpRoutesOutput) /// - On failure, responds with [`SdkError`](crate::operation::add_ip_routes::AddIpRoutesError) pub fn add_ip_routes(&self) -> crate::operation::add_ip_routes::builders::AddIpRoutesFluentBuilder { diff --git a/sdk/directory/src/client/create_trust.rs b/sdk/directory/src/client/create_trust.rs index d5e03de2f4a8..fad1d7c2b716 100644 --- a/sdk/directory/src/client/create_trust.rs +++ b/sdk/directory/src/client/create_trust.rs @@ -5,7 +5,7 @@ impl super::Client { /// - The fluent builder is configurable: /// - [`directory_id(impl Into)`](crate::operation::create_trust::builders::CreateTrustFluentBuilder::directory_id) / [`set_directory_id(Option)`](crate::operation::create_trust::builders::CreateTrustFluentBuilder::set_directory_id):
    required: **true**

    The Directory ID of the Managed Microsoft AD directory for which to establish the trust relationship.


    /// - [`remote_domain_name(impl Into)`](crate::operation::create_trust::builders::CreateTrustFluentBuilder::remote_domain_name) / [`set_remote_domain_name(Option)`](crate::operation::create_trust::builders::CreateTrustFluentBuilder::set_remote_domain_name):
    required: **true**

    The Fully Qualified Domain Name (FQDN) of the external domain for which to create the trust relationship.


    - /// - [`trust_password(impl Into)`](crate::operation::create_trust::builders::CreateTrustFluentBuilder::trust_password) / [`set_trust_password(Option)`](crate::operation::create_trust::builders::CreateTrustFluentBuilder::set_trust_password):
    required: **true**

    The trust password. The must be the same password that was used when creating the trust relationship on the external domain.


    + /// - [`trust_password(impl Into)`](crate::operation::create_trust::builders::CreateTrustFluentBuilder::trust_password) / [`set_trust_password(Option)`](crate::operation::create_trust::builders::CreateTrustFluentBuilder::set_trust_password):
    required: **true**

    The trust password. The trust password must be the same password that was used when creating the trust relationship on the external domain.


    /// - [`trust_direction(TrustDirection)`](crate::operation::create_trust::builders::CreateTrustFluentBuilder::trust_direction) / [`set_trust_direction(Option)`](crate::operation::create_trust::builders::CreateTrustFluentBuilder::set_trust_direction):
    required: **true**

    The direction of the trust relationship.


    /// - [`trust_type(TrustType)`](crate::operation::create_trust::builders::CreateTrustFluentBuilder::trust_type) / [`set_trust_type(Option)`](crate::operation::create_trust::builders::CreateTrustFluentBuilder::set_trust_type):
    required: **false**

    The trust relationship type. Forest is the default.


    /// - [`conditional_forwarder_ip_addrs(impl Into)`](crate::operation::create_trust::builders::CreateTrustFluentBuilder::conditional_forwarder_ip_addrs) / [`set_conditional_forwarder_ip_addrs(Option>)`](crate::operation::create_trust::builders::CreateTrustFluentBuilder::set_conditional_forwarder_ip_addrs):
    required: **false**

    The IP addresses of the remote DNS server associated with RemoteDomainName.


    diff --git a/sdk/directory/src/client/describe_directory_data_access.rs b/sdk/directory/src/client/describe_directory_data_access.rs new file mode 100644 index 000000000000..6837c8106ed1 --- /dev/null +++ b/sdk/directory/src/client/describe_directory_data_access.rs @@ -0,0 +1,15 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`DescribeDirectoryDataAccess`](crate::operation::describe_directory_data_access::builders::DescribeDirectoryDataAccessFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`directory_id(impl Into)`](crate::operation::describe_directory_data_access::builders::DescribeDirectoryDataAccessFluentBuilder::directory_id) / [`set_directory_id(Option)`](crate::operation::describe_directory_data_access::builders::DescribeDirectoryDataAccessFluentBuilder::set_directory_id):
    required: **true**

    The directory identifier.


    + /// - On success, responds with [`DescribeDirectoryDataAccessOutput`](crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessOutput) with field(s): + /// - [`data_access_status(Option)`](crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessOutput::data_access_status):

    The current status of data access through the Directory Service Data API.

    + /// - On failure, responds with [`SdkError`](crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError) + pub fn describe_directory_data_access( + &self, + ) -> crate::operation::describe_directory_data_access::builders::DescribeDirectoryDataAccessFluentBuilder { + crate::operation::describe_directory_data_access::builders::DescribeDirectoryDataAccessFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/directory/src/client/disable_client_authentication.rs b/sdk/directory/src/client/disable_client_authentication.rs index 416ef33f2fc9..642509294d24 100644 --- a/sdk/directory/src/client/disable_client_authentication.rs +++ b/sdk/directory/src/client/disable_client_authentication.rs @@ -4,7 +4,7 @@ impl super::Client { /// /// - The fluent builder is configurable: /// - [`directory_id(impl Into)`](crate::operation::disable_client_authentication::builders::DisableClientAuthenticationFluentBuilder::directory_id) / [`set_directory_id(Option)`](crate::operation::disable_client_authentication::builders::DisableClientAuthenticationFluentBuilder::set_directory_id):
    required: **true**

    The identifier of the directory


    - /// - [`r#type(ClientAuthenticationType)`](crate::operation::disable_client_authentication::builders::DisableClientAuthenticationFluentBuilder::type) / [`set_type(Option)`](crate::operation::disable_client_authentication::builders::DisableClientAuthenticationFluentBuilder::set_type):
    required: **true**

    The type of client authentication to disable. Currently, only the parameter, SmartCard is supported.


    + /// - [`r#type(ClientAuthenticationType)`](crate::operation::disable_client_authentication::builders::DisableClientAuthenticationFluentBuilder::type) / [`set_type(Option)`](crate::operation::disable_client_authentication::builders::DisableClientAuthenticationFluentBuilder::set_type):
    required: **true**

    The type of client authentication to disable. Currently the only parameter "SmartCard" is supported.


    /// - On success, responds with [`DisableClientAuthenticationOutput`](crate::operation::disable_client_authentication::DisableClientAuthenticationOutput) /// - On failure, responds with [`SdkError`](crate::operation::disable_client_authentication::DisableClientAuthenticationError) pub fn disable_client_authentication( diff --git a/sdk/directory/src/client/disable_directory_data_access.rs b/sdk/directory/src/client/disable_directory_data_access.rs new file mode 100644 index 000000000000..51e419185bc5 --- /dev/null +++ b/sdk/directory/src/client/disable_directory_data_access.rs @@ -0,0 +1,14 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`DisableDirectoryDataAccess`](crate::operation::disable_directory_data_access::builders::DisableDirectoryDataAccessFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`directory_id(impl Into)`](crate::operation::disable_directory_data_access::builders::DisableDirectoryDataAccessFluentBuilder::directory_id) / [`set_directory_id(Option)`](crate::operation::disable_directory_data_access::builders::DisableDirectoryDataAccessFluentBuilder::set_directory_id):
    required: **true**

    The directory identifier.


    + /// - On success, responds with [`DisableDirectoryDataAccessOutput`](crate::operation::disable_directory_data_access::DisableDirectoryDataAccessOutput) + /// - On failure, responds with [`SdkError`](crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError) + pub fn disable_directory_data_access( + &self, + ) -> crate::operation::disable_directory_data_access::builders::DisableDirectoryDataAccessFluentBuilder { + crate::operation::disable_directory_data_access::builders::DisableDirectoryDataAccessFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/directory/src/client/enable_directory_data_access.rs b/sdk/directory/src/client/enable_directory_data_access.rs new file mode 100644 index 000000000000..d5553b980c1e --- /dev/null +++ b/sdk/directory/src/client/enable_directory_data_access.rs @@ -0,0 +1,12 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`EnableDirectoryDataAccess`](crate::operation::enable_directory_data_access::builders::EnableDirectoryDataAccessFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`directory_id(impl Into)`](crate::operation::enable_directory_data_access::builders::EnableDirectoryDataAccessFluentBuilder::directory_id) / [`set_directory_id(Option)`](crate::operation::enable_directory_data_access::builders::EnableDirectoryDataAccessFluentBuilder::set_directory_id):
    required: **true**

    The directory identifier.


    + /// - On success, responds with [`EnableDirectoryDataAccessOutput`](crate::operation::enable_directory_data_access::EnableDirectoryDataAccessOutput) + /// - On failure, responds with [`SdkError`](crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError) + pub fn enable_directory_data_access(&self) -> crate::operation::enable_directory_data_access::builders::EnableDirectoryDataAccessFluentBuilder { + crate::operation::enable_directory_data_access::builders::EnableDirectoryDataAccessFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/directory/src/error_meta.rs b/sdk/directory/src/error_meta.rs index a39d90d01f15..e1bc1f58c567 100644 --- a/sdk/directory/src/error_meta.rs +++ b/sdk/directory/src/error_meta.rs @@ -3,7 +3,7 @@ #[non_exhaustive] #[derive(::std::fmt::Debug)] pub enum Error { - ///

    Client authentication is not available in this region at this time.

    + ///

    You do not have sufficient access to perform this action.

    AccessDeniedException(crate::types::error::AccessDeniedException), ///

    An authentication error occurred.

    AuthenticationFailedException(crate::types::error::AuthenticationFailedException), @@ -29,7 +29,7 @@ pub enum Error { DirectoryLimitExceededException(crate::types::error::DirectoryLimitExceededException), ///

    The specified directory has not been shared with this Amazon Web Services account.

    DirectoryNotSharedException(crate::types::error::DirectoryNotSharedException), - ///

    The specified directory is unavailable or could not be found.

    + ///

    The specified directory is unavailable.

    DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), ///

    The maximum allowed number of domain controllers per directory was exceeded. The default limit per directory is 20 domain controllers.

    DomainControllerLimitExceededException(crate::types::error::DomainControllerLimitExceededException), @@ -1006,6 +1006,49 @@ impl From for } } } +impl + From<::aws_smithy_runtime_api::client::result::SdkError> + for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from( + err: ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError, + R, + >, + ) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError) -> Self { + match err { + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError::AccessDeniedException(inner) => { + Error::AccessDeniedException(inner) + } + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError::ClientException(inner) => { + Error::ClientException(inner) + } + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError::DirectoryDoesNotExistException(inner) => { + Error::DirectoryDoesNotExistException(inner) + } + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError::ServiceException(inner) => { + Error::ServiceException(inner) + } + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError::UnsupportedOperationException(inner) => { + Error::UnsupportedOperationException(inner) + } + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error where @@ -1348,6 +1391,49 @@ impl From From<::aws_smithy_runtime_api::client::result::SdkError> + for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from( + err: ::aws_smithy_runtime_api::client::result::SdkError, + ) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError) -> Self { + match err { + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError::AccessDeniedException(inner) => { + Error::AccessDeniedException(inner) + } + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError::ClientException(inner) => Error::ClientException(inner), + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError::DirectoryDoesNotExistException(inner) => { + Error::DirectoryDoesNotExistException(inner) + } + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError::DirectoryInDesiredStateException(inner) => { + Error::DirectoryInDesiredStateException(inner) + } + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError::DirectoryUnavailableException(inner) => { + Error::DirectoryUnavailableException(inner) + } + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError::ServiceException(inner) => { + Error::ServiceException(inner) + } + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError::UnsupportedOperationException(inner) => { + Error::UnsupportedOperationException(inner) + } + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error where R: Send + Sync + std::fmt::Debug + 'static, @@ -1469,6 +1555,47 @@ impl From From<::aws_smithy_runtime_api::client::result::SdkError> + for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from( + err: ::aws_smithy_runtime_api::client::result::SdkError, + ) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError) -> Self { + match err { + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError::AccessDeniedException(inner) => { + Error::AccessDeniedException(inner) + } + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError::ClientException(inner) => Error::ClientException(inner), + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError::DirectoryDoesNotExistException(inner) => { + Error::DirectoryDoesNotExistException(inner) + } + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError::DirectoryInDesiredStateException(inner) => { + Error::DirectoryInDesiredStateException(inner) + } + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError::DirectoryUnavailableException(inner) => { + Error::DirectoryUnavailableException(inner) + } + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError::ServiceException(inner) => Error::ServiceException(inner), + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError::UnsupportedOperationException(inner) => { + Error::UnsupportedOperationException(inner) + } + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error where R: Send + Sync + std::fmt::Debug + 'static, diff --git a/sdk/directory/src/lib.rs b/sdk/directory/src/lib.rs index 19e68a00f63f..59a0cc8c4375 100644 --- a/sdk/directory/src/lib.rs +++ b/sdk/directory/src/lib.rs @@ -31,7 +31,7 @@ //! ```toml //! [dependencies] //! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -//! aws-sdk-directory = "1.44.0" +//! aws-sdk-directory = "1.45.0" //! tokio = { version = "1", features = ["full"] } //! ``` //! diff --git a/sdk/directory/src/operation.rs b/sdk/directory/src/operation.rs index 9804efa10ae7..edcf70136ab5 100644 --- a/sdk/directory/src/operation.rs +++ b/sdk/directory/src/operation.rs @@ -76,6 +76,9 @@ pub mod describe_conditional_forwarders; /// Types for the `DescribeDirectories` operation. pub mod describe_directories; +/// Types for the `DescribeDirectoryDataAccess` operation. +pub mod describe_directory_data_access; + /// Types for the `DescribeDomainControllers` operation. pub mod describe_domain_controllers; @@ -106,6 +109,9 @@ pub mod describe_update_directory; /// Types for the `DisableClientAuthentication` operation. pub mod disable_client_authentication; +/// Types for the `DisableDirectoryDataAccess` operation. +pub mod disable_directory_data_access; + /// Types for the `DisableLDAPS` operation. pub mod disable_ldaps; @@ -118,6 +124,9 @@ pub mod disable_sso; /// Types for the `EnableClientAuthentication` operation. pub mod enable_client_authentication; +/// Types for the `EnableDirectoryDataAccess` operation. +pub mod enable_directory_data_access; + /// Types for the `EnableLDAPS` operation. pub mod enable_ldaps; diff --git a/sdk/directory/src/operation/add_ip_routes.rs b/sdk/directory/src/operation/add_ip_routes.rs index 5b07bf2b4045..3470cd0cad91 100644 --- a/sdk/directory/src/operation/add_ip_routes.rs +++ b/sdk/directory/src/operation/add_ip_routes.rs @@ -250,7 +250,7 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for AddIpRoutesEn pub enum AddIpRoutesError { ///

    A client exception has occurred.

    ClientException(crate::types::error::ClientException), - ///

    The specified directory is unavailable or could not be found.

    + ///

    The specified directory is unavailable.

    DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), ///

    The specified entity already exists.

    EntityAlreadyExistsException(crate::types::error::EntityAlreadyExistsException), diff --git a/sdk/directory/src/operation/add_ip_routes/_add_ip_routes_input.rs b/sdk/directory/src/operation/add_ip_routes/_add_ip_routes_input.rs index eae4d274da9b..343dfe387e18 100644 --- a/sdk/directory/src/operation/add_ip_routes/_add_ip_routes_input.rs +++ b/sdk/directory/src/operation/add_ip_routes/_add_ip_routes_input.rs @@ -11,39 +11,39 @@ pub struct AddIpRoutesInput { ///

    Inbound:

    ///
      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 88, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 88, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 123, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 123, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 138, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 138, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 389, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 389, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 464, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 464, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 445, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 445, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 88, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 88, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 135, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 135, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 445, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 445, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 464, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 464, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 636, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 636, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 1024-65535, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 1024-65535, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 3268-33269, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 3268-33269, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: DNS (UDP), Protocol: UDP, Range: 53, Source: 0.0.0.0/0

    • + ///

      Type: DNS (UDP), Protocol: UDP, Range: 53, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: DNS (TCP), Protocol: TCP, Range: 53, Source: 0.0.0.0/0

    • + ///

      Type: DNS (TCP), Protocol: TCP, Range: 53, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: LDAP, Protocol: TCP, Range: 389, Source: 0.0.0.0/0

    • + ///

      Type: LDAP, Protocol: TCP, Range: 389, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: All ICMP, Protocol: All, Range: N/A, Source: 0.0.0.0/0

    • + ///

      Type: All ICMP, Protocol: All, Range: N/A, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    ///

    ///

    Outbound:

    @@ -69,39 +69,39 @@ impl AddIpRoutesInput { ///

    Inbound:

    ///
      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 88, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 88, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 123, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 123, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 138, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 138, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 389, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 389, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 464, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 464, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 445, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 445, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 88, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 88, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 135, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 135, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 445, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 445, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 464, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 464, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 636, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 636, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 1024-65535, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 1024-65535, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 3268-33269, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 3268-33269, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: DNS (UDP), Protocol: UDP, Range: 53, Source: 0.0.0.0/0

    • + ///

      Type: DNS (UDP), Protocol: UDP, Range: 53, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: DNS (TCP), Protocol: TCP, Range: 53, Source: 0.0.0.0/0

    • + ///

      Type: DNS (TCP), Protocol: TCP, Range: 53, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: LDAP, Protocol: TCP, Range: 389, Source: 0.0.0.0/0

    • + ///

      Type: LDAP, Protocol: TCP, Range: 389, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: All ICMP, Protocol: All, Range: N/A, Source: 0.0.0.0/0

    • + ///

      Type: All ICMP, Protocol: All, Range: N/A, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    ///

    ///

    Outbound:

    @@ -169,39 +169,39 @@ impl AddIpRoutesInputBuilder { ///

    Inbound:

    ///
      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 88, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 88, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 123, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 123, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 138, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 138, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 389, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 389, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 464, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 464, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 445, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 445, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 88, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 88, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 135, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 135, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 445, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 445, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 464, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 464, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 636, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 636, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 1024-65535, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 1024-65535, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 3268-33269, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 3268-33269, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: DNS (UDP), Protocol: UDP, Range: 53, Source: 0.0.0.0/0

    • + ///

      Type: DNS (UDP), Protocol: UDP, Range: 53, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: DNS (TCP), Protocol: TCP, Range: 53, Source: 0.0.0.0/0

    • + ///

      Type: DNS (TCP), Protocol: TCP, Range: 53, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: LDAP, Protocol: TCP, Range: 389, Source: 0.0.0.0/0

    • + ///

      Type: LDAP, Protocol: TCP, Range: 389, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: All ICMP, Protocol: All, Range: N/A, Source: 0.0.0.0/0

    • + ///

      Type: All ICMP, Protocol: All, Range: N/A, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    ///

    ///

    Outbound:

    @@ -218,39 +218,39 @@ impl AddIpRoutesInputBuilder { ///

    Inbound:

    ///
      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 88, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 88, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 123, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 123, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 138, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 138, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 389, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 389, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 464, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 464, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 445, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 445, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 88, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 88, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 135, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 135, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 445, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 445, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 464, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 464, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 636, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 636, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 1024-65535, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 1024-65535, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 3268-33269, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 3268-33269, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: DNS (UDP), Protocol: UDP, Range: 53, Source: 0.0.0.0/0

    • + ///

      Type: DNS (UDP), Protocol: UDP, Range: 53, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: DNS (TCP), Protocol: TCP, Range: 53, Source: 0.0.0.0/0

    • + ///

      Type: DNS (TCP), Protocol: TCP, Range: 53, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: LDAP, Protocol: TCP, Range: 389, Source: 0.0.0.0/0

    • + ///

      Type: LDAP, Protocol: TCP, Range: 389, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: All ICMP, Protocol: All, Range: N/A, Source: 0.0.0.0/0

    • + ///

      Type: All ICMP, Protocol: All, Range: N/A, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    ///

    ///

    Outbound:

    @@ -267,39 +267,39 @@ impl AddIpRoutesInputBuilder { ///

    Inbound:

    ///
      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 88, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 88, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 123, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 123, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 138, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 138, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 389, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 389, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 464, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 464, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 445, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 445, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 88, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 88, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 135, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 135, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 445, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 445, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 464, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 464, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 636, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 636, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 1024-65535, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 1024-65535, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 3268-33269, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 3268-33269, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: DNS (UDP), Protocol: UDP, Range: 53, Source: 0.0.0.0/0

    • + ///

      Type: DNS (UDP), Protocol: UDP, Range: 53, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: DNS (TCP), Protocol: TCP, Range: 53, Source: 0.0.0.0/0

    • + ///

      Type: DNS (TCP), Protocol: TCP, Range: 53, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: LDAP, Protocol: TCP, Range: 389, Source: 0.0.0.0/0

    • + ///

      Type: LDAP, Protocol: TCP, Range: 389, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: All ICMP, Protocol: All, Range: N/A, Source: 0.0.0.0/0

    • + ///

      Type: All ICMP, Protocol: All, Range: N/A, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    ///

    ///

    Outbound:

    diff --git a/sdk/directory/src/operation/add_ip_routes/builders.rs b/sdk/directory/src/operation/add_ip_routes/builders.rs index 7419ab7eed3c..072509f56e0c 100644 --- a/sdk/directory/src/operation/add_ip_routes/builders.rs +++ b/sdk/directory/src/operation/add_ip_routes/builders.rs @@ -146,39 +146,39 @@ impl AddIpRoutesFluentBuilder { ///

    Inbound:

    ///
      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 88, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 88, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 123, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 123, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 138, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 138, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 389, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 389, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 464, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 464, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 445, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 445, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 88, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 88, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 135, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 135, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 445, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 445, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 464, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 464, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 636, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 636, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 1024-65535, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 1024-65535, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 3268-33269, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 3268-33269, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: DNS (UDP), Protocol: UDP, Range: 53, Source: 0.0.0.0/0

    • + ///

      Type: DNS (UDP), Protocol: UDP, Range: 53, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: DNS (TCP), Protocol: TCP, Range: 53, Source: 0.0.0.0/0

    • + ///

      Type: DNS (TCP), Protocol: TCP, Range: 53, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: LDAP, Protocol: TCP, Range: 389, Source: 0.0.0.0/0

    • + ///

      Type: LDAP, Protocol: TCP, Range: 389, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: All ICMP, Protocol: All, Range: N/A, Source: 0.0.0.0/0

    • + ///

      Type: All ICMP, Protocol: All, Range: N/A, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    ///

    ///

    Outbound:

    @@ -195,39 +195,39 @@ impl AddIpRoutesFluentBuilder { ///

    Inbound:

    ///
      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 88, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 88, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 123, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 123, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 138, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 138, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 389, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 389, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 464, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 464, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 445, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 445, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 88, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 88, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 135, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 135, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 445, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 445, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 464, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 464, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 636, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 636, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 1024-65535, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 1024-65535, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 3268-33269, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 3268-33269, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: DNS (UDP), Protocol: UDP, Range: 53, Source: 0.0.0.0/0

    • + ///

      Type: DNS (UDP), Protocol: UDP, Range: 53, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: DNS (TCP), Protocol: TCP, Range: 53, Source: 0.0.0.0/0

    • + ///

      Type: DNS (TCP), Protocol: TCP, Range: 53, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: LDAP, Protocol: TCP, Range: 389, Source: 0.0.0.0/0

    • + ///

      Type: LDAP, Protocol: TCP, Range: 389, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: All ICMP, Protocol: All, Range: N/A, Source: 0.0.0.0/0

    • + ///

      Type: All ICMP, Protocol: All, Range: N/A, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    ///

    ///

    Outbound:

    @@ -244,39 +244,39 @@ impl AddIpRoutesFluentBuilder { ///

    Inbound:

    ///
      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 88, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 88, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 123, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 123, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 138, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 138, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 389, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 389, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 464, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 464, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 445, Source: 0.0.0.0/0

    • + ///

      Type: Custom UDP Rule, Protocol: UDP, Range: 445, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 88, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 88, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 135, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 135, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 445, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 445, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 464, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 464, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 636, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 636, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 1024-65535, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 1024-65535, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 3268-33269, Source: 0.0.0.0/0

    • + ///

      Type: Custom TCP Rule, Protocol: TCP, Range: 3268-33269, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: DNS (UDP), Protocol: UDP, Range: 53, Source: 0.0.0.0/0

    • + ///

      Type: DNS (UDP), Protocol: UDP, Range: 53, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: DNS (TCP), Protocol: TCP, Range: 53, Source: 0.0.0.0/0

    • + ///

      Type: DNS (TCP), Protocol: TCP, Range: 53, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: LDAP, Protocol: TCP, Range: 389, Source: 0.0.0.0/0

    • + ///

      Type: LDAP, Protocol: TCP, Range: 389, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    • - ///

      Type: All ICMP, Protocol: All, Range: N/A, Source: 0.0.0.0/0

    • + ///

      Type: All ICMP, Protocol: All, Range: N/A, Source: Managed Microsoft AD VPC IPv4 CIDR

      ///
    ///

    ///

    Outbound:

    diff --git a/sdk/directory/src/operation/add_region.rs b/sdk/directory/src/operation/add_region.rs index 887d828a436e..b7bfe95fb237 100644 --- a/sdk/directory/src/operation/add_region.rs +++ b/sdk/directory/src/operation/add_region.rs @@ -245,7 +245,7 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for AddRegionEndp #[non_exhaustive] #[derive(::std::fmt::Debug)] pub enum AddRegionError { - ///

    Client authentication is not available in this region at this time.

    + ///

    You do not have sufficient access to perform this action.

    AccessDeniedException(crate::types::error::AccessDeniedException), ///

    A client exception has occurred.

    ClientException(crate::types::error::ClientException), @@ -253,7 +253,7 @@ pub enum AddRegionError { DirectoryAlreadyInRegionException(crate::types::error::DirectoryAlreadyInRegionException), ///

    The specified directory does not exist in the system.

    DirectoryDoesNotExistException(crate::types::error::DirectoryDoesNotExistException), - ///

    The specified directory is unavailable or could not be found.

    + ///

    The specified directory is unavailable.

    DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), ///

    The specified entity could not be found.

    EntityDoesNotExistException(crate::types::error::EntityDoesNotExistException), diff --git a/sdk/directory/src/operation/create_computer.rs b/sdk/directory/src/operation/create_computer.rs index f8766eae9392..c46d7f15f646 100644 --- a/sdk/directory/src/operation/create_computer.rs +++ b/sdk/directory/src/operation/create_computer.rs @@ -252,7 +252,7 @@ pub enum CreateComputerError { AuthenticationFailedException(crate::types::error::AuthenticationFailedException), ///

    A client exception has occurred.

    ClientException(crate::types::error::ClientException), - ///

    The specified directory is unavailable or could not be found.

    + ///

    The specified directory is unavailable.

    DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), ///

    The specified entity already exists.

    EntityAlreadyExistsException(crate::types::error::EntityAlreadyExistsException), diff --git a/sdk/directory/src/operation/create_conditional_forwarder.rs b/sdk/directory/src/operation/create_conditional_forwarder.rs index cfd24bfcb384..7c04f63c5b53 100644 --- a/sdk/directory/src/operation/create_conditional_forwarder.rs +++ b/sdk/directory/src/operation/create_conditional_forwarder.rs @@ -258,7 +258,7 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateConditi pub enum CreateConditionalForwarderError { ///

    A client exception has occurred.

    ClientException(crate::types::error::ClientException), - ///

    The specified directory is unavailable or could not be found.

    + ///

    The specified directory is unavailable.

    DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), ///

    The specified entity already exists.

    EntityAlreadyExistsException(crate::types::error::EntityAlreadyExistsException), diff --git a/sdk/directory/src/operation/create_trust/_create_trust_input.rs b/sdk/directory/src/operation/create_trust/_create_trust_input.rs index 74def0e44ee7..dfc68c2af6a5 100644 --- a/sdk/directory/src/operation/create_trust/_create_trust_input.rs +++ b/sdk/directory/src/operation/create_trust/_create_trust_input.rs @@ -9,7 +9,7 @@ pub struct CreateTrustInput { pub directory_id: ::std::option::Option<::std::string::String>, ///

    The Fully Qualified Domain Name (FQDN) of the external domain for which to create the trust relationship.

    pub remote_domain_name: ::std::option::Option<::std::string::String>, - ///

    The trust password. The must be the same password that was used when creating the trust relationship on the external domain.

    + ///

    The trust password. The trust password must be the same password that was used when creating the trust relationship on the external domain.

    pub trust_password: ::std::option::Option<::std::string::String>, ///

    The direction of the trust relationship.

    pub trust_direction: ::std::option::Option, @@ -29,7 +29,7 @@ impl CreateTrustInput { pub fn remote_domain_name(&self) -> ::std::option::Option<&str> { self.remote_domain_name.as_deref() } - ///

    The trust password. The must be the same password that was used when creating the trust relationship on the external domain.

    + ///

    The trust password. The trust password must be the same password that was used when creating the trust relationship on the external domain.

    pub fn trust_password(&self) -> ::std::option::Option<&str> { self.trust_password.as_deref() } @@ -115,18 +115,18 @@ impl CreateTrustInputBuilder { pub fn get_remote_domain_name(&self) -> &::std::option::Option<::std::string::String> { &self.remote_domain_name } - ///

    The trust password. The must be the same password that was used when creating the trust relationship on the external domain.

    + ///

    The trust password. The trust password must be the same password that was used when creating the trust relationship on the external domain.

    /// This field is required. pub fn trust_password(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.trust_password = ::std::option::Option::Some(input.into()); self } - ///

    The trust password. The must be the same password that was used when creating the trust relationship on the external domain.

    + ///

    The trust password. The trust password must be the same password that was used when creating the trust relationship on the external domain.

    pub fn set_trust_password(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.trust_password = input; self } - ///

    The trust password. The must be the same password that was used when creating the trust relationship on the external domain.

    + ///

    The trust password. The trust password must be the same password that was used when creating the trust relationship on the external domain.

    pub fn get_trust_password(&self) -> &::std::option::Option<::std::string::String> { &self.trust_password } diff --git a/sdk/directory/src/operation/create_trust/builders.rs b/sdk/directory/src/operation/create_trust/builders.rs index 4bd419b66e37..9836f813d5aa 100644 --- a/sdk/directory/src/operation/create_trust/builders.rs +++ b/sdk/directory/src/operation/create_trust/builders.rs @@ -137,17 +137,17 @@ impl CreateTrustFluentBuilder { pub fn get_remote_domain_name(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_remote_domain_name() } - ///

    The trust password. The must be the same password that was used when creating the trust relationship on the external domain.

    + ///

    The trust password. The trust password must be the same password that was used when creating the trust relationship on the external domain.

    pub fn trust_password(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.trust_password(input.into()); self } - ///

    The trust password. The must be the same password that was used when creating the trust relationship on the external domain.

    + ///

    The trust password. The trust password must be the same password that was used when creating the trust relationship on the external domain.

    pub fn set_trust_password(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.inner = self.inner.set_trust_password(input); self } - ///

    The trust password. The must be the same password that was used when creating the trust relationship on the external domain.

    + ///

    The trust password. The trust password must be the same password that was used when creating the trust relationship on the external domain.

    pub fn get_trust_password(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_trust_password() } diff --git a/sdk/directory/src/operation/delete_conditional_forwarder.rs b/sdk/directory/src/operation/delete_conditional_forwarder.rs index 4e813467354b..939cd0d576eb 100644 --- a/sdk/directory/src/operation/delete_conditional_forwarder.rs +++ b/sdk/directory/src/operation/delete_conditional_forwarder.rs @@ -258,7 +258,7 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DeleteConditi pub enum DeleteConditionalForwarderError { ///

    A client exception has occurred.

    ClientException(crate::types::error::ClientException), - ///

    The specified directory is unavailable or could not be found.

    + ///

    The specified directory is unavailable.

    DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), ///

    The specified entity could not be found.

    EntityDoesNotExistException(crate::types::error::EntityDoesNotExistException), diff --git a/sdk/directory/src/operation/deregister_certificate.rs b/sdk/directory/src/operation/deregister_certificate.rs index 382508edeb59..b4b6d3e4ab4e 100644 --- a/sdk/directory/src/operation/deregister_certificate.rs +++ b/sdk/directory/src/operation/deregister_certificate.rs @@ -264,7 +264,7 @@ pub enum DeregisterCertificateError { ClientException(crate::types::error::ClientException), ///

    The specified directory does not exist in the system.

    DirectoryDoesNotExistException(crate::types::error::DirectoryDoesNotExistException), - ///

    The specified directory is unavailable or could not be found.

    + ///

    The specified directory is unavailable.

    DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), ///

    One or more parameters are not valid.

    InvalidParameterException(crate::types::error::InvalidParameterException), diff --git a/sdk/directory/src/operation/describe_client_authentication_settings.rs b/sdk/directory/src/operation/describe_client_authentication_settings.rs index 9b1333746fd5..1a86e7708515 100644 --- a/sdk/directory/src/operation/describe_client_authentication_settings.rs +++ b/sdk/directory/src/operation/describe_client_authentication_settings.rs @@ -260,7 +260,7 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DescribeClien #[non_exhaustive] #[derive(::std::fmt::Debug)] pub enum DescribeClientAuthenticationSettingsError { - ///

    Client authentication is not available in this region at this time.

    + ///

    You do not have sufficient access to perform this action.

    AccessDeniedException(crate::types::error::AccessDeniedException), ///

    A client exception has occurred.

    ClientException(crate::types::error::ClientException), diff --git a/sdk/directory/src/operation/describe_conditional_forwarders.rs b/sdk/directory/src/operation/describe_conditional_forwarders.rs index 74a716a22634..87fe1bb43f18 100644 --- a/sdk/directory/src/operation/describe_conditional_forwarders.rs +++ b/sdk/directory/src/operation/describe_conditional_forwarders.rs @@ -258,7 +258,7 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DescribeCondi pub enum DescribeConditionalForwardersError { ///

    A client exception has occurred.

    ClientException(crate::types::error::ClientException), - ///

    The specified directory is unavailable or could not be found.

    + ///

    The specified directory is unavailable.

    DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), ///

    The specified entity could not be found.

    EntityDoesNotExistException(crate::types::error::EntityDoesNotExistException), diff --git a/sdk/directory/src/operation/describe_directory_data_access.rs b/sdk/directory/src/operation/describe_directory_data_access.rs new file mode 100644 index 000000000000..1b8eeed350be --- /dev/null +++ b/sdk/directory/src/operation/describe_directory_data_access.rs @@ -0,0 +1,407 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `DescribeDirectoryDataAccess`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct DescribeDirectoryDataAccess; +impl DescribeDirectoryDataAccess { + /// Creates a new `DescribeDirectoryDataAccess` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessInput, + ) -> ::std::result::Result< + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point( + "directoryservice", + "DescribeDirectoryDataAccess", + input, + runtime_plugins, + stop_point, + ) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DescribeDirectoryDataAccess { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("DescribeDirectoryDataAccess"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + DescribeDirectoryDataAccessRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + DescribeDirectoryDataAccessResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "DescribeDirectoryDataAccess", + "directoryservice", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DescribeDirectoryDataAccess") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(DescribeDirectoryDataAccessEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct DescribeDirectoryDataAccessResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DescribeDirectoryDataAccessResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_describe_directory_data_access::de_describe_directory_data_access_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_describe_directory_data_access::de_describe_directory_data_access_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct DescribeDirectoryDataAccessRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DescribeDirectoryDataAccessRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-amz-json-1.1"); + builder = _header_serialization_settings.set_default_header( + builder, + ::http::header::HeaderName::from_static("x-amz-target"), + "DirectoryService_20150416.DescribeDirectoryDataAccess", + ); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from( + crate::protocol_serde::shape_describe_directory_data_access::ser_describe_directory_data_access_input(&input)?, + ); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct DescribeDirectoryDataAccessEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DescribeDirectoryDataAccessEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "DescribeDirectoryDataAccessEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to DescribeDirectoryDataAccessInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `DescribeDirectoryDataAccessError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum DescribeDirectoryDataAccessError { + ///

    You do not have sufficient access to perform this action.

    + AccessDeniedException(crate::types::error::AccessDeniedException), + ///

    A client exception has occurred.

    + ClientException(crate::types::error::ClientException), + ///

    The specified directory does not exist in the system.

    + DirectoryDoesNotExistException(crate::types::error::DirectoryDoesNotExistException), + ///

    An exception has occurred in Directory Service.

    + ServiceException(crate::types::error::ServiceException), + ///

    The operation is not supported.

    + UnsupportedOperationException(crate::types::error::UnsupportedOperationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-DescribeDirectoryDataAccessError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl DescribeDirectoryDataAccessError { + /// Creates the `DescribeDirectoryDataAccessError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `DescribeDirectoryDataAccessError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ClientException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::DirectoryDoesNotExistException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ServiceException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::UnsupportedOperationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `DescribeDirectoryDataAccessError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `DescribeDirectoryDataAccessError::ClientException`. + pub fn is_client_exception(&self) -> bool { + matches!(self, Self::ClientException(_)) + } + /// Returns `true` if the error kind is `DescribeDirectoryDataAccessError::DirectoryDoesNotExistException`. + pub fn is_directory_does_not_exist_exception(&self) -> bool { + matches!(self, Self::DirectoryDoesNotExistException(_)) + } + /// Returns `true` if the error kind is `DescribeDirectoryDataAccessError::ServiceException`. + pub fn is_service_exception(&self) -> bool { + matches!(self, Self::ServiceException(_)) + } + /// Returns `true` if the error kind is `DescribeDirectoryDataAccessError::UnsupportedOperationException`. + pub fn is_unsupported_operation_exception(&self) -> bool { + matches!(self, Self::UnsupportedOperationException(_)) + } +} +impl ::std::error::Error for DescribeDirectoryDataAccessError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::ClientException(_inner) => ::std::option::Option::Some(_inner), + Self::DirectoryDoesNotExistException(_inner) => ::std::option::Option::Some(_inner), + Self::ServiceException(_inner) => ::std::option::Option::Some(_inner), + Self::UnsupportedOperationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for DescribeDirectoryDataAccessError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::ClientException(_inner) => _inner.fmt(f), + Self::DirectoryDoesNotExistException(_inner) => _inner.fmt(f), + Self::ServiceException(_inner) => _inner.fmt(f), + Self::UnsupportedOperationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for DescribeDirectoryDataAccessError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + ::std::option::Option::None + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for DescribeDirectoryDataAccessError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ClientException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::DirectoryDoesNotExistException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ServiceException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::UnsupportedOperationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DescribeDirectoryDataAccessError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::describe_directory_data_access::_describe_directory_data_access_output::DescribeDirectoryDataAccessOutput; + +pub use crate::operation::describe_directory_data_access::_describe_directory_data_access_input::DescribeDirectoryDataAccessInput; + +mod _describe_directory_data_access_input; + +mod _describe_directory_data_access_output; + +/// Builders +pub mod builders; diff --git a/sdk/directory/src/operation/describe_directory_data_access/_describe_directory_data_access_input.rs b/sdk/directory/src/operation/describe_directory_data_access/_describe_directory_data_access_input.rs new file mode 100644 index 000000000000..ed5917ff3b83 --- /dev/null +++ b/sdk/directory/src/operation/describe_directory_data_access/_describe_directory_data_access_input.rs @@ -0,0 +1,55 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct DescribeDirectoryDataAccessInput { + ///

    The directory identifier.

    + pub directory_id: ::std::option::Option<::std::string::String>, +} +impl DescribeDirectoryDataAccessInput { + ///

    The directory identifier.

    + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } +} +impl DescribeDirectoryDataAccessInput { + /// Creates a new builder-style object to manufacture [`DescribeDirectoryDataAccessInput`](crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessInput). + pub fn builder() -> crate::operation::describe_directory_data_access::builders::DescribeDirectoryDataAccessInputBuilder { + crate::operation::describe_directory_data_access::builders::DescribeDirectoryDataAccessInputBuilder::default() + } +} + +/// A builder for [`DescribeDirectoryDataAccessInput`](crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct DescribeDirectoryDataAccessInputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, +} +impl DescribeDirectoryDataAccessInputBuilder { + ///

    The directory identifier.

    + /// This field is required. + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

    The directory identifier.

    + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

    The directory identifier.

    + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + /// Consumes the builder and constructs a [`DescribeDirectoryDataAccessInput`](crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessInput). + pub fn build( + self, + ) -> ::std::result::Result< + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessInput, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok(crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessInput { + directory_id: self.directory_id, + }) + } +} diff --git a/sdk/directory/src/operation/describe_directory_data_access/_describe_directory_data_access_output.rs b/sdk/directory/src/operation/describe_directory_data_access/_describe_directory_data_access_output.rs new file mode 100644 index 000000000000..ed0449aabb24 --- /dev/null +++ b/sdk/directory/src/operation/describe_directory_data_access/_describe_directory_data_access_output.rs @@ -0,0 +1,66 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct DescribeDirectoryDataAccessOutput { + ///

    The current status of data access through the Directory Service Data API.

    + pub data_access_status: ::std::option::Option, + _request_id: Option, +} +impl DescribeDirectoryDataAccessOutput { + ///

    The current status of data access through the Directory Service Data API.

    + pub fn data_access_status(&self) -> ::std::option::Option<&crate::types::DataAccessStatus> { + self.data_access_status.as_ref() + } +} +impl ::aws_types::request_id::RequestId for DescribeDirectoryDataAccessOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl DescribeDirectoryDataAccessOutput { + /// Creates a new builder-style object to manufacture [`DescribeDirectoryDataAccessOutput`](crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessOutput). + pub fn builder() -> crate::operation::describe_directory_data_access::builders::DescribeDirectoryDataAccessOutputBuilder { + crate::operation::describe_directory_data_access::builders::DescribeDirectoryDataAccessOutputBuilder::default() + } +} + +/// A builder for [`DescribeDirectoryDataAccessOutput`](crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct DescribeDirectoryDataAccessOutputBuilder { + pub(crate) data_access_status: ::std::option::Option, + _request_id: Option, +} +impl DescribeDirectoryDataAccessOutputBuilder { + ///

    The current status of data access through the Directory Service Data API.

    + pub fn data_access_status(mut self, input: crate::types::DataAccessStatus) -> Self { + self.data_access_status = ::std::option::Option::Some(input); + self + } + ///

    The current status of data access through the Directory Service Data API.

    + pub fn set_data_access_status(mut self, input: ::std::option::Option) -> Self { + self.data_access_status = input; + self + } + ///

    The current status of data access through the Directory Service Data API.

    + pub fn get_data_access_status(&self) -> &::std::option::Option { + &self.data_access_status + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`DescribeDirectoryDataAccessOutput`](crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessOutput). + pub fn build(self) -> crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessOutput { + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessOutput { + data_access_status: self.data_access_status, + _request_id: self._request_id, + } + } +} diff --git a/sdk/directory/src/operation/describe_directory_data_access/builders.rs b/sdk/directory/src/operation/describe_directory_data_access/builders.rs new file mode 100644 index 000000000000..b1b15dd4ee5b --- /dev/null +++ b/sdk/directory/src/operation/describe_directory_data_access/builders.rs @@ -0,0 +1,125 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::describe_directory_data_access::_describe_directory_data_access_output::DescribeDirectoryDataAccessOutputBuilder; + +pub use crate::operation::describe_directory_data_access::_describe_directory_data_access_input::DescribeDirectoryDataAccessInputBuilder; + +impl crate::operation::describe_directory_data_access::builders::DescribeDirectoryDataAccessInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.describe_directory_data_access(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `DescribeDirectoryDataAccess`. +/// +///

    Obtains status of directory data access enablement through the Directory Service Data API for the specified directory.

    +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct DescribeDirectoryDataAccessFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::describe_directory_data_access::builders::DescribeDirectoryDataAccessInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessOutput, + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError, + > for DescribeDirectoryDataAccessFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessOutput, + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl DescribeDirectoryDataAccessFluentBuilder { + /// Creates a new `DescribeDirectoryDataAccessFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the DescribeDirectoryDataAccess as a reference. + pub fn as_input(&self) -> &crate::operation::describe_directory_data_access::builders::DescribeDirectoryDataAccessInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::describe_directory_data_access::DescribeDirectoryDataAccess::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccess::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessOutput, + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

    The directory identifier.

    + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.directory_id(input.into()); + self + } + ///

    The directory identifier.

    + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_directory_id(input); + self + } + ///

    The directory identifier.

    + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_directory_id() + } +} diff --git a/sdk/directory/src/operation/describe_regions.rs b/sdk/directory/src/operation/describe_regions.rs index 1f65c9536190..ded7b3d16dfe 100644 --- a/sdk/directory/src/operation/describe_regions.rs +++ b/sdk/directory/src/operation/describe_regions.rs @@ -248,7 +248,7 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DescribeRegio #[non_exhaustive] #[derive(::std::fmt::Debug)] pub enum DescribeRegionsError { - ///

    Client authentication is not available in this region at this time.

    + ///

    You do not have sufficient access to perform this action.

    AccessDeniedException(crate::types::error::AccessDeniedException), ///

    A client exception has occurred.

    ClientException(crate::types::error::ClientException), diff --git a/sdk/directory/src/operation/describe_update_directory.rs b/sdk/directory/src/operation/describe_update_directory.rs index 20465459840e..a757e3182347 100644 --- a/sdk/directory/src/operation/describe_update_directory.rs +++ b/sdk/directory/src/operation/describe_update_directory.rs @@ -256,7 +256,7 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DescribeUpdat #[non_exhaustive] #[derive(::std::fmt::Debug)] pub enum DescribeUpdateDirectoryError { - ///

    Client authentication is not available in this region at this time.

    + ///

    You do not have sufficient access to perform this action.

    AccessDeniedException(crate::types::error::AccessDeniedException), ///

    A client exception has occurred.

    ClientException(crate::types::error::ClientException), diff --git a/sdk/directory/src/operation/disable_client_authentication.rs b/sdk/directory/src/operation/disable_client_authentication.rs index d6531f190218..542da0eb4581 100644 --- a/sdk/directory/src/operation/disable_client_authentication.rs +++ b/sdk/directory/src/operation/disable_client_authentication.rs @@ -256,7 +256,7 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DisableClient #[non_exhaustive] #[derive(::std::fmt::Debug)] pub enum DisableClientAuthenticationError { - ///

    Client authentication is not available in this region at this time.

    + ///

    You do not have sufficient access to perform this action.

    AccessDeniedException(crate::types::error::AccessDeniedException), ///

    A client exception has occurred.

    ClientException(crate::types::error::ClientException), diff --git a/sdk/directory/src/operation/disable_client_authentication/_disable_client_authentication_input.rs b/sdk/directory/src/operation/disable_client_authentication/_disable_client_authentication_input.rs index d9c404e92a8b..976330f3bf6a 100644 --- a/sdk/directory/src/operation/disable_client_authentication/_disable_client_authentication_input.rs +++ b/sdk/directory/src/operation/disable_client_authentication/_disable_client_authentication_input.rs @@ -5,7 +5,7 @@ pub struct DisableClientAuthenticationInput { ///

    The identifier of the directory

    pub directory_id: ::std::option::Option<::std::string::String>, - ///

    The type of client authentication to disable. Currently, only the parameter, SmartCard is supported.

    + ///

    The type of client authentication to disable. Currently the only parameter "SmartCard" is supported.

    pub r#type: ::std::option::Option, } impl DisableClientAuthenticationInput { @@ -13,7 +13,7 @@ impl DisableClientAuthenticationInput { pub fn directory_id(&self) -> ::std::option::Option<&str> { self.directory_id.as_deref() } - ///

    The type of client authentication to disable. Currently, only the parameter, SmartCard is supported.

    + ///

    The type of client authentication to disable. Currently the only parameter "SmartCard" is supported.

    pub fn r#type(&self) -> ::std::option::Option<&crate::types::ClientAuthenticationType> { self.r#type.as_ref() } @@ -48,18 +48,18 @@ impl DisableClientAuthenticationInputBuilder { pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { &self.directory_id } - ///

    The type of client authentication to disable. Currently, only the parameter, SmartCard is supported.

    + ///

    The type of client authentication to disable. Currently the only parameter "SmartCard" is supported.

    /// This field is required. pub fn r#type(mut self, input: crate::types::ClientAuthenticationType) -> Self { self.r#type = ::std::option::Option::Some(input); self } - ///

    The type of client authentication to disable. Currently, only the parameter, SmartCard is supported.

    + ///

    The type of client authentication to disable. Currently the only parameter "SmartCard" is supported.

    pub fn set_type(mut self, input: ::std::option::Option) -> Self { self.r#type = input; self } - ///

    The type of client authentication to disable. Currently, only the parameter, SmartCard is supported.

    + ///

    The type of client authentication to disable. Currently the only parameter "SmartCard" is supported.

    pub fn get_type(&self) -> &::std::option::Option { &self.r#type } diff --git a/sdk/directory/src/operation/disable_client_authentication/builders.rs b/sdk/directory/src/operation/disable_client_authentication/builders.rs index 30e20e395242..4fb75aa14933 100644 --- a/sdk/directory/src/operation/disable_client_authentication/builders.rs +++ b/sdk/directory/src/operation/disable_client_authentication/builders.rs @@ -122,17 +122,17 @@ impl DisableClientAuthenticationFluentBuilder { pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_directory_id() } - ///

    The type of client authentication to disable. Currently, only the parameter, SmartCard is supported.

    + ///

    The type of client authentication to disable. Currently the only parameter "SmartCard" is supported.

    pub fn r#type(mut self, input: crate::types::ClientAuthenticationType) -> Self { self.inner = self.inner.r#type(input); self } - ///

    The type of client authentication to disable. Currently, only the parameter, SmartCard is supported.

    + ///

    The type of client authentication to disable. Currently the only parameter "SmartCard" is supported.

    pub fn set_type(mut self, input: ::std::option::Option) -> Self { self.inner = self.inner.set_type(input); self } - ///

    The type of client authentication to disable. Currently, only the parameter, SmartCard is supported.

    + ///

    The type of client authentication to disable. Currently the only parameter "SmartCard" is supported.

    pub fn get_type(&self) -> &::std::option::Option { self.inner.get_type() } diff --git a/sdk/directory/src/operation/disable_directory_data_access.rs b/sdk/directory/src/operation/disable_directory_data_access.rs new file mode 100644 index 000000000000..d647536ad2d3 --- /dev/null +++ b/sdk/directory/src/operation/disable_directory_data_access.rs @@ -0,0 +1,427 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `DisableDirectoryDataAccess`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct DisableDirectoryDataAccess; +impl DisableDirectoryDataAccess { + /// Creates a new `DisableDirectoryDataAccess` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::disable_directory_data_access::DisableDirectoryDataAccessInput, + ) -> ::std::result::Result< + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::disable_directory_data_access::DisableDirectoryDataAccessInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point( + "directoryservice", + "DisableDirectoryDataAccess", + input, + runtime_plugins, + stop_point, + ) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DisableDirectoryDataAccess { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("DisableDirectoryDataAccess"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + DisableDirectoryDataAccessRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + DisableDirectoryDataAccessResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "DisableDirectoryDataAccess", + "directoryservice", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DisableDirectoryDataAccess") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(DisableDirectoryDataAccessEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct DisableDirectoryDataAccessResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DisableDirectoryDataAccessResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_disable_directory_data_access::de_disable_directory_data_access_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_disable_directory_data_access::de_disable_directory_data_access_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct DisableDirectoryDataAccessRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DisableDirectoryDataAccessRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::disable_directory_data_access::DisableDirectoryDataAccessInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::disable_directory_data_access::DisableDirectoryDataAccessInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-amz-json-1.1"); + builder = _header_serialization_settings.set_default_header( + builder, + ::http::header::HeaderName::from_static("x-amz-target"), + "DirectoryService_20150416.DisableDirectoryDataAccess", + ); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from( + crate::protocol_serde::shape_disable_directory_data_access::ser_disable_directory_data_access_input(&input)?, + ); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct DisableDirectoryDataAccessEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DisableDirectoryDataAccessEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "DisableDirectoryDataAccessEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to DisableDirectoryDataAccessInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `DisableDirectoryDataAccessError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum DisableDirectoryDataAccessError { + ///

    You do not have sufficient access to perform this action.

    + AccessDeniedException(crate::types::error::AccessDeniedException), + ///

    A client exception has occurred.

    + ClientException(crate::types::error::ClientException), + ///

    The specified directory does not exist in the system.

    + DirectoryDoesNotExistException(crate::types::error::DirectoryDoesNotExistException), + ///

    The directory is already updated to desired update type settings.

    + DirectoryInDesiredStateException(crate::types::error::DirectoryInDesiredStateException), + ///

    The specified directory is unavailable.

    + DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), + ///

    An exception has occurred in Directory Service.

    + ServiceException(crate::types::error::ServiceException), + ///

    The operation is not supported.

    + UnsupportedOperationException(crate::types::error::UnsupportedOperationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-DisableDirectoryDataAccessError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl DisableDirectoryDataAccessError { + /// Creates the `DisableDirectoryDataAccessError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `DisableDirectoryDataAccessError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ClientException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::DirectoryDoesNotExistException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::DirectoryInDesiredStateException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::DirectoryUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ServiceException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::UnsupportedOperationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `DisableDirectoryDataAccessError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `DisableDirectoryDataAccessError::ClientException`. + pub fn is_client_exception(&self) -> bool { + matches!(self, Self::ClientException(_)) + } + /// Returns `true` if the error kind is `DisableDirectoryDataAccessError::DirectoryDoesNotExistException`. + pub fn is_directory_does_not_exist_exception(&self) -> bool { + matches!(self, Self::DirectoryDoesNotExistException(_)) + } + /// Returns `true` if the error kind is `DisableDirectoryDataAccessError::DirectoryInDesiredStateException`. + pub fn is_directory_in_desired_state_exception(&self) -> bool { + matches!(self, Self::DirectoryInDesiredStateException(_)) + } + /// Returns `true` if the error kind is `DisableDirectoryDataAccessError::DirectoryUnavailableException`. + pub fn is_directory_unavailable_exception(&self) -> bool { + matches!(self, Self::DirectoryUnavailableException(_)) + } + /// Returns `true` if the error kind is `DisableDirectoryDataAccessError::ServiceException`. + pub fn is_service_exception(&self) -> bool { + matches!(self, Self::ServiceException(_)) + } + /// Returns `true` if the error kind is `DisableDirectoryDataAccessError::UnsupportedOperationException`. + pub fn is_unsupported_operation_exception(&self) -> bool { + matches!(self, Self::UnsupportedOperationException(_)) + } +} +impl ::std::error::Error for DisableDirectoryDataAccessError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::ClientException(_inner) => ::std::option::Option::Some(_inner), + Self::DirectoryDoesNotExistException(_inner) => ::std::option::Option::Some(_inner), + Self::DirectoryInDesiredStateException(_inner) => ::std::option::Option::Some(_inner), + Self::DirectoryUnavailableException(_inner) => ::std::option::Option::Some(_inner), + Self::ServiceException(_inner) => ::std::option::Option::Some(_inner), + Self::UnsupportedOperationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for DisableDirectoryDataAccessError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::ClientException(_inner) => _inner.fmt(f), + Self::DirectoryDoesNotExistException(_inner) => _inner.fmt(f), + Self::DirectoryInDesiredStateException(_inner) => _inner.fmt(f), + Self::DirectoryUnavailableException(_inner) => _inner.fmt(f), + Self::ServiceException(_inner) => _inner.fmt(f), + Self::UnsupportedOperationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for DisableDirectoryDataAccessError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + ::std::option::Option::None + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for DisableDirectoryDataAccessError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ClientException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::DirectoryDoesNotExistException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::DirectoryInDesiredStateException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::DirectoryUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ServiceException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::UnsupportedOperationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DisableDirectoryDataAccessError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::disable_directory_data_access::_disable_directory_data_access_output::DisableDirectoryDataAccessOutput; + +pub use crate::operation::disable_directory_data_access::_disable_directory_data_access_input::DisableDirectoryDataAccessInput; + +mod _disable_directory_data_access_input; + +mod _disable_directory_data_access_output; + +/// Builders +pub mod builders; diff --git a/sdk/directory/src/operation/disable_directory_data_access/_disable_directory_data_access_input.rs b/sdk/directory/src/operation/disable_directory_data_access/_disable_directory_data_access_input.rs new file mode 100644 index 000000000000..9ff4c00fa012 --- /dev/null +++ b/sdk/directory/src/operation/disable_directory_data_access/_disable_directory_data_access_input.rs @@ -0,0 +1,55 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct DisableDirectoryDataAccessInput { + ///

    The directory identifier.

    + pub directory_id: ::std::option::Option<::std::string::String>, +} +impl DisableDirectoryDataAccessInput { + ///

    The directory identifier.

    + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } +} +impl DisableDirectoryDataAccessInput { + /// Creates a new builder-style object to manufacture [`DisableDirectoryDataAccessInput`](crate::operation::disable_directory_data_access::DisableDirectoryDataAccessInput). + pub fn builder() -> crate::operation::disable_directory_data_access::builders::DisableDirectoryDataAccessInputBuilder { + crate::operation::disable_directory_data_access::builders::DisableDirectoryDataAccessInputBuilder::default() + } +} + +/// A builder for [`DisableDirectoryDataAccessInput`](crate::operation::disable_directory_data_access::DisableDirectoryDataAccessInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct DisableDirectoryDataAccessInputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, +} +impl DisableDirectoryDataAccessInputBuilder { + ///

    The directory identifier.

    + /// This field is required. + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

    The directory identifier.

    + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

    The directory identifier.

    + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + /// Consumes the builder and constructs a [`DisableDirectoryDataAccessInput`](crate::operation::disable_directory_data_access::DisableDirectoryDataAccessInput). + pub fn build( + self, + ) -> ::std::result::Result< + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessInput, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok(crate::operation::disable_directory_data_access::DisableDirectoryDataAccessInput { + directory_id: self.directory_id, + }) + } +} diff --git a/sdk/directory/src/operation/disable_directory_data_access/_disable_directory_data_access_output.rs b/sdk/directory/src/operation/disable_directory_data_access/_disable_directory_data_access_output.rs new file mode 100644 index 000000000000..af96367c163e --- /dev/null +++ b/sdk/directory/src/operation/disable_directory_data_access/_disable_directory_data_access_output.rs @@ -0,0 +1,42 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct DisableDirectoryDataAccessOutput { + _request_id: Option, +} +impl ::aws_types::request_id::RequestId for DisableDirectoryDataAccessOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl DisableDirectoryDataAccessOutput { + /// Creates a new builder-style object to manufacture [`DisableDirectoryDataAccessOutput`](crate::operation::disable_directory_data_access::DisableDirectoryDataAccessOutput). + pub fn builder() -> crate::operation::disable_directory_data_access::builders::DisableDirectoryDataAccessOutputBuilder { + crate::operation::disable_directory_data_access::builders::DisableDirectoryDataAccessOutputBuilder::default() + } +} + +/// A builder for [`DisableDirectoryDataAccessOutput`](crate::operation::disable_directory_data_access::DisableDirectoryDataAccessOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct DisableDirectoryDataAccessOutputBuilder { + _request_id: Option, +} +impl DisableDirectoryDataAccessOutputBuilder { + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`DisableDirectoryDataAccessOutput`](crate::operation::disable_directory_data_access::DisableDirectoryDataAccessOutput). + pub fn build(self) -> crate::operation::disable_directory_data_access::DisableDirectoryDataAccessOutput { + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessOutput { + _request_id: self._request_id, + } + } +} diff --git a/sdk/directory/src/operation/disable_directory_data_access/builders.rs b/sdk/directory/src/operation/disable_directory_data_access/builders.rs new file mode 100644 index 000000000000..254285452b15 --- /dev/null +++ b/sdk/directory/src/operation/disable_directory_data_access/builders.rs @@ -0,0 +1,125 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::disable_directory_data_access::_disable_directory_data_access_output::DisableDirectoryDataAccessOutputBuilder; + +pub use crate::operation::disable_directory_data_access::_disable_directory_data_access_input::DisableDirectoryDataAccessInputBuilder; + +impl crate::operation::disable_directory_data_access::builders::DisableDirectoryDataAccessInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.disable_directory_data_access(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `DisableDirectoryDataAccess`. +/// +///

    Deactivates access to directory data via the Directory Service Data API for the specified directory.

    +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct DisableDirectoryDataAccessFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::disable_directory_data_access::builders::DisableDirectoryDataAccessInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessOutput, + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError, + > for DisableDirectoryDataAccessFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessOutput, + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl DisableDirectoryDataAccessFluentBuilder { + /// Creates a new `DisableDirectoryDataAccessFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the DisableDirectoryDataAccess as a reference. + pub fn as_input(&self) -> &crate::operation::disable_directory_data_access::builders::DisableDirectoryDataAccessInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::disable_directory_data_access::DisableDirectoryDataAccess::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::disable_directory_data_access::DisableDirectoryDataAccess::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessOutput, + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

    The directory identifier.

    + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.directory_id(input.into()); + self + } + ///

    The directory identifier.

    + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_directory_id(input); + self + } + ///

    The directory identifier.

    + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_directory_id() + } +} diff --git a/sdk/directory/src/operation/disable_ldaps.rs b/sdk/directory/src/operation/disable_ldaps.rs index f9c6ac550d73..e09150176d8e 100644 --- a/sdk/directory/src/operation/disable_ldaps.rs +++ b/sdk/directory/src/operation/disable_ldaps.rs @@ -252,7 +252,7 @@ pub enum DisableLDAPSError { ClientException(crate::types::error::ClientException), ///

    The specified directory does not exist in the system.

    DirectoryDoesNotExistException(crate::types::error::DirectoryDoesNotExistException), - ///

    The specified directory is unavailable or could not be found.

    + ///

    The specified directory is unavailable.

    DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), ///

    The LDAP activities could not be performed because they are limited by the LDAPS status.

    InvalidLdapsStatusException(crate::types::error::InvalidLdapsStatusException), diff --git a/sdk/directory/src/operation/enable_client_authentication.rs b/sdk/directory/src/operation/enable_client_authentication.rs index ab4de574d0fe..a0b7f3b9bce4 100644 --- a/sdk/directory/src/operation/enable_client_authentication.rs +++ b/sdk/directory/src/operation/enable_client_authentication.rs @@ -256,7 +256,7 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for EnableClientA #[non_exhaustive] #[derive(::std::fmt::Debug)] pub enum EnableClientAuthenticationError { - ///

    Client authentication is not available in this region at this time.

    + ///

    You do not have sufficient access to perform this action.

    AccessDeniedException(crate::types::error::AccessDeniedException), ///

    A client exception has occurred.

    ClientException(crate::types::error::ClientException), diff --git a/sdk/directory/src/operation/enable_directory_data_access.rs b/sdk/directory/src/operation/enable_directory_data_access.rs new file mode 100644 index 000000000000..5c25ad38830c --- /dev/null +++ b/sdk/directory/src/operation/enable_directory_data_access.rs @@ -0,0 +1,427 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `EnableDirectoryDataAccess`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct EnableDirectoryDataAccess; +impl EnableDirectoryDataAccess { + /// Creates a new `EnableDirectoryDataAccess` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::enable_directory_data_access::EnableDirectoryDataAccessInput, + ) -> ::std::result::Result< + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::enable_directory_data_access::EnableDirectoryDataAccessInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point( + "directoryservice", + "EnableDirectoryDataAccess", + input, + runtime_plugins, + stop_point, + ) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for EnableDirectoryDataAccess { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("EnableDirectoryDataAccess"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + EnableDirectoryDataAccessRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + EnableDirectoryDataAccessResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "EnableDirectoryDataAccess", + "directoryservice", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("EnableDirectoryDataAccess") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(EnableDirectoryDataAccessEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct EnableDirectoryDataAccessResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for EnableDirectoryDataAccessResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_enable_directory_data_access::de_enable_directory_data_access_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_enable_directory_data_access::de_enable_directory_data_access_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct EnableDirectoryDataAccessRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for EnableDirectoryDataAccessRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::enable_directory_data_access::EnableDirectoryDataAccessInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::enable_directory_data_access::EnableDirectoryDataAccessInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-amz-json-1.1"); + builder = _header_serialization_settings.set_default_header( + builder, + ::http::header::HeaderName::from_static("x-amz-target"), + "DirectoryService_20150416.EnableDirectoryDataAccess", + ); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from( + crate::protocol_serde::shape_enable_directory_data_access::ser_enable_directory_data_access_input(&input)?, + ); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct EnableDirectoryDataAccessEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for EnableDirectoryDataAccessEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "EnableDirectoryDataAccessEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to EnableDirectoryDataAccessInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `EnableDirectoryDataAccessError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum EnableDirectoryDataAccessError { + ///

    You do not have sufficient access to perform this action.

    + AccessDeniedException(crate::types::error::AccessDeniedException), + ///

    A client exception has occurred.

    + ClientException(crate::types::error::ClientException), + ///

    The specified directory does not exist in the system.

    + DirectoryDoesNotExistException(crate::types::error::DirectoryDoesNotExistException), + ///

    The directory is already updated to desired update type settings.

    + DirectoryInDesiredStateException(crate::types::error::DirectoryInDesiredStateException), + ///

    The specified directory is unavailable.

    + DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), + ///

    An exception has occurred in Directory Service.

    + ServiceException(crate::types::error::ServiceException), + ///

    The operation is not supported.

    + UnsupportedOperationException(crate::types::error::UnsupportedOperationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-EnableDirectoryDataAccessError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl EnableDirectoryDataAccessError { + /// Creates the `EnableDirectoryDataAccessError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `EnableDirectoryDataAccessError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ClientException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::DirectoryDoesNotExistException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::DirectoryInDesiredStateException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::DirectoryUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ServiceException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::UnsupportedOperationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `EnableDirectoryDataAccessError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `EnableDirectoryDataAccessError::ClientException`. + pub fn is_client_exception(&self) -> bool { + matches!(self, Self::ClientException(_)) + } + /// Returns `true` if the error kind is `EnableDirectoryDataAccessError::DirectoryDoesNotExistException`. + pub fn is_directory_does_not_exist_exception(&self) -> bool { + matches!(self, Self::DirectoryDoesNotExistException(_)) + } + /// Returns `true` if the error kind is `EnableDirectoryDataAccessError::DirectoryInDesiredStateException`. + pub fn is_directory_in_desired_state_exception(&self) -> bool { + matches!(self, Self::DirectoryInDesiredStateException(_)) + } + /// Returns `true` if the error kind is `EnableDirectoryDataAccessError::DirectoryUnavailableException`. + pub fn is_directory_unavailable_exception(&self) -> bool { + matches!(self, Self::DirectoryUnavailableException(_)) + } + /// Returns `true` if the error kind is `EnableDirectoryDataAccessError::ServiceException`. + pub fn is_service_exception(&self) -> bool { + matches!(self, Self::ServiceException(_)) + } + /// Returns `true` if the error kind is `EnableDirectoryDataAccessError::UnsupportedOperationException`. + pub fn is_unsupported_operation_exception(&self) -> bool { + matches!(self, Self::UnsupportedOperationException(_)) + } +} +impl ::std::error::Error for EnableDirectoryDataAccessError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::ClientException(_inner) => ::std::option::Option::Some(_inner), + Self::DirectoryDoesNotExistException(_inner) => ::std::option::Option::Some(_inner), + Self::DirectoryInDesiredStateException(_inner) => ::std::option::Option::Some(_inner), + Self::DirectoryUnavailableException(_inner) => ::std::option::Option::Some(_inner), + Self::ServiceException(_inner) => ::std::option::Option::Some(_inner), + Self::UnsupportedOperationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for EnableDirectoryDataAccessError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::ClientException(_inner) => _inner.fmt(f), + Self::DirectoryDoesNotExistException(_inner) => _inner.fmt(f), + Self::DirectoryInDesiredStateException(_inner) => _inner.fmt(f), + Self::DirectoryUnavailableException(_inner) => _inner.fmt(f), + Self::ServiceException(_inner) => _inner.fmt(f), + Self::UnsupportedOperationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for EnableDirectoryDataAccessError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + ::std::option::Option::None + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for EnableDirectoryDataAccessError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ClientException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::DirectoryDoesNotExistException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::DirectoryInDesiredStateException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::DirectoryUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ServiceException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::UnsupportedOperationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for EnableDirectoryDataAccessError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::enable_directory_data_access::_enable_directory_data_access_output::EnableDirectoryDataAccessOutput; + +pub use crate::operation::enable_directory_data_access::_enable_directory_data_access_input::EnableDirectoryDataAccessInput; + +mod _enable_directory_data_access_input; + +mod _enable_directory_data_access_output; + +/// Builders +pub mod builders; diff --git a/sdk/directory/src/operation/enable_directory_data_access/_enable_directory_data_access_input.rs b/sdk/directory/src/operation/enable_directory_data_access/_enable_directory_data_access_input.rs new file mode 100644 index 000000000000..84e8d9f03d87 --- /dev/null +++ b/sdk/directory/src/operation/enable_directory_data_access/_enable_directory_data_access_input.rs @@ -0,0 +1,55 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct EnableDirectoryDataAccessInput { + ///

    The directory identifier.

    + pub directory_id: ::std::option::Option<::std::string::String>, +} +impl EnableDirectoryDataAccessInput { + ///

    The directory identifier.

    + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } +} +impl EnableDirectoryDataAccessInput { + /// Creates a new builder-style object to manufacture [`EnableDirectoryDataAccessInput`](crate::operation::enable_directory_data_access::EnableDirectoryDataAccessInput). + pub fn builder() -> crate::operation::enable_directory_data_access::builders::EnableDirectoryDataAccessInputBuilder { + crate::operation::enable_directory_data_access::builders::EnableDirectoryDataAccessInputBuilder::default() + } +} + +/// A builder for [`EnableDirectoryDataAccessInput`](crate::operation::enable_directory_data_access::EnableDirectoryDataAccessInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct EnableDirectoryDataAccessInputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, +} +impl EnableDirectoryDataAccessInputBuilder { + ///

    The directory identifier.

    + /// This field is required. + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

    The directory identifier.

    + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

    The directory identifier.

    + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + /// Consumes the builder and constructs a [`EnableDirectoryDataAccessInput`](crate::operation::enable_directory_data_access::EnableDirectoryDataAccessInput). + pub fn build( + self, + ) -> ::std::result::Result< + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessInput, + ::aws_smithy_types::error::operation::BuildError, + > { + ::std::result::Result::Ok(crate::operation::enable_directory_data_access::EnableDirectoryDataAccessInput { + directory_id: self.directory_id, + }) + } +} diff --git a/sdk/directory/src/operation/enable_directory_data_access/_enable_directory_data_access_output.rs b/sdk/directory/src/operation/enable_directory_data_access/_enable_directory_data_access_output.rs new file mode 100644 index 000000000000..f5071f1ea1e1 --- /dev/null +++ b/sdk/directory/src/operation/enable_directory_data_access/_enable_directory_data_access_output.rs @@ -0,0 +1,42 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct EnableDirectoryDataAccessOutput { + _request_id: Option, +} +impl ::aws_types::request_id::RequestId for EnableDirectoryDataAccessOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl EnableDirectoryDataAccessOutput { + /// Creates a new builder-style object to manufacture [`EnableDirectoryDataAccessOutput`](crate::operation::enable_directory_data_access::EnableDirectoryDataAccessOutput). + pub fn builder() -> crate::operation::enable_directory_data_access::builders::EnableDirectoryDataAccessOutputBuilder { + crate::operation::enable_directory_data_access::builders::EnableDirectoryDataAccessOutputBuilder::default() + } +} + +/// A builder for [`EnableDirectoryDataAccessOutput`](crate::operation::enable_directory_data_access::EnableDirectoryDataAccessOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct EnableDirectoryDataAccessOutputBuilder { + _request_id: Option, +} +impl EnableDirectoryDataAccessOutputBuilder { + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`EnableDirectoryDataAccessOutput`](crate::operation::enable_directory_data_access::EnableDirectoryDataAccessOutput). + pub fn build(self) -> crate::operation::enable_directory_data_access::EnableDirectoryDataAccessOutput { + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessOutput { + _request_id: self._request_id, + } + } +} diff --git a/sdk/directory/src/operation/enable_directory_data_access/builders.rs b/sdk/directory/src/operation/enable_directory_data_access/builders.rs new file mode 100644 index 000000000000..94ec87d4286a --- /dev/null +++ b/sdk/directory/src/operation/enable_directory_data_access/builders.rs @@ -0,0 +1,125 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::enable_directory_data_access::_enable_directory_data_access_output::EnableDirectoryDataAccessOutputBuilder; + +pub use crate::operation::enable_directory_data_access::_enable_directory_data_access_input::EnableDirectoryDataAccessInputBuilder; + +impl crate::operation::enable_directory_data_access::builders::EnableDirectoryDataAccessInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.enable_directory_data_access(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `EnableDirectoryDataAccess`. +/// +///

    Enables access to directory data via the Directory Service Data API for the specified directory.

    +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct EnableDirectoryDataAccessFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::enable_directory_data_access::builders::EnableDirectoryDataAccessInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessOutput, + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError, + > for EnableDirectoryDataAccessFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessOutput, + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl EnableDirectoryDataAccessFluentBuilder { + /// Creates a new `EnableDirectoryDataAccessFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the EnableDirectoryDataAccess as a reference. + pub fn as_input(&self) -> &crate::operation::enable_directory_data_access::builders::EnableDirectoryDataAccessInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::enable_directory_data_access::EnableDirectoryDataAccess::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::enable_directory_data_access::EnableDirectoryDataAccess::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessOutput, + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

    The directory identifier.

    + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.directory_id(input.into()); + self + } + ///

    The directory identifier.

    + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_directory_id(input); + self + } + ///

    The directory identifier.

    + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_directory_id() + } +} diff --git a/sdk/directory/src/operation/enable_ldaps.rs b/sdk/directory/src/operation/enable_ldaps.rs index 31bc4e50f198..15c08ab534e8 100644 --- a/sdk/directory/src/operation/enable_ldaps.rs +++ b/sdk/directory/src/operation/enable_ldaps.rs @@ -252,7 +252,7 @@ pub enum EnableLDAPSError { ClientException(crate::types::error::ClientException), ///

    The specified directory does not exist in the system.

    DirectoryDoesNotExistException(crate::types::error::DirectoryDoesNotExistException), - ///

    The specified directory is unavailable or could not be found.

    + ///

    The specified directory is unavailable.

    DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), ///

    The LDAP activities could not be performed because they are limited by the LDAPS status.

    InvalidLdapsStatusException(crate::types::error::InvalidLdapsStatusException), diff --git a/sdk/directory/src/operation/register_certificate.rs b/sdk/directory/src/operation/register_certificate.rs index 0ed0fb4f6248..bb99b2f253d7 100644 --- a/sdk/directory/src/operation/register_certificate.rs +++ b/sdk/directory/src/operation/register_certificate.rs @@ -263,7 +263,7 @@ pub enum RegisterCertificateError { ClientException(crate::types::error::ClientException), ///

    The specified directory does not exist in the system.

    DirectoryDoesNotExistException(crate::types::error::DirectoryDoesNotExistException), - ///

    The specified directory is unavailable or could not be found.

    + ///

    The specified directory is unavailable.

    DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), ///

    The certificate PEM that was provided has incorrect encoding.

    InvalidCertificateException(crate::types::error::InvalidCertificateException), diff --git a/sdk/directory/src/operation/remove_ip_routes.rs b/sdk/directory/src/operation/remove_ip_routes.rs index d6493bf488cc..a0a5d9642ff7 100644 --- a/sdk/directory/src/operation/remove_ip_routes.rs +++ b/sdk/directory/src/operation/remove_ip_routes.rs @@ -250,7 +250,7 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for RemoveIpRoute pub enum RemoveIpRoutesError { ///

    A client exception has occurred.

    ClientException(crate::types::error::ClientException), - ///

    The specified directory is unavailable or could not be found.

    + ///

    The specified directory is unavailable.

    DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), ///

    The specified entity could not be found.

    EntityDoesNotExistException(crate::types::error::EntityDoesNotExistException), diff --git a/sdk/directory/src/operation/remove_region.rs b/sdk/directory/src/operation/remove_region.rs index 0076e96ea962..836c67fa08bf 100644 --- a/sdk/directory/src/operation/remove_region.rs +++ b/sdk/directory/src/operation/remove_region.rs @@ -248,13 +248,13 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for RemoveRegionE #[non_exhaustive] #[derive(::std::fmt::Debug)] pub enum RemoveRegionError { - ///

    Client authentication is not available in this region at this time.

    + ///

    You do not have sufficient access to perform this action.

    AccessDeniedException(crate::types::error::AccessDeniedException), ///

    A client exception has occurred.

    ClientException(crate::types::error::ClientException), ///

    The specified directory does not exist in the system.

    DirectoryDoesNotExistException(crate::types::error::DirectoryDoesNotExistException), - ///

    The specified directory is unavailable or could not be found.

    + ///

    The specified directory is unavailable.

    DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), ///

    An exception has occurred in Directory Service.

    ServiceException(crate::types::error::ServiceException), diff --git a/sdk/directory/src/operation/reset_user_password.rs b/sdk/directory/src/operation/reset_user_password.rs index f51cdfc5e320..0d4b6a0d85ed 100644 --- a/sdk/directory/src/operation/reset_user_password.rs +++ b/sdk/directory/src/operation/reset_user_password.rs @@ -256,7 +256,7 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ResetUserPass pub enum ResetUserPasswordError { ///

    A client exception has occurred.

    ClientException(crate::types::error::ClientException), - ///

    The specified directory is unavailable or could not be found.

    + ///

    The specified directory is unavailable.

    DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), ///

    The specified entity could not be found.

    EntityDoesNotExistException(crate::types::error::EntityDoesNotExistException), diff --git a/sdk/directory/src/operation/reset_user_password/builders.rs b/sdk/directory/src/operation/reset_user_password/builders.rs index 0528544c0d81..10003b971cd5 100644 --- a/sdk/directory/src/operation/reset_user_password/builders.rs +++ b/sdk/directory/src/operation/reset_user_password/builders.rs @@ -22,7 +22,7 @@ impl crate::operation::reset_user_password::builders::ResetUserPasswordInputBuil } /// Fluent builder constructing a request to `ResetUserPassword`. /// -///

    Resets the password for any user in your Managed Microsoft AD or Simple AD directory.

    +///

    Resets the password for any user in your Managed Microsoft AD or Simple AD directory. Disabled users will become enabled and can be authenticated following the API call.

    ///

    You can reset the password for any user in your directory with the following exceptions:

    ///
      ///
    • diff --git a/sdk/directory/src/operation/share_directory.rs b/sdk/directory/src/operation/share_directory.rs index 7796229007dd..93250def5e61 100644 --- a/sdk/directory/src/operation/share_directory.rs +++ b/sdk/directory/src/operation/share_directory.rs @@ -248,7 +248,7 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ShareDirector #[non_exhaustive] #[derive(::std::fmt::Debug)] pub enum ShareDirectoryError { - ///

      Client authentication is not available in this region at this time.

      + ///

      You do not have sufficient access to perform this action.

      AccessDeniedException(crate::types::error::AccessDeniedException), ///

      A client exception has occurred.

      ClientException(crate::types::error::ClientException), diff --git a/sdk/directory/src/operation/start_schema_extension.rs b/sdk/directory/src/operation/start_schema_extension.rs index 8edfb7cf3fbc..2f6e3358b83c 100644 --- a/sdk/directory/src/operation/start_schema_extension.rs +++ b/sdk/directory/src/operation/start_schema_extension.rs @@ -258,7 +258,7 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StartSchemaEx pub enum StartSchemaExtensionError { ///

      A client exception has occurred.

      ClientException(crate::types::error::ClientException), - ///

      The specified directory is unavailable or could not be found.

      + ///

      The specified directory is unavailable.

      DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), ///

      The specified entity could not be found.

      EntityDoesNotExistException(crate::types::error::EntityDoesNotExistException), diff --git a/sdk/directory/src/operation/update_conditional_forwarder.rs b/sdk/directory/src/operation/update_conditional_forwarder.rs index 71b3af54c974..7e3c9f35d4c6 100644 --- a/sdk/directory/src/operation/update_conditional_forwarder.rs +++ b/sdk/directory/src/operation/update_conditional_forwarder.rs @@ -258,7 +258,7 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateConditi pub enum UpdateConditionalForwarderError { ///

      A client exception has occurred.

      ClientException(crate::types::error::ClientException), - ///

      The specified directory is unavailable or could not be found.

      + ///

      The specified directory is unavailable.

      DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), ///

      The specified entity could not be found.

      EntityDoesNotExistException(crate::types::error::EntityDoesNotExistException), diff --git a/sdk/directory/src/operation/update_directory_setup.rs b/sdk/directory/src/operation/update_directory_setup.rs index de36de70009f..908d345a8dea 100644 --- a/sdk/directory/src/operation/update_directory_setup.rs +++ b/sdk/directory/src/operation/update_directory_setup.rs @@ -256,7 +256,7 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateDirecto #[non_exhaustive] #[derive(::std::fmt::Debug)] pub enum UpdateDirectorySetupError { - ///

      Client authentication is not available in this region at this time.

      + ///

      You do not have sufficient access to perform this action.

      AccessDeniedException(crate::types::error::AccessDeniedException), ///

      A client exception has occurred.

      ClientException(crate::types::error::ClientException), @@ -264,7 +264,7 @@ pub enum UpdateDirectorySetupError { DirectoryDoesNotExistException(crate::types::error::DirectoryDoesNotExistException), ///

      The directory is already updated to desired update type settings.

      DirectoryInDesiredStateException(crate::types::error::DirectoryInDesiredStateException), - ///

      The specified directory is unavailable or could not be found.

      + ///

      The specified directory is unavailable.

      DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), ///

      One or more parameters are not valid.

      InvalidParameterException(crate::types::error::InvalidParameterException), diff --git a/sdk/directory/src/operation/update_number_of_domain_controllers.rs b/sdk/directory/src/operation/update_number_of_domain_controllers.rs index c8429ed79946..2486d5a88582 100644 --- a/sdk/directory/src/operation/update_number_of_domain_controllers.rs +++ b/sdk/directory/src/operation/update_number_of_domain_controllers.rs @@ -260,7 +260,7 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateNumberO pub enum UpdateNumberOfDomainControllersError { ///

      A client exception has occurred.

      ClientException(crate::types::error::ClientException), - ///

      The specified directory is unavailable or could not be found.

      + ///

      The specified directory is unavailable.

      DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), ///

      The maximum allowed number of domain controllers per directory was exceeded. The default limit per directory is 20 domain controllers.

      DomainControllerLimitExceededException(crate::types::error::DomainControllerLimitExceededException), diff --git a/sdk/directory/src/operation/update_settings.rs b/sdk/directory/src/operation/update_settings.rs index e9d294774d73..96feeff7676d 100644 --- a/sdk/directory/src/operation/update_settings.rs +++ b/sdk/directory/src/operation/update_settings.rs @@ -252,7 +252,7 @@ pub enum UpdateSettingsError { ClientException(crate::types::error::ClientException), ///

      The specified directory does not exist in the system.

      DirectoryDoesNotExistException(crate::types::error::DirectoryDoesNotExistException), - ///

      The specified directory is unavailable or could not be found.

      + ///

      The specified directory is unavailable.

      DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), ///

      The specified directory setting is not compatible with other settings.

      IncompatibleSettingsException(crate::types::error::IncompatibleSettingsException), diff --git a/sdk/directory/src/protocol_serde.rs b/sdk/directory/src/protocol_serde.rs index 111f82890784..bbc226546354 100644 --- a/sdk/directory/src/protocol_serde.rs +++ b/sdk/directory/src/protocol_serde.rs @@ -73,6 +73,8 @@ pub(crate) mod shape_describe_conditional_forwarders; pub(crate) mod shape_describe_directories; +pub(crate) mod shape_describe_directory_data_access; + pub(crate) mod shape_describe_domain_controllers; pub(crate) mod shape_describe_event_topics; @@ -93,6 +95,8 @@ pub(crate) mod shape_describe_update_directory; pub(crate) mod shape_disable_client_authentication; +pub(crate) mod shape_disable_directory_data_access; + pub(crate) mod shape_disable_ldaps; pub(crate) mod shape_disable_radius; @@ -101,6 +105,8 @@ pub(crate) mod shape_disable_sso; pub(crate) mod shape_enable_client_authentication; +pub(crate) mod shape_enable_directory_data_access; + pub(crate) mod shape_enable_ldaps; pub(crate) mod shape_enable_radius; @@ -229,6 +235,8 @@ pub(crate) mod shape_describe_conditional_forwarders_input; pub(crate) mod shape_describe_directories_input; +pub(crate) mod shape_describe_directory_data_access_input; + pub(crate) mod shape_describe_domain_controllers_input; pub(crate) mod shape_describe_event_topics_input; @@ -263,6 +271,8 @@ pub(crate) mod shape_directory_unavailable_exception; pub(crate) mod shape_disable_client_authentication_input; +pub(crate) mod shape_disable_directory_data_access_input; + pub(crate) mod shape_disable_ldaps_input; pub(crate) mod shape_disable_radius_input; @@ -273,6 +283,8 @@ pub(crate) mod shape_domain_controller_limit_exceeded_exception; pub(crate) mod shape_enable_client_authentication_input; +pub(crate) mod shape_enable_directory_data_access_input; + pub(crate) mod shape_enable_ldaps_input; pub(crate) mod shape_enable_radius_input; diff --git a/sdk/directory/src/protocol_serde/shape_describe_directory_data_access.rs b/sdk/directory/src/protocol_serde/shape_describe_directory_data_access.rs new file mode 100644 index 000000000000..07ab2e0a6e9c --- /dev/null +++ b/sdk/directory/src/protocol_serde/shape_describe_directory_data_access.rs @@ -0,0 +1,178 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_describe_directory_data_access_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessOutput, + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError, +> { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "AccessDeniedException" => crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ClientException" => crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError::ClientException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ClientExceptionBuilder::default(); + output = crate::protocol_serde::shape_client_exception::de_client_exception_json_err(_response_body, output) + .map_err(crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "DirectoryDoesNotExistException" => { + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError::DirectoryDoesNotExistException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::DirectoryDoesNotExistExceptionBuilder::default(); + output = crate::protocol_serde::shape_directory_does_not_exist_exception::de_directory_does_not_exist_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + "ServiceException" => crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError::ServiceException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ServiceExceptionBuilder::default(); + output = crate::protocol_serde::shape_service_exception::de_service_exception_json_err(_response_body, output) + .map_err(crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "UnsupportedOperationException" => { + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError::UnsupportedOperationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::UnsupportedOperationExceptionBuilder::default(); + output = crate::protocol_serde::shape_unsupported_operation_exception::de_unsupported_operation_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + _ => crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_describe_directory_data_access_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessOutput, + crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError, +> { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::describe_directory_data_access::builders::DescribeDirectoryDataAccessOutputBuilder::default(); + output = crate::protocol_serde::shape_describe_directory_data_access::de_describe_directory_data_access(_response_body, output) + .map_err(crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub fn ser_describe_directory_data_access_input( + input: &crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_describe_directory_data_access_input::ser_describe_directory_data_access_input_input(&mut object, input)?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} + +pub(crate) fn de_describe_directory_data_access( + value: &[u8], + mut builder: crate::operation::describe_directory_data_access::builders::DescribeDirectoryDataAccessOutputBuilder, +) -> Result< + crate::operation::describe_directory_data_access::builders::DescribeDirectoryDataAccessOutputBuilder, + ::aws_smithy_json::deserialize::error::DeserializeError, +> { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "DataAccessStatus" => { + builder = builder.set_data_access_status( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::DataAccessStatus::from(u.as_ref()))) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/directory/src/protocol_serde/shape_describe_directory_data_access_input.rs b/sdk/directory/src/protocol_serde/shape_describe_directory_data_access_input.rs new file mode 100644 index 000000000000..66192dfcfec1 --- /dev/null +++ b/sdk/directory/src/protocol_serde/shape_describe_directory_data_access_input.rs @@ -0,0 +1,10 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_describe_directory_data_access_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::describe_directory_data_access::DescribeDirectoryDataAccessInput, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.directory_id { + object.key("DirectoryId").string(var_1.as_str()); + } + Ok(()) +} diff --git a/sdk/directory/src/protocol_serde/shape_disable_directory_data_access.rs b/sdk/directory/src/protocol_serde/shape_disable_directory_data_access.rs new file mode 100644 index 000000000000..7ebfc3c0d2e9 --- /dev/null +++ b/sdk/directory/src/protocol_serde/shape_disable_directory_data_access.rs @@ -0,0 +1,177 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_disable_directory_data_access_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessOutput, + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError, +> { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "AccessDeniedException" => crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ClientException" => crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError::ClientException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ClientExceptionBuilder::default(); + output = crate::protocol_serde::shape_client_exception::de_client_exception_json_err(_response_body, output) + .map_err(crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "DirectoryDoesNotExistException" => { + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError::DirectoryDoesNotExistException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::DirectoryDoesNotExistExceptionBuilder::default(); + output = crate::protocol_serde::shape_directory_does_not_exist_exception::de_directory_does_not_exist_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + "DirectoryInDesiredStateException" => { + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError::DirectoryInDesiredStateException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::DirectoryInDesiredStateExceptionBuilder::default(); + output = crate::protocol_serde::shape_directory_in_desired_state_exception::de_directory_in_desired_state_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + "DirectoryUnavailableException" => { + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError::DirectoryUnavailableException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::DirectoryUnavailableExceptionBuilder::default(); + output = crate::protocol_serde::shape_directory_unavailable_exception::de_directory_unavailable_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + "ServiceException" => crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError::ServiceException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ServiceExceptionBuilder::default(); + output = crate::protocol_serde::shape_service_exception::de_service_exception_json_err(_response_body, output) + .map_err(crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "UnsupportedOperationException" => { + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError::UnsupportedOperationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::UnsupportedOperationExceptionBuilder::default(); + output = crate::protocol_serde::shape_unsupported_operation_exception::de_unsupported_operation_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + _ => crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_disable_directory_data_access_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessOutput, + crate::operation::disable_directory_data_access::DisableDirectoryDataAccessError, +> { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::disable_directory_data_access::builders::DisableDirectoryDataAccessOutputBuilder::default(); + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub fn ser_disable_directory_data_access_input( + input: &crate::operation::disable_directory_data_access::DisableDirectoryDataAccessInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_disable_directory_data_access_input::ser_disable_directory_data_access_input_input(&mut object, input)?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} diff --git a/sdk/directory/src/protocol_serde/shape_disable_directory_data_access_input.rs b/sdk/directory/src/protocol_serde/shape_disable_directory_data_access_input.rs new file mode 100644 index 000000000000..91e0339631c3 --- /dev/null +++ b/sdk/directory/src/protocol_serde/shape_disable_directory_data_access_input.rs @@ -0,0 +1,10 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_disable_directory_data_access_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::disable_directory_data_access::DisableDirectoryDataAccessInput, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.directory_id { + object.key("DirectoryId").string(var_1.as_str()); + } + Ok(()) +} diff --git a/sdk/directory/src/protocol_serde/shape_enable_directory_data_access.rs b/sdk/directory/src/protocol_serde/shape_enable_directory_data_access.rs new file mode 100644 index 000000000000..4da1dc466505 --- /dev/null +++ b/sdk/directory/src/protocol_serde/shape_enable_directory_data_access.rs @@ -0,0 +1,181 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_enable_directory_data_access_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessOutput, + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError, +> { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => { + return Err(crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError::unhandled( + generic, + )) + } + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "AccessDeniedException" => crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ClientException" => crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError::ClientException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ClientExceptionBuilder::default(); + output = crate::protocol_serde::shape_client_exception::de_client_exception_json_err(_response_body, output) + .map_err(crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "DirectoryDoesNotExistException" => { + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError::DirectoryDoesNotExistException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::DirectoryDoesNotExistExceptionBuilder::default(); + output = crate::protocol_serde::shape_directory_does_not_exist_exception::de_directory_does_not_exist_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + "DirectoryInDesiredStateException" => { + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError::DirectoryInDesiredStateException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::DirectoryInDesiredStateExceptionBuilder::default(); + output = crate::protocol_serde::shape_directory_in_desired_state_exception::de_directory_in_desired_state_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + "DirectoryUnavailableException" => { + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError::DirectoryUnavailableException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::DirectoryUnavailableExceptionBuilder::default(); + output = crate::protocol_serde::shape_directory_unavailable_exception::de_directory_unavailable_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + "ServiceException" => crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError::ServiceException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ServiceExceptionBuilder::default(); + output = crate::protocol_serde::shape_service_exception::de_service_exception_json_err(_response_body, output) + .map_err(crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "UnsupportedOperationException" => { + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError::UnsupportedOperationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::UnsupportedOperationExceptionBuilder::default(); + output = crate::protocol_serde::shape_unsupported_operation_exception::de_unsupported_operation_exception_json_err( + _response_body, + output, + ) + .map_err(crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }) + } + _ => crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_enable_directory_data_access_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessOutput, + crate::operation::enable_directory_data_access::EnableDirectoryDataAccessError, +> { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::enable_directory_data_access::builders::EnableDirectoryDataAccessOutputBuilder::default(); + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub fn ser_enable_directory_data_access_input( + input: &crate::operation::enable_directory_data_access::EnableDirectoryDataAccessInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_enable_directory_data_access_input::ser_enable_directory_data_access_input_input(&mut object, input)?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} diff --git a/sdk/directory/src/protocol_serde/shape_enable_directory_data_access_input.rs b/sdk/directory/src/protocol_serde/shape_enable_directory_data_access_input.rs new file mode 100644 index 000000000000..78907f75895d --- /dev/null +++ b/sdk/directory/src/protocol_serde/shape_enable_directory_data_access_input.rs @@ -0,0 +1,10 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_enable_directory_data_access_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::enable_directory_data_access::EnableDirectoryDataAccessInput, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.directory_id { + object.key("DirectoryId").string(var_1.as_str()); + } + Ok(()) +} diff --git a/sdk/directory/src/types.rs b/sdk/directory/src/types.rs index 89ebe67de7fc..cd90b6821079 100644 --- a/sdk/directory/src/types.rs +++ b/sdk/directory/src/types.rs @@ -97,6 +97,8 @@ pub use crate::types::_domain_controller::DomainController; pub use crate::types::_domain_controller_status::DomainControllerStatus; +pub use crate::types::_data_access_status::DataAccessStatus; + pub use crate::types::_directory_description::DirectoryDescription; pub use crate::types::_regions_info::RegionsInfo; @@ -155,6 +157,8 @@ mod _computer; mod _conditional_forwarder; +mod _data_access_status; + mod _directory_configuration_status; mod _directory_connect_settings; diff --git a/sdk/directory/src/types/_data_access_status.rs b/sdk/directory/src/types/_data_access_status.rs new file mode 100644 index 000000000000..9c349b7b2401 --- /dev/null +++ b/sdk/directory/src/types/_data_access_status.rs @@ -0,0 +1,125 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// When writing a match expression against `DataAccessStatus`, it is important to ensure +/// your code is forward-compatible. That is, if a match arm handles a case for a +/// feature that is supported by the service but has not been represented as an enum +/// variant in a current version of SDK, your code should continue to work when you +/// upgrade SDK to a future version in which the enum does include a variant for that +/// feature. +/// +/// Here is an example of how you can make a match expression forward-compatible: +/// +/// ```text +/// # let dataaccessstatus = unimplemented!(); +/// match dataaccessstatus { +/// DataAccessStatus::Disabled => { /* ... */ }, +/// DataAccessStatus::Disabling => { /* ... */ }, +/// DataAccessStatus::Enabled => { /* ... */ }, +/// DataAccessStatus::Enabling => { /* ... */ }, +/// DataAccessStatus::Failed => { /* ... */ }, +/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, +/// _ => { /* ... */ }, +/// } +/// ``` +/// The above code demonstrates that when `dataaccessstatus` represents +/// `NewFeature`, the execution path will lead to the second last match arm, +/// even though the enum does not contain a variant `DataAccessStatus::NewFeature` +/// in the current version of SDK. The reason is that the variable `other`, +/// created by the `@` operator, is bound to +/// `DataAccessStatus::Unknown(UnknownVariantValue("NewFeature".to_owned()))` +/// and calling `as_str` on it yields `"NewFeature"`. +/// This match expression is forward-compatible when executed with a newer +/// version of SDK where the variant `DataAccessStatus::NewFeature` is defined. +/// Specifically, when `dataaccessstatus` represents `NewFeature`, +/// the execution path will hit the second last match arm as before by virtue of +/// calling `as_str` on `DataAccessStatus::NewFeature` also yielding `"NewFeature"`. +/// +/// Explicitly matching on the `Unknown` variant should +/// be avoided for two reasons: +/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. +/// - It might inadvertently shadow other intended match arms. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive( + ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash, +)] +pub enum DataAccessStatus { + #[allow(missing_docs)] // documentation missing in model + Disabled, + #[allow(missing_docs)] // documentation missing in model + Disabling, + #[allow(missing_docs)] // documentation missing in model + Enabled, + #[allow(missing_docs)] // documentation missing in model + Enabling, + #[allow(missing_docs)] // documentation missing in model + Failed, + /// `Unknown` contains new variants that have been added since this code was generated. + #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")] + Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), +} +impl ::std::convert::From<&str> for DataAccessStatus { + fn from(s: &str) -> Self { + match s { + "Disabled" => DataAccessStatus::Disabled, + "Disabling" => DataAccessStatus::Disabling, + "Enabled" => DataAccessStatus::Enabled, + "Enabling" => DataAccessStatus::Enabling, + "Failed" => DataAccessStatus::Failed, + other => DataAccessStatus::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())), + } + } +} +impl ::std::str::FromStr for DataAccessStatus { + type Err = ::std::convert::Infallible; + + fn from_str(s: &str) -> ::std::result::Result::Err> { + ::std::result::Result::Ok(DataAccessStatus::from(s)) + } +} +impl DataAccessStatus { + /// Returns the `&str` value of the enum member. + pub fn as_str(&self) -> &str { + match self { + DataAccessStatus::Disabled => "Disabled", + DataAccessStatus::Disabling => "Disabling", + DataAccessStatus::Enabled => "Enabled", + DataAccessStatus::Enabling => "Enabling", + DataAccessStatus::Failed => "Failed", + DataAccessStatus::Unknown(value) => value.as_str(), + } + } + /// Returns all the `&str` representations of the enum members. + pub const fn values() -> &'static [&'static str] { + &["Disabled", "Disabling", "Enabled", "Enabling", "Failed"] + } +} +impl ::std::convert::AsRef for DataAccessStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl DataAccessStatus { + /// Parses the enum value while disallowing unknown variants. + /// + /// Unknown variants will result in an error. + pub fn try_parse(value: &str) -> ::std::result::Result { + match Self::from(value) { + #[allow(deprecated)] + Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)), + known => Ok(known), + } + } +} +impl ::std::fmt::Display for DataAccessStatus { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + match self { + DataAccessStatus::Disabled => write!(f, "Disabled"), + DataAccessStatus::Disabling => write!(f, "Disabling"), + DataAccessStatus::Enabled => write!(f, "Enabled"), + DataAccessStatus::Enabling => write!(f, "Enabling"), + DataAccessStatus::Failed => write!(f, "Failed"), + DataAccessStatus::Unknown(value) => write!(f, "{}", value), + } + } +} diff --git a/sdk/directory/src/types/_directory_description.rs b/sdk/directory/src/types/_directory_description.rs index 579c89ab2a0c..f13ccff69824 100644 --- a/sdk/directory/src/types/_directory_description.rs +++ b/sdk/directory/src/types/_directory_description.rs @@ -36,7 +36,7 @@ pub struct DirectoryDescription { pub launch_time: ::std::option::Option<::aws_smithy_types::DateTime>, ///

      The date and time that the stage was last updated.

      pub stage_last_updated_date_time: ::std::option::Option<::aws_smithy_types::DateTime>, - ///

      The directory size.

      + ///

      The directory type.

      pub r#type: ::std::option::Option, ///

      A DirectoryVpcSettingsDescription object that contains additional information about a directory. This member is only present if the directory is a Simple AD or Managed Microsoft AD directory.

      pub vpc_settings: ::std::option::Option, @@ -124,7 +124,7 @@ impl DirectoryDescription { pub fn stage_last_updated_date_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> { self.stage_last_updated_date_time.as_ref() } - ///

      The directory size.

      + ///

      The directory type.

      pub fn r#type(&self) -> ::std::option::Option<&crate::types::DirectoryType> { self.r#type.as_ref() } @@ -462,17 +462,17 @@ impl DirectoryDescriptionBuilder { pub fn get_stage_last_updated_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { &self.stage_last_updated_date_time } - ///

      The directory size.

      + ///

      The directory type.

      pub fn r#type(mut self, input: crate::types::DirectoryType) -> Self { self.r#type = ::std::option::Option::Some(input); self } - ///

      The directory size.

      + ///

      The directory type.

      pub fn set_type(mut self, input: ::std::option::Option) -> Self { self.r#type = input; self } - ///

      The directory size.

      + ///

      The directory type.

      pub fn get_type(&self) -> &::std::option::Option { &self.r#type } diff --git a/sdk/directory/src/types/_directory_stage.rs b/sdk/directory/src/types/_directory_stage.rs index 13165d222f33..d38ecf120105 100644 --- a/sdk/directory/src/types/_directory_stage.rs +++ b/sdk/directory/src/types/_directory_stage.rs @@ -23,6 +23,7 @@ /// DirectoryStage::Requested => { /* ... */ }, /// DirectoryStage::Restorefailed => { /* ... */ }, /// DirectoryStage::Restoring => { /* ... */ }, +/// DirectoryStage::Updating => { /* ... */ }, /// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, /// _ => { /* ... */ }, /// } @@ -72,6 +73,8 @@ pub enum DirectoryStage { Restorefailed, #[allow(missing_docs)] // documentation missing in model Restoring, + #[allow(missing_docs)] // documentation missing in model + Updating, /// `Unknown` contains new variants that have been added since this code was generated. #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")] Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), @@ -90,6 +93,7 @@ impl ::std::convert::From<&str> for DirectoryStage { "Requested" => DirectoryStage::Requested, "RestoreFailed" => DirectoryStage::Restorefailed, "Restoring" => DirectoryStage::Restoring, + "Updating" => DirectoryStage::Updating, other => DirectoryStage::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())), } } @@ -116,6 +120,7 @@ impl DirectoryStage { DirectoryStage::Requested => "Requested", DirectoryStage::Restorefailed => "RestoreFailed", DirectoryStage::Restoring => "Restoring", + DirectoryStage::Updating => "Updating", DirectoryStage::Unknown(value) => value.as_str(), } } @@ -133,6 +138,7 @@ impl DirectoryStage { "Requested", "RestoreFailed", "Restoring", + "Updating", ] } } @@ -167,6 +173,7 @@ impl ::std::fmt::Display for DirectoryStage { DirectoryStage::Requested => write!(f, "Requested"), DirectoryStage::Restorefailed => write!(f, "RestoreFailed"), DirectoryStage::Restoring => write!(f, "Restoring"), + DirectoryStage::Updating => write!(f, "Updating"), DirectoryStage::Unknown(value) => write!(f, "{}", value), } } diff --git a/sdk/directory/src/types/_domain_controller_status.rs b/sdk/directory/src/types/_domain_controller_status.rs index 43f11634c6d6..4e978c97c990 100644 --- a/sdk/directory/src/types/_domain_controller_status.rs +++ b/sdk/directory/src/types/_domain_controller_status.rs @@ -19,6 +19,7 @@ /// DomainControllerStatus::Failed => { /* ... */ }, /// DomainControllerStatus::Impaired => { /* ... */ }, /// DomainControllerStatus::Restoring => { /* ... */ }, +/// DomainControllerStatus::Updating => { /* ... */ }, /// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, /// _ => { /* ... */ }, /// } @@ -60,6 +61,8 @@ pub enum DomainControllerStatus { Impaired, #[allow(missing_docs)] // documentation missing in model Restoring, + #[allow(missing_docs)] // documentation missing in model + Updating, /// `Unknown` contains new variants that have been added since this code was generated. #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")] Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), @@ -74,6 +77,7 @@ impl ::std::convert::From<&str> for DomainControllerStatus { "Failed" => DomainControllerStatus::Failed, "Impaired" => DomainControllerStatus::Impaired, "Restoring" => DomainControllerStatus::Restoring, + "Updating" => DomainControllerStatus::Updating, other => DomainControllerStatus::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())), } } @@ -96,12 +100,13 @@ impl DomainControllerStatus { DomainControllerStatus::Failed => "Failed", DomainControllerStatus::Impaired => "Impaired", DomainControllerStatus::Restoring => "Restoring", + DomainControllerStatus::Updating => "Updating", DomainControllerStatus::Unknown(value) => value.as_str(), } } /// Returns all the `&str` representations of the enum members. pub const fn values() -> &'static [&'static str] { - &["Active", "Creating", "Deleted", "Deleting", "Failed", "Impaired", "Restoring"] + &["Active", "Creating", "Deleted", "Deleting", "Failed", "Impaired", "Restoring", "Updating"] } } impl ::std::convert::AsRef for DomainControllerStatus { @@ -131,6 +136,7 @@ impl ::std::fmt::Display for DomainControllerStatus { DomainControllerStatus::Failed => write!(f, "Failed"), DomainControllerStatus::Impaired => write!(f, "Impaired"), DomainControllerStatus::Restoring => write!(f, "Restoring"), + DomainControllerStatus::Updating => write!(f, "Updating"), DomainControllerStatus::Unknown(value) => write!(f, "{}", value), } } diff --git a/sdk/directory/src/types/_radius_settings.rs b/sdk/directory/src/types/_radius_settings.rs index 2fd54731b1a0..62a52e64fabc 100644 --- a/sdk/directory/src/types/_radius_settings.rs +++ b/sdk/directory/src/types/_radius_settings.rs @@ -10,7 +10,7 @@ pub struct RadiusSettings { pub radius_port: ::std::option::Option, ///

      The amount of time, in seconds, to wait for the RADIUS server to respond.

      pub radius_timeout: ::std::option::Option, - ///

      The maximum number of times that communication with the RADIUS server is attempted.

      + ///

      The maximum number of times that communication with the RADIUS server is retried after the initial attempt.

      pub radius_retries: i32, ///

      Required for enabling RADIUS on the directory.

      pub shared_secret: ::std::option::Option<::std::string::String>, @@ -36,7 +36,7 @@ impl RadiusSettings { pub fn radius_timeout(&self) -> ::std::option::Option { self.radius_timeout } - ///

      The maximum number of times that communication with the RADIUS server is attempted.

      + ///

      The maximum number of times that communication with the RADIUS server is retried after the initial attempt.

      pub fn radius_retries(&self) -> i32 { self.radius_retries } @@ -140,17 +140,17 @@ impl RadiusSettingsBuilder { pub fn get_radius_timeout(&self) -> &::std::option::Option { &self.radius_timeout } - ///

      The maximum number of times that communication with the RADIUS server is attempted.

      + ///

      The maximum number of times that communication with the RADIUS server is retried after the initial attempt.

      pub fn radius_retries(mut self, input: i32) -> Self { self.radius_retries = ::std::option::Option::Some(input); self } - ///

      The maximum number of times that communication with the RADIUS server is attempted.

      + ///

      The maximum number of times that communication with the RADIUS server is retried after the initial attempt.

      pub fn set_radius_retries(mut self, input: ::std::option::Option) -> Self { self.radius_retries = input; self } - ///

      The maximum number of times that communication with the RADIUS server is attempted.

      + ///

      The maximum number of times that communication with the RADIUS server is retried after the initial attempt.

      pub fn get_radius_retries(&self) -> &::std::option::Option { &self.radius_retries } diff --git a/sdk/directory/src/types/_tag.rs b/sdk/directory/src/types/_tag.rs index 6aff25f8d68c..cad9b24443a1 100644 --- a/sdk/directory/src/types/_tag.rs +++ b/sdk/directory/src/types/_tag.rs @@ -4,18 +4,18 @@ #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] pub struct Tag { - ///

      Required name of the tag. The string value can be Unicode characters and cannot be prefixed with "aws:". The string can contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-' (Java regex: "^(\[\\p{L}\\p{Z}\\p{N}_.:/=+\\-\]*)$").

      + ///

      Required name of the tag. The string value can be Unicode characters and cannot be prefixed with "aws:". The string can contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-', ':', '@'(Java regex: "^(\[\\p{L}\\p{Z}\\p{N}_.:/=+\\-\]*)$").

      pub key: ::std::string::String, - ///

      The optional value of the tag. The string value can be Unicode characters. The string can contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-' (Java regex: "^(\[\\p{L}\\p{Z}\\p{N}_.:/=+\\-\]*)$").

      + ///

      The optional value of the tag. The string value can be Unicode characters. The string can contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-', ':', '@' (Java regex: "^(\[\\p{L}\\p{Z}\\p{N}_.:/=+\\-\]*)$").

      pub value: ::std::string::String, } impl Tag { - ///

      Required name of the tag. The string value can be Unicode characters and cannot be prefixed with "aws:". The string can contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-' (Java regex: "^(\[\\p{L}\\p{Z}\\p{N}_.:/=+\\-\]*)$").

      + ///

      Required name of the tag. The string value can be Unicode characters and cannot be prefixed with "aws:". The string can contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-', ':', '@'(Java regex: "^(\[\\p{L}\\p{Z}\\p{N}_.:/=+\\-\]*)$").

      pub fn key(&self) -> &str { use std::ops::Deref; self.key.deref() } - ///

      The optional value of the tag. The string value can be Unicode characters. The string can contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-' (Java regex: "^(\[\\p{L}\\p{Z}\\p{N}_.:/=+\\-\]*)$").

      + ///

      The optional value of the tag. The string value can be Unicode characters. The string can contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-', ':', '@' (Java regex: "^(\[\\p{L}\\p{Z}\\p{N}_.:/=+\\-\]*)$").

      pub fn value(&self) -> &str { use std::ops::Deref; self.value.deref() @@ -36,33 +36,33 @@ pub struct TagBuilder { pub(crate) value: ::std::option::Option<::std::string::String>, } impl TagBuilder { - ///

      Required name of the tag. The string value can be Unicode characters and cannot be prefixed with "aws:". The string can contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-' (Java regex: "^(\[\\p{L}\\p{Z}\\p{N}_.:/=+\\-\]*)$").

      + ///

      Required name of the tag. The string value can be Unicode characters and cannot be prefixed with "aws:". The string can contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-', ':', '@'(Java regex: "^(\[\\p{L}\\p{Z}\\p{N}_.:/=+\\-\]*)$").

      /// This field is required. pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.key = ::std::option::Option::Some(input.into()); self } - ///

      Required name of the tag. The string value can be Unicode characters and cannot be prefixed with "aws:". The string can contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-' (Java regex: "^(\[\\p{L}\\p{Z}\\p{N}_.:/=+\\-\]*)$").

      + ///

      Required name of the tag. The string value can be Unicode characters and cannot be prefixed with "aws:". The string can contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-', ':', '@'(Java regex: "^(\[\\p{L}\\p{Z}\\p{N}_.:/=+\\-\]*)$").

      pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.key = input; self } - ///

      Required name of the tag. The string value can be Unicode characters and cannot be prefixed with "aws:". The string can contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-' (Java regex: "^(\[\\p{L}\\p{Z}\\p{N}_.:/=+\\-\]*)$").

      + ///

      Required name of the tag. The string value can be Unicode characters and cannot be prefixed with "aws:". The string can contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-', ':', '@'(Java regex: "^(\[\\p{L}\\p{Z}\\p{N}_.:/=+\\-\]*)$").

      pub fn get_key(&self) -> &::std::option::Option<::std::string::String> { &self.key } - ///

      The optional value of the tag. The string value can be Unicode characters. The string can contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-' (Java regex: "^(\[\\p{L}\\p{Z}\\p{N}_.:/=+\\-\]*)$").

      + ///

      The optional value of the tag. The string value can be Unicode characters. The string can contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-', ':', '@' (Java regex: "^(\[\\p{L}\\p{Z}\\p{N}_.:/=+\\-\]*)$").

      /// This field is required. pub fn value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.value = ::std::option::Option::Some(input.into()); self } - ///

      The optional value of the tag. The string value can be Unicode characters. The string can contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-' (Java regex: "^(\[\\p{L}\\p{Z}\\p{N}_.:/=+\\-\]*)$").

      + ///

      The optional value of the tag. The string value can be Unicode characters. The string can contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-', ':', '@' (Java regex: "^(\[\\p{L}\\p{Z}\\p{N}_.:/=+\\-\]*)$").

      pub fn set_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.value = input; self } - ///

      The optional value of the tag. The string value can be Unicode characters. The string can contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-' (Java regex: "^(\[\\p{L}\\p{Z}\\p{N}_.:/=+\\-\]*)$").

      + ///

      The optional value of the tag. The string value can be Unicode characters. The string can contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-', ':', '@' (Java regex: "^(\[\\p{L}\\p{Z}\\p{N}_.:/=+\\-\]*)$").

      pub fn get_value(&self) -> &::std::option::Option<::std::string::String> { &self.value } diff --git a/sdk/directory/src/types/error/_access_denied_exception.rs b/sdk/directory/src/types/error/_access_denied_exception.rs index ad7b46e9bbff..c8845356bf19 100644 --- a/sdk/directory/src/types/error/_access_denied_exception.rs +++ b/sdk/directory/src/types/error/_access_denied_exception.rs @@ -1,6 +1,6 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -///

      Client authentication is not available in this region at this time.

      +///

      You do not have sufficient access to perform this action.

      #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] pub struct AccessDeniedException { diff --git a/sdk/directory/src/types/error/_directory_unavailable_exception.rs b/sdk/directory/src/types/error/_directory_unavailable_exception.rs index 8266b8d826b0..557d53879bc8 100644 --- a/sdk/directory/src/types/error/_directory_unavailable_exception.rs +++ b/sdk/directory/src/types/error/_directory_unavailable_exception.rs @@ -1,6 +1,6 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -///

      The specified directory is unavailable or could not be found.

      +///

      The specified directory is unavailable.

      #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] pub struct DirectoryUnavailableException { diff --git a/sdk/directoryservicedata/Cargo.toml b/sdk/directoryservicedata/Cargo.toml new file mode 100644 index 000000000000..c18a1003c5da --- /dev/null +++ b/sdk/directoryservicedata/Cargo.toml @@ -0,0 +1,90 @@ +# Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +[package] +name = "aws-sdk-directoryservicedata" +version = "1.0.0" +authors = ["AWS Rust SDK Team ", "Russell Cohen "] +description = "AWS SDK for AWS Directory Service Data" +edition = "2021" +license = "Apache-2.0" +repository = "https://github.com/awslabs/aws-sdk-rust" +rust-version = "1.78.0" +readme = "README.md" +[package.metadata.smithy] +codegen-version = "e96640bd33df40026447b9e3f826144f8e3c7724" +[package.metadata.docs.rs] +all-features = true +targets = ["x86_64-unknown-linux-gnu"] +[dependencies.aws-credential-types] +path = "../aws-credential-types" +version = "1.2.1" + +[dependencies.aws-runtime] +path = "../aws-runtime" +version = "1.4.3" + +[dependencies.aws-smithy-async] +path = "../aws-smithy-async" +version = "1.2.1" + +[dependencies.aws-smithy-http] +path = "../aws-smithy-http" +version = "0.60.11" + +[dependencies.aws-smithy-json] +path = "../aws-smithy-json" +version = "0.60.7" + +[dependencies.aws-smithy-runtime] +path = "../aws-smithy-runtime" +features = ["client"] +version = "1.7.1" + +[dependencies.aws-smithy-runtime-api] +path = "../aws-smithy-runtime-api" +features = ["client", "http-02x"] +version = "1.7.2" + +[dependencies.aws-smithy-types] +path = "../aws-smithy-types" +version = "1.2.6" + +[dependencies.aws-types] +path = "../aws-types" +version = "1.3.3" + +[dependencies.bytes] +version = "1.4.0" + +[dependencies.fastrand] +version = "2.0.0" + +[dependencies.http] +version = "0.2.9" + +[dependencies.once_cell] +version = "1.16" + +[dependencies.regex-lite] +version = "0.1.5" + +[dependencies.tracing] +version = "0.1" +[dev-dependencies.aws-config] +path = "../aws-config" +version = "1.5.6" + +[dev-dependencies.aws-credential-types] +path = "../aws-credential-types" +features = ["test-util"] +version = "1.2.1" + +[dev-dependencies.tokio] +version = "1.23.1" +features = ["macros", "test-util", "rt-multi-thread"] + +[features] +behavior-version-latest = [] +rustls = ["aws-smithy-runtime/tls-rustls"] +rt-tokio = ["aws-smithy-async/rt-tokio", "aws-smithy-types/rt-tokio"] +test-util = ["aws-credential-types/test-util", "aws-smithy-runtime/test-util"] +default = ["rustls", "rt-tokio"] diff --git a/sdk/directoryservicedata/LICENSE b/sdk/directoryservicedata/LICENSE new file mode 100644 index 000000000000..3581ac356771 --- /dev/null +++ b/sdk/directoryservicedata/LICENSE @@ -0,0 +1,202 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + diff --git a/sdk/directoryservicedata/README.md b/sdk/directoryservicedata/README.md new file mode 100644 index 000000000000..168aa69d52d9 --- /dev/null +++ b/sdk/directoryservicedata/README.md @@ -0,0 +1,65 @@ +# aws-sdk-directoryservicedata + +Amazon Web Services Directory Service Data is an extension of Directory Service. This API reference provides detailed information about Directory Service Data operations and object types. + +With Directory Service Data, you can create, read, update, and delete users, groups, and memberships from your Managed Microsoft AD without additional costs and without deploying dedicated management instances. You can also perform built-in object management tasks across directories without direct network connectivity, which simplifies provisioning and access management to achieve fully automated deployments. Directory Service Data supports user and group write operations, such as CreateUser and CreateGroup, within the organizational unit (OU) of your Managed Microsoft AD. Directory Service Data supports read operations, such as ListUsers and ListGroups, on all users, groups, and group memberships within your Managed Microsoft AD and across trusted realms. Directory Service Data supports adding and removing group members in your OU and the Amazon Web Services Delegated Groups OU, so you can grant and deny access to specific roles and permissions. For more information, see [Manage users and groups](https://docs.aws.amazon.com/directoryservice/latest/admin-guide/ms_ad_manage_users_groups.html) in the _Directory Service Administration Guide_. + +Directory Service Data connects to your Managed Microsoft AD domain controllers and performs operations on underlying directory objects. When you create your Managed Microsoft AD, you choose subnets for domain controllers that Directory Service creates on your behalf. If a domain controller is unavailable, Directory Service Data uses an available domain controller. As a result, you might notice eventual consistency while objects replicate from one domain controller to another domain controller. For more information, see [What gets created](https://docs.aws.amazon.com/directoryservice/latest/admin-guide/ms_ad_getting_started_what_gets_created.html) in the _Directory Service Administration Guide_. Directory limits vary by Managed Microsoft AD edition: + - __Standard edition__ – Supports 8 transactions per second (TPS) for read operations and 4 TPS for write operations per directory. There's a concurrency limit of 10 concurrent requests. + - __Enterprise edition__ – Supports 16 transactions per second (TPS) for read operations and 8 TPS for write operations per directory. There's a concurrency limit of 10 concurrent requests. + - __Amazon Web Services Account__ - Supports a total of 100 TPS for Directory Service Data operations across all directories. + +Directory Service Data only supports the Managed Microsoft AD directory type and is only available in the primary Amazon Web Services Region. For more information, see [Managed Microsoft AD](https://docs.aws.amazon.com/directoryservice/latest/admin-guide/directory_microsoft_ad.html) and [Primary vs additional Regions](https://docs.aws.amazon.com/directoryservice/latest/admin-guide/multi-region-global-primary-additional.html) in the _Directory Service Administration Guide_. + +## Getting Started + +> Examples are available for many services and operations, check out the +> [examples folder in GitHub](https://github.com/awslabs/aws-sdk-rust/tree/main/examples). + +The SDK provides one crate per AWS service. You must add [Tokio](https://crates.io/crates/tokio) +as a dependency within your Rust project to execute asynchronous code. To add `aws-sdk-directoryservicedata` to +your project, add the following to your **Cargo.toml** file: + +```toml +[dependencies] +aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } +aws-sdk-directoryservicedata = "1.0.0" +tokio = { version = "1", features = ["full"] } +``` + +Then in code, a client can be created with the following: + +```rust,no_run +use aws_sdk_directoryservicedata as directoryservicedata; + +#[::tokio::main] +async fn main() -> Result<(), directoryservicedata::Error> { + let config = aws_config::load_from_env().await; + let client = aws_sdk_directoryservicedata::Client::new(&config); + + // ... make some calls with the client + + Ok(()) +} +``` + +See the [client documentation](https://docs.rs/aws-sdk-directoryservicedata/latest/aws_sdk_directoryservicedata/client/struct.Client.html) +for information on what calls can be made, and the inputs and outputs for each of those calls. + +## Using the SDK + +Until the SDK is released, we will be adding information about using the SDK to the +[Developer Guide](https://docs.aws.amazon.com/sdk-for-rust/latest/dg/welcome.html). Feel free to suggest +additional sections for the guide by opening an issue and describing what you are trying to do. + +## Getting Help + +* [GitHub discussions](https://github.com/awslabs/aws-sdk-rust/discussions) - For ideas, RFCs & general questions +* [GitHub issues](https://github.com/awslabs/aws-sdk-rust/issues/new/choose) - For bug reports & feature requests +* [Generated Docs (latest version)](https://awslabs.github.io/aws-sdk-rust/) +* [Usage examples](https://github.com/awslabs/aws-sdk-rust/tree/main/examples) + +## License + +This project is licensed under the Apache-2.0 License. + diff --git a/sdk/directoryservicedata/src/auth_plugin.rs b/sdk/directoryservicedata/src/auth_plugin.rs new file mode 100644 index 000000000000..6367570f4123 --- /dev/null +++ b/sdk/directoryservicedata/src/auth_plugin.rs @@ -0,0 +1,35 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +use std::borrow::Cow; + +use aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolver; +use aws_smithy_runtime_api::client::auth::AuthSchemeId; +use aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder; +use aws_smithy_runtime_api::client::runtime_plugin::{Order, RuntimePlugin}; + +#[derive(Debug)] +pub(crate) struct DefaultAuthOptionsPlugin { + runtime_components: RuntimeComponentsBuilder, +} + +impl DefaultAuthOptionsPlugin { + pub(crate) fn new(auth_schemes: Vec) -> Self { + let runtime_components = RuntimeComponentsBuilder::new("default_auth_options") + .with_auth_scheme_option_resolver(Some(StaticAuthSchemeOptionResolver::new(auth_schemes))); + Self { runtime_components } + } +} + +impl RuntimePlugin for DefaultAuthOptionsPlugin { + fn order(&self) -> Order { + Order::Defaults + } + + fn runtime_components(&self, _current_components: &RuntimeComponentsBuilder) -> Cow<'_, RuntimeComponentsBuilder> { + Cow::Borrowed(&self.runtime_components) + } +} diff --git a/sdk/directoryservicedata/src/client.rs b/sdk/directoryservicedata/src/client.rs new file mode 100644 index 000000000000..bbd1491a80ff --- /dev/null +++ b/sdk/directoryservicedata/src/client.rs @@ -0,0 +1,198 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[derive(Debug)] +pub(crate) struct Handle { + pub(crate) conf: crate::Config, + #[allow(dead_code)] // unused when a service does not provide any operations + pub(crate) runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, +} + +/// Client for AWS Directory Service Data +/// +/// Client for invoking operations on AWS Directory Service Data. Each operation on AWS Directory Service Data is a method on this +/// this struct. `.send()` MUST be invoked on the generated operations to dispatch the request to the service. +/// ## Constructing a `Client` +/// +/// A [`Config`] is required to construct a client. For most use cases, the [`aws-config`] +/// crate should be used to automatically resolve this config using +/// [`aws_config::load_from_env()`], since this will resolve an [`SdkConfig`] which can be shared +/// across multiple different AWS SDK clients. This config resolution process can be customized +/// by calling [`aws_config::from_env()`] instead, which returns a [`ConfigLoader`] that uses +/// the [builder pattern] to customize the default config. +/// +/// In the simplest case, creating a client looks as follows: +/// ```rust,no_run +/// # async fn wrapper() { +/// let config = aws_config::load_from_env().await; +/// let client = aws_sdk_directoryservicedata::Client::new(&config); +/// # } +/// ``` +/// +/// Occasionally, SDKs may have additional service-specific values that can be set on the [`Config`] that +/// is absent from [`SdkConfig`], or slightly different settings for a specific client may be desired. +/// The [`Builder`](crate::config::Builder) struct implements `From<&SdkConfig>`, so setting these specific settings can be +/// done as follows: +/// +/// ```rust,no_run +/// # async fn wrapper() { +/// let sdk_config = ::aws_config::load_from_env().await; +/// let config = aws_sdk_directoryservicedata::config::Builder::from(&sdk_config) +/// # /* +/// .some_service_specific_setting("value") +/// # */ +/// .build(); +/// # } +/// ``` +/// +/// See the [`aws-config` docs] and [`Config`] for more information on customizing configuration. +/// +/// _Note:_ Client construction is expensive due to connection thread pool initialization, and should +/// be done once at application start-up. +/// +/// [`Config`]: crate::Config +/// [`ConfigLoader`]: https://docs.rs/aws-config/*/aws_config/struct.ConfigLoader.html +/// [`SdkConfig`]: https://docs.rs/aws-config/*/aws_config/struct.SdkConfig.html +/// [`aws-config` docs]: https://docs.rs/aws-config/* +/// [`aws-config`]: https://crates.io/crates/aws-config +/// [`aws_config::from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.from_env.html +/// [`aws_config::load_from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.load_from_env.html +/// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#builders-enable-construction-of-complex-values-c-builder +/// # Using the `Client` +/// +/// A client has a function for every operation that can be performed by the service. +/// For example, the [`AddGroupMember`](crate::operation::add_group_member) operation has +/// a [`Client::add_group_member`], function which returns a builder for that operation. +/// The fluent builder ultimately has a `send()` function that returns an async future that +/// returns a result, as illustrated below: +/// +/// ```rust,ignore +/// let result = client.add_group_member() +/// .directory_id("example") +/// .send() +/// .await; +/// ``` +/// +/// The underlying HTTP requests that get made by this can be modified with the `customize_operation` +/// function on the fluent builder. See the [`customize`](crate::client::customize) module for more +/// information. +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct Client { + handle: ::std::sync::Arc, +} + +impl Client { + /// Creates a new client from the service [`Config`](crate::Config). + /// + /// # Panics + /// + /// This method will panic in the following cases: + /// + /// - Retries or timeouts are enabled without a `sleep_impl` configured. + /// - Identity caching is enabled without a `sleep_impl` and `time_source` configured. + /// - No `behavior_version` is provided. + /// + /// The panic message for each of these will have instructions on how to resolve them. + #[track_caller] + pub fn from_conf(conf: crate::Config) -> Self { + let handle = Handle { + conf: conf.clone(), + runtime_plugins: crate::config::base_client_runtime_plugins(conf), + }; + if let Err(err) = Self::validate_config(&handle) { + panic!("Invalid client configuration: {err}"); + } + Self { + handle: ::std::sync::Arc::new(handle), + } + } + + /// Returns the client's configuration. + pub fn config(&self) -> &crate::Config { + &self.handle.conf + } + + fn validate_config(handle: &Handle) -> Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let mut cfg = ::aws_smithy_types::config_bag::ConfigBag::base(); + handle + .runtime_plugins + .apply_client_configuration(&mut cfg)? + .validate_base_client_config(&cfg)?; + Ok(()) + } +} + +impl Client { + /// Creates a new client from an [SDK Config](::aws_types::sdk_config::SdkConfig). + /// + /// # Panics + /// + /// - This method will panic if the `sdk_config` is missing an async sleep implementation. If you experience this panic, set + /// the `sleep_impl` on the Config passed into this function to fix it. + /// - This method will panic if the `sdk_config` is missing an HTTP connector. If you experience this panic, set the + /// `http_connector` on the Config passed into this function to fix it. + /// - This method will panic if no `BehaviorVersion` is provided. If you experience this panic, set `behavior_version` on the Config or enable the `behavior-version-latest` Cargo feature. + #[track_caller] + pub fn new(sdk_config: &::aws_types::sdk_config::SdkConfig) -> Self { + Self::from_conf(sdk_config.into()) + } +} + +mod add_group_member; + +mod create_group; + +mod create_user; + +/// Operation customization and supporting types. +/// +/// The underlying HTTP requests made during an operation can be customized +/// by calling the `customize()` method on the builder returned from a client +/// operation call. For example, this can be used to add an additional HTTP header: +/// +/// ```ignore +/// # async fn wrapper() -> ::std::result::Result<(), aws_sdk_directoryservicedata::Error> { +/// # let client: aws_sdk_directoryservicedata::Client = unimplemented!(); +/// use ::http::header::{HeaderName, HeaderValue}; +/// +/// let result = client.add_group_member() +/// .customize() +/// .mutate_request(|req| { +/// // Add `x-example-header` with value +/// req.headers_mut() +/// .insert( +/// HeaderName::from_static("x-example-header"), +/// HeaderValue::from_static("1"), +/// ); +/// }) +/// .send() +/// .await; +/// # } +/// ``` +pub mod customize; + +mod delete_group; + +mod delete_user; + +mod describe_group; + +mod describe_user; + +mod disable_user; + +mod list_group_members; + +mod list_groups; + +mod list_groups_for_member; + +mod list_users; + +mod remove_group_member; + +mod search_groups; + +mod search_users; + +mod update_group; + +mod update_user; diff --git a/sdk/directoryservicedata/src/client/add_group_member.rs b/sdk/directoryservicedata/src/client/add_group_member.rs new file mode 100644 index 000000000000..04af09f24187 --- /dev/null +++ b/sdk/directoryservicedata/src/client/add_group_member.rs @@ -0,0 +1,16 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`AddGroupMember`](crate::operation::add_group_member::builders::AddGroupMemberFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`directory_id(impl Into)`](crate::operation::add_group_member::builders::AddGroupMemberFluentBuilder::directory_id) / [`set_directory_id(Option)`](crate::operation::add_group_member::builders::AddGroupMemberFluentBuilder::set_directory_id):
      required: **true**

      The identifier (ID) of the directory that's associated with the group.


      + /// - [`group_name(impl Into)`](crate::operation::add_group_member::builders::AddGroupMemberFluentBuilder::group_name) / [`set_group_name(Option)`](crate::operation::add_group_member::builders::AddGroupMemberFluentBuilder::set_group_name):
      required: **true**

      The name of the group.


      + /// - [`member_name(impl Into)`](crate::operation::add_group_member::builders::AddGroupMemberFluentBuilder::member_name) / [`set_member_name(Option)`](crate::operation::add_group_member::builders::AddGroupMemberFluentBuilder::set_member_name):
      required: **true**

      The SAMAccountName of the user, group, or computer to add as a group member.


      + /// - [`member_realm(impl Into)`](crate::operation::add_group_member::builders::AddGroupMemberFluentBuilder::member_realm) / [`set_member_realm(Option)`](crate::operation::add_group_member::builders::AddGroupMemberFluentBuilder::set_member_realm):
      required: **false**

      The domain name that's associated with the group member. This parameter is required only when adding a member outside of your Managed Microsoft AD domain to a group inside of your Managed Microsoft AD domain. This parameter defaults to the Managed Microsoft AD domain.

      This parameter is case insensitive.


      + /// - [`client_token(impl Into)`](crate::operation::add_group_member::builders::AddGroupMemberFluentBuilder::client_token) / [`set_client_token(Option)`](crate::operation::add_group_member::builders::AddGroupMemberFluentBuilder::set_client_token):
      required: **false**

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      This parameter is optional when using the CLI or SDK.


      + /// - On success, responds with [`AddGroupMemberOutput`](crate::operation::add_group_member::AddGroupMemberOutput) + /// - On failure, responds with [`SdkError`](crate::operation::add_group_member::AddGroupMemberError) + pub fn add_group_member(&self) -> crate::operation::add_group_member::builders::AddGroupMemberFluentBuilder { + crate::operation::add_group_member::builders::AddGroupMemberFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/directoryservicedata/src/client/create_group.rs b/sdk/directoryservicedata/src/client/create_group.rs new file mode 100644 index 000000000000..5bf7ad851e47 --- /dev/null +++ b/sdk/directoryservicedata/src/client/create_group.rs @@ -0,0 +1,20 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`CreateGroup`](crate::operation::create_group::builders::CreateGroupFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`directory_id(impl Into)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::directory_id) / [`set_directory_id(Option)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::set_directory_id):
      required: **true**

      The identifier (ID) of the directory that's associated with the group.


      + /// - [`sam_account_name(impl Into)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::sam_account_name) / [`set_sam_account_name(Option)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::set_sam_account_name):
      required: **true**

      The name of the group.


      + /// - [`group_type(GroupType)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::group_type) / [`set_group_type(Option)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::set_group_type):
      required: **false**

      The AD group type. For details, see Active Directory security group type.


      + /// - [`group_scope(GroupScope)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::group_scope) / [`set_group_scope(Option)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::set_group_scope):
      required: **false**

      The scope of the AD group. For details, see Active Directory security group scope.


      + /// - [`other_attributes(impl Into, AttributeValue)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::other_attributes) / [`set_other_attributes(Option>)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::set_other_attributes):
      required: **false**

      An expression that defines one or more attributes with the data type and value of each attribute.


      + /// - [`client_token(impl Into)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::client_token) / [`set_client_token(Option)`](crate::operation::create_group::builders::CreateGroupFluentBuilder::set_client_token):
      required: **false**

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      This parameter is optional when using the CLI or SDK.


      + /// - On success, responds with [`CreateGroupOutput`](crate::operation::create_group::CreateGroupOutput) with field(s): + /// - [`directory_id(Option)`](crate::operation::create_group::CreateGroupOutput::directory_id):

      The identifier (ID) of the directory that's associated with the group.

      + /// - [`sam_account_name(Option)`](crate::operation::create_group::CreateGroupOutput::sam_account_name):

      The name of the group.

      + /// - [`sid(Option)`](crate::operation::create_group::CreateGroupOutput::sid):

      The unique security identifier (SID) of the group.

      + /// - On failure, responds with [`SdkError`](crate::operation::create_group::CreateGroupError) + pub fn create_group(&self) -> crate::operation::create_group::builders::CreateGroupFluentBuilder { + crate::operation::create_group::builders::CreateGroupFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/directoryservicedata/src/client/create_user.rs b/sdk/directoryservicedata/src/client/create_user.rs new file mode 100644 index 000000000000..428534a94521 --- /dev/null +++ b/sdk/directoryservicedata/src/client/create_user.rs @@ -0,0 +1,21 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`CreateUser`](crate::operation::create_user::builders::CreateUserFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`directory_id(impl Into)`](crate::operation::create_user::builders::CreateUserFluentBuilder::directory_id) / [`set_directory_id(Option)`](crate::operation::create_user::builders::CreateUserFluentBuilder::set_directory_id):
      required: **true**

      The identifier (ID) of the directory that’s associated with the user.


      + /// - [`sam_account_name(impl Into)`](crate::operation::create_user::builders::CreateUserFluentBuilder::sam_account_name) / [`set_sam_account_name(Option)`](crate::operation::create_user::builders::CreateUserFluentBuilder::set_sam_account_name):
      required: **true**

      The name of the user.


      + /// - [`email_address(impl Into)`](crate::operation::create_user::builders::CreateUserFluentBuilder::email_address) / [`set_email_address(Option)`](crate::operation::create_user::builders::CreateUserFluentBuilder::set_email_address):
      required: **false**

      The email address of the user.


      + /// - [`given_name(impl Into)`](crate::operation::create_user::builders::CreateUserFluentBuilder::given_name) / [`set_given_name(Option)`](crate::operation::create_user::builders::CreateUserFluentBuilder::set_given_name):
      required: **false**

      The first name of the user.


      + /// - [`surname(impl Into)`](crate::operation::create_user::builders::CreateUserFluentBuilder::surname) / [`set_surname(Option)`](crate::operation::create_user::builders::CreateUserFluentBuilder::set_surname):
      required: **false**

      The last name of the user.


      + /// - [`other_attributes(impl Into, AttributeValue)`](crate::operation::create_user::builders::CreateUserFluentBuilder::other_attributes) / [`set_other_attributes(Option>)`](crate::operation::create_user::builders::CreateUserFluentBuilder::set_other_attributes):
      required: **false**

      An expression that defines one or more attribute names with the data type and value of each attribute. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.

      Attribute names are case insensitive.


      + /// - [`client_token(impl Into)`](crate::operation::create_user::builders::CreateUserFluentBuilder::client_token) / [`set_client_token(Option)`](crate::operation::create_user::builders::CreateUserFluentBuilder::set_client_token):
      required: **false**

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      This parameter is optional when using the CLI or SDK.


      + /// - On success, responds with [`CreateUserOutput`](crate::operation::create_user::CreateUserOutput) with field(s): + /// - [`directory_id(Option)`](crate::operation::create_user::CreateUserOutput::directory_id):

      The identifier (ID) of the directory where the address block is added.

      + /// - [`sid(Option)`](crate::operation::create_user::CreateUserOutput::sid):

      The unique security identifier (SID) of the user.

      + /// - [`sam_account_name(Option)`](crate::operation::create_user::CreateUserOutput::sam_account_name):

      The name of the user.

      + /// - On failure, responds with [`SdkError`](crate::operation::create_user::CreateUserError) + pub fn create_user(&self) -> crate::operation::create_user::builders::CreateUserFluentBuilder { + crate::operation::create_user::builders::CreateUserFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/directoryservicedata/src/client/customize.rs b/sdk/directoryservicedata/src/client/customize.rs new file mode 100644 index 000000000000..1a70244060cc --- /dev/null +++ b/sdk/directoryservicedata/src/client/customize.rs @@ -0,0 +1,113 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// `CustomizableOperation` allows for configuring a single operation invocation before it is sent. +pub struct CustomizableOperation { + customizable_send: B, + config_override: ::std::option::Option, + interceptors: Vec<::aws_smithy_runtime_api::client::interceptors::SharedInterceptor>, + runtime_plugins: Vec<::aws_smithy_runtime_api::client::runtime_plugin::SharedRuntimePlugin>, + _output: ::std::marker::PhantomData, + _error: ::std::marker::PhantomData, +} + +impl CustomizableOperation { + /// Creates a new `CustomizableOperation` from `customizable_send`. + #[allow(dead_code)] // unused when a service does not provide any operations + pub(crate) fn new(customizable_send: B) -> Self { + Self { + customizable_send, + config_override: ::std::option::Option::None, + interceptors: vec![], + runtime_plugins: vec![], + _output: ::std::marker::PhantomData, + _error: ::std::marker::PhantomData, + } + } + + pub(crate) fn execute(self, f: impl ::std::ops::FnOnce(B, crate::config::Builder) -> U) -> U { + let mut config_override = self.config_override.unwrap_or_default(); + self.interceptors.into_iter().for_each(|interceptor| { + config_override.push_interceptor(interceptor); + }); + self.runtime_plugins.into_iter().for_each(|plugin| { + config_override.push_runtime_plugin(plugin); + }); + f(self.customizable_send, config_override) + } + + /// Adds an [interceptor](::aws_smithy_runtime_api::client::interceptors::Intercept) that runs at specific stages of the request execution pipeline. + /// + /// Note that interceptors can also be added to `CustomizableOperation` by `config_override`, + /// `map_request`, and `mutate_request` (the last two are implemented via interceptors under the hood). + /// The order in which those user-specified operation interceptors are invoked should not be relied upon + /// as it is an implementation detail. + pub fn interceptor(mut self, interceptor: impl ::aws_smithy_runtime_api::client::interceptors::Intercept + 'static) -> Self { + self.interceptors + .push(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::new(interceptor)); + self + } + + /// Adds a runtime plugin. + #[allow(unused)] + pub(crate) fn runtime_plugin(mut self, runtime_plugin: impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin + 'static) -> Self { + self.runtime_plugins + .push(::aws_smithy_runtime_api::client::runtime_plugin::SharedRuntimePlugin::new(runtime_plugin)); + self + } + + /// Allows for customizing the operation's request. + pub fn map_request(mut self, f: F) -> Self + where + F: ::std::ops::Fn( + ::aws_smithy_runtime_api::client::orchestrator::HttpRequest, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, MapE> + + ::std::marker::Send + + ::std::marker::Sync + + 'static, + MapE: ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static, + { + self.interceptors + .push(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::new( + ::aws_smithy_runtime::client::interceptors::MapRequestInterceptor::new(f), + )); + self + } + + /// Convenience for `map_request` where infallible direct mutation of request is acceptable. + pub fn mutate_request(mut self, f: F) -> Self + where + F: ::std::ops::Fn(&mut ::aws_smithy_runtime_api::client::orchestrator::HttpRequest) + ::std::marker::Send + ::std::marker::Sync + 'static, + { + self.interceptors + .push(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::new( + ::aws_smithy_runtime::client::interceptors::MutateRequestInterceptor::new(f), + )); + self + } + + /// Overrides config for a single operation invocation. + /// + /// `config_override` is applied to the operation configuration level. + /// The fields in the builder that are `Some` override those applied to the service + /// configuration level. For instance, + /// + /// | Config A | overridden by Config B | = Config C | + /// |--------------------|------------------------|--------------------| + /// | field_1: None, | field_1: Some(v2), | field_1: Some(v2), | + /// | field_2: Some(v1), | field_2: Some(v2), | field_2: Some(v2), | + /// | field_3: Some(v1), | field_3: None, | field_3: Some(v1), | + pub fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.config_override = Some(config_override.into()); + self + } + + /// Sends the request and returns the response. + pub async fn send(self) -> crate::client::customize::internal::SendResult + where + E: std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static, + B: crate::client::customize::internal::CustomizableSend, + { + self.execute(|sender, config| sender.send(config)).await + } +} + +pub(crate) mod internal; diff --git a/sdk/directoryservicedata/src/client/customize/internal.rs b/sdk/directoryservicedata/src/client/customize/internal.rs new file mode 100644 index 000000000000..a4492e4c3942 --- /dev/null +++ b/sdk/directoryservicedata/src/client/customize/internal.rs @@ -0,0 +1,12 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub type BoxFuture = ::std::pin::Pin<::std::boxed::Box + ::std::marker::Send>>; + +pub type SendResult = + ::std::result::Result>; + +pub trait CustomizableSend: ::std::marker::Send + ::std::marker::Sync { + // Takes an owned `self` as the implementation will internally call methods that take `self`. + // If it took `&self`, that would make this trait object safe, but some implementing types do not + // derive `Clone`, unable to yield `self` from `&self`. + fn send(self, config_override: crate::config::Builder) -> BoxFuture>; +} diff --git a/sdk/directoryservicedata/src/client/delete_group.rs b/sdk/directoryservicedata/src/client/delete_group.rs new file mode 100644 index 000000000000..91162ffd2ddc --- /dev/null +++ b/sdk/directoryservicedata/src/client/delete_group.rs @@ -0,0 +1,14 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`DeleteGroup`](crate::operation::delete_group::builders::DeleteGroupFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`directory_id(impl Into)`](crate::operation::delete_group::builders::DeleteGroupFluentBuilder::directory_id) / [`set_directory_id(Option)`](crate::operation::delete_group::builders::DeleteGroupFluentBuilder::set_directory_id):
      required: **true**

      The identifier (ID) of the directory that's associated with the group.


      + /// - [`sam_account_name(impl Into)`](crate::operation::delete_group::builders::DeleteGroupFluentBuilder::sam_account_name) / [`set_sam_account_name(Option)`](crate::operation::delete_group::builders::DeleteGroupFluentBuilder::set_sam_account_name):
      required: **true**

      The name of the group.


      + /// - [`client_token(impl Into)`](crate::operation::delete_group::builders::DeleteGroupFluentBuilder::client_token) / [`set_client_token(Option)`](crate::operation::delete_group::builders::DeleteGroupFluentBuilder::set_client_token):
      required: **false**

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      This parameter is optional when using the CLI or SDK.


      + /// - On success, responds with [`DeleteGroupOutput`](crate::operation::delete_group::DeleteGroupOutput) + /// - On failure, responds with [`SdkError`](crate::operation::delete_group::DeleteGroupError) + pub fn delete_group(&self) -> crate::operation::delete_group::builders::DeleteGroupFluentBuilder { + crate::operation::delete_group::builders::DeleteGroupFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/directoryservicedata/src/client/delete_user.rs b/sdk/directoryservicedata/src/client/delete_user.rs new file mode 100644 index 000000000000..34d76decfa51 --- /dev/null +++ b/sdk/directoryservicedata/src/client/delete_user.rs @@ -0,0 +1,14 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`DeleteUser`](crate::operation::delete_user::builders::DeleteUserFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`directory_id(impl Into)`](crate::operation::delete_user::builders::DeleteUserFluentBuilder::directory_id) / [`set_directory_id(Option)`](crate::operation::delete_user::builders::DeleteUserFluentBuilder::set_directory_id):
      required: **true**

      The identifier (ID) of the directory that's associated with the user.


      + /// - [`sam_account_name(impl Into)`](crate::operation::delete_user::builders::DeleteUserFluentBuilder::sam_account_name) / [`set_sam_account_name(Option)`](crate::operation::delete_user::builders::DeleteUserFluentBuilder::set_sam_account_name):
      required: **true**

      The name of the user.


      + /// - [`client_token(impl Into)`](crate::operation::delete_user::builders::DeleteUserFluentBuilder::client_token) / [`set_client_token(Option)`](crate::operation::delete_user::builders::DeleteUserFluentBuilder::set_client_token):
      required: **false**

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      This parameter is optional when using the CLI or SDK.


      + /// - On success, responds with [`DeleteUserOutput`](crate::operation::delete_user::DeleteUserOutput) + /// - On failure, responds with [`SdkError`](crate::operation::delete_user::DeleteUserError) + pub fn delete_user(&self) -> crate::operation::delete_user::builders::DeleteUserFluentBuilder { + crate::operation::delete_user::builders::DeleteUserFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/directoryservicedata/src/client/describe_group.rs b/sdk/directoryservicedata/src/client/describe_group.rs new file mode 100644 index 000000000000..abfba0ded196 --- /dev/null +++ b/sdk/directoryservicedata/src/client/describe_group.rs @@ -0,0 +1,23 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`DescribeGroup`](crate::operation::describe_group::builders::DescribeGroupFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`directory_id(impl Into)`](crate::operation::describe_group::builders::DescribeGroupFluentBuilder::directory_id) / [`set_directory_id(Option)`](crate::operation::describe_group::builders::DescribeGroupFluentBuilder::set_directory_id):
      required: **true**

      The Identifier (ID) of the directory associated with the group.


      + /// - [`realm(impl Into)`](crate::operation::describe_group::builders::DescribeGroupFluentBuilder::realm) / [`set_realm(Option)`](crate::operation::describe_group::builders::DescribeGroupFluentBuilder::set_realm):
      required: **false**

      The domain name that's associated with the group.

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      This value is case insensitive.


      + /// - [`sam_account_name(impl Into)`](crate::operation::describe_group::builders::DescribeGroupFluentBuilder::sam_account_name) / [`set_sam_account_name(Option)`](crate::operation::describe_group::builders::DescribeGroupFluentBuilder::set_sam_account_name):
      required: **true**

      The name of the group.


      + /// - [`other_attributes(impl Into)`](crate::operation::describe_group::builders::DescribeGroupFluentBuilder::other_attributes) / [`set_other_attributes(Option>)`](crate::operation::describe_group::builders::DescribeGroupFluentBuilder::set_other_attributes):
      required: **false**

      One or more attributes to be returned for the group. For a list of supported attributes, see Directory Service Data Attributes.


      + /// - On success, responds with [`DescribeGroupOutput`](crate::operation::describe_group::DescribeGroupOutput) with field(s): + /// - [`directory_id(Option)`](crate::operation::describe_group::DescribeGroupOutput::directory_id):

      The identifier (ID) of the directory that's associated with the group.

      + /// - [`realm(Option)`](crate::operation::describe_group::DescribeGroupOutput::realm):

      The domain name that's associated with the group.

      + /// - [`sid(Option)`](crate::operation::describe_group::DescribeGroupOutput::sid):

      The unique security identifier (SID) of the group.

      + /// - [`sam_account_name(Option)`](crate::operation::describe_group::DescribeGroupOutput::sam_account_name):

      The name of the group.

      + /// - [`distinguished_name(Option)`](crate::operation::describe_group::DescribeGroupOutput::distinguished_name):

      The distinguished name of the object.

      + /// - [`group_type(Option)`](crate::operation::describe_group::DescribeGroupOutput::group_type):

      The AD group type. For details, see Active Directory security group type.

      + /// - [`group_scope(Option)`](crate::operation::describe_group::DescribeGroupOutput::group_scope):

      The scope of the AD group. For details, see Active Directory security groups.

      + /// - [`other_attributes(Option>)`](crate::operation::describe_group::DescribeGroupOutput::other_attributes):

      The attribute values that are returned for the attribute names that are included in the request.

      + /// - On failure, responds with [`SdkError`](crate::operation::describe_group::DescribeGroupError) + pub fn describe_group(&self) -> crate::operation::describe_group::builders::DescribeGroupFluentBuilder { + crate::operation::describe_group::builders::DescribeGroupFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/directoryservicedata/src/client/describe_user.rs b/sdk/directoryservicedata/src/client/describe_user.rs new file mode 100644 index 000000000000..77af8363e3fa --- /dev/null +++ b/sdk/directoryservicedata/src/client/describe_user.rs @@ -0,0 +1,26 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`DescribeUser`](crate::operation::describe_user::builders::DescribeUserFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`directory_id(impl Into)`](crate::operation::describe_user::builders::DescribeUserFluentBuilder::directory_id) / [`set_directory_id(Option)`](crate::operation::describe_user::builders::DescribeUserFluentBuilder::set_directory_id):
      required: **true**

      The identifier (ID) of the directory that's associated with the user.


      + /// - [`sam_account_name(impl Into)`](crate::operation::describe_user::builders::DescribeUserFluentBuilder::sam_account_name) / [`set_sam_account_name(Option)`](crate::operation::describe_user::builders::DescribeUserFluentBuilder::set_sam_account_name):
      required: **true**

      The name of the user.


      + /// - [`other_attributes(impl Into)`](crate::operation::describe_user::builders::DescribeUserFluentBuilder::other_attributes) / [`set_other_attributes(Option>)`](crate::operation::describe_user::builders::DescribeUserFluentBuilder::set_other_attributes):
      required: **false**

      One or more attribute names to be returned for the user. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.


      + /// - [`realm(impl Into)`](crate::operation::describe_user::builders::DescribeUserFluentBuilder::realm) / [`set_realm(Option)`](crate::operation::describe_user::builders::DescribeUserFluentBuilder::set_realm):
      required: **false**

      The domain name that's associated with the user.

      This parameter is optional, so you can return users outside your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.

      This value is case insensitive.


      + /// - On success, responds with [`DescribeUserOutput`](crate::operation::describe_user::DescribeUserOutput) with field(s): + /// - [`directory_id(Option)`](crate::operation::describe_user::DescribeUserOutput::directory_id):

      The identifier (ID) of the directory that's associated with the user.

      + /// - [`realm(Option)`](crate::operation::describe_user::DescribeUserOutput::realm):

      The domain name that's associated with the user.

      + /// - [`sid(Option)`](crate::operation::describe_user::DescribeUserOutput::sid):

      The unique security identifier (SID) of the user.

      + /// - [`sam_account_name(Option)`](crate::operation::describe_user::DescribeUserOutput::sam_account_name):

      The name of the user.

      + /// - [`distinguished_name(Option)`](crate::operation::describe_user::DescribeUserOutput::distinguished_name):

      The distinguished name of the object.

      + /// - [`user_principal_name(Option)`](crate::operation::describe_user::DescribeUserOutput::user_principal_name):

      The UPN that is an Internet-style login name for a user and is based on the Internet standard RFC 822. The UPN is shorter than the distinguished name and easier to remember.

      + /// - [`email_address(Option)`](crate::operation::describe_user::DescribeUserOutput::email_address):

      The email address of the user.

      + /// - [`given_name(Option)`](crate::operation::describe_user::DescribeUserOutput::given_name):

      The first name of the user.

      + /// - [`surname(Option)`](crate::operation::describe_user::DescribeUserOutput::surname):

      The last name of the user.

      + /// - [`enabled(Option)`](crate::operation::describe_user::DescribeUserOutput::enabled):

      Indicates whether the user account is active.

      + /// - [`other_attributes(Option>)`](crate::operation::describe_user::DescribeUserOutput::other_attributes):

      The attribute values that are returned for the attribute names that are included in the request.

      Attribute names are case insensitive.

      + /// - On failure, responds with [`SdkError`](crate::operation::describe_user::DescribeUserError) + pub fn describe_user(&self) -> crate::operation::describe_user::builders::DescribeUserFluentBuilder { + crate::operation::describe_user::builders::DescribeUserFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/directoryservicedata/src/client/disable_user.rs b/sdk/directoryservicedata/src/client/disable_user.rs new file mode 100644 index 000000000000..75eee885ccd1 --- /dev/null +++ b/sdk/directoryservicedata/src/client/disable_user.rs @@ -0,0 +1,14 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`DisableUser`](crate::operation::disable_user::builders::DisableUserFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`directory_id(impl Into)`](crate::operation::disable_user::builders::DisableUserFluentBuilder::directory_id) / [`set_directory_id(Option)`](crate::operation::disable_user::builders::DisableUserFluentBuilder::set_directory_id):
      required: **true**

      The identifier (ID) of the directory that's associated with the user.


      + /// - [`sam_account_name(impl Into)`](crate::operation::disable_user::builders::DisableUserFluentBuilder::sam_account_name) / [`set_sam_account_name(Option)`](crate::operation::disable_user::builders::DisableUserFluentBuilder::set_sam_account_name):
      required: **true**

      The name of the user.


      + /// - [`client_token(impl Into)`](crate::operation::disable_user::builders::DisableUserFluentBuilder::client_token) / [`set_client_token(Option)`](crate::operation::disable_user::builders::DisableUserFluentBuilder::set_client_token):
      required: **false**

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      This parameter is optional when using the CLI or SDK.


      + /// - On success, responds with [`DisableUserOutput`](crate::operation::disable_user::DisableUserOutput) + /// - On failure, responds with [`SdkError`](crate::operation::disable_user::DisableUserError) + pub fn disable_user(&self) -> crate::operation::disable_user::builders::DisableUserFluentBuilder { + crate::operation::disable_user::builders::DisableUserFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/directoryservicedata/src/client/list_group_members.rs b/sdk/directoryservicedata/src/client/list_group_members.rs new file mode 100644 index 000000000000..0862d0e7387b --- /dev/null +++ b/sdk/directoryservicedata/src/client/list_group_members.rs @@ -0,0 +1,23 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`ListGroupMembers`](crate::operation::list_group_members::builders::ListGroupMembersFluentBuilder) operation. + /// This operation supports pagination; See [`into_paginator()`](crate::operation::list_group_members::builders::ListGroupMembersFluentBuilder::into_paginator). + /// + /// - The fluent builder is configurable: + /// - [`directory_id(impl Into)`](crate::operation::list_group_members::builders::ListGroupMembersFluentBuilder::directory_id) / [`set_directory_id(Option)`](crate::operation::list_group_members::builders::ListGroupMembersFluentBuilder::set_directory_id):
      required: **true**

      The identifier (ID) of the directory that's associated with the group.


      + /// - [`realm(impl Into)`](crate::operation::list_group_members::builders::ListGroupMembersFluentBuilder::realm) / [`set_realm(Option)`](crate::operation::list_group_members::builders::ListGroupMembersFluentBuilder::set_realm):
      required: **false**

      The domain name that's associated with the group.

      This parameter is optional, so you can return members from a group outside of your Managed Microsoft AD domain. When no value is defined, only members of your Managed Microsoft AD groups are returned.

      This value is case insensitive.


      + /// - [`member_realm(impl Into)`](crate::operation::list_group_members::builders::ListGroupMembersFluentBuilder::member_realm) / [`set_member_realm(Option)`](crate::operation::list_group_members::builders::ListGroupMembersFluentBuilder::set_member_realm):
      required: **false**

      The domain name that's associated with the group member. This parameter defaults to the Managed Microsoft AD domain.

      This parameter is optional and case insensitive.


      + /// - [`sam_account_name(impl Into)`](crate::operation::list_group_members::builders::ListGroupMembersFluentBuilder::sam_account_name) / [`set_sam_account_name(Option)`](crate::operation::list_group_members::builders::ListGroupMembersFluentBuilder::set_sam_account_name):
      required: **true**

      The name of the group.


      + /// - [`next_token(impl Into)`](crate::operation::list_group_members::builders::ListGroupMembersFluentBuilder::next_token) / [`set_next_token(Option)`](crate::operation::list_group_members::builders::ListGroupMembersFluentBuilder::set_next_token):
      required: **false**

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.


      + /// - [`max_results(i32)`](crate::operation::list_group_members::builders::ListGroupMembersFluentBuilder::max_results) / [`set_max_results(Option)`](crate::operation::list_group_members::builders::ListGroupMembersFluentBuilder::set_max_results):
      required: **false**

      The maximum number of results to be returned per request.


      + /// - On success, responds with [`ListGroupMembersOutput`](crate::operation::list_group_members::ListGroupMembersOutput) with field(s): + /// - [`directory_id(Option)`](crate::operation::list_group_members::ListGroupMembersOutput::directory_id):

      Identifier (ID) of the directory associated with the group.

      + /// - [`realm(Option)`](crate::operation::list_group_members::ListGroupMembersOutput::realm):

      The domain name that's associated with the group.

      + /// - [`member_realm(Option)`](crate::operation::list_group_members::ListGroupMembersOutput::member_realm):

      The domain name that's associated with the member.

      + /// - [`members(Option>)`](crate::operation::list_group_members::ListGroupMembersOutput::members):

      The member information that the request returns.

      + /// - [`next_token(Option)`](crate::operation::list_group_members::ListGroupMembersOutput::next_token):

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + /// - On failure, responds with [`SdkError`](crate::operation::list_group_members::ListGroupMembersError) + pub fn list_group_members(&self) -> crate::operation::list_group_members::builders::ListGroupMembersFluentBuilder { + crate::operation::list_group_members::builders::ListGroupMembersFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/directoryservicedata/src/client/list_groups.rs b/sdk/directoryservicedata/src/client/list_groups.rs new file mode 100644 index 000000000000..d01f4d55af98 --- /dev/null +++ b/sdk/directoryservicedata/src/client/list_groups.rs @@ -0,0 +1,20 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`ListGroups`](crate::operation::list_groups::builders::ListGroupsFluentBuilder) operation. + /// This operation supports pagination; See [`into_paginator()`](crate::operation::list_groups::builders::ListGroupsFluentBuilder::into_paginator). + /// + /// - The fluent builder is configurable: + /// - [`directory_id(impl Into)`](crate::operation::list_groups::builders::ListGroupsFluentBuilder::directory_id) / [`set_directory_id(Option)`](crate::operation::list_groups::builders::ListGroupsFluentBuilder::set_directory_id):
      required: **true**

      The identifier (ID) of the directory that's associated with the group.


      + /// - [`realm(impl Into)`](crate::operation::list_groups::builders::ListGroupsFluentBuilder::realm) / [`set_realm(Option)`](crate::operation::list_groups::builders::ListGroupsFluentBuilder::set_realm):
      required: **false**

      The domain name associated with the directory.

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      This value is case insensitive.


      + /// - [`next_token(impl Into)`](crate::operation::list_groups::builders::ListGroupsFluentBuilder::next_token) / [`set_next_token(Option)`](crate::operation::list_groups::builders::ListGroupsFluentBuilder::set_next_token):
      required: **false**

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.


      + /// - [`max_results(i32)`](crate::operation::list_groups::builders::ListGroupsFluentBuilder::max_results) / [`set_max_results(Option)`](crate::operation::list_groups::builders::ListGroupsFluentBuilder::set_max_results):
      required: **false**

      The maximum number of results to be returned per request.


      + /// - On success, responds with [`ListGroupsOutput`](crate::operation::list_groups::ListGroupsOutput) with field(s): + /// - [`directory_id(Option)`](crate::operation::list_groups::ListGroupsOutput::directory_id):

      The identifier (ID) of the directory that's associated with the group.

      + /// - [`realm(Option)`](crate::operation::list_groups::ListGroupsOutput::realm):

      The domain name associated with the group.

      + /// - [`groups(Option>)`](crate::operation::list_groups::ListGroupsOutput::groups):

      The group information that the request returns.

      + /// - [`next_token(Option)`](crate::operation::list_groups::ListGroupsOutput::next_token):

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + /// - On failure, responds with [`SdkError`](crate::operation::list_groups::ListGroupsError) + pub fn list_groups(&self) -> crate::operation::list_groups::builders::ListGroupsFluentBuilder { + crate::operation::list_groups::builders::ListGroupsFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/directoryservicedata/src/client/list_groups_for_member.rs b/sdk/directoryservicedata/src/client/list_groups_for_member.rs new file mode 100644 index 000000000000..5cbd7fd61e71 --- /dev/null +++ b/sdk/directoryservicedata/src/client/list_groups_for_member.rs @@ -0,0 +1,23 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`ListGroupsForMember`](crate::operation::list_groups_for_member::builders::ListGroupsForMemberFluentBuilder) operation. + /// This operation supports pagination; See [`into_paginator()`](crate::operation::list_groups_for_member::builders::ListGroupsForMemberFluentBuilder::into_paginator). + /// + /// - The fluent builder is configurable: + /// - [`directory_id(impl Into)`](crate::operation::list_groups_for_member::builders::ListGroupsForMemberFluentBuilder::directory_id) / [`set_directory_id(Option)`](crate::operation::list_groups_for_member::builders::ListGroupsForMemberFluentBuilder::set_directory_id):
      required: **true**

      The identifier (ID) of the directory that's associated with the member.


      + /// - [`realm(impl Into)`](crate::operation::list_groups_for_member::builders::ListGroupsForMemberFluentBuilder::realm) / [`set_realm(Option)`](crate::operation::list_groups_for_member::builders::ListGroupsForMemberFluentBuilder::set_realm):
      required: **false**

      The domain name that's associated with the group.

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      This value is case insensitive and defaults to your Managed Microsoft AD domain.


      + /// - [`member_realm(impl Into)`](crate::operation::list_groups_for_member::builders::ListGroupsForMemberFluentBuilder::member_realm) / [`set_member_realm(Option)`](crate::operation::list_groups_for_member::builders::ListGroupsForMemberFluentBuilder::set_member_realm):
      required: **false**

      The domain name that's associated with the group member.

      This parameter is optional, so you can limit your results to the group members in a specific domain.

      This parameter is case insensitive and defaults to Realm


      + /// - [`sam_account_name(impl Into)`](crate::operation::list_groups_for_member::builders::ListGroupsForMemberFluentBuilder::sam_account_name) / [`set_sam_account_name(Option)`](crate::operation::list_groups_for_member::builders::ListGroupsForMemberFluentBuilder::set_sam_account_name):
      required: **true**

      The SAMAccountName of the user, group, or computer that's a member of the group.


      + /// - [`next_token(impl Into)`](crate::operation::list_groups_for_member::builders::ListGroupsForMemberFluentBuilder::next_token) / [`set_next_token(Option)`](crate::operation::list_groups_for_member::builders::ListGroupsForMemberFluentBuilder::set_next_token):
      required: **false**

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.


      + /// - [`max_results(i32)`](crate::operation::list_groups_for_member::builders::ListGroupsForMemberFluentBuilder::max_results) / [`set_max_results(Option)`](crate::operation::list_groups_for_member::builders::ListGroupsForMemberFluentBuilder::set_max_results):
      required: **false**

      The maximum number of results to be returned per request.


      + /// - On success, responds with [`ListGroupsForMemberOutput`](crate::operation::list_groups_for_member::ListGroupsForMemberOutput) with field(s): + /// - [`directory_id(Option)`](crate::operation::list_groups_for_member::ListGroupsForMemberOutput::directory_id):

      The identifier (ID) of the directory that's associated with the member.

      + /// - [`realm(Option)`](crate::operation::list_groups_for_member::ListGroupsForMemberOutput::realm):

      The domain that's associated with the group.

      + /// - [`member_realm(Option)`](crate::operation::list_groups_for_member::ListGroupsForMemberOutput::member_realm):

      The domain that's associated with the member.

      + /// - [`groups(Option>)`](crate::operation::list_groups_for_member::ListGroupsForMemberOutput::groups):

      The group information that the request returns.

      + /// - [`next_token(Option)`](crate::operation::list_groups_for_member::ListGroupsForMemberOutput::next_token):

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + /// - On failure, responds with [`SdkError`](crate::operation::list_groups_for_member::ListGroupsForMemberError) + pub fn list_groups_for_member(&self) -> crate::operation::list_groups_for_member::builders::ListGroupsForMemberFluentBuilder { + crate::operation::list_groups_for_member::builders::ListGroupsForMemberFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/directoryservicedata/src/client/list_users.rs b/sdk/directoryservicedata/src/client/list_users.rs new file mode 100644 index 000000000000..81660d5ab2d6 --- /dev/null +++ b/sdk/directoryservicedata/src/client/list_users.rs @@ -0,0 +1,20 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`ListUsers`](crate::operation::list_users::builders::ListUsersFluentBuilder) operation. + /// This operation supports pagination; See [`into_paginator()`](crate::operation::list_users::builders::ListUsersFluentBuilder::into_paginator). + /// + /// - The fluent builder is configurable: + /// - [`directory_id(impl Into)`](crate::operation::list_users::builders::ListUsersFluentBuilder::directory_id) / [`set_directory_id(Option)`](crate::operation::list_users::builders::ListUsersFluentBuilder::set_directory_id):
      required: **true**

      The identifier (ID) of the directory that's associated with the user.


      + /// - [`realm(impl Into)`](crate::operation::list_users::builders::ListUsersFluentBuilder::realm) / [`set_realm(Option)`](crate::operation::list_users::builders::ListUsersFluentBuilder::set_realm):
      required: **false**

      The domain name that's associated with the user.

      This parameter is optional, so you can return users outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.

      This value is case insensitive.


      + /// - [`next_token(impl Into)`](crate::operation::list_users::builders::ListUsersFluentBuilder::next_token) / [`set_next_token(Option)`](crate::operation::list_users::builders::ListUsersFluentBuilder::set_next_token):
      required: **false**

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.


      + /// - [`max_results(i32)`](crate::operation::list_users::builders::ListUsersFluentBuilder::max_results) / [`set_max_results(Option)`](crate::operation::list_users::builders::ListUsersFluentBuilder::set_max_results):
      required: **false**

      The maximum number of results to be returned per request.


      + /// - On success, responds with [`ListUsersOutput`](crate::operation::list_users::ListUsersOutput) with field(s): + /// - [`directory_id(Option)`](crate::operation::list_users::ListUsersOutput::directory_id):

      The identifier (ID) of the directory that's associated with the user.

      + /// - [`realm(Option)`](crate::operation::list_users::ListUsersOutput::realm):

      The domain that's associated with the user.

      + /// - [`users(Option>)`](crate::operation::list_users::ListUsersOutput::users):

      The user information that the request returns.

      + /// - [`next_token(Option)`](crate::operation::list_users::ListUsersOutput::next_token):

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + /// - On failure, responds with [`SdkError`](crate::operation::list_users::ListUsersError) + pub fn list_users(&self) -> crate::operation::list_users::builders::ListUsersFluentBuilder { + crate::operation::list_users::builders::ListUsersFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/directoryservicedata/src/client/remove_group_member.rs b/sdk/directoryservicedata/src/client/remove_group_member.rs new file mode 100644 index 000000000000..6ff255aa1a41 --- /dev/null +++ b/sdk/directoryservicedata/src/client/remove_group_member.rs @@ -0,0 +1,16 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`RemoveGroupMember`](crate::operation::remove_group_member::builders::RemoveGroupMemberFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`directory_id(impl Into)`](crate::operation::remove_group_member::builders::RemoveGroupMemberFluentBuilder::directory_id) / [`set_directory_id(Option)`](crate::operation::remove_group_member::builders::RemoveGroupMemberFluentBuilder::set_directory_id):
      required: **true**

      The identifier (ID) of the directory that's associated with the member.


      + /// - [`group_name(impl Into)`](crate::operation::remove_group_member::builders::RemoveGroupMemberFluentBuilder::group_name) / [`set_group_name(Option)`](crate::operation::remove_group_member::builders::RemoveGroupMemberFluentBuilder::set_group_name):
      required: **true**

      The name of the group.


      + /// - [`member_name(impl Into)`](crate::operation::remove_group_member::builders::RemoveGroupMemberFluentBuilder::member_name) / [`set_member_name(Option)`](crate::operation::remove_group_member::builders::RemoveGroupMemberFluentBuilder::set_member_name):
      required: **true**

      The SAMAccountName of the user, group, or computer to remove from the group.


      + /// - [`member_realm(impl Into)`](crate::operation::remove_group_member::builders::RemoveGroupMemberFluentBuilder::member_realm) / [`set_member_realm(Option)`](crate::operation::remove_group_member::builders::RemoveGroupMemberFluentBuilder::set_member_realm):
      required: **false**

      The domain name that's associated with the group member. This parameter defaults to the Managed Microsoft AD domain.

      This parameter is optional and case insensitive.


      + /// - [`client_token(impl Into)`](crate::operation::remove_group_member::builders::RemoveGroupMemberFluentBuilder::client_token) / [`set_client_token(Option)`](crate::operation::remove_group_member::builders::RemoveGroupMemberFluentBuilder::set_client_token):
      required: **false**

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      This parameter is optional when using the CLI or SDK.


      + /// - On success, responds with [`RemoveGroupMemberOutput`](crate::operation::remove_group_member::RemoveGroupMemberOutput) + /// - On failure, responds with [`SdkError`](crate::operation::remove_group_member::RemoveGroupMemberError) + pub fn remove_group_member(&self) -> crate::operation::remove_group_member::builders::RemoveGroupMemberFluentBuilder { + crate::operation::remove_group_member::builders::RemoveGroupMemberFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/directoryservicedata/src/client/search_groups.rs b/sdk/directoryservicedata/src/client/search_groups.rs new file mode 100644 index 000000000000..c5156256ed4c --- /dev/null +++ b/sdk/directoryservicedata/src/client/search_groups.rs @@ -0,0 +1,22 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`SearchGroups`](crate::operation::search_groups::builders::SearchGroupsFluentBuilder) operation. + /// This operation supports pagination; See [`into_paginator()`](crate::operation::search_groups::builders::SearchGroupsFluentBuilder::into_paginator). + /// + /// - The fluent builder is configurable: + /// - [`directory_id(impl Into)`](crate::operation::search_groups::builders::SearchGroupsFluentBuilder::directory_id) / [`set_directory_id(Option)`](crate::operation::search_groups::builders::SearchGroupsFluentBuilder::set_directory_id):
      required: **true**

      The identifier (ID) of the directory that's associated with the group.


      + /// - [`search_string(impl Into)`](crate::operation::search_groups::builders::SearchGroupsFluentBuilder::search_string) / [`set_search_string(Option)`](crate::operation::search_groups::builders::SearchGroupsFluentBuilder::set_search_string):
      required: **true**

      The attribute value that you want to search for.

      Wildcard (*) searches aren't supported. For a list of supported attributes, see Directory Service Data Attributes.


      + /// - [`search_attributes(impl Into)`](crate::operation::search_groups::builders::SearchGroupsFluentBuilder::search_attributes) / [`set_search_attributes(Option>)`](crate::operation::search_groups::builders::SearchGroupsFluentBuilder::set_search_attributes):
      required: **true**

      One or more data attributes that are used to search for a group. For a list of supported attributes, see Directory Service Data Attributes.


      + /// - [`realm(impl Into)`](crate::operation::search_groups::builders::SearchGroupsFluentBuilder::realm) / [`set_realm(Option)`](crate::operation::search_groups::builders::SearchGroupsFluentBuilder::set_realm):
      required: **false**

      The domain name that's associated with the group.

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      This value is case insensitive.


      + /// - [`next_token(impl Into)`](crate::operation::search_groups::builders::SearchGroupsFluentBuilder::next_token) / [`set_next_token(Option)`](crate::operation::search_groups::builders::SearchGroupsFluentBuilder::set_next_token):
      required: **false**

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.


      + /// - [`max_results(i32)`](crate::operation::search_groups::builders::SearchGroupsFluentBuilder::max_results) / [`set_max_results(Option)`](crate::operation::search_groups::builders::SearchGroupsFluentBuilder::set_max_results):
      required: **false**

      The maximum number of results to be returned per request.


      + /// - On success, responds with [`SearchGroupsOutput`](crate::operation::search_groups::SearchGroupsOutput) with field(s): + /// - [`directory_id(Option)`](crate::operation::search_groups::SearchGroupsOutput::directory_id):

      The identifier (ID) of the directory that's associated with the group.

      + /// - [`realm(Option)`](crate::operation::search_groups::SearchGroupsOutput::realm):

      The domain that's associated with the group.

      + /// - [`groups(Option>)`](crate::operation::search_groups::SearchGroupsOutput::groups):

      The group information that the request returns.

      + /// - [`next_token(Option)`](crate::operation::search_groups::SearchGroupsOutput::next_token):

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + /// - On failure, responds with [`SdkError`](crate::operation::search_groups::SearchGroupsError) + pub fn search_groups(&self) -> crate::operation::search_groups::builders::SearchGroupsFluentBuilder { + crate::operation::search_groups::builders::SearchGroupsFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/directoryservicedata/src/client/search_users.rs b/sdk/directoryservicedata/src/client/search_users.rs new file mode 100644 index 000000000000..400750862bc0 --- /dev/null +++ b/sdk/directoryservicedata/src/client/search_users.rs @@ -0,0 +1,22 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`SearchUsers`](crate::operation::search_users::builders::SearchUsersFluentBuilder) operation. + /// This operation supports pagination; See [`into_paginator()`](crate::operation::search_users::builders::SearchUsersFluentBuilder::into_paginator). + /// + /// - The fluent builder is configurable: + /// - [`directory_id(impl Into)`](crate::operation::search_users::builders::SearchUsersFluentBuilder::directory_id) / [`set_directory_id(Option)`](crate::operation::search_users::builders::SearchUsersFluentBuilder::set_directory_id):
      required: **true**

      The identifier (ID) of the directory that's associated with the user.


      + /// - [`realm(impl Into)`](crate::operation::search_users::builders::SearchUsersFluentBuilder::realm) / [`set_realm(Option)`](crate::operation::search_users::builders::SearchUsersFluentBuilder::set_realm):
      required: **false**

      The domain name that's associated with the user.

      This parameter is optional, so you can return users outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.

      This value is case insensitive.


      + /// - [`search_string(impl Into)`](crate::operation::search_users::builders::SearchUsersFluentBuilder::search_string) / [`set_search_string(Option)`](crate::operation::search_users::builders::SearchUsersFluentBuilder::set_search_string):
      required: **true**

      The attribute value that you want to search for.

      Wildcard (*) searches aren't supported. For a list of supported attributes, see Directory Service Data Attributes.


      + /// - [`search_attributes(impl Into)`](crate::operation::search_users::builders::SearchUsersFluentBuilder::search_attributes) / [`set_search_attributes(Option>)`](crate::operation::search_users::builders::SearchUsersFluentBuilder::set_search_attributes):
      required: **true**

      One or more data attributes that are used to search for a user. For a list of supported attributes, see Directory Service Data Attributes.


      + /// - [`next_token(impl Into)`](crate::operation::search_users::builders::SearchUsersFluentBuilder::next_token) / [`set_next_token(Option)`](crate::operation::search_users::builders::SearchUsersFluentBuilder::set_next_token):
      required: **false**

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.


      + /// - [`max_results(i32)`](crate::operation::search_users::builders::SearchUsersFluentBuilder::max_results) / [`set_max_results(Option)`](crate::operation::search_users::builders::SearchUsersFluentBuilder::set_max_results):
      required: **false**

      The maximum number of results to be returned per request.


      + /// - On success, responds with [`SearchUsersOutput`](crate::operation::search_users::SearchUsersOutput) with field(s): + /// - [`directory_id(Option)`](crate::operation::search_users::SearchUsersOutput::directory_id):

      The identifier (ID) of the directory where the address block is added.

      + /// - [`realm(Option)`](crate::operation::search_users::SearchUsersOutput::realm):

      The domain that's associated with the user.

      + /// - [`users(Option>)`](crate::operation::search_users::SearchUsersOutput::users):

      The user information that the request returns.

      + /// - [`next_token(Option)`](crate::operation::search_users::SearchUsersOutput::next_token):

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + /// - On failure, responds with [`SdkError`](crate::operation::search_users::SearchUsersError) + pub fn search_users(&self) -> crate::operation::search_users::builders::SearchUsersFluentBuilder { + crate::operation::search_users::builders::SearchUsersFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/directoryservicedata/src/client/update_group.rs b/sdk/directoryservicedata/src/client/update_group.rs new file mode 100644 index 000000000000..1f499c9937e5 --- /dev/null +++ b/sdk/directoryservicedata/src/client/update_group.rs @@ -0,0 +1,18 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`UpdateGroup`](crate::operation::update_group::builders::UpdateGroupFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`directory_id(impl Into)`](crate::operation::update_group::builders::UpdateGroupFluentBuilder::directory_id) / [`set_directory_id(Option)`](crate::operation::update_group::builders::UpdateGroupFluentBuilder::set_directory_id):
      required: **true**

      The identifier (ID) of the directory that's associated with the group.


      + /// - [`sam_account_name(impl Into)`](crate::operation::update_group::builders::UpdateGroupFluentBuilder::sam_account_name) / [`set_sam_account_name(Option)`](crate::operation::update_group::builders::UpdateGroupFluentBuilder::set_sam_account_name):
      required: **true**

      The name of the group.


      + /// - [`group_type(GroupType)`](crate::operation::update_group::builders::UpdateGroupFluentBuilder::group_type) / [`set_group_type(Option)`](crate::operation::update_group::builders::UpdateGroupFluentBuilder::set_group_type):
      required: **false**

      The AD group type. For details, see Active Directory security group type.


      + /// - [`group_scope(GroupScope)`](crate::operation::update_group::builders::UpdateGroupFluentBuilder::group_scope) / [`set_group_scope(Option)`](crate::operation::update_group::builders::UpdateGroupFluentBuilder::set_group_scope):
      required: **false**

      The scope of the AD group. For details, see Active Directory security groups.


      + /// - [`other_attributes(impl Into, AttributeValue)`](crate::operation::update_group::builders::UpdateGroupFluentBuilder::other_attributes) / [`set_other_attributes(Option>)`](crate::operation::update_group::builders::UpdateGroupFluentBuilder::set_other_attributes):
      required: **false**

      An expression that defines one or more attributes with the data type and the value of each attribute.


      + /// - [`update_type(UpdateType)`](crate::operation::update_group::builders::UpdateGroupFluentBuilder::update_type) / [`set_update_type(Option)`](crate::operation::update_group::builders::UpdateGroupFluentBuilder::set_update_type):
      required: **false**

      The type of update to be performed. If no value exists for the attribute, use ADD. Otherwise, use REPLACE to change an attribute value or REMOVE to clear the attribute value.


      + /// - [`client_token(impl Into)`](crate::operation::update_group::builders::UpdateGroupFluentBuilder::client_token) / [`set_client_token(Option)`](crate::operation::update_group::builders::UpdateGroupFluentBuilder::set_client_token):
      required: **false**

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      This parameter is optional when using the CLI or SDK.


      + /// - On success, responds with [`UpdateGroupOutput`](crate::operation::update_group::UpdateGroupOutput) + /// - On failure, responds with [`SdkError`](crate::operation::update_group::UpdateGroupError) + pub fn update_group(&self) -> crate::operation::update_group::builders::UpdateGroupFluentBuilder { + crate::operation::update_group::builders::UpdateGroupFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/directoryservicedata/src/client/update_user.rs b/sdk/directoryservicedata/src/client/update_user.rs new file mode 100644 index 000000000000..6d136589bf91 --- /dev/null +++ b/sdk/directoryservicedata/src/client/update_user.rs @@ -0,0 +1,19 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +impl super::Client { + /// Constructs a fluent builder for the [`UpdateUser`](crate::operation::update_user::builders::UpdateUserFluentBuilder) operation. + /// + /// - The fluent builder is configurable: + /// - [`directory_id(impl Into)`](crate::operation::update_user::builders::UpdateUserFluentBuilder::directory_id) / [`set_directory_id(Option)`](crate::operation::update_user::builders::UpdateUserFluentBuilder::set_directory_id):
      required: **true**

      The identifier (ID) of the directory that's associated with the user.


      + /// - [`sam_account_name(impl Into)`](crate::operation::update_user::builders::UpdateUserFluentBuilder::sam_account_name) / [`set_sam_account_name(Option)`](crate::operation::update_user::builders::UpdateUserFluentBuilder::set_sam_account_name):
      required: **true**

      The name of the user.


      + /// - [`email_address(impl Into)`](crate::operation::update_user::builders::UpdateUserFluentBuilder::email_address) / [`set_email_address(Option)`](crate::operation::update_user::builders::UpdateUserFluentBuilder::set_email_address):
      required: **false**

      The email address of the user.


      + /// - [`given_name(impl Into)`](crate::operation::update_user::builders::UpdateUserFluentBuilder::given_name) / [`set_given_name(Option)`](crate::operation::update_user::builders::UpdateUserFluentBuilder::set_given_name):
      required: **false**

      The first name of the user.


      + /// - [`surname(impl Into)`](crate::operation::update_user::builders::UpdateUserFluentBuilder::surname) / [`set_surname(Option)`](crate::operation::update_user::builders::UpdateUserFluentBuilder::set_surname):
      required: **false**

      The last name of the user.


      + /// - [`other_attributes(impl Into, AttributeValue)`](crate::operation::update_user::builders::UpdateUserFluentBuilder::other_attributes) / [`set_other_attributes(Option>)`](crate::operation::update_user::builders::UpdateUserFluentBuilder::set_other_attributes):
      required: **false**

      An expression that defines one or more attribute names with the data type and value of each attribute. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.

      Attribute names are case insensitive.


      + /// - [`update_type(UpdateType)`](crate::operation::update_user::builders::UpdateUserFluentBuilder::update_type) / [`set_update_type(Option)`](crate::operation::update_user::builders::UpdateUserFluentBuilder::set_update_type):
      required: **false**

      The type of update to be performed. If no value exists for the attribute, use ADD. Otherwise, use REPLACE to change an attribute value or REMOVE to clear the attribute value.


      + /// - [`client_token(impl Into)`](crate::operation::update_user::builders::UpdateUserFluentBuilder::client_token) / [`set_client_token(Option)`](crate::operation::update_user::builders::UpdateUserFluentBuilder::set_client_token):
      required: **false**

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      This parameter is optional when using the CLI or SDK.


      + /// - On success, responds with [`UpdateUserOutput`](crate::operation::update_user::UpdateUserOutput) + /// - On failure, responds with [`SdkError`](crate::operation::update_user::UpdateUserError) + pub fn update_user(&self) -> crate::operation::update_user::builders::UpdateUserFluentBuilder { + crate::operation::update_user::builders::UpdateUserFluentBuilder::new(self.handle.clone()) + } +} diff --git a/sdk/directoryservicedata/src/client_idempotency_token.rs b/sdk/directoryservicedata/src/client_idempotency_token.rs new file mode 100644 index 000000000000..e6cbb8442e82 --- /dev/null +++ b/sdk/directoryservicedata/src/client_idempotency_token.rs @@ -0,0 +1,73 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +use std::borrow::Cow; +use std::fmt; + +use aws_smithy_runtime_api::box_error::BoxError; +use aws_smithy_runtime_api::client::interceptors::context::{BeforeSerializationInterceptorContextMut, Input}; +use aws_smithy_runtime_api::client::interceptors::{Intercept, SharedInterceptor}; +use aws_smithy_runtime_api::client::runtime_components::{RuntimeComponents, RuntimeComponentsBuilder}; +use aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin; +use aws_smithy_types::config_bag::ConfigBag; + +use crate::idempotency_token::IdempotencyTokenProvider; + +#[derive(Debug)] +pub(crate) struct IdempotencyTokenRuntimePlugin { + runtime_components: RuntimeComponentsBuilder, +} + +impl IdempotencyTokenRuntimePlugin { + pub(crate) fn new(set_token: S) -> Self + where + S: Fn(IdempotencyTokenProvider, &mut Input) + Send + Sync + 'static, + { + Self { + runtime_components: RuntimeComponentsBuilder::new("IdempotencyTokenRuntimePlugin") + .with_interceptor(SharedInterceptor::new(IdempotencyTokenInterceptor { set_token })), + } + } +} + +impl RuntimePlugin for IdempotencyTokenRuntimePlugin { + fn runtime_components(&self, _: &RuntimeComponentsBuilder) -> Cow<'_, RuntimeComponentsBuilder> { + Cow::Borrowed(&self.runtime_components) + } +} + +struct IdempotencyTokenInterceptor { + set_token: S, +} + +impl fmt::Debug for IdempotencyTokenInterceptor { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("IdempotencyTokenInterceptor").finish() + } +} + +impl Intercept for IdempotencyTokenInterceptor +where + S: Fn(IdempotencyTokenProvider, &mut Input) + Send + Sync, +{ + fn name(&self) -> &'static str { + "IdempotencyTokenInterceptor" + } + + fn modify_before_serialization( + &self, + context: &mut BeforeSerializationInterceptorContextMut<'_>, + _runtime_components: &RuntimeComponents, + cfg: &mut ConfigBag, + ) -> Result<(), BoxError> { + let token_provider = cfg + .load::() + .expect("the idempotency provider must be set") + .clone(); + (self.set_token)(token_provider, context.input_mut()); + Ok(()) + } +} diff --git a/sdk/directoryservicedata/src/config.rs b/sdk/directoryservicedata/src/config.rs new file mode 100644 index 000000000000..ed5395154df9 --- /dev/null +++ b/sdk/directoryservicedata/src/config.rs @@ -0,0 +1,1371 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// Configuration for a aws_sdk_directoryservicedata service client. +/// +/// +/// Service configuration allows for customization of endpoints, region, credentials providers, +/// and retry configuration. Generally, it is constructed automatically for you from a shared +/// configuration loaded by the `aws-config` crate. For example: +/// +/// ```ignore +/// // Load a shared config from the environment +/// let shared_config = aws_config::from_env().load().await; +/// // The client constructor automatically converts the shared config into the service config +/// let client = Client::new(&shared_config); +/// ``` +/// +/// The service config can also be constructed manually using its builder. +/// +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct Config { + // Both `config` and `cloneable` are the same config, but the cloneable one + // is kept around so that it is possible to convert back into a builder. This can be + // optimized in the future. + pub(crate) config: crate::config::FrozenLayer, + cloneable: ::aws_smithy_types::config_bag::CloneableLayer, + pub(crate) runtime_components: crate::config::RuntimeComponentsBuilder, + pub(crate) runtime_plugins: ::std::vec::Vec, + behavior_version: ::std::option::Option, +} +impl Config { + /// Constructs a config builder. + pub fn builder() -> Builder { + Builder::default() + } + /// Converts this config back into a builder so that it can be tweaked. + pub fn to_builder(&self) -> Builder { + Builder { + config: self.cloneable.clone(), + runtime_components: self.runtime_components.clone(), + runtime_plugins: self.runtime_plugins.clone(), + behavior_version: self.behavior_version, + } + } + /// Return a reference to the stalled stream protection configuration contained in this config, if any. + pub fn stalled_stream_protection(&self) -> ::std::option::Option<&crate::config::StalledStreamProtectionConfig> { + self.config.load::() + } + /// Return the [`SharedHttpClient`](crate::config::SharedHttpClient) to use when making requests, if any. + pub fn http_client(&self) -> Option { + self.runtime_components.http_client() + } + /// Returns the endpoint resolver. + pub fn endpoint_resolver(&self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver { + self.runtime_components.endpoint_resolver().expect("resolver defaulted if not set") + } + /// Return a reference to the retry configuration contained in this config, if any. + pub fn retry_config(&self) -> ::std::option::Option<&::aws_smithy_types::retry::RetryConfig> { + self.config.load::<::aws_smithy_types::retry::RetryConfig>() + } + + /// Return a cloned shared async sleep implementation from this config, if any. + pub fn sleep_impl(&self) -> ::std::option::Option { + self.runtime_components.sleep_impl() + } + + /// Return a reference to the timeout configuration contained in this config, if any. + pub fn timeout_config(&self) -> ::std::option::Option<&::aws_smithy_types::timeout::TimeoutConfig> { + self.config.load::<::aws_smithy_types::timeout::TimeoutConfig>() + } + + /// Returns a reference to the retry partition contained in this config, if any. + /// + /// WARNING: This method is unstable and may be removed at any time. Do not rely on this + /// method for anything! + pub fn retry_partition(&self) -> ::std::option::Option<&::aws_smithy_runtime::client::retries::RetryPartition> { + self.config.load::<::aws_smithy_runtime::client::retries::RetryPartition>() + } + /// Returns the configured identity cache for auth. + pub fn identity_cache(&self) -> ::std::option::Option { + self.runtime_components.identity_cache() + } + /// Returns interceptors currently registered by the user. + pub fn interceptors(&self) -> impl Iterator + '_ { + self.runtime_components.interceptors() + } + /// Return time source used for this service. + pub fn time_source(&self) -> ::std::option::Option<::aws_smithy_async::time::SharedTimeSource> { + self.runtime_components.time_source() + } + /// Returns retry classifiers currently registered by the user. + pub fn retry_classifiers(&self) -> impl Iterator + '_ { + self.runtime_components.retry_classifiers() + } + /// Returns the name of the app that is using the client, if it was provided. + /// + /// This _optional_ name is used to identify the application in the user agent that + /// gets sent along with requests. + pub fn app_name(&self) -> ::std::option::Option<&::aws_types::app_name::AppName> { + self.config.load::<::aws_types::app_name::AppName>() + } + /// Returns the invocation ID generator if one was given in config. + /// + /// The invocation ID generator generates ID values for the `amz-sdk-invocation-id` header. By default, this will be a random UUID. Overriding it may be useful in tests that examine the HTTP request and need to be deterministic. + pub fn invocation_id_generator(&self) -> ::std::option::Option<::aws_runtime::invocation_id::SharedInvocationIdGenerator> { + self.config.load::<::aws_runtime::invocation_id::SharedInvocationIdGenerator>().cloned() + } + /// Creates a new [service config](crate::Config) from a [shared `config`](::aws_types::sdk_config::SdkConfig). + pub fn new(config: &::aws_types::sdk_config::SdkConfig) -> Self { + Builder::from(config).build() + } + /// The signature version 4 service signing name to use in the credential scope when signing requests. + /// + /// The signing service may be overridden by the `Endpoint`, or by specifying a custom + /// [`SigningName`](aws_types::SigningName) during operation construction + pub fn signing_name(&self) -> &'static str { + "ds-data" + } + /// Returns the AWS region, if it was provided. + pub fn region(&self) -> ::std::option::Option<&crate::config::Region> { + self.config.load::() + } + /// This function was intended to be removed, and has been broken since release-2023-11-15 as it always returns a `None`. Do not use. + #[deprecated( + note = "This function was intended to be removed, and has been broken since release-2023-11-15 as it always returns a `None`. Do not use." + )] + pub fn credentials_provider(&self) -> Option { + ::std::option::Option::None + } +} +/// Builder for creating a `Config`. +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct Builder { + pub(crate) config: ::aws_smithy_types::config_bag::CloneableLayer, + pub(crate) runtime_components: crate::config::RuntimeComponentsBuilder, + pub(crate) runtime_plugins: ::std::vec::Vec, + pub(crate) behavior_version: ::std::option::Option, +} +impl ::std::default::Default for Builder { + fn default() -> Self { + Self { + config: ::std::default::Default::default(), + runtime_components: crate::config::RuntimeComponentsBuilder::new("service config"), + runtime_plugins: ::std::default::Default::default(), + behavior_version: ::std::default::Default::default(), + } + } +} +impl Builder { + /// Constructs a config builder. + pub fn new() -> Self { + Self::default() + } + /// Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag, + /// but not those in runtime components. + #[allow(unused)] + pub(crate) fn from_config_bag(config_bag: &::aws_smithy_types::config_bag::ConfigBag) -> Self { + let mut builder = Self::new(); + builder.set_stalled_stream_protection(config_bag.load::().cloned()); + builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned()); + builder.set_timeout_config(config_bag.load::<::aws_smithy_types::timeout::TimeoutConfig>().cloned()); + builder.set_retry_partition(config_bag.load::<::aws_smithy_runtime::client::retries::RetryPartition>().cloned()); + builder.set_app_name(config_bag.load::<::aws_types::app_name::AppName>().cloned()); + builder.set_endpoint_url(config_bag.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())); + builder.set_use_dual_stack(config_bag.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)); + builder.set_use_fips(config_bag.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)); + builder.set_region(config_bag.load::().cloned()); + builder + } + /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig) + /// to configure protection for stalled streams. + pub fn stalled_stream_protection(mut self, stalled_stream_protection_config: crate::config::StalledStreamProtectionConfig) -> Self { + self.set_stalled_stream_protection(::std::option::Option::Some(stalled_stream_protection_config)); + self + } + /// Set the [`StalledStreamProtectionConfig`](crate::config::StalledStreamProtectionConfig) + /// to configure protection for stalled streams. + pub fn set_stalled_stream_protection( + &mut self, + stalled_stream_protection_config: ::std::option::Option, + ) -> &mut Self { + self.config.store_or_unset(stalled_stream_protection_config); + self + } + /// Sets the idempotency token provider to use for service calls that require tokens. + pub fn idempotency_token_provider( + mut self, + idempotency_token_provider: impl ::std::convert::Into, + ) -> Self { + self.set_idempotency_token_provider(::std::option::Option::Some(idempotency_token_provider.into())); + self + } + /// Sets the idempotency token provider to use for service calls that require tokens. + pub fn set_idempotency_token_provider( + &mut self, + idempotency_token_provider: ::std::option::Option, + ) -> &mut Self { + self.config.store_or_unset(idempotency_token_provider); + self + } + /// Sets the HTTP client to use when making requests. + /// + /// # Examples + /// ```no_run + /// # #[cfg(test)] + /// # mod tests { + /// # #[test] + /// # fn example() { + /// use std::time::Duration; + /// use aws_sdk_directoryservicedata::config::Config; + /// use aws_smithy_runtime::client::http::hyper_014::HyperClientBuilder; + /// + /// let https_connector = hyper_rustls::HttpsConnectorBuilder::new() + /// .with_webpki_roots() + /// .https_only() + /// .enable_http1() + /// .enable_http2() + /// .build(); + /// let hyper_client = HyperClientBuilder::new().build(https_connector); + /// + /// // This connector can then be given to a generated service Config + /// let config = my_service_client::Config::builder() + /// .endpoint_url("https://example.com") + /// .http_client(hyper_client) + /// .build(); + /// let client = my_service_client::Client::from_conf(config); + /// # } + /// # } + /// ``` + pub fn http_client(mut self, http_client: impl crate::config::HttpClient + 'static) -> Self { + self.set_http_client(::std::option::Option::Some(crate::config::IntoShared::into_shared(http_client))); + self + } + + /// Sets the HTTP client to use when making requests. + /// + /// # Examples + /// ```no_run + /// # #[cfg(test)] + /// # mod tests { + /// # #[test] + /// # fn example() { + /// use std::time::Duration; + /// use aws_sdk_directoryservicedata::config::{Builder, Config}; + /// use aws_smithy_runtime::client::http::hyper_014::HyperClientBuilder; + /// + /// fn override_http_client(builder: &mut Builder) { + /// let https_connector = hyper_rustls::HttpsConnectorBuilder::new() + /// .with_webpki_roots() + /// .https_only() + /// .enable_http1() + /// .enable_http2() + /// .build(); + /// let hyper_client = HyperClientBuilder::new().build(https_connector); + /// builder.set_http_client(Some(hyper_client)); + /// } + /// + /// let mut builder = aws_sdk_directoryservicedata::Config::builder(); + /// override_http_client(&mut builder); + /// let config = builder.build(); + /// # } + /// # } + /// ``` + pub fn set_http_client(&mut self, http_client: Option) -> &mut Self { + self.runtime_components.set_http_client(http_client); + self + } + /// Sets the endpoint resolver to use when making requests. + /// + + /// When unset, the client will used a generated endpoint resolver based on the endpoint resolution + /// rules for `aws_sdk_directoryservicedata`. + + /// + /// Note: setting an endpoint resolver will replace any endpoint URL that has been set. + /// This method accepts an endpoint resolver [specific to this service](crate::config::endpoint::ResolveEndpoint). If you want to + /// provide a shared endpoint resolver, use [`Self::set_endpoint_resolver`]. + /// + /// # Examples + /// Create a custom endpoint resolver that resolves a different endpoing per-stage, e.g. staging vs. production. + /// ```no_run + /// use aws_sdk_directoryservicedata::config::endpoint::{ResolveEndpoint, EndpointFuture, Params, Endpoint}; + /// #[derive(Debug)] + /// struct StageResolver { stage: String } + /// impl ResolveEndpoint for StageResolver { + /// fn resolve_endpoint(&self, params: &Params) -> EndpointFuture<'_> { + /// let stage = &self.stage; + /// EndpointFuture::ready(Ok(Endpoint::builder().url(format!("{stage}.myservice.com")).build())) + /// } + /// } + /// let resolver = StageResolver { stage: std::env::var("STAGE").unwrap() }; + /// let config = aws_sdk_directoryservicedata::Config::builder().endpoint_resolver(resolver).build(); + /// let client = aws_sdk_directoryservicedata::Client::from_conf(config); + /// ``` + pub fn endpoint_resolver(mut self, endpoint_resolver: impl crate::config::endpoint::ResolveEndpoint + 'static) -> Self { + self.set_endpoint_resolver(::std::option::Option::Some(endpoint_resolver.into_shared_resolver())); + self + } + + /// Sets the endpoint resolver to use when making requests. + /// + + /// When unset, the client will used a generated endpoint resolver based on the endpoint resolution + /// rules for `aws_sdk_directoryservicedata`. + pub fn set_endpoint_resolver( + &mut self, + endpoint_resolver: ::std::option::Option<::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver>, + ) -> &mut Self { + self.runtime_components.set_endpoint_resolver(endpoint_resolver); + self + } + /// Set the retry_config for the builder + /// + /// # Examples + /// ```no_run + /// use aws_sdk_directoryservicedata::config::Config; + /// use aws_sdk_directoryservicedata::config::retry::RetryConfig; + /// + /// let retry_config = RetryConfig::standard().with_max_attempts(5); + /// let config = Config::builder().retry_config(retry_config).build(); + /// ``` + pub fn retry_config(mut self, retry_config: ::aws_smithy_types::retry::RetryConfig) -> Self { + self.set_retry_config(Some(retry_config)); + self + } + + /// Set the retry_config for the builder + /// + /// # Examples + /// ```no_run + /// use aws_sdk_directoryservicedata::config::{Builder, Config}; + /// use aws_sdk_directoryservicedata::config::retry::RetryConfig; + /// + /// fn disable_retries(builder: &mut Builder) { + /// let retry_config = RetryConfig::standard().with_max_attempts(1); + /// builder.set_retry_config(Some(retry_config)); + /// } + /// + /// let mut builder = Config::builder(); + /// disable_retries(&mut builder); + /// let config = builder.build(); + /// ``` + pub fn set_retry_config(&mut self, retry_config: ::std::option::Option<::aws_smithy_types::retry::RetryConfig>) -> &mut Self { + retry_config.map(|r| self.config.store_put(r)); + self + } + /// Set the sleep_impl for the builder + /// + /// # Examples + /// + /// ```no_run + /// use aws_sdk_directoryservicedata::config::{AsyncSleep, Config, SharedAsyncSleep, Sleep}; + /// + /// #[derive(Debug)] + /// pub struct ForeverSleep; + /// + /// impl AsyncSleep for ForeverSleep { + /// fn sleep(&self, duration: std::time::Duration) -> Sleep { + /// Sleep::new(std::future::pending()) + /// } + /// } + /// + /// let sleep_impl = SharedAsyncSleep::new(ForeverSleep); + /// let config = Config::builder().sleep_impl(sleep_impl).build(); + /// ``` + pub fn sleep_impl(mut self, sleep_impl: impl crate::config::AsyncSleep + 'static) -> Self { + self.set_sleep_impl(Some(::aws_smithy_runtime_api::shared::IntoShared::into_shared(sleep_impl))); + self + } + + /// Set the sleep_impl for the builder + /// + /// # Examples + /// + /// ```no_run + /// use aws_sdk_directoryservicedata::config::{AsyncSleep, Builder, Config, SharedAsyncSleep, Sleep}; + /// + /// #[derive(Debug)] + /// pub struct ForeverSleep; + /// + /// impl AsyncSleep for ForeverSleep { + /// fn sleep(&self, duration: std::time::Duration) -> Sleep { + /// Sleep::new(std::future::pending()) + /// } + /// } + /// + /// fn set_never_ending_sleep_impl(builder: &mut Builder) { + /// let sleep_impl = SharedAsyncSleep::new(ForeverSleep); + /// builder.set_sleep_impl(Some(sleep_impl)); + /// } + /// + /// let mut builder = Config::builder(); + /// set_never_ending_sleep_impl(&mut builder); + /// let config = builder.build(); + /// ``` + pub fn set_sleep_impl(&mut self, sleep_impl: ::std::option::Option) -> &mut Self { + self.runtime_components.set_sleep_impl(sleep_impl); + self + } + /// Set the timeout_config for the builder + /// + /// # Examples + /// + /// ```no_run + /// # use std::time::Duration; + /// use aws_sdk_directoryservicedata::config::Config; + /// use aws_sdk_directoryservicedata::config::timeout::TimeoutConfig; + /// + /// let timeout_config = TimeoutConfig::builder() + /// .operation_attempt_timeout(Duration::from_secs(1)) + /// .build(); + /// let config = Config::builder().timeout_config(timeout_config).build(); + /// ``` + pub fn timeout_config(mut self, timeout_config: ::aws_smithy_types::timeout::TimeoutConfig) -> Self { + self.set_timeout_config(Some(timeout_config)); + self + } + + /// Set the timeout_config for the builder. + /// + /// Setting this to `None` has no effect if another source of configuration has set timeouts. If you + /// are attempting to disable timeouts, use [`TimeoutConfig::disabled`](::aws_smithy_types::timeout::TimeoutConfig::disabled) + /// + /// + /// # Examples + /// + /// ```no_run + /// # use std::time::Duration; + /// use aws_sdk_directoryservicedata::config::{Builder, Config}; + /// use aws_sdk_directoryservicedata::config::timeout::TimeoutConfig; + /// + /// fn set_request_timeout(builder: &mut Builder) { + /// let timeout_config = TimeoutConfig::builder() + /// .operation_attempt_timeout(Duration::from_secs(1)) + /// .build(); + /// builder.set_timeout_config(Some(timeout_config)); + /// } + /// + /// let mut builder = Config::builder(); + /// set_request_timeout(&mut builder); + /// let config = builder.build(); + /// ``` + pub fn set_timeout_config(&mut self, timeout_config: ::std::option::Option<::aws_smithy_types::timeout::TimeoutConfig>) -> &mut Self { + // passing None has no impact. + let Some(mut timeout_config) = timeout_config else { return self }; + + if let Some(base) = self.config.load::<::aws_smithy_types::timeout::TimeoutConfig>() { + timeout_config.take_defaults_from(base); + } + self.config.store_put(timeout_config); + self + } + /// Set the partition for retry-related state. When clients share a retry partition, they will + /// also share things like token buckets and client rate limiters. By default, all clients + /// for the same service will share a partition. + pub fn retry_partition(mut self, retry_partition: ::aws_smithy_runtime::client::retries::RetryPartition) -> Self { + self.set_retry_partition(Some(retry_partition)); + self + } + /// Set the partition for retry-related state. When clients share a retry partition, they will + /// also share things like token buckets and client rate limiters. By default, all clients + /// for the same service will share a partition. + pub fn set_retry_partition( + &mut self, + retry_partition: ::std::option::Option<::aws_smithy_runtime::client::retries::RetryPartition>, + ) -> &mut Self { + retry_partition.map(|r| self.config.store_put(r)); + self + } + /// Set the identity cache for auth. + /// + /// The identity cache defaults to a lazy caching implementation that will resolve + /// an identity when it is requested, and place it in the cache thereafter. Subsequent + /// requests will take the value from the cache while it is still valid. Once it expires, + /// the next request will result in refreshing the identity. + /// + /// This configuration allows you to disable or change the default caching mechanism. + /// To use a custom caching mechanism, implement the [`ResolveCachedIdentity`](crate::config::ResolveCachedIdentity) + /// trait and pass that implementation into this function. + /// + /// # Examples + /// + /// Disabling identity caching: + /// ```no_run + /// use aws_sdk_directoryservicedata::config::IdentityCache; + /// + /// let config = aws_sdk_directoryservicedata::Config::builder() + /// .identity_cache(IdentityCache::no_cache()) + /// // ... + /// .build(); + /// let client = aws_sdk_directoryservicedata::Client::from_conf(config); + /// ``` + /// + /// Customizing lazy caching: + /// ```no_run + /// use aws_sdk_directoryservicedata::config::IdentityCache; + /// use std::time::Duration; + /// + /// let config = aws_sdk_directoryservicedata::Config::builder() + /// .identity_cache( + /// IdentityCache::lazy() + /// // change the load timeout to 10 seconds + /// .load_timeout(Duration::from_secs(10)) + /// .build() + /// ) + /// // ... + /// .build(); + /// let client = aws_sdk_directoryservicedata::Client::from_conf(config); + /// ``` + + pub fn identity_cache(mut self, identity_cache: impl crate::config::ResolveCachedIdentity + 'static) -> Self { + self.set_identity_cache(identity_cache); + self + } + + /// Set the identity cache for auth. + /// + /// The identity cache defaults to a lazy caching implementation that will resolve + /// an identity when it is requested, and place it in the cache thereafter. Subsequent + /// requests will take the value from the cache while it is still valid. Once it expires, + /// the next request will result in refreshing the identity. + /// + /// This configuration allows you to disable or change the default caching mechanism. + /// To use a custom caching mechanism, implement the [`ResolveCachedIdentity`](crate::config::ResolveCachedIdentity) + /// trait and pass that implementation into this function. + /// + /// # Examples + /// + /// Disabling identity caching: + /// ```no_run + /// use aws_sdk_directoryservicedata::config::IdentityCache; + /// + /// let config = aws_sdk_directoryservicedata::Config::builder() + /// .identity_cache(IdentityCache::no_cache()) + /// // ... + /// .build(); + /// let client = aws_sdk_directoryservicedata::Client::from_conf(config); + /// ``` + /// + /// Customizing lazy caching: + /// ```no_run + /// use aws_sdk_directoryservicedata::config::IdentityCache; + /// use std::time::Duration; + /// + /// let config = aws_sdk_directoryservicedata::Config::builder() + /// .identity_cache( + /// IdentityCache::lazy() + /// // change the load timeout to 10 seconds + /// .load_timeout(Duration::from_secs(10)) + /// .build() + /// ) + /// // ... + /// .build(); + /// let client = aws_sdk_directoryservicedata::Client::from_conf(config); + /// ``` + + pub fn set_identity_cache(&mut self, identity_cache: impl crate::config::ResolveCachedIdentity + 'static) -> &mut Self { + self.runtime_components.set_identity_cache(::std::option::Option::Some(identity_cache)); + self + } + /// Add an [interceptor](crate::config::Intercept) that runs at specific stages of the request execution pipeline. + /// + /// Interceptors targeted at a certain stage are executed according to the pre-defined priority. + /// The SDK provides a default set of interceptors. An interceptor configured by this method + /// will run after those default interceptors. + /// + /// # Examples + /// ```no_run + /// # #[cfg(test)] + /// # mod tests { + /// # #[test] + /// # fn example() { + /// use aws_smithy_runtime_api::client::interceptors::context::phase::BeforeTransmit; + /// use aws_smithy_runtime_api::client::interceptors::{Interceptor, InterceptorContext}; + /// use aws_smithy_types::config_bag::ConfigBag; + /// use aws_sdk_directoryservicedata::config::Config; + /// + /// fn base_url() -> String { + /// // ... + /// # String::new() + /// } + /// + /// #[derive(Debug)] + /// pub struct UriModifierInterceptor; + /// impl Intercept for UriModifierInterceptor { + /// fn modify_before_signing( + /// &self, + /// context: &mut InterceptorContext, + /// _cfg: &mut ConfigBag, + /// ) -> Result<(), aws_smithy_runtime_api::client::interceptors::BoxError> { + /// let request = context.request_mut(); + /// let uri = format!("{}{}", base_url(), request.uri().path()); + /// *request.uri_mut() = uri.parse()?; + /// + /// Ok(()) + /// } + /// } + /// + /// let config = Config::builder() + /// .interceptor(UriModifierInterceptor) + /// .build(); + /// # } + /// # } + /// ``` + pub fn interceptor(mut self, interceptor: impl crate::config::Intercept + 'static) -> Self { + self.push_interceptor(crate::config::SharedInterceptor::new(interceptor)); + self + } + + /// Add a [`SharedInterceptor`](crate::config::SharedInterceptor) that runs at specific stages of the request execution pipeline. + /// + /// Interceptors targeted at a certain stage are executed according to the pre-defined priority. + /// The SDK provides a default set of interceptors. An interceptor configured by this method + /// will run after those default interceptors. + /// + /// # Examples + /// ```no_run + /// # #[cfg(test)] + /// # mod tests { + /// # #[test] + /// # fn example() { + /// use aws_smithy_runtime_api::client::interceptors::context::phase::BeforeTransmit; + /// use aws_smithy_runtime_api::client::interceptors::{Interceptor, InterceptorContext, SharedInterceptor}; + /// use aws_smithy_types::config_bag::ConfigBag; + /// use aws_sdk_directoryservicedata::config::{Builder, Config}; + /// + /// fn base_url() -> String { + /// // ... + /// # String::new() + /// } + /// + /// fn modify_request_uri(builder: &mut Builder) { + /// #[derive(Debug)] + /// pub struct UriModifierInterceptor; + /// impl Intercept for UriModifierInterceptor { + /// fn modify_before_signing( + /// &self, + /// context: &mut InterceptorContext, + /// _cfg: &mut ConfigBag, + /// ) -> Result<(), aws_smithy_runtime_api::client::interceptors::BoxError> { + /// let request = context.request_mut(); + /// let uri = format!("{}{}", base_url(), request.uri().path()); + /// *request.uri_mut() = uri.parse()?; + /// + /// Ok(()) + /// } + /// } + /// builder.push_interceptor(SharedInterceptor::new(UriModifierInterceptor)); + /// } + /// + /// let mut builder = Config::builder(); + /// modify_request_uri(&mut builder); + /// let config = builder.build(); + /// # } + /// # } + /// ``` + pub fn push_interceptor(&mut self, interceptor: crate::config::SharedInterceptor) -> &mut Self { + self.runtime_components.push_interceptor(interceptor); + self + } + + /// Set [`SharedInterceptor`](crate::config::SharedInterceptor)s for the builder. + pub fn set_interceptors(&mut self, interceptors: impl IntoIterator) -> &mut Self { + self.runtime_components.set_interceptors(interceptors.into_iter()); + self + } + /// Sets the time source used for this service + pub fn time_source(mut self, time_source: impl ::aws_smithy_async::time::TimeSource + 'static) -> Self { + self.set_time_source(::std::option::Option::Some(::aws_smithy_runtime_api::shared::IntoShared::into_shared( + time_source, + ))); + self + } + /// Sets the time source used for this service + pub fn set_time_source(&mut self, time_source: ::std::option::Option<::aws_smithy_async::time::SharedTimeSource>) -> &mut Self { + self.runtime_components.set_time_source(time_source); + self + } + /// Add type implementing [`ClassifyRetry`](::aws_smithy_runtime_api::client::retries::classifiers::ClassifyRetry) that will be used by the + /// [`RetryStrategy`](::aws_smithy_runtime_api::client::retries::RetryStrategy) to determine what responses should be retried. + /// + /// A retry classifier configured by this method will run according to its [priority](::aws_smithy_runtime_api::client::retries::classifiers::RetryClassifierPriority). + /// + /// # Examples + /// ```no_run + /// # #[cfg(test)] + /// # mod tests { + /// # #[test] + /// # fn example() { + /// use aws_smithy_runtime_api::client::interceptors::context::InterceptorContext; + /// use aws_smithy_runtime_api::client::orchestrator::OrchestratorError; + /// use aws_smithy_runtime_api::client::retries::classifiers::{ + /// ClassifyRetry, RetryAction, RetryClassifierPriority, + /// }; + /// use aws_smithy_types::error::metadata::ProvideErrorMetadata; + /// use aws_smithy_types::retry::ErrorKind; + /// use std::error::Error as StdError; + /// use std::marker::PhantomData; + /// use aws_sdk_directoryservicedata::config::Config; + /// # struct SomeOperationError {} + /// + /// const RETRYABLE_ERROR_CODES: &[&str] = [ + /// // List error codes to be retried here... + /// ]; + /// + /// // When classifying at an operation's error type, classifiers require a generic parameter. + /// // When classifying the HTTP response alone, no generic is needed. + /// #[derive(Debug, Default)] + /// pub struct ErrorCodeClassifier { + /// _inner: PhantomData, + /// } + /// + /// impl ExampleErrorCodeClassifier { + /// pub fn new() -> Self { + /// Self { + /// _inner: PhantomData, + /// } + /// } + /// } + /// + /// impl ClassifyRetry for ExampleErrorCodeClassifier + /// where + /// // Adding a trait bound for ProvideErrorMetadata allows us to inspect the error code. + /// E: StdError + ProvideErrorMetadata + Send + Sync + 'static, + /// { + /// fn classify_retry(&self, ctx: &InterceptorContext) -> RetryAction { + /// // Check for a result + /// let output_or_error = ctx.output_or_error(); + /// // Check for an error + /// let error = match output_or_error { + /// Some(Ok(_)) | None => return RetryAction::NoActionIndicated, + /// Some(Err(err)) => err, + /// }; + /// + /// // Downcast the generic error and extract the code + /// let error_code = OrchestratorError::as_operation_error(error) + /// .and_then(|err| err.downcast_ref::()) + /// .and_then(|err| err.code()); + /// + /// // If this error's code is in our list, return an action that tells the RetryStrategy to retry this request. + /// if let Some(error_code) = error_code { + /// if RETRYABLE_ERROR_CODES.contains(&error_code) { + /// return RetryAction::transient_error(); + /// } + /// } + /// + /// // Otherwise, return that no action is indicated i.e. that this classifier doesn't require a retry. + /// // Another classifier may still classify this response as retryable. + /// RetryAction::NoActionIndicated + /// } + /// + /// fn name(&self) -> &'static str { "Example Error Code Classifier" } + /// } + /// + /// let config = Config::builder() + /// .retry_classifier(ExampleErrorCodeClassifier::::new()) + /// .build(); + /// # } + /// # } + /// ``` + pub fn retry_classifier( + mut self, + retry_classifier: impl ::aws_smithy_runtime_api::client::retries::classifiers::ClassifyRetry + 'static, + ) -> Self { + self.push_retry_classifier(::aws_smithy_runtime_api::client::retries::classifiers::SharedRetryClassifier::new( + retry_classifier, + )); + self + } + + /// Add a [`SharedRetryClassifier`](::aws_smithy_runtime_api::client::retries::classifiers::SharedRetryClassifier) that will be used by the + /// [`RetryStrategy`](::aws_smithy_runtime_api::client::retries::RetryStrategy) to determine what responses should be retried. + /// + /// A retry classifier configured by this method will run according to its priority. + /// + /// # Examples + /// ```no_run + /// # #[cfg(test)] + /// # mod tests { + /// # #[test] + /// # fn example() { + /// use aws_smithy_runtime_api::client::interceptors::context::InterceptorContext; + /// use aws_smithy_runtime_api::client::orchestrator::OrchestratorError; + /// use aws_smithy_runtime_api::client::retries::classifiers::{ + /// ClassifyRetry, RetryAction, RetryClassifierPriority, + /// }; + /// use aws_smithy_types::error::metadata::ProvideErrorMetadata; + /// use aws_smithy_types::retry::ErrorKind; + /// use std::error::Error as StdError; + /// use std::marker::PhantomData; + /// use aws_sdk_directoryservicedata::config::{Builder, Config}; + /// # struct SomeOperationError {} + /// + /// const RETRYABLE_ERROR_CODES: &[&str] = [ + /// // List error codes to be retried here... + /// ]; + /// fn set_example_error_code_classifier(builder: &mut Builder) { + /// // When classifying at an operation's error type, classifiers require a generic parameter. + /// // When classifying the HTTP response alone, no generic is needed. + /// #[derive(Debug, Default)] + /// pub struct ExampleErrorCodeClassifier { + /// _inner: PhantomData, + /// } + /// + /// impl ExampleErrorCodeClassifier { + /// pub fn new() -> Self { + /// Self { + /// _inner: PhantomData, + /// } + /// } + /// } + /// + /// impl ClassifyRetry for ExampleErrorCodeClassifier + /// where + /// // Adding a trait bound for ProvideErrorMetadata allows us to inspect the error code. + /// E: StdError + ProvideErrorMetadata + Send + Sync + 'static, + /// { + /// fn classify_retry(&self, ctx: &InterceptorContext) -> RetryAction { + /// // Check for a result + /// let output_or_error = ctx.output_or_error(); + /// // Check for an error + /// let error = match output_or_error { + /// Some(Ok(_)) | None => return RetryAction::NoActionIndicated, + /// Some(Err(err)) => err, + /// }; + /// + /// // Downcast the generic error and extract the code + /// let error_code = OrchestratorError::as_operation_error(error) + /// .and_then(|err| err.downcast_ref::()) + /// .and_then(|err| err.code()); + /// + /// // If this error's code is in our list, return an action that tells the RetryStrategy to retry this request. + /// if let Some(error_code) = error_code { + /// if RETRYABLE_ERROR_CODES.contains(&error_code) { + /// return RetryAction::transient_error(); + /// } + /// } + /// + /// // Otherwise, return that no action is indicated i.e. that this classifier doesn't require a retry. + /// // Another classifier may still classify this response as retryable. + /// RetryAction::NoActionIndicated + /// } + /// + /// fn name(&self) -> &'static str { "Example Error Code Classifier" } + /// } + /// + /// builder.push_retry_classifier(ExampleErrorCodeClassifier::::new()) + /// } + /// + /// let mut builder = Config::builder(); + /// set_example_error_code_classifier(&mut builder); + /// let config = builder.build(); + /// # } + /// # } + /// ``` + pub fn push_retry_classifier( + &mut self, + retry_classifier: ::aws_smithy_runtime_api::client::retries::classifiers::SharedRetryClassifier, + ) -> &mut Self { + self.runtime_components.push_retry_classifier(retry_classifier); + self + } + + /// Set [`SharedRetryClassifier`](::aws_smithy_runtime_api::client::retries::classifiers::SharedRetryClassifier)s for the builder, replacing any that + /// were previously set. + pub fn set_retry_classifiers( + &mut self, + retry_classifiers: impl IntoIterator, + ) -> &mut Self { + self.runtime_components.set_retry_classifiers(retry_classifiers.into_iter()); + self + } + /// Sets the name of the app that is using the client. + /// + /// This _optional_ name is used to identify the application in the user agent that + /// gets sent along with requests. + pub fn app_name(mut self, app_name: ::aws_types::app_name::AppName) -> Self { + self.set_app_name(Some(app_name)); + self + } + /// Sets the name of the app that is using the client. + /// + /// This _optional_ name is used to identify the application in the user agent that + /// gets sent along with requests. + pub fn set_app_name(&mut self, app_name: ::std::option::Option<::aws_types::app_name::AppName>) -> &mut Self { + self.config.store_or_unset(app_name); + self + } + /// Overrides the default invocation ID generator. + /// + /// The invocation ID generator generates ID values for the `amz-sdk-invocation-id` header. By default, this will be a random UUID. Overriding it may be useful in tests that examine the HTTP request and need to be deterministic. + pub fn invocation_id_generator(mut self, gen: impl ::aws_runtime::invocation_id::InvocationIdGenerator + 'static) -> Self { + self.set_invocation_id_generator(::std::option::Option::Some( + ::aws_runtime::invocation_id::SharedInvocationIdGenerator::new(gen), + )); + self + } + /// Overrides the default invocation ID generator. + /// + /// The invocation ID generator generates ID values for the `amz-sdk-invocation-id` header. By default, this will be a random UUID. Overriding it may be useful in tests that examine the HTTP request and need to be deterministic. + pub fn set_invocation_id_generator( + &mut self, + gen: ::std::option::Option<::aws_runtime::invocation_id::SharedInvocationIdGenerator>, + ) -> &mut Self { + self.config.store_or_unset(gen); + self + } + /// Sets the endpoint URL used to communicate with this service + + /// Note: this is used in combination with other endpoint rules, e.g. an API that applies a host-label prefix + /// will be prefixed onto this URL. To fully override the endpoint resolver, use + /// [`Builder::endpoint_resolver`]. + pub fn endpoint_url(mut self, endpoint_url: impl Into<::std::string::String>) -> Self { + self.set_endpoint_url(Some(endpoint_url.into())); + self + } + /// Sets the endpoint URL used to communicate with this service + + /// Note: this is used in combination with other endpoint rules, e.g. an API that applies a host-label prefix + /// will be prefixed onto this URL. To fully override the endpoint resolver, use + /// [`Builder::endpoint_resolver`]. + pub fn set_endpoint_url(&mut self, endpoint_url: Option<::std::string::String>) -> &mut Self { + self.config.store_or_unset(endpoint_url.map(::aws_types::endpoint_config::EndpointUrl)); + self + } + /// When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error. + pub fn use_dual_stack(mut self, use_dual_stack: impl Into) -> Self { + self.set_use_dual_stack(Some(use_dual_stack.into())); + self + } + /// When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error. + pub fn set_use_dual_stack(&mut self, use_dual_stack: Option) -> &mut Self { + self.config.store_or_unset(use_dual_stack.map(::aws_types::endpoint_config::UseDualStack)); + self + } + /// When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error. + pub fn use_fips(mut self, use_fips: impl Into) -> Self { + self.set_use_fips(Some(use_fips.into())); + self + } + /// When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error. + pub fn set_use_fips(&mut self, use_fips: Option) -> &mut Self { + self.config.store_or_unset(use_fips.map(::aws_types::endpoint_config::UseFips)); + self + } + /// Sets the AWS region to use when making requests. + /// + /// # Examples + /// ```no_run + /// use aws_types::region::Region; + /// use aws_sdk_directoryservicedata::config::{Builder, Config}; + /// + /// let config = aws_sdk_directoryservicedata::Config::builder() + /// .region(Region::new("us-east-1")) + /// .build(); + /// ``` + pub fn region(mut self, region: impl ::std::convert::Into<::std::option::Option>) -> Self { + self.set_region(region.into()); + self + } + /// Sets the AWS region to use when making requests. + pub fn set_region(&mut self, region: ::std::option::Option) -> &mut Self { + self.config.store_or_unset(region); + self + } + /// Sets the credentials provider for this service + pub fn credentials_provider(mut self, credentials_provider: impl crate::config::ProvideCredentials + 'static) -> Self { + self.set_credentials_provider(::std::option::Option::Some(crate::config::SharedCredentialsProvider::new( + credentials_provider, + ))); + self + } + /// Sets the credentials provider for this service + pub fn set_credentials_provider(&mut self, credentials_provider: ::std::option::Option) -> &mut Self { + if let Some(credentials_provider) = credentials_provider { + self.runtime_components + .set_identity_resolver(::aws_runtime::auth::sigv4::SCHEME_ID, credentials_provider); + } + self + } + /// Sets the [`behavior major version`](crate::config::BehaviorVersion). + /// + /// Over time, new best-practice behaviors are introduced. However, these behaviors might not be backwards + /// compatible. For example, a change which introduces new default timeouts or a new retry-mode for + /// all operations might be the ideal behavior but could break existing applications. + /// + /// # Examples + /// + /// Set the behavior major version to `latest`. This is equivalent to enabling the `behavior-version-latest` cargo feature. + /// ```no_run + /// use aws_sdk_directoryservicedata::config::BehaviorVersion; + /// + /// let config = aws_sdk_directoryservicedata::Config::builder() + /// .behavior_version(BehaviorVersion::latest()) + /// // ... + /// .build(); + /// let client = aws_sdk_directoryservicedata::Client::from_conf(config); + /// ``` + /// + /// Customizing behavior major version: + /// ```no_run + /// use aws_sdk_directoryservicedata::config::BehaviorVersion; + /// + /// let config = aws_sdk_directoryservicedata::Config::builder() + /// .behavior_version(BehaviorVersion::v2023_11_09()) + /// // ... + /// .build(); + /// let client = aws_sdk_directoryservicedata::Client::from_conf(config); + /// ``` + + pub fn behavior_version(mut self, behavior_version: crate::config::BehaviorVersion) -> Self { + self.set_behavior_version(Some(behavior_version)); + self + } + + /// Sets the [`behavior major version`](crate::config::BehaviorVersion). + /// + /// Over time, new best-practice behaviors are introduced. However, these behaviors might not be backwards + /// compatible. For example, a change which introduces new default timeouts or a new retry-mode for + /// all operations might be the ideal behavior but could break existing applications. + /// + /// # Examples + /// + /// Set the behavior major version to `latest`. This is equivalent to enabling the `behavior-version-latest` cargo feature. + /// ```no_run + /// use aws_sdk_directoryservicedata::config::BehaviorVersion; + /// + /// let config = aws_sdk_directoryservicedata::Config::builder() + /// .behavior_version(BehaviorVersion::latest()) + /// // ... + /// .build(); + /// let client = aws_sdk_directoryservicedata::Client::from_conf(config); + /// ``` + /// + /// Customizing behavior major version: + /// ```no_run + /// use aws_sdk_directoryservicedata::config::BehaviorVersion; + /// + /// let config = aws_sdk_directoryservicedata::Config::builder() + /// .behavior_version(BehaviorVersion::v2023_11_09()) + /// // ... + /// .build(); + /// let client = aws_sdk_directoryservicedata::Client::from_conf(config); + /// ``` + + pub fn set_behavior_version(&mut self, behavior_version: Option) -> &mut Self { + self.behavior_version = behavior_version; + self + } + + /// Convenience method to set the latest behavior major version + /// + /// This is equivalent to enabling the `behavior-version-latest` Cargo feature + pub fn behavior_version_latest(mut self) -> Self { + self.set_behavior_version(Some(crate::config::BehaviorVersion::latest())); + self + } + /// Adds a runtime plugin to the config. + #[allow(unused)] + pub(crate) fn runtime_plugin(mut self, plugin: impl crate::config::RuntimePlugin + 'static) -> Self { + self.push_runtime_plugin(crate::config::SharedRuntimePlugin::new(plugin)); + self + } + /// Adds a runtime plugin to the config. + #[allow(unused)] + pub(crate) fn push_runtime_plugin(&mut self, plugin: crate::config::SharedRuntimePlugin) -> &mut Self { + self.runtime_plugins.push(plugin); + self + } + #[cfg(any(feature = "test-util", test))] + #[allow(unused_mut)] + /// Apply test defaults to the builder + pub fn apply_test_defaults(&mut self) -> &mut Self { + self.set_idempotency_token_provider(Some("00000000-0000-4000-8000-000000000000".into())); + self.set_time_source(::std::option::Option::Some(::aws_smithy_async::time::SharedTimeSource::new( + ::aws_smithy_async::time::StaticTimeSource::new(::std::time::UNIX_EPOCH + ::std::time::Duration::from_secs(1234567890)), + ))); + self.config.store_put(::aws_runtime::user_agent::AwsUserAgent::for_tests()); + self.set_credentials_provider(Some(crate::config::SharedCredentialsProvider::new( + ::aws_credential_types::Credentials::for_tests(), + ))); + self.behavior_version = ::std::option::Option::Some(crate::config::BehaviorVersion::latest()); + self + } + #[cfg(any(feature = "test-util", test))] + #[allow(unused_mut)] + /// Apply test defaults to the builder + pub fn with_test_defaults(mut self) -> Self { + self.apply_test_defaults(); + self + } + /// Builds a [`Config`]. + #[allow(unused_mut)] + pub fn build(mut self) -> Config { + let mut layer = self.config; + if self.runtime_components.time_source().is_none() { + self.runtime_components + .set_time_source(::std::option::Option::Some(::std::default::Default::default())); + } + layer.store_put(crate::meta::API_METADATA.clone()); + layer.store_put(::aws_types::SigningName::from_static("ds-data")); + layer + .load::<::aws_types::region::Region>() + .cloned() + .map(|r| layer.store_put(::aws_types::region::SigningRegion::from(r))); + Config { + config: crate::config::Layer::from(layer.clone()) + .with_name("aws_sdk_directoryservicedata::config::Config") + .freeze(), + cloneable: layer, + runtime_components: self.runtime_components, + runtime_plugins: self.runtime_plugins, + behavior_version: self.behavior_version, + } + } +} +#[derive(::std::fmt::Debug)] +pub(crate) struct ServiceRuntimePlugin { + config: ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer>, + runtime_components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, +} + +impl ServiceRuntimePlugin { + pub fn new(_service_config: crate::config::Config) -> Self { + let config = { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("DirectoryServiceData"); + cfg.store_put(crate::idempotency_token::default_provider()); + ::std::option::Option::Some(cfg.freeze()) + }; + let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin"); + runtime_components.set_endpoint_resolver(Some({ + use crate::config::endpoint::ResolveEndpoint; + crate::config::endpoint::DefaultResolver::new().into_shared_resolver() + })); + runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new()); + runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default()); + runtime_components.push_interceptor(::aws_runtime::service_clock_skew::ServiceClockSkewInterceptor::new()); + runtime_components.push_interceptor(::aws_runtime::request_info::RequestInfoInterceptor::new()); + runtime_components.push_interceptor(::aws_runtime::user_agent::UserAgentInterceptor::new()); + runtime_components.push_interceptor(::aws_runtime::invocation_id::InvocationIdInterceptor::new()); + runtime_components.push_interceptor(::aws_runtime::recursion_detection::RecursionDetectionInterceptor::new()); + runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new( + ::aws_runtime::auth::sigv4::SigV4AuthScheme::new(), + )); + Self { config, runtime_components } + } +} + +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ServiceRuntimePlugin { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + self.config.clone() + } + + fn order(&self) -> ::aws_smithy_runtime_api::client::runtime_plugin::Order { + ::aws_smithy_runtime_api::client::runtime_plugin::Order::Defaults + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + ::std::borrow::Cow::Borrowed(&self.runtime_components) + } +} + +/// Cross-operation shared-state singletons + +/// A plugin that enables configuration for a single operation invocation +/// +/// The `config` method will return a `FrozenLayer` by storing values from `config_override`. +/// In the case of default values requested, they will be obtained from `client_config`. +#[derive(Debug)] +pub(crate) struct ConfigOverrideRuntimePlugin { + pub(crate) config: ::aws_smithy_types::config_bag::FrozenLayer, + pub(crate) components: ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, +} + +impl ConfigOverrideRuntimePlugin { + #[allow(dead_code)] // unused when a service does not provide any operations + pub(crate) fn new( + config_override: Builder, + initial_config: ::aws_smithy_types::config_bag::FrozenLayer, + initial_components: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> Self { + let mut layer = config_override.config; + let mut components = config_override.runtime_components; + #[allow(unused_mut)] + let mut resolver = + ::aws_smithy_runtime::client::config_override::Resolver::overrid(initial_config, initial_components, &mut layer, &mut components); + + resolver + .config_mut() + .load::<::aws_types::region::Region>() + .cloned() + .map(|r| resolver.config_mut().store_put(::aws_types::region::SigningRegion::from(r))); + + let _ = resolver; + Self { + config: ::aws_smithy_types::config_bag::Layer::from(layer) + .with_name("aws_sdk_directoryservicedata::config::ConfigOverrideRuntimePlugin") + .freeze(), + components, + } + } +} + +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ConfigOverrideRuntimePlugin { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + Some(self.config.clone()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + ::std::borrow::Cow::Borrowed(&self.components) + } +} + +pub use ::aws_smithy_runtime::client::identity::IdentityCache; +pub use ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents; +pub use ::aws_smithy_types::config_bag::ConfigBag; + +pub use ::aws_credential_types::Credentials; + +impl From<&::aws_types::sdk_config::SdkConfig> for Builder { + fn from(input: &::aws_types::sdk_config::SdkConfig) -> Self { + let mut builder = Builder::default(); + builder.set_credentials_provider(input.credentials_provider()); + builder = builder.region(input.region().cloned()); + builder.set_use_fips(input.use_fips()); + builder.set_use_dual_stack(input.use_dual_stack()); + if input.get_origin("endpoint_url").is_client_config() { + builder.set_endpoint_url(input.endpoint_url().map(|s| s.to_string())); + } else { + builder.set_endpoint_url( + input + .service_config() + .and_then(|conf| { + conf.load_config(service_config_key("AWS_ENDPOINT_URL", "endpoint_url")) + .map(|it| it.parse().unwrap()) + }) + .or_else(|| input.endpoint_url().map(|s| s.to_string())), + ); + } + // resiliency + builder.set_retry_config(input.retry_config().cloned()); + builder.set_timeout_config(input.timeout_config().cloned()); + builder.set_sleep_impl(input.sleep_impl()); + + builder.set_http_client(input.http_client()); + builder.set_time_source(input.time_source()); + builder.set_behavior_version(input.behavior_version()); + // setting `None` here removes the default + if let Some(config) = input.stalled_stream_protection() { + builder.set_stalled_stream_protection(Some(config)); + } + + if let Some(cache) = input.identity_cache() { + builder.set_identity_cache(cache); + } + builder.set_app_name(input.app_name().cloned()); + + builder + } +} + +impl From<&::aws_types::sdk_config::SdkConfig> for Config { + fn from(sdk_config: &::aws_types::sdk_config::SdkConfig) -> Self { + Builder::from(sdk_config).build() + } +} + +pub use ::aws_types::app_name::AppName; + +#[allow(dead_code)] +fn service_config_key<'a>(env: &'a str, profile: &'a str) -> aws_types::service_config::ServiceConfigKey<'a> { + ::aws_types::service_config::ServiceConfigKey::builder() + .service_id("directoryservicedata") + .env(env) + .profile(profile) + .build() + .expect("all field sets explicitly, can't fail") +} + +pub use ::aws_smithy_async::rt::sleep::Sleep; + +pub(crate) fn base_client_runtime_plugins(mut config: crate::Config) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut configured_plugins = ::std::vec::Vec::new(); + ::std::mem::swap(&mut config.runtime_plugins, &mut configured_plugins); + #[cfg(feature = "behavior-version-latest")] + { + if config.behavior_version.is_none() { + config.behavior_version = Some(::aws_smithy_runtime_api::client::behavior_version::BehaviorVersion::latest()); + } + } + + let mut plugins = ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins::new() + // defaults + .with_client_plugins(::aws_smithy_runtime::client::defaults::default_plugins( + ::aws_smithy_runtime::client::defaults::DefaultPluginParams::new() + .with_retry_partition_name("directoryservicedata") + .with_behavior_version(config.behavior_version.expect("Invalid client configuration: A behavior major version must be set when sending a request or constructing a client. You must set it during client construction or by enabling the `behavior-version-latest` cargo feature.")) + )) + // user config + .with_client_plugin( + ::aws_smithy_runtime_api::client::runtime_plugin::StaticRuntimePlugin::new() + .with_config(config.config.clone()) + .with_runtime_components(config.runtime_components.clone()) + ) + // codegen config + .with_client_plugin(crate::config::ServiceRuntimePlugin::new(config.clone())) + .with_client_plugin(::aws_smithy_runtime::client::auth::no_auth::NoAuthRuntimePlugin::new()); + + for plugin in configured_plugins { + plugins = plugins.with_client_plugin(plugin); + } + plugins +} + +pub use ::aws_smithy_types::config_bag::FrozenLayer; + +pub use ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder; + +pub use ::aws_smithy_runtime_api::client::runtime_plugin::SharedRuntimePlugin; + +pub use ::aws_smithy_runtime_api::client::behavior_version::BehaviorVersion; + +pub use ::aws_smithy_runtime_api::client::stalled_stream_protection::StalledStreamProtectionConfig; + +pub use ::aws_smithy_runtime_api::client::http::SharedHttpClient; + +pub use ::aws_smithy_async::rt::sleep::SharedAsyncSleep; + +pub use ::aws_smithy_runtime_api::client::identity::SharedIdentityCache; + +pub use ::aws_smithy_runtime_api::client::interceptors::SharedInterceptor; + +pub use ::aws_types::region::Region; + +pub use ::aws_credential_types::provider::SharedCredentialsProvider; + +pub use ::aws_smithy_runtime_api::client::http::HttpClient; + +pub use ::aws_smithy_runtime_api::shared::IntoShared; + +pub use ::aws_smithy_async::rt::sleep::AsyncSleep; + +pub use ::aws_smithy_runtime_api::client::identity::ResolveCachedIdentity; + +pub use ::aws_smithy_runtime_api::client::interceptors::Intercept; + +pub use ::aws_credential_types::provider::ProvideCredentials; + +pub use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin; + +pub use ::aws_smithy_types::config_bag::Layer; + +/// Types needed to configure endpoint resolution. +pub mod endpoint; + +/// HTTP request and response types. +pub mod http; + +/// Types needed to implement [`Intercept`](crate::config::Intercept). +pub mod interceptors; + +/// Retry configuration. +pub mod retry; + +/// Timeout configuration. +pub mod timeout; diff --git a/sdk/directoryservicedata/src/config/endpoint.rs b/sdk/directoryservicedata/src/config/endpoint.rs new file mode 100644 index 000000000000..3d497be2b39e --- /dev/null +++ b/sdk/directoryservicedata/src/config/endpoint.rs @@ -0,0 +1,694 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use ::aws_smithy_runtime_api::client::endpoint::EndpointFuture; +pub use ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver; +pub use ::aws_smithy_types::endpoint::Endpoint; + +#[cfg(test)] +mod test { + + /// For region us-east-1 with FIPS enabled and DualStack enabled + #[test] + fn test_1() { + let params = crate::config::endpoint::Params::builder() + .region("us-east-1".to_string()) + .use_fips(true) + .use_dual_stack(true) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://ds-data-fips.us-east-1.api.aws"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://ds-data-fips.us-east-1.api.aws") + .build() + ); + } + + /// For region us-east-1 with FIPS enabled and DualStack disabled + #[test] + fn test_2() { + let params = crate::config::endpoint::Params::builder() + .region("us-east-1".to_string()) + .use_fips(true) + .use_dual_stack(false) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://ds-data-fips.us-east-1.amazonaws.com"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://ds-data-fips.us-east-1.amazonaws.com") + .build() + ); + } + + /// For region us-east-1 with FIPS disabled and DualStack enabled + #[test] + fn test_3() { + let params = crate::config::endpoint::Params::builder() + .region("us-east-1".to_string()) + .use_fips(false) + .use_dual_stack(true) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://ds-data.us-east-1.api.aws"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://ds-data.us-east-1.api.aws") + .build() + ); + } + + /// For region us-east-1 with FIPS disabled and DualStack disabled + #[test] + fn test_4() { + let params = crate::config::endpoint::Params::builder() + .region("us-east-1".to_string()) + .use_fips(false) + .use_dual_stack(false) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://ds-data.us-east-1.amazonaws.com"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://ds-data.us-east-1.amazonaws.com") + .build() + ); + } + + /// For region cn-north-1 with FIPS enabled and DualStack enabled + #[test] + fn test_5() { + let params = crate::config::endpoint::Params::builder() + .region("cn-north-1".to_string()) + .use_fips(true) + .use_dual_stack(true) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://ds-data-fips.cn-north-1.api.amazonwebservices.com.cn"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://ds-data-fips.cn-north-1.api.amazonwebservices.com.cn") + .build() + ); + } + + /// For region cn-north-1 with FIPS enabled and DualStack disabled + #[test] + fn test_6() { + let params = crate::config::endpoint::Params::builder() + .region("cn-north-1".to_string()) + .use_fips(true) + .use_dual_stack(false) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://ds-data-fips.cn-north-1.amazonaws.com.cn"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://ds-data-fips.cn-north-1.amazonaws.com.cn") + .build() + ); + } + + /// For region cn-north-1 with FIPS disabled and DualStack enabled + #[test] + fn test_7() { + let params = crate::config::endpoint::Params::builder() + .region("cn-north-1".to_string()) + .use_fips(false) + .use_dual_stack(true) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://ds-data.cn-north-1.api.amazonwebservices.com.cn"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://ds-data.cn-north-1.api.amazonwebservices.com.cn") + .build() + ); + } + + /// For region cn-north-1 with FIPS disabled and DualStack disabled + #[test] + fn test_8() { + let params = crate::config::endpoint::Params::builder() + .region("cn-north-1".to_string()) + .use_fips(false) + .use_dual_stack(false) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://ds-data.cn-north-1.amazonaws.com.cn"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://ds-data.cn-north-1.amazonaws.com.cn") + .build() + ); + } + + /// For region us-gov-east-1 with FIPS enabled and DualStack enabled + #[test] + fn test_9() { + let params = crate::config::endpoint::Params::builder() + .region("us-gov-east-1".to_string()) + .use_fips(true) + .use_dual_stack(true) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://ds-data-fips.us-gov-east-1.api.aws"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://ds-data-fips.us-gov-east-1.api.aws") + .build() + ); + } + + /// For region us-gov-east-1 with FIPS enabled and DualStack disabled + #[test] + fn test_10() { + let params = crate::config::endpoint::Params::builder() + .region("us-gov-east-1".to_string()) + .use_fips(true) + .use_dual_stack(false) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://ds-data-fips.us-gov-east-1.amazonaws.com"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://ds-data-fips.us-gov-east-1.amazonaws.com") + .build() + ); + } + + /// For region us-gov-east-1 with FIPS disabled and DualStack enabled + #[test] + fn test_11() { + let params = crate::config::endpoint::Params::builder() + .region("us-gov-east-1".to_string()) + .use_fips(false) + .use_dual_stack(true) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://ds-data.us-gov-east-1.api.aws"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://ds-data.us-gov-east-1.api.aws") + .build() + ); + } + + /// For region us-gov-east-1 with FIPS disabled and DualStack disabled + #[test] + fn test_12() { + let params = crate::config::endpoint::Params::builder() + .region("us-gov-east-1".to_string()) + .use_fips(false) + .use_dual_stack(false) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://ds-data.us-gov-east-1.amazonaws.com"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://ds-data.us-gov-east-1.amazonaws.com") + .build() + ); + } + + /// For region us-iso-east-1 with FIPS enabled and DualStack enabled + #[test] + fn test_13() { + let params = crate::config::endpoint::Params::builder() + .region("us-iso-east-1".to_string()) + .use_fips(true) + .use_dual_stack(true) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let error = endpoint.expect_err("expected error: FIPS and DualStack are enabled, but this partition does not support one or both [For region us-iso-east-1 with FIPS enabled and DualStack enabled]"); + assert_eq!( + format!("{}", error), + "FIPS and DualStack are enabled, but this partition does not support one or both" + ) + } + + /// For region us-iso-east-1 with FIPS enabled and DualStack disabled + #[test] + fn test_14() { + let params = crate::config::endpoint::Params::builder() + .region("us-iso-east-1".to_string()) + .use_fips(true) + .use_dual_stack(false) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://ds-data-fips.us-iso-east-1.c2s.ic.gov"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://ds-data-fips.us-iso-east-1.c2s.ic.gov") + .build() + ); + } + + /// For region us-iso-east-1 with FIPS disabled and DualStack enabled + #[test] + fn test_15() { + let params = crate::config::endpoint::Params::builder() + .region("us-iso-east-1".to_string()) + .use_fips(false) + .use_dual_stack(true) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let error = endpoint.expect_err("expected error: DualStack is enabled but this partition does not support DualStack [For region us-iso-east-1 with FIPS disabled and DualStack enabled]"); + assert_eq!(format!("{}", error), "DualStack is enabled but this partition does not support DualStack") + } + + /// For region us-iso-east-1 with FIPS disabled and DualStack disabled + #[test] + fn test_16() { + let params = crate::config::endpoint::Params::builder() + .region("us-iso-east-1".to_string()) + .use_fips(false) + .use_dual_stack(false) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://ds-data.us-iso-east-1.c2s.ic.gov"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://ds-data.us-iso-east-1.c2s.ic.gov") + .build() + ); + } + + /// For region us-isob-east-1 with FIPS enabled and DualStack enabled + #[test] + fn test_17() { + let params = crate::config::endpoint::Params::builder() + .region("us-isob-east-1".to_string()) + .use_fips(true) + .use_dual_stack(true) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let error = endpoint.expect_err("expected error: FIPS and DualStack are enabled, but this partition does not support one or both [For region us-isob-east-1 with FIPS enabled and DualStack enabled]"); + assert_eq!( + format!("{}", error), + "FIPS and DualStack are enabled, but this partition does not support one or both" + ) + } + + /// For region us-isob-east-1 with FIPS enabled and DualStack disabled + #[test] + fn test_18() { + let params = crate::config::endpoint::Params::builder() + .region("us-isob-east-1".to_string()) + .use_fips(true) + .use_dual_stack(false) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://ds-data-fips.us-isob-east-1.sc2s.sgov.gov"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://ds-data-fips.us-isob-east-1.sc2s.sgov.gov") + .build() + ); + } + + /// For region us-isob-east-1 with FIPS disabled and DualStack enabled + #[test] + fn test_19() { + let params = crate::config::endpoint::Params::builder() + .region("us-isob-east-1".to_string()) + .use_fips(false) + .use_dual_stack(true) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let error = endpoint.expect_err("expected error: DualStack is enabled but this partition does not support DualStack [For region us-isob-east-1 with FIPS disabled and DualStack enabled]"); + assert_eq!(format!("{}", error), "DualStack is enabled but this partition does not support DualStack") + } + + /// For region us-isob-east-1 with FIPS disabled and DualStack disabled + #[test] + fn test_20() { + let params = crate::config::endpoint::Params::builder() + .region("us-isob-east-1".to_string()) + .use_fips(false) + .use_dual_stack(false) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://ds-data.us-isob-east-1.sc2s.sgov.gov"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder() + .url("https://ds-data.us-isob-east-1.sc2s.sgov.gov") + .build() + ); + } + + /// For custom endpoint with region set and fips disabled and dualstack disabled + #[test] + fn test_21() { + let params = crate::config::endpoint::Params::builder() + .region("us-east-1".to_string()) + .use_fips(false) + .use_dual_stack(false) + .endpoint("https://example.com".to_string()) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://example.com"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder().url("https://example.com").build() + ); + } + + /// For custom endpoint with region not set and fips disabled and dualstack disabled + #[test] + fn test_22() { + let params = crate::config::endpoint::Params::builder() + .use_fips(false) + .use_dual_stack(false) + .endpoint("https://example.com".to_string()) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let endpoint = endpoint.expect("Expected valid endpoint: https://example.com"); + assert_eq!( + endpoint, + ::aws_smithy_types::endpoint::Endpoint::builder().url("https://example.com").build() + ); + } + + /// For custom endpoint with fips enabled and dualstack disabled + #[test] + fn test_23() { + let params = crate::config::endpoint::Params::builder() + .region("us-east-1".to_string()) + .use_fips(true) + .use_dual_stack(false) + .endpoint("https://example.com".to_string()) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let error = endpoint.expect_err("expected error: Invalid Configuration: FIPS and custom endpoint are not supported [For custom endpoint with fips enabled and dualstack disabled]"); + assert_eq!(format!("{}", error), "Invalid Configuration: FIPS and custom endpoint are not supported") + } + + /// For custom endpoint with fips disabled and dualstack enabled + #[test] + fn test_24() { + let params = crate::config::endpoint::Params::builder() + .region("us-east-1".to_string()) + .use_fips(false) + .use_dual_stack(true) + .endpoint("https://example.com".to_string()) + .build() + .expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let error = endpoint.expect_err("expected error: Invalid Configuration: Dualstack and custom endpoint are not supported [For custom endpoint with fips disabled and dualstack enabled]"); + assert_eq!( + format!("{}", error), + "Invalid Configuration: Dualstack and custom endpoint are not supported" + ) + } + + /// Missing region + #[test] + fn test_25() { + let params = crate::config::endpoint::Params::builder().build().expect("invalid params"); + let resolver = crate::config::endpoint::DefaultResolver::new(); + let endpoint = resolver.resolve_endpoint(¶ms); + let error = endpoint.expect_err("expected error: Invalid Configuration: Missing Region [Missing region]"); + assert_eq!(format!("{}", error), "Invalid Configuration: Missing Region") + } +} + +/// Endpoint resolver trait specific to AWS Directory Service Data +pub trait ResolveEndpoint: ::std::marker::Send + ::std::marker::Sync + ::std::fmt::Debug { + /// Resolve an endpoint with the given parameters + fn resolve_endpoint<'a>(&'a self, params: &'a crate::config::endpoint::Params) -> ::aws_smithy_runtime_api::client::endpoint::EndpointFuture<'a>; + + /// Convert this service-specific resolver into a `SharedEndpointResolver` + /// + /// The resulting resolver will downcast `EndpointResolverParams` into `crate::config::endpoint::Params`. + fn into_shared_resolver(self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver + where + Self: Sized + 'static, + { + ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver::new(DowncastParams(self)) + } +} + +#[derive(Debug)] +struct DowncastParams(T); +impl ::aws_smithy_runtime_api::client::endpoint::ResolveEndpoint for DowncastParams +where + T: ResolveEndpoint, +{ + fn resolve_endpoint<'a>( + &'a self, + params: &'a ::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams, + ) -> ::aws_smithy_runtime_api::client::endpoint::EndpointFuture<'a> { + let ep = match params.get::() { + Some(params) => self.0.resolve_endpoint(params), + None => ::aws_smithy_runtime_api::client::endpoint::EndpointFuture::ready(Err("params of expected type was not present".into())), + }; + ep + } +} + +/// The default endpoint resolver +#[derive(Debug, Default)] +pub struct DefaultResolver { + partition_resolver: crate::endpoint_lib::partition::PartitionResolver, +} + +impl DefaultResolver { + /// Create a new endpoint resolver with default settings + pub fn new() -> Self { + Self { + partition_resolver: crate::endpoint_lib::DEFAULT_PARTITION_RESOLVER.clone(), + } + } + + fn resolve_endpoint( + &self, + params: &crate::config::endpoint::Params, + ) -> Result<::aws_smithy_types::endpoint::Endpoint, ::aws_smithy_runtime_api::box_error::BoxError> { + let mut diagnostic_collector = crate::endpoint_lib::diagnostic::DiagnosticCollector::new(); + Ok( + crate::config::endpoint::internals::resolve_endpoint(params, &mut diagnostic_collector, &self.partition_resolver) + .map_err(|err| err.with_source(diagnostic_collector.take_last_error()))?, + ) + } +} + +impl crate::config::endpoint::ResolveEndpoint for DefaultResolver { + fn resolve_endpoint(&self, params: &crate::config::endpoint::Params) -> ::aws_smithy_runtime_api::client::endpoint::EndpointFuture { + ::aws_smithy_runtime_api::client::endpoint::EndpointFuture::ready(self.resolve_endpoint(params)) + } +} + +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +/// Configuration parameters for resolving the correct endpoint +pub struct Params { + /// The AWS region used to dispatch the request. + pub(crate) region: ::std::option::Option<::std::string::String>, + /// When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error. + pub(crate) use_dual_stack: bool, + /// When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error. + pub(crate) use_fips: bool, + /// Override the endpoint used to send this request + pub(crate) endpoint: ::std::option::Option<::std::string::String>, +} +impl Params { + /// Create a builder for [`Params`] + pub fn builder() -> crate::config::endpoint::ParamsBuilder { + crate::config::endpoint::ParamsBuilder::default() + } + /// The AWS region used to dispatch the request. + pub fn region(&self) -> ::std::option::Option<&str> { + self.region.as_deref() + } + /// When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error. + pub fn use_dual_stack(&self) -> ::std::option::Option { + Some(self.use_dual_stack) + } + /// When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error. + pub fn use_fips(&self) -> ::std::option::Option { + Some(self.use_fips) + } + /// Override the endpoint used to send this request + pub fn endpoint(&self) -> ::std::option::Option<&str> { + self.endpoint.as_deref() + } +} + +/// Builder for [`Params`] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +pub struct ParamsBuilder { + region: ::std::option::Option<::std::string::String>, + use_dual_stack: ::std::option::Option, + use_fips: ::std::option::Option, + endpoint: ::std::option::Option<::std::string::String>, +} +impl ParamsBuilder { + /// Consume this builder, creating [`Params`]. + pub fn build(self) -> ::std::result::Result { + Ok( + #[allow(clippy::unnecessary_lazy_evaluations)] + crate::config::endpoint::Params { + region: self.region, + use_dual_stack: self + .use_dual_stack + .or_else(|| Some(false)) + .ok_or_else(|| crate::config::endpoint::InvalidParams::missing("use_dual_stack"))?, + use_fips: self + .use_fips + .or_else(|| Some(false)) + .ok_or_else(|| crate::config::endpoint::InvalidParams::missing("use_fips"))?, + endpoint: self.endpoint, + }, + ) + } + /// Sets the value for region + /// + /// The AWS region used to dispatch the request. + pub fn region(mut self, value: impl Into<::std::string::String>) -> Self { + self.region = Some(value.into()); + self + } + + /// Sets the value for region + /// + /// The AWS region used to dispatch the request. + pub fn set_region(mut self, param: Option<::std::string::String>) -> Self { + self.region = param; + self + } + /// Sets the value for use_dual_stack + /// + /// When unset, this parameter has a default value of `false`. + /// When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error. + pub fn use_dual_stack(mut self, value: impl Into) -> Self { + self.use_dual_stack = Some(value.into()); + self + } + + /// Sets the value for use_dual_stack + /// + /// When unset, this parameter has a default value of `false`. + /// When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error. + pub fn set_use_dual_stack(mut self, param: Option) -> Self { + self.use_dual_stack = param; + self + } + /// Sets the value for use_fips + /// + /// When unset, this parameter has a default value of `false`. + /// When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error. + pub fn use_fips(mut self, value: impl Into) -> Self { + self.use_fips = Some(value.into()); + self + } + + /// Sets the value for use_fips + /// + /// When unset, this parameter has a default value of `false`. + /// When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error. + pub fn set_use_fips(mut self, param: Option) -> Self { + self.use_fips = param; + self + } + /// Sets the value for endpoint + /// + /// Override the endpoint used to send this request + pub fn endpoint(mut self, value: impl Into<::std::string::String>) -> Self { + self.endpoint = Some(value.into()); + self + } + + /// Sets the value for endpoint + /// + /// Override the endpoint used to send this request + pub fn set_endpoint(mut self, param: Option<::std::string::String>) -> Self { + self.endpoint = param; + self + } +} + +/// An error that occurred during endpoint resolution +#[derive(Debug)] +pub struct InvalidParams { + field: std::borrow::Cow<'static, str>, +} + +impl InvalidParams { + #[allow(dead_code)] + fn missing(field: &'static str) -> Self { + Self { field: field.into() } + } +} + +impl std::fmt::Display for InvalidParams { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "a required field was missing: `{}`", self.field) + } +} + +impl std::error::Error for InvalidParams {} + +mod internals; diff --git a/sdk/directoryservicedata/src/config/endpoint/internals.rs b/sdk/directoryservicedata/src/config/endpoint/internals.rs new file mode 100644 index 000000000000..3a67c17561f1 --- /dev/null +++ b/sdk/directoryservicedata/src/config/endpoint/internals.rs @@ -0,0 +1,123 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow( + clippy::collapsible_if, + clippy::bool_comparison, + clippy::nonminimal_bool, + clippy::comparison_to_empty, + clippy::redundant_pattern_matching +)] +pub(super) fn resolve_endpoint( + _params: &crate::config::endpoint::Params, + _diagnostic_collector: &mut crate::endpoint_lib::diagnostic::DiagnosticCollector, + partition_resolver: &crate::endpoint_lib::partition::PartitionResolver, +) -> ::aws_smithy_http::endpoint::Result { + #[allow(unused_variables)] + let region = &_params.region; + #[allow(unused_variables)] + let use_dual_stack = &_params.use_dual_stack; + #[allow(unused_variables)] + let use_fips = &_params.use_fips; + #[allow(unused_variables)] + let endpoint = &_params.endpoint; + #[allow(unused_variables)] + if let Some(endpoint) = endpoint { + if (*use_fips) == (true) { + return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message( + "Invalid Configuration: FIPS and custom endpoint are not supported".to_string(), + )); + } + if (*use_dual_stack) == (true) { + return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message( + "Invalid Configuration: Dualstack and custom endpoint are not supported".to_string(), + )); + } + return Ok(::aws_smithy_types::endpoint::Endpoint::builder().url(endpoint.to_owned()).build()); + } + #[allow(unused_variables)] + if let Some(region) = region { + #[allow(unused_variables)] + if let Some(partition_result) = partition_resolver.resolve_partition(region, _diagnostic_collector) { + if (*use_fips) == (true) { + if (*use_dual_stack) == (true) { + if (true) == (partition_result.supports_fips()) { + if (true) == (partition_result.supports_dual_stack()) { + return Ok(::aws_smithy_types::endpoint::Endpoint::builder() + .url({ + let mut out = String::new(); + out.push_str("https://ds-data-fips."); + #[allow(clippy::needless_borrow)] + out.push_str(®ion); + out.push('.'); + #[allow(clippy::needless_borrow)] + out.push_str(&partition_result.dual_stack_dns_suffix()); + out + }) + .build()); + } + } + return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message( + "FIPS and DualStack are enabled, but this partition does not support one or both".to_string(), + )); + } + } + if (*use_fips) == (true) { + if (partition_result.supports_fips()) == (true) { + return Ok(::aws_smithy_types::endpoint::Endpoint::builder() + .url({ + let mut out = String::new(); + out.push_str("https://ds-data-fips."); + #[allow(clippy::needless_borrow)] + out.push_str(®ion); + out.push('.'); + #[allow(clippy::needless_borrow)] + out.push_str(&partition_result.dns_suffix()); + out + }) + .build()); + } + return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message( + "FIPS is enabled but this partition does not support FIPS".to_string(), + )); + } + if (*use_dual_stack) == (true) { + if (true) == (partition_result.supports_dual_stack()) { + return Ok(::aws_smithy_types::endpoint::Endpoint::builder() + .url({ + let mut out = String::new(); + out.push_str("https://ds-data."); + #[allow(clippy::needless_borrow)] + out.push_str(®ion); + out.push('.'); + #[allow(clippy::needless_borrow)] + out.push_str(&partition_result.dual_stack_dns_suffix()); + out + }) + .build()); + } + return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message( + "DualStack is enabled but this partition does not support DualStack".to_string(), + )); + } + return Ok(::aws_smithy_types::endpoint::Endpoint::builder() + .url({ + let mut out = String::new(); + out.push_str("https://ds-data."); + #[allow(clippy::needless_borrow)] + out.push_str(®ion); + out.push('.'); + #[allow(clippy::needless_borrow)] + out.push_str(&partition_result.dns_suffix()); + out + }) + .build()); + } + #[allow(unreachable_code)] + return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message(format!( + "No rules matched these parameters. This is a bug. {:?}", + _params + ))); + } + return Err(::aws_smithy_http::endpoint::ResolveEndpointError::message( + "Invalid Configuration: Missing Region".to_string(), + )); +} diff --git a/sdk/directoryservicedata/src/config/http.rs b/sdk/directoryservicedata/src/config/http.rs new file mode 100644 index 000000000000..504946ac1b22 --- /dev/null +++ b/sdk/directoryservicedata/src/config/http.rs @@ -0,0 +1,3 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use ::aws_smithy_runtime_api::client::orchestrator::HttpRequest; +pub use ::aws_smithy_runtime_api::client::orchestrator::HttpResponse; diff --git a/sdk/directoryservicedata/src/config/interceptors.rs b/sdk/directoryservicedata/src/config/interceptors.rs new file mode 100644 index 000000000000..cfde73a6e1a8 --- /dev/null +++ b/sdk/directoryservicedata/src/config/interceptors.rs @@ -0,0 +1,11 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use ::aws_smithy_runtime_api::client::interceptors::context::AfterDeserializationInterceptorContextRef; +pub use ::aws_smithy_runtime_api::client::interceptors::context::BeforeDeserializationInterceptorContextMut; +pub use ::aws_smithy_runtime_api::client::interceptors::context::BeforeDeserializationInterceptorContextRef; +pub use ::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextMut; +pub use ::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef; +pub use ::aws_smithy_runtime_api::client::interceptors::context::BeforeTransmitInterceptorContextMut; +pub use ::aws_smithy_runtime_api::client::interceptors::context::BeforeTransmitInterceptorContextRef; +pub use ::aws_smithy_runtime_api::client::interceptors::context::FinalizerInterceptorContextMut; +pub use ::aws_smithy_runtime_api::client::interceptors::context::FinalizerInterceptorContextRef; +pub use ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext; diff --git a/sdk/directoryservicedata/src/config/retry.rs b/sdk/directoryservicedata/src/config/retry.rs new file mode 100644 index 000000000000..595062713158 --- /dev/null +++ b/sdk/directoryservicedata/src/config/retry.rs @@ -0,0 +1,7 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use ::aws_smithy_runtime_api::client::retries::classifiers::ClassifyRetry; +pub use ::aws_smithy_runtime_api::client::retries::classifiers::RetryAction; +pub use ::aws_smithy_runtime_api::client::retries::ShouldAttempt; + +pub use ::aws_smithy_runtime::client::retries::RetryPartition; +pub use ::aws_smithy_types::retry::{ReconnectMode, RetryConfig, RetryConfigBuilder, RetryMode}; diff --git a/sdk/directoryservicedata/src/config/timeout.rs b/sdk/directoryservicedata/src/config/timeout.rs new file mode 100644 index 000000000000..bc2026d62a04 --- /dev/null +++ b/sdk/directoryservicedata/src/config/timeout.rs @@ -0,0 +1,2 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use ::aws_smithy_types::timeout::{TimeoutConfig, TimeoutConfigBuilder}; diff --git a/sdk/directoryservicedata/src/endpoint_lib.rs b/sdk/directoryservicedata/src/endpoint_lib.rs new file mode 100644 index 000000000000..4dc3eeb071ae --- /dev/null +++ b/sdk/directoryservicedata/src/endpoint_lib.rs @@ -0,0 +1,19 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +// Loading the partition JSON is expensive since it involves many regex compilations, +// so cache the result so that it only need to be paid for the first constructed client. +pub(crate) static DEFAULT_PARTITION_RESOLVER: ::once_cell::sync::Lazy = + ::once_cell::sync::Lazy::new(|| match std::env::var("SMITHY_CLIENT_SDK_CUSTOM_PARTITION") { + Ok(partitions) => { + ::tracing::debug!("loading custom partitions located at {partitions}"); + let partition_dot_json = std::fs::read_to_string(partitions).expect("should be able to read a custom partition JSON"); + crate::endpoint_lib::partition::PartitionResolver::new_from_json(partition_dot_json.as_bytes()).expect("valid JSON") + } + _ => { + ::tracing::debug!("loading default partitions"); + crate::endpoint_lib::partition::PartitionResolver::new_from_json(b"{\"partitions\":[{\"id\":\"aws\",\"outputs\":{\"dnsSuffix\":\"amazonaws.com\",\"dualStackDnsSuffix\":\"api.aws\",\"implicitGlobalRegion\":\"us-east-1\",\"name\":\"aws\",\"supportsDualStack\":true,\"supportsFIPS\":true},\"regionRegex\":\"^(us|eu|ap|sa|ca|me|af|il|mx)\\\\-\\\\w+\\\\-\\\\d+$\",\"regions\":{\"af-south-1\":{\"description\":\"Africa (Cape Town)\"},\"ap-east-1\":{\"description\":\"Asia Pacific (Hong Kong)\"},\"ap-northeast-1\":{\"description\":\"Asia Pacific (Tokyo)\"},\"ap-northeast-2\":{\"description\":\"Asia Pacific (Seoul)\"},\"ap-northeast-3\":{\"description\":\"Asia Pacific (Osaka)\"},\"ap-south-1\":{\"description\":\"Asia Pacific (Mumbai)\"},\"ap-south-2\":{\"description\":\"Asia Pacific (Hyderabad)\"},\"ap-southeast-1\":{\"description\":\"Asia Pacific (Singapore)\"},\"ap-southeast-2\":{\"description\":\"Asia Pacific (Sydney)\"},\"ap-southeast-3\":{\"description\":\"Asia Pacific (Jakarta)\"},\"ap-southeast-4\":{\"description\":\"Asia Pacific (Melbourne)\"},\"ap-southeast-5\":{\"description\":\"Asia Pacific (Malaysia)\"},\"aws-global\":{\"description\":\"AWS Standard global region\"},\"ca-central-1\":{\"description\":\"Canada (Central)\"},\"ca-west-1\":{\"description\":\"Canada West (Calgary)\"},\"eu-central-1\":{\"description\":\"Europe (Frankfurt)\"},\"eu-central-2\":{\"description\":\"Europe (Zurich)\"},\"eu-north-1\":{\"description\":\"Europe (Stockholm)\"},\"eu-south-1\":{\"description\":\"Europe (Milan)\"},\"eu-south-2\":{\"description\":\"Europe (Spain)\"},\"eu-west-1\":{\"description\":\"Europe (Ireland)\"},\"eu-west-2\":{\"description\":\"Europe (London)\"},\"eu-west-3\":{\"description\":\"Europe (Paris)\"},\"il-central-1\":{\"description\":\"Israel (Tel Aviv)\"},\"me-central-1\":{\"description\":\"Middle East (UAE)\"},\"me-south-1\":{\"description\":\"Middle East (Bahrain)\"},\"sa-east-1\":{\"description\":\"South America (Sao Paulo)\"},\"us-east-1\":{\"description\":\"US East (N. Virginia)\"},\"us-east-2\":{\"description\":\"US East (Ohio)\"},\"us-west-1\":{\"description\":\"US West (N. California)\"},\"us-west-2\":{\"description\":\"US West (Oregon)\"}}},{\"id\":\"aws-cn\",\"outputs\":{\"dnsSuffix\":\"amazonaws.com.cn\",\"dualStackDnsSuffix\":\"api.amazonwebservices.com.cn\",\"implicitGlobalRegion\":\"cn-northwest-1\",\"name\":\"aws-cn\",\"supportsDualStack\":true,\"supportsFIPS\":true},\"regionRegex\":\"^cn\\\\-\\\\w+\\\\-\\\\d+$\",\"regions\":{\"aws-cn-global\":{\"description\":\"AWS China global region\"},\"cn-north-1\":{\"description\":\"China (Beijing)\"},\"cn-northwest-1\":{\"description\":\"China (Ningxia)\"}}},{\"id\":\"aws-us-gov\",\"outputs\":{\"dnsSuffix\":\"amazonaws.com\",\"dualStackDnsSuffix\":\"api.aws\",\"implicitGlobalRegion\":\"us-gov-west-1\",\"name\":\"aws-us-gov\",\"supportsDualStack\":true,\"supportsFIPS\":true},\"regionRegex\":\"^us\\\\-gov\\\\-\\\\w+\\\\-\\\\d+$\",\"regions\":{\"aws-us-gov-global\":{\"description\":\"AWS GovCloud (US) global region\"},\"us-gov-east-1\":{\"description\":\"AWS GovCloud (US-East)\"},\"us-gov-west-1\":{\"description\":\"AWS GovCloud (US-West)\"}}},{\"id\":\"aws-iso\",\"outputs\":{\"dnsSuffix\":\"c2s.ic.gov\",\"dualStackDnsSuffix\":\"c2s.ic.gov\",\"implicitGlobalRegion\":\"us-iso-east-1\",\"name\":\"aws-iso\",\"supportsDualStack\":false,\"supportsFIPS\":true},\"regionRegex\":\"^us\\\\-iso\\\\-\\\\w+\\\\-\\\\d+$\",\"regions\":{\"aws-iso-global\":{\"description\":\"AWS ISO (US) global region\"},\"us-iso-east-1\":{\"description\":\"US ISO East\"},\"us-iso-west-1\":{\"description\":\"US ISO WEST\"}}},{\"id\":\"aws-iso-b\",\"outputs\":{\"dnsSuffix\":\"sc2s.sgov.gov\",\"dualStackDnsSuffix\":\"sc2s.sgov.gov\",\"implicitGlobalRegion\":\"us-isob-east-1\",\"name\":\"aws-iso-b\",\"supportsDualStack\":false,\"supportsFIPS\":true},\"regionRegex\":\"^us\\\\-isob\\\\-\\\\w+\\\\-\\\\d+$\",\"regions\":{\"aws-iso-b-global\":{\"description\":\"AWS ISOB (US) global region\"},\"us-isob-east-1\":{\"description\":\"US ISOB East (Ohio)\"}}},{\"id\":\"aws-iso-e\",\"outputs\":{\"dnsSuffix\":\"cloud.adc-e.uk\",\"dualStackDnsSuffix\":\"cloud.adc-e.uk\",\"implicitGlobalRegion\":\"eu-isoe-west-1\",\"name\":\"aws-iso-e\",\"supportsDualStack\":false,\"supportsFIPS\":true},\"regionRegex\":\"^eu\\\\-isoe\\\\-\\\\w+\\\\-\\\\d+$\",\"regions\":{\"eu-isoe-west-1\":{\"description\":\"EU ISOE West\"}}},{\"id\":\"aws-iso-f\",\"outputs\":{\"dnsSuffix\":\"csp.hci.ic.gov\",\"dualStackDnsSuffix\":\"csp.hci.ic.gov\",\"implicitGlobalRegion\":\"us-isof-south-1\",\"name\":\"aws-iso-f\",\"supportsDualStack\":false,\"supportsFIPS\":true},\"regionRegex\":\"^us\\\\-isof\\\\-\\\\w+\\\\-\\\\d+$\",\"regions\":{}}],\"version\":\"1.1\"}").expect("valid JSON") + } + }); + +pub(crate) mod diagnostic; + +pub(crate) mod partition; diff --git a/sdk/directoryservicedata/src/endpoint_lib/diagnostic.rs b/sdk/directoryservicedata/src/endpoint_lib/diagnostic.rs new file mode 100644 index 000000000000..3413d0ea46d3 --- /dev/null +++ b/sdk/directoryservicedata/src/endpoint_lib/diagnostic.rs @@ -0,0 +1,45 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +use std::error::Error; + +/// Diagnostic collector for endpoint resolution +/// +/// Endpoint functions return `Option`—to enable diagnostic information to flow, we capture the +/// last error that occurred. +#[derive(Debug, Default)] +pub(crate) struct DiagnosticCollector { + last_error: Option>, +} + +impl DiagnosticCollector { + #[allow(unused)] + /// Report an error to the collector + pub(crate) fn report_error(&mut self, err: impl Into>) { + self.last_error = Some(err.into()); + } + + #[allow(unused)] + /// Capture a result, returning Some(t) when the input was `Ok` and `None` otherwise + pub(crate) fn capture>>(&mut self, err: Result) -> Option { + match err { + Ok(res) => Some(res), + Err(e) => { + self.report_error(e); + None + } + } + } + + pub(crate) fn take_last_error(&mut self) -> Option> { + self.last_error.take() + } + + /// Create a new diagnostic collector + pub(crate) fn new() -> Self { + Self { last_error: None } + } +} diff --git a/sdk/directoryservicedata/src/endpoint_lib/partition.rs b/sdk/directoryservicedata/src/endpoint_lib/partition.rs new file mode 100644 index 000000000000..65d99bc4a5e5 --- /dev/null +++ b/sdk/directoryservicedata/src/endpoint_lib/partition.rs @@ -0,0 +1,557 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +//! Partition function to determine a partition for a given region +//! +//! This function supports adding regions dynamically, parsing a JSON file, and builder construction. +//! +//! If, at a future point, this interface stabilizes it is a good candidate for extraction into a +//! shared crate. +use crate::endpoint_lib::diagnostic::DiagnosticCollector; +use crate::endpoint_lib::partition::deser::deserialize_partitions; +use aws_smithy_json::deserialize::error::DeserializeError; +use regex_lite::Regex; +use std::borrow::Cow; +use std::collections::HashMap; + +/// Determine the AWS partition metadata for a given region +#[derive(Clone, Debug, Default)] +pub(crate) struct PartitionResolver { + partitions: Vec, +} + +impl PartitionResolver { + pub(crate) fn from_partitions(partitions: Vec) -> Self { + Self { partitions } + } +} + +/// Partition result returned from partition resolver +pub(crate) struct Partition<'a> { + name: &'a str, + dns_suffix: &'a str, + dual_stack_dns_suffix: &'a str, + supports_fips: bool, + supports_dual_stack: bool, + implicit_global_region: &'a str, +} + +#[allow(unused)] +impl<'a> Partition<'a> { + pub(crate) fn name(&self) -> &str { + self.name + } + + pub(crate) fn dns_suffix(&self) -> &str { + self.dns_suffix + } + + pub(crate) fn supports_fips(&self) -> bool { + self.supports_fips + } + + pub(crate) fn dual_stack_dns_suffix(&self) -> &str { + self.dual_stack_dns_suffix + } + + pub(crate) fn supports_dual_stack(&self) -> bool { + self.supports_dual_stack + } + + pub(crate) fn implicit_global_region(&self) -> &str { + self.implicit_global_region + } +} + +static DEFAULT_OVERRIDE: &PartitionOutputOverride = &PartitionOutputOverride { + name: None, + dns_suffix: None, + dual_stack_dns_suffix: None, + supports_fips: None, + supports_dual_stack: None, + implicit_global_region: None, +}; + +/// Merge the base output and the override output, dealing with `Cow`s +macro_rules! merge { + ($base: expr, $output: expr, $field: ident) => { + $output.$field.as_ref().map(|s| s.as_ref()).unwrap_or($base.outputs.$field.as_ref()) + }; +} + +impl PartitionResolver { + #[allow(unused)] + pub(crate) fn empty() -> PartitionResolver { + PartitionResolver { partitions: vec![] } + } + + #[allow(unused)] + pub(crate) fn add_partition(&mut self, partition: PartitionMetadata) { + self.partitions.push(partition); + } + + pub(crate) fn new_from_json(partition_dot_json: &[u8]) -> Result { + deserialize_partitions(partition_dot_json) + } + + /// Resolve a partition for a given region + /// + /// 1. Enumerate each partition in the `partitions` array, and determine if the identifier to be + /// resolved matches an explicit region listed in the `regions` array for a given partition. + /// If identifier matches, proceed to step 4, otherwise continue to step 2. + /// 2. Enumerate each partition in the `partitions` array, use the regular expression + /// `regionRegex` to determine if the identifier matches the regular expression. If the + /// identifier matches, proceed to step 4, otherwise continue to step 3. + /// 3. If no partition is matched after exhausting step 1 and step 2, then fallback to matching + /// the identifier to the partition where `id == "aws"`, and proceed to step 4. If no `aws` + /// partition is present, return `None`. + /// 4. After matching the identifier to a partition using one of the previous steps, the partition function should return a + /// typed data structure containing the fields in `outputs` in the matched partition. **Important:** If a specific region + /// was matched, the properties associated with that region **MUST** be merged with the `outputs` field. + pub(crate) fn resolve_partition(&self, region: &str, e: &mut DiagnosticCollector) -> Option { + let mut explicit_match_partition = self.partitions.iter().flat_map(|part| part.explicit_match(region)); + let mut regex_match_partition = self.partitions.iter().flat_map(|part| part.regex_match(region)); + + let (base, region_override) = explicit_match_partition.next().or_else(|| regex_match_partition.next()).or_else(|| { + match self.partitions.iter().find(|p| p.id == "aws") { + Some(partition) => Some((partition, None)), + None => { + e.report_error("no AWS partition!"); + None + } + } + })?; + let region_override = region_override.as_ref().unwrap_or(&DEFAULT_OVERRIDE); + Some(Partition { + name: merge!(base, region_override, name), + dns_suffix: merge!(base, region_override, dns_suffix), + dual_stack_dns_suffix: merge!(base, region_override, dual_stack_dns_suffix), + supports_fips: region_override.supports_fips.unwrap_or(base.outputs.supports_fips), + supports_dual_stack: region_override.supports_dual_stack.unwrap_or(base.outputs.supports_dual_stack), + implicit_global_region: merge!(base, region_override, implicit_global_region), + }) + } +} + +type Str = Cow<'static, str>; + +#[derive(Clone, Debug)] +pub(crate) struct PartitionMetadata { + id: Str, + region_regex: Regex, + regions: HashMap, + outputs: PartitionOutput, +} + +#[derive(Default)] +pub(crate) struct PartitionMetadataBuilder { + pub(crate) id: Option, + pub(crate) region_regex: Option, + pub(crate) regions: HashMap, + pub(crate) outputs: Option, +} + +impl PartitionMetadataBuilder { + pub(crate) fn build(self) -> PartitionMetadata { + PartitionMetadata { + id: self.id.expect("id must be defined"), + region_regex: self.region_regex.expect("region regex must be defined"), + regions: self.regions, + outputs: self + .outputs + .expect("outputs must be defined") + .into_partition_output() + .expect("missing fields on outputs"), + } + } +} + +impl PartitionMetadata { + fn explicit_match(&self, region: &str) -> Option<(&PartitionMetadata, Option<&PartitionOutputOverride>)> { + self.regions.get(region).map(|output_override| (self, Some(output_override))) + } + + fn regex_match(&self, region: &str) -> Option<(&PartitionMetadata, Option<&PartitionOutputOverride>)> { + if self.region_regex.is_match(region) { + Some((self, None)) + } else { + None + } + } +} + +#[derive(Clone, Debug)] +pub(crate) struct PartitionOutput { + name: Str, + dns_suffix: Str, + dual_stack_dns_suffix: Str, + supports_fips: bool, + supports_dual_stack: bool, + implicit_global_region: Str, +} + +#[derive(Clone, Debug, Default)] +pub(crate) struct PartitionOutputOverride { + name: Option, + dns_suffix: Option, + dual_stack_dns_suffix: Option, + supports_fips: Option, + supports_dual_stack: Option, + implicit_global_region: Option, +} + +impl PartitionOutputOverride { + pub(crate) fn into_partition_output(self) -> Result> { + Ok(PartitionOutput { + name: self.name.ok_or("missing name")?, + dns_suffix: self.dns_suffix.ok_or("missing dnsSuffix")?, + dual_stack_dns_suffix: self.dual_stack_dns_suffix.ok_or("missing dual_stackDnsSuffix")?, + supports_fips: self.supports_fips.ok_or("missing supports fips")?, + supports_dual_stack: self.supports_dual_stack.ok_or("missing supportsDualstack")?, + implicit_global_region: self.implicit_global_region.ok_or("missing implicitGlobalRegion")?, + }) + } +} + +/// JSON deserializers for partition metadata +/// +/// This code was generated by smithy-rs and then hand edited for clarity +mod deser { + use crate::endpoint_lib::partition::{PartitionMetadata, PartitionMetadataBuilder, PartitionOutputOverride, PartitionResolver}; + use aws_smithy_json::deserialize::token::{expect_bool_or_null, expect_start_object, expect_string_or_null, skip_value}; + use aws_smithy_json::deserialize::{error::DeserializeError, json_token_iter, Token}; + use regex_lite::Regex; + use std::borrow::Cow; + use std::collections::HashMap; + + pub(crate) fn deserialize_partitions(value: &[u8]) -> Result { + let mut tokens_owned = json_token_iter(value).peekable(); + let tokens = &mut tokens_owned; + expect_start_object(tokens.next())?; + let mut resolver = None; + loop { + match tokens.next().transpose()? { + Some(Token::EndObject { .. }) => break, + Some(Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "partitions" => { + resolver = Some(PartitionResolver::from_partitions(deser_partitions(tokens)?)); + } + _ => skip_value(tokens)?, + }, + other => return Err(DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))), + } + } + if tokens.next().is_some() { + return Err(DeserializeError::custom("found more JSON tokens after completing parsing")); + } + resolver.ok_or_else(|| DeserializeError::custom("did not find partitions array")) + } + + fn deser_partitions<'a, I>(tokens: &mut std::iter::Peekable) -> Result, DeserializeError> + where + I: Iterator, DeserializeError>>, + { + match tokens.next().transpose()? { + Some(Token::StartArray { .. }) => { + let mut items = Vec::new(); + loop { + match tokens.peek() { + Some(Ok(Token::EndArray { .. })) => { + tokens.next().transpose().unwrap(); + break; + } + _ => { + items.push(deser_partition(tokens)?); + } + } + } + Ok(items) + } + _ => Err(DeserializeError::custom("expected start array")), + } + } + + pub(crate) fn deser_partition<'a, I>(tokens: &mut std::iter::Peekable) -> Result + where + I: Iterator, DeserializeError>>, + { + match tokens.next().transpose()? { + Some(Token::StartObject { .. }) => { + let mut builder = PartitionMetadataBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(Token::EndObject { .. }) => break, + Some(Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "id" => { + builder.id = token_to_str(tokens.next())?; + } + "regionRegex" => { + builder.region_regex = token_to_str(tokens.next())? + .map(|region_regex| Regex::new(®ion_regex)) + .transpose() + .map_err(|_e| DeserializeError::custom("invalid regex"))?; + } + "regions" => { + builder.regions = deser_explicit_regions(tokens)?; + } + "outputs" => { + builder.outputs = deser_outputs(tokens)?; + } + _ => skip_value(tokens)?, + }, + other => return Err(DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))), + } + } + Ok(builder.build()) + } + _ => Err(DeserializeError::custom("expected start object")), + } + } + + #[allow(clippy::type_complexity, non_snake_case)] + pub(crate) fn deser_explicit_regions<'a, I>( + tokens: &mut std::iter::Peekable, + ) -> Result, DeserializeError> + where + I: Iterator, DeserializeError>>, + { + match tokens.next().transpose()? { + Some(Token::StartObject { .. }) => { + let mut map = HashMap::new(); + loop { + match tokens.next().transpose()? { + Some(Token::EndObject { .. }) => break, + Some(Token::ObjectKey { key, .. }) => { + let key = key.to_unescaped().map(|u| u.into_owned())?; + let value = deser_outputs(tokens)?; + if let Some(value) = value { + map.insert(key.into(), value); + } + } + other => return Err(DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))), + } + } + Ok(map) + } + _ => Err(DeserializeError::custom("expected start object")), + } + } + + /// Convert a token to `Str` (a potentially static String) + fn token_to_str(token: Option>) -> Result, DeserializeError> { + Ok(expect_string_or_null(token)? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()? + .map(Cow::Owned)) + } + + fn deser_outputs<'a, I>(tokens: &mut std::iter::Peekable) -> Result, DeserializeError> + where + I: Iterator, DeserializeError>>, + { + match tokens.next().transpose()? { + Some(Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = PartitionOutputOverride::default(); + loop { + match tokens.next().transpose()? { + Some(Token::EndObject { .. }) => break, + Some(Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "name" => { + builder.name = token_to_str(tokens.next())?; + } + "dnsSuffix" => { + builder.dns_suffix = token_to_str(tokens.next())?; + } + "dualStackDnsSuffix" => { + builder.dual_stack_dns_suffix = token_to_str(tokens.next())?; + } + "supportsFIPS" => { + builder.supports_fips = expect_bool_or_null(tokens.next())?; + } + "supportsDualStack" => { + builder.supports_dual_stack = expect_bool_or_null(tokens.next())?; + } + "implicitGlobalRegion" => { + builder.implicit_global_region = token_to_str(tokens.next())?; + } + _ => skip_value(tokens)?, + }, + other => return Err(DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))), + } + } + Ok(Some(builder)) + } + _ => Err(DeserializeError::custom("expected start object")), + } + } +} + +#[cfg(test)] +mod test { + use crate::endpoint_lib::diagnostic::DiagnosticCollector; + use crate::endpoint_lib::partition::{Partition, PartitionMetadata, PartitionOutput, PartitionOutputOverride, PartitionResolver}; + use regex_lite::Regex; + use std::collections::HashMap; + + fn resolve<'a>(resolver: &'a PartitionResolver, region: &str) -> Partition<'a> { + resolver + .resolve_partition(region, &mut DiagnosticCollector::new()) + .expect("could not resolve partition") + } + + #[test] + fn deserialize_partitions() { + let partitions = r#"{ + "version": "1.1", + "partitions": [ + { + "id": "aws", + "regionRegex": "^(us|eu|ap|sa|ca|me|af)-\\w+-\\d+$", + "regions": { + "af-south-1": {}, + "af-east-1": {}, + "ap-northeast-1": {}, + "ap-northeast-2": {}, + "ap-northeast-3": {}, + "ap-south-1": {}, + "ap-southeast-1": {}, + "ap-southeast-2": {}, + "ap-southeast-3": {}, + "ca-central-1": {}, + "eu-central-1": {}, + "eu-north-1": {}, + "eu-south-1": {}, + "eu-west-1": {}, + "eu-west-2": {}, + "eu-west-3": {}, + "me-south-1": {}, + "sa-east-1": {}, + "us-east-1": {}, + "us-east-2": {}, + "us-west-1": {}, + "us-west-2": {}, + "aws-global": {} + }, + "outputs": { + "name": "aws", + "dnsSuffix": "amazonaws.com", + "dualStackDnsSuffix": "api.aws", + "supportsFIPS": true, + "supportsDualStack": true, + "implicitGlobalRegion": "us-east-1" + } + }, + { + "id": "aws-us-gov", + "regionRegex": "^us\\-gov\\-\\w+\\-\\d+$", + "regions": { + "us-gov-west-1": {}, + "us-gov-east-1": {}, + "aws-us-gov-global": {} + }, + "outputs": { + "name": "aws-us-gov", + "dnsSuffix": "amazonaws.com", + "dualStackDnsSuffix": "api.aws", + "supportsFIPS": true, + "supportsDualStack": true, + "implicitGlobalRegion": "us-gov-east-1" + } + }, + { + "id": "aws-cn", + "regionRegex": "^cn\\-\\w+\\-\\d+$", + "regions": { + "cn-north-1": {}, + "cn-northwest-1": {}, + "aws-cn-global": {} + }, + "outputs": { + "name": "aws-cn", + "dnsSuffix": "amazonaws.com.cn", + "dualStackDnsSuffix": "api.amazonwebservices.com.cn", + "supportsFIPS": true, + "supportsDualStack": true, + "implicitGlobalRegion": "cn-north-1" + } + }, + { + "id": "aws-iso", + "regionRegex": "^us\\-iso\\-\\w+\\-\\d+$", + "outputs": { + "name": "aws-iso", + "dnsSuffix": "c2s.ic.gov", + "supportsFIPS": true, + "supportsDualStack": false, + "dualStackDnsSuffix": "c2s.ic.gov", + "implicitGlobalRegion": "us-iso-foo-1" + }, + "regions": {} + }, + { + "id": "aws-iso-b", + "regionRegex": "^us\\-isob\\-\\w+\\-\\d+$", + "outputs": { + "name": "aws-iso-b", + "dnsSuffix": "sc2s.sgov.gov", + "supportsFIPS": true, + "supportsDualStack": false, + "dualStackDnsSuffix": "sc2s.sgov.gov", + "implicitGlobalRegion": "us-isob-foo-1" + }, + "regions": {} + } + ] +}"#; + let resolver = super::deser::deserialize_partitions(partitions.as_bytes()).expect("valid resolver"); + assert_eq!(resolve(&resolver, "cn-north-1").name, "aws-cn"); + assert_eq!(resolve(&resolver, "cn-north-1").dns_suffix, "amazonaws.com.cn"); + assert_eq!(resolver.partitions.len(), 5); + assert_eq!(resolve(&resolver, "af-south-1").implicit_global_region, "us-east-1"); + } + + #[test] + fn resolve_partitions() { + let mut resolver = PartitionResolver::empty(); + let new_suffix = PartitionOutputOverride { + dns_suffix: Some("mars.aws".into()), + ..Default::default() + }; + resolver.add_partition(PartitionMetadata { + id: "aws".into(), + region_regex: Regex::new("^(us|eu|ap|sa|ca|me|af)-\\w+-\\d+$").unwrap(), + regions: HashMap::from([("mars-east-2".into(), new_suffix)]), + outputs: PartitionOutput { + name: "aws".into(), + dns_suffix: "amazonaws.com".into(), + dual_stack_dns_suffix: "api.aws".into(), + supports_fips: true, + supports_dual_stack: true, + implicit_global_region: "us-east-1".into(), + }, + }); + resolver.add_partition(PartitionMetadata { + id: "other".into(), + region_regex: Regex::new("^(other)-\\w+-\\d+$").unwrap(), + regions: Default::default(), + outputs: PartitionOutput { + name: "other".into(), + dns_suffix: "other.amazonaws.com".into(), + dual_stack_dns_suffix: "other.aws".into(), + supports_fips: false, + supports_dual_stack: true, + implicit_global_region: "other-south-2".into(), + }, + }); + assert_eq!(resolve(&resolver, "us-east-1").name, "aws"); + assert_eq!(resolve(&resolver, "other-west-2").name, "other"); + // mars-east-1 hits aws through the default fallback + assert_eq!(resolve(&resolver, "mars-east-1").dns_suffix, "amazonaws.com"); + // mars-east-2 hits aws through the region override + assert_eq!(resolve(&resolver, "mars-east-2").dns_suffix, "mars.aws"); + } +} diff --git a/sdk/directoryservicedata/src/error.rs b/sdk/directoryservicedata/src/error.rs new file mode 100644 index 000000000000..25b0dd73f8ca --- /dev/null +++ b/sdk/directoryservicedata/src/error.rs @@ -0,0 +1,30 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use ::aws_smithy_runtime_api::box_error::BoxError; + +/// Error type returned by the client. +pub type SdkError = ::aws_smithy_runtime_api::client::result::SdkError; +pub use ::aws_smithy_runtime_api::client::result::ConnectorError; +pub use ::aws_smithy_types::error::operation::BuildError; + +pub use ::aws_smithy_types::error::display::DisplayErrorContext; +pub use ::aws_smithy_types::error::metadata::ErrorMetadata; +pub use ::aws_smithy_types::error::metadata::ProvideErrorMetadata; + +/// The given enum value failed to parse since it is not a known value. +#[derive(Debug)] +pub struct UnknownVariantError { + value: ::std::string::String, +} +impl UnknownVariantError { + pub(crate) fn new(value: impl ::std::convert::Into<::std::string::String>) -> Self { + Self { value: value.into() } + } +} +impl ::std::fmt::Display for UnknownVariantError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::result::Result<(), ::std::fmt::Error> { + write!(f, "unknown enum variant: '{}'", self.value) + } +} +impl ::std::error::Error for UnknownVariantError {} + +pub(crate) mod sealed_unhandled; diff --git a/sdk/directoryservicedata/src/error/sealed_unhandled.rs b/sdk/directoryservicedata/src/error/sealed_unhandled.rs new file mode 100644 index 000000000000..357c3ccc4c9a --- /dev/null +++ b/sdk/directoryservicedata/src/error/sealed_unhandled.rs @@ -0,0 +1,20 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// This struct is not intended to be used. +/// +/// This struct holds information about an unhandled error, +/// but that information should be obtained by using the +/// [`ProvideErrorMetadata`](::aws_smithy_types::error::metadata::ProvideErrorMetadata) trait +/// on the error type. +/// +/// This struct intentionally doesn't yield any useful information itself. +#[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ +variable wildcard pattern and check `.code()`: + \ +   `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ +See [`ProvideErrorMetadata`](::aws_smithy_types::error::metadata::ProvideErrorMetadata) for what information is available for the error.")] +#[derive(Debug)] +pub struct Unhandled { + pub(crate) source: ::aws_smithy_runtime_api::box_error::BoxError, + pub(crate) meta: ::aws_smithy_types::error::metadata::ErrorMetadata, +} diff --git a/sdk/directoryservicedata/src/error_meta.rs b/sdk/directoryservicedata/src/error_meta.rs new file mode 100644 index 000000000000..9bbbddab4a54 --- /dev/null +++ b/sdk/directoryservicedata/src/error_meta.rs @@ -0,0 +1,576 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// All possible error types for this service. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum Error { + ///

      You don't have permission to perform the request or access the directory. It can also occur when the DirectoryId doesn't exist or the user, member, or group might be outside of your organizational unit (OU).

      + ///

      Make sure that you have the authentication and authorization to perform the action. Review the directory information in the request, and make sure that the object isn't outside of your OU.

      + AccessDeniedException(crate::types::error::AccessDeniedException), + ///

      This error will occur when you try to create a resource that conflicts with an existing object. It can also occur when adding a member to a group that the member is already in.

      + ///

      This error can be caused by a request sent within the 8-hour idempotency window with the same client token but different input parameters. Client tokens should not be re-used across different requests. After 8 hours, any request with the same client token is treated as a new request.

      + ConflictException(crate::types::error::ConflictException), + ///

      The request could not be completed due to a problem in the configuration or current state of the specified directory.

      + DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), + ///

      The operation didn't succeed because an internal error occurred. Try again later.

      + InternalServerException(crate::types::error::InternalServerException), + ///

      The resource couldn't be found.

      + ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

      The limit on the number of requests per second has been exceeded.

      + ThrottlingException(crate::types::error::ThrottlingException), + ///

      The request isn't valid. Review the details in the error message to update the invalid parameters or values in your request.

      + ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl ::std::fmt::Display for Error { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Error::AccessDeniedException(inner) => inner.fmt(f), + Error::ConflictException(inner) => inner.fmt(f), + Error::DirectoryUnavailableException(inner) => inner.fmt(f), + Error::InternalServerException(inner) => inner.fmt(f), + Error::ResourceNotFoundException(inner) => inner.fmt(f), + Error::ThrottlingException(inner) => inner.fmt(f), + Error::ValidationException(inner) => inner.fmt(f), + Error::Unhandled(_) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl From<::aws_smithy_types::error::operation::BuildError> for Error { + fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self { + Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: value.into(), + meta: ::std::default::Default::default(), + }) + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error { + fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata { + match self { + Self::AccessDeniedException(inner) => inner.meta(), + Self::ConflictException(inner) => inner.meta(), + Self::DirectoryUnavailableException(inner) => inner.meta(), + Self::InternalServerException(inner) => inner.meta(), + Self::ResourceNotFoundException(inner) => inner.meta(), + Self::ThrottlingException(inner) => inner.meta(), + Self::ValidationException(inner) => inner.meta(), + Self::Unhandled(inner) => &inner.meta, + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from(err: ::aws_smithy_runtime_api::client::result::SdkError) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::add_group_member::AddGroupMemberError) -> Self { + match err { + crate::operation::add_group_member::AddGroupMemberError::AccessDeniedException(inner) => Error::AccessDeniedException(inner), + crate::operation::add_group_member::AddGroupMemberError::ConflictException(inner) => Error::ConflictException(inner), + crate::operation::add_group_member::AddGroupMemberError::DirectoryUnavailableException(inner) => { + Error::DirectoryUnavailableException(inner) + } + crate::operation::add_group_member::AddGroupMemberError::InternalServerException(inner) => Error::InternalServerException(inner), + crate::operation::add_group_member::AddGroupMemberError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner), + crate::operation::add_group_member::AddGroupMemberError::ThrottlingException(inner) => Error::ThrottlingException(inner), + crate::operation::add_group_member::AddGroupMemberError::ValidationException(inner) => Error::ValidationException(inner), + crate::operation::add_group_member::AddGroupMemberError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from(err: ::aws_smithy_runtime_api::client::result::SdkError) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::create_group::CreateGroupError) -> Self { + match err { + crate::operation::create_group::CreateGroupError::AccessDeniedException(inner) => Error::AccessDeniedException(inner), + crate::operation::create_group::CreateGroupError::ConflictException(inner) => Error::ConflictException(inner), + crate::operation::create_group::CreateGroupError::DirectoryUnavailableException(inner) => Error::DirectoryUnavailableException(inner), + crate::operation::create_group::CreateGroupError::InternalServerException(inner) => Error::InternalServerException(inner), + crate::operation::create_group::CreateGroupError::ThrottlingException(inner) => Error::ThrottlingException(inner), + crate::operation::create_group::CreateGroupError::ValidationException(inner) => Error::ValidationException(inner), + crate::operation::create_group::CreateGroupError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from(err: ::aws_smithy_runtime_api::client::result::SdkError) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::create_user::CreateUserError) -> Self { + match err { + crate::operation::create_user::CreateUserError::AccessDeniedException(inner) => Error::AccessDeniedException(inner), + crate::operation::create_user::CreateUserError::ConflictException(inner) => Error::ConflictException(inner), + crate::operation::create_user::CreateUserError::DirectoryUnavailableException(inner) => Error::DirectoryUnavailableException(inner), + crate::operation::create_user::CreateUserError::InternalServerException(inner) => Error::InternalServerException(inner), + crate::operation::create_user::CreateUserError::ThrottlingException(inner) => Error::ThrottlingException(inner), + crate::operation::create_user::CreateUserError::ValidationException(inner) => Error::ValidationException(inner), + crate::operation::create_user::CreateUserError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from(err: ::aws_smithy_runtime_api::client::result::SdkError) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::delete_group::DeleteGroupError) -> Self { + match err { + crate::operation::delete_group::DeleteGroupError::AccessDeniedException(inner) => Error::AccessDeniedException(inner), + crate::operation::delete_group::DeleteGroupError::ConflictException(inner) => Error::ConflictException(inner), + crate::operation::delete_group::DeleteGroupError::DirectoryUnavailableException(inner) => Error::DirectoryUnavailableException(inner), + crate::operation::delete_group::DeleteGroupError::InternalServerException(inner) => Error::InternalServerException(inner), + crate::operation::delete_group::DeleteGroupError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner), + crate::operation::delete_group::DeleteGroupError::ThrottlingException(inner) => Error::ThrottlingException(inner), + crate::operation::delete_group::DeleteGroupError::ValidationException(inner) => Error::ValidationException(inner), + crate::operation::delete_group::DeleteGroupError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from(err: ::aws_smithy_runtime_api::client::result::SdkError) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::delete_user::DeleteUserError) -> Self { + match err { + crate::operation::delete_user::DeleteUserError::AccessDeniedException(inner) => Error::AccessDeniedException(inner), + crate::operation::delete_user::DeleteUserError::ConflictException(inner) => Error::ConflictException(inner), + crate::operation::delete_user::DeleteUserError::DirectoryUnavailableException(inner) => Error::DirectoryUnavailableException(inner), + crate::operation::delete_user::DeleteUserError::InternalServerException(inner) => Error::InternalServerException(inner), + crate::operation::delete_user::DeleteUserError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner), + crate::operation::delete_user::DeleteUserError::ThrottlingException(inner) => Error::ThrottlingException(inner), + crate::operation::delete_user::DeleteUserError::ValidationException(inner) => Error::ValidationException(inner), + crate::operation::delete_user::DeleteUserError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from(err: ::aws_smithy_runtime_api::client::result::SdkError) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::describe_group::DescribeGroupError) -> Self { + match err { + crate::operation::describe_group::DescribeGroupError::AccessDeniedException(inner) => Error::AccessDeniedException(inner), + crate::operation::describe_group::DescribeGroupError::DirectoryUnavailableException(inner) => Error::DirectoryUnavailableException(inner), + crate::operation::describe_group::DescribeGroupError::InternalServerException(inner) => Error::InternalServerException(inner), + crate::operation::describe_group::DescribeGroupError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner), + crate::operation::describe_group::DescribeGroupError::ThrottlingException(inner) => Error::ThrottlingException(inner), + crate::operation::describe_group::DescribeGroupError::ValidationException(inner) => Error::ValidationException(inner), + crate::operation::describe_group::DescribeGroupError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from(err: ::aws_smithy_runtime_api::client::result::SdkError) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::describe_user::DescribeUserError) -> Self { + match err { + crate::operation::describe_user::DescribeUserError::AccessDeniedException(inner) => Error::AccessDeniedException(inner), + crate::operation::describe_user::DescribeUserError::DirectoryUnavailableException(inner) => Error::DirectoryUnavailableException(inner), + crate::operation::describe_user::DescribeUserError::InternalServerException(inner) => Error::InternalServerException(inner), + crate::operation::describe_user::DescribeUserError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner), + crate::operation::describe_user::DescribeUserError::ThrottlingException(inner) => Error::ThrottlingException(inner), + crate::operation::describe_user::DescribeUserError::ValidationException(inner) => Error::ValidationException(inner), + crate::operation::describe_user::DescribeUserError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from(err: ::aws_smithy_runtime_api::client::result::SdkError) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::disable_user::DisableUserError) -> Self { + match err { + crate::operation::disable_user::DisableUserError::AccessDeniedException(inner) => Error::AccessDeniedException(inner), + crate::operation::disable_user::DisableUserError::ConflictException(inner) => Error::ConflictException(inner), + crate::operation::disable_user::DisableUserError::DirectoryUnavailableException(inner) => Error::DirectoryUnavailableException(inner), + crate::operation::disable_user::DisableUserError::InternalServerException(inner) => Error::InternalServerException(inner), + crate::operation::disable_user::DisableUserError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner), + crate::operation::disable_user::DisableUserError::ThrottlingException(inner) => Error::ThrottlingException(inner), + crate::operation::disable_user::DisableUserError::ValidationException(inner) => Error::ValidationException(inner), + crate::operation::disable_user::DisableUserError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from(err: ::aws_smithy_runtime_api::client::result::SdkError) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::list_group_members::ListGroupMembersError) -> Self { + match err { + crate::operation::list_group_members::ListGroupMembersError::AccessDeniedException(inner) => Error::AccessDeniedException(inner), + crate::operation::list_group_members::ListGroupMembersError::DirectoryUnavailableException(inner) => { + Error::DirectoryUnavailableException(inner) + } + crate::operation::list_group_members::ListGroupMembersError::InternalServerException(inner) => Error::InternalServerException(inner), + crate::operation::list_group_members::ListGroupMembersError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner), + crate::operation::list_group_members::ListGroupMembersError::ThrottlingException(inner) => Error::ThrottlingException(inner), + crate::operation::list_group_members::ListGroupMembersError::ValidationException(inner) => Error::ValidationException(inner), + crate::operation::list_group_members::ListGroupMembersError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from(err: ::aws_smithy_runtime_api::client::result::SdkError) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::list_groups::ListGroupsError) -> Self { + match err { + crate::operation::list_groups::ListGroupsError::AccessDeniedException(inner) => Error::AccessDeniedException(inner), + crate::operation::list_groups::ListGroupsError::DirectoryUnavailableException(inner) => Error::DirectoryUnavailableException(inner), + crate::operation::list_groups::ListGroupsError::InternalServerException(inner) => Error::InternalServerException(inner), + crate::operation::list_groups::ListGroupsError::ThrottlingException(inner) => Error::ThrottlingException(inner), + crate::operation::list_groups::ListGroupsError::ValidationException(inner) => Error::ValidationException(inner), + crate::operation::list_groups::ListGroupsError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from(err: ::aws_smithy_runtime_api::client::result::SdkError) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::list_groups_for_member::ListGroupsForMemberError) -> Self { + match err { + crate::operation::list_groups_for_member::ListGroupsForMemberError::AccessDeniedException(inner) => Error::AccessDeniedException(inner), + crate::operation::list_groups_for_member::ListGroupsForMemberError::DirectoryUnavailableException(inner) => { + Error::DirectoryUnavailableException(inner) + } + crate::operation::list_groups_for_member::ListGroupsForMemberError::InternalServerException(inner) => { + Error::InternalServerException(inner) + } + crate::operation::list_groups_for_member::ListGroupsForMemberError::ResourceNotFoundException(inner) => { + Error::ResourceNotFoundException(inner) + } + crate::operation::list_groups_for_member::ListGroupsForMemberError::ThrottlingException(inner) => Error::ThrottlingException(inner), + crate::operation::list_groups_for_member::ListGroupsForMemberError::ValidationException(inner) => Error::ValidationException(inner), + crate::operation::list_groups_for_member::ListGroupsForMemberError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from(err: ::aws_smithy_runtime_api::client::result::SdkError) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::list_users::ListUsersError) -> Self { + match err { + crate::operation::list_users::ListUsersError::AccessDeniedException(inner) => Error::AccessDeniedException(inner), + crate::operation::list_users::ListUsersError::DirectoryUnavailableException(inner) => Error::DirectoryUnavailableException(inner), + crate::operation::list_users::ListUsersError::InternalServerException(inner) => Error::InternalServerException(inner), + crate::operation::list_users::ListUsersError::ThrottlingException(inner) => Error::ThrottlingException(inner), + crate::operation::list_users::ListUsersError::ValidationException(inner) => Error::ValidationException(inner), + crate::operation::list_users::ListUsersError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from(err: ::aws_smithy_runtime_api::client::result::SdkError) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::remove_group_member::RemoveGroupMemberError) -> Self { + match err { + crate::operation::remove_group_member::RemoveGroupMemberError::AccessDeniedException(inner) => Error::AccessDeniedException(inner), + crate::operation::remove_group_member::RemoveGroupMemberError::ConflictException(inner) => Error::ConflictException(inner), + crate::operation::remove_group_member::RemoveGroupMemberError::DirectoryUnavailableException(inner) => { + Error::DirectoryUnavailableException(inner) + } + crate::operation::remove_group_member::RemoveGroupMemberError::InternalServerException(inner) => Error::InternalServerException(inner), + crate::operation::remove_group_member::RemoveGroupMemberError::ResourceNotFoundException(inner) => { + Error::ResourceNotFoundException(inner) + } + crate::operation::remove_group_member::RemoveGroupMemberError::ThrottlingException(inner) => Error::ThrottlingException(inner), + crate::operation::remove_group_member::RemoveGroupMemberError::ValidationException(inner) => Error::ValidationException(inner), + crate::operation::remove_group_member::RemoveGroupMemberError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from(err: ::aws_smithy_runtime_api::client::result::SdkError) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::search_groups::SearchGroupsError) -> Self { + match err { + crate::operation::search_groups::SearchGroupsError::AccessDeniedException(inner) => Error::AccessDeniedException(inner), + crate::operation::search_groups::SearchGroupsError::DirectoryUnavailableException(inner) => Error::DirectoryUnavailableException(inner), + crate::operation::search_groups::SearchGroupsError::InternalServerException(inner) => Error::InternalServerException(inner), + crate::operation::search_groups::SearchGroupsError::ThrottlingException(inner) => Error::ThrottlingException(inner), + crate::operation::search_groups::SearchGroupsError::ValidationException(inner) => Error::ValidationException(inner), + crate::operation::search_groups::SearchGroupsError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from(err: ::aws_smithy_runtime_api::client::result::SdkError) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::search_users::SearchUsersError) -> Self { + match err { + crate::operation::search_users::SearchUsersError::AccessDeniedException(inner) => Error::AccessDeniedException(inner), + crate::operation::search_users::SearchUsersError::DirectoryUnavailableException(inner) => Error::DirectoryUnavailableException(inner), + crate::operation::search_users::SearchUsersError::InternalServerException(inner) => Error::InternalServerException(inner), + crate::operation::search_users::SearchUsersError::ThrottlingException(inner) => Error::ThrottlingException(inner), + crate::operation::search_users::SearchUsersError::ValidationException(inner) => Error::ValidationException(inner), + crate::operation::search_users::SearchUsersError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from(err: ::aws_smithy_runtime_api::client::result::SdkError) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::update_group::UpdateGroupError) -> Self { + match err { + crate::operation::update_group::UpdateGroupError::AccessDeniedException(inner) => Error::AccessDeniedException(inner), + crate::operation::update_group::UpdateGroupError::ConflictException(inner) => Error::ConflictException(inner), + crate::operation::update_group::UpdateGroupError::DirectoryUnavailableException(inner) => Error::DirectoryUnavailableException(inner), + crate::operation::update_group::UpdateGroupError::InternalServerException(inner) => Error::InternalServerException(inner), + crate::operation::update_group::UpdateGroupError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner), + crate::operation::update_group::UpdateGroupError::ThrottlingException(inner) => Error::ThrottlingException(inner), + crate::operation::update_group::UpdateGroupError::ValidationException(inner) => Error::ValidationException(inner), + crate::operation::update_group::UpdateGroupError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl From<::aws_smithy_runtime_api::client::result::SdkError> for Error +where + R: Send + Sync + std::fmt::Debug + 'static, +{ + fn from(err: ::aws_smithy_runtime_api::client::result::SdkError) -> Self { + match err { + ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()), + _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled { + meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(), + source: err.into(), + }), + } + } +} +impl From for Error { + fn from(err: crate::operation::update_user::UpdateUserError) -> Self { + match err { + crate::operation::update_user::UpdateUserError::AccessDeniedException(inner) => Error::AccessDeniedException(inner), + crate::operation::update_user::UpdateUserError::ConflictException(inner) => Error::ConflictException(inner), + crate::operation::update_user::UpdateUserError::DirectoryUnavailableException(inner) => Error::DirectoryUnavailableException(inner), + crate::operation::update_user::UpdateUserError::InternalServerException(inner) => Error::InternalServerException(inner), + crate::operation::update_user::UpdateUserError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner), + crate::operation::update_user::UpdateUserError::ThrottlingException(inner) => Error::ThrottlingException(inner), + crate::operation::update_user::UpdateUserError::ValidationException(inner) => Error::ValidationException(inner), + crate::operation::update_user::UpdateUserError::Unhandled(inner) => Error::Unhandled(inner), + } + } +} +impl ::std::error::Error for Error { + fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Error::AccessDeniedException(inner) => inner.source(), + Error::ConflictException(inner) => inner.source(), + Error::DirectoryUnavailableException(inner) => inner.source(), + Error::InternalServerException(inner) => inner.source(), + Error::ResourceNotFoundException(inner) => inner.source(), + Error::ThrottlingException(inner) => inner.source(), + Error::ValidationException(inner) => inner.source(), + Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source), + } + } +} +impl ::aws_types::request_id::RequestId for Error { + fn request_id(&self) -> Option<&str> { + match self { + Self::AccessDeniedException(e) => e.request_id(), + Self::ConflictException(e) => e.request_id(), + Self::DirectoryUnavailableException(e) => e.request_id(), + Self::InternalServerException(e) => e.request_id(), + Self::ResourceNotFoundException(e) => e.request_id(), + Self::ThrottlingException(e) => e.request_id(), + Self::ValidationException(e) => e.request_id(), + Self::Unhandled(e) => e.meta.request_id(), + } + } +} diff --git a/sdk/directoryservicedata/src/idempotency_token.rs b/sdk/directoryservicedata/src/idempotency_token.rs new file mode 100644 index 000000000000..ea19dae3f738 --- /dev/null +++ b/sdk/directoryservicedata/src/idempotency_token.rs @@ -0,0 +1,102 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +use aws_smithy_types::config_bag::{Storable, StoreReplace}; +use std::sync::Mutex; + +pub(crate) fn uuid_v4(input: u128) -> String { + let mut out = String::with_capacity(36); + // u4-aligned index into [input] + let mut rnd_idx: u8 = 0; + const HEX_CHARS: &[u8; 16] = b"0123456789abcdef"; + + for str_idx in 0..36 { + if str_idx == 8 || str_idx == 13 || str_idx == 18 || str_idx == 23 { + out.push('-'); + // UUID version character + } else if str_idx == 14 { + out.push('4'); + } else { + let mut dat: u8 = ((input >> (rnd_idx * 4)) & 0x0F) as u8; + // UUID variant bits + if str_idx == 19 { + dat |= 0b00001000; + } + rnd_idx += 1; + out.push(HEX_CHARS[dat as usize] as char); + } + } + out +} + +/// IdempotencyTokenProvider generates idempotency tokens for idempotent API requests +/// +/// Generally, customers will not need to interact with this at all. A sensible default will be +/// provided automatically during config construction. However, if you need deterministic behavior +/// for testing, two options are available: +/// 1. Utilize the From<&'static str>` implementation to hard code an idempotency token +/// 2. Seed the token provider with [`IdempotencyTokenProvider::with_seed`](IdempotencyTokenProvider::with_seed) +#[derive(Debug)] +pub struct IdempotencyTokenProvider { + inner: Inner, +} + +#[derive(Debug)] +enum Inner { + Static(&'static str), + Random(Mutex), +} + +pub fn default_provider() -> IdempotencyTokenProvider { + IdempotencyTokenProvider::random() +} + +impl From<&'static str> for IdempotencyTokenProvider { + fn from(token: &'static str) -> Self { + Self::fixed(token) + } +} + +impl Storable for IdempotencyTokenProvider { + type Storer = StoreReplace; +} + +impl IdempotencyTokenProvider { + pub fn make_idempotency_token(&self) -> String { + match &self.inner { + Inner::Static(token) => token.to_string(), + Inner::Random(rng) => { + let input: u128 = rng.lock().unwrap().u128(..); + uuid_v4(input) + } + } + } + + pub fn with_seed(seed: u64) -> Self { + Self { + inner: Inner::Random(Mutex::new(fastrand::Rng::with_seed(seed))), + } + } + + pub fn random() -> Self { + Self { + inner: Inner::Random(Mutex::new(fastrand::Rng::new())), + } + } + + pub fn fixed(token: &'static str) -> Self { + Self { inner: Inner::Static(token) } + } +} + +impl Clone for IdempotencyTokenProvider { + fn clone(&self) -> Self { + match &self.inner { + Inner::Static(token) => IdempotencyTokenProvider::fixed(token), + Inner::Random(_) => IdempotencyTokenProvider::random(), + } + } +} diff --git a/sdk/directoryservicedata/src/json_errors.rs b/sdk/directoryservicedata/src/json_errors.rs new file mode 100644 index 000000000000..e48663f337fc --- /dev/null +++ b/sdk/directoryservicedata/src/json_errors.rs @@ -0,0 +1,180 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +use aws_smithy_json::deserialize::token::skip_value; +use aws_smithy_json::deserialize::{error::DeserializeError, json_token_iter, Token}; +use aws_smithy_runtime_api::http::Headers; +use aws_smithy_types::error::metadata::{Builder as ErrorMetadataBuilder, ErrorMetadata}; +use std::borrow::Cow; + +// currently only used by AwsJson +#[allow(unused)] +pub fn is_error(response: &http::Response) -> bool { + !response.status().is_success() +} + +fn sanitize_error_code(error_code: &str) -> &str { + // Trim a trailing URL from the error code, which is done by removing the longest suffix + // beginning with a `:` + let error_code = match error_code.find(':') { + Some(idx) => &error_code[..idx], + None => error_code, + }; + + // Trim a prefixing namespace from the error code, beginning with a `#` + match error_code.find('#') { + Some(idx) => &error_code[idx + 1..], + None => error_code, + } +} + +struct ErrorBody<'a> { + code: Option>, + message: Option>, +} + +fn parse_error_body(bytes: &[u8]) -> Result { + let mut tokens = json_token_iter(bytes).peekable(); + let (mut typ, mut code, mut message) = (None, None, None); + if let Some(Token::StartObject { .. }) = tokens.next().transpose()? { + loop { + match tokens.next().transpose()? { + Some(Token::EndObject { .. }) => break, + Some(Token::ObjectKey { key, .. }) => { + if let Some(Ok(Token::ValueString { value, .. })) = tokens.peek() { + match key.as_escaped_str() { + "code" => code = Some(value.to_unescaped()?), + "__type" => typ = Some(value.to_unescaped()?), + "message" | "Message" | "errorMessage" => message = Some(value.to_unescaped()?), + _ => {} + } + } + skip_value(&mut tokens)?; + } + _ => return Err(DeserializeError::custom("expected object key or end object")), + } + } + if tokens.next().is_some() { + return Err(DeserializeError::custom("found more JSON tokens after completing parsing")); + } + } + Ok(ErrorBody { code: code.or(typ), message }) +} + +pub fn parse_error_metadata(payload: &[u8], headers: &Headers) -> Result { + let ErrorBody { code, message } = parse_error_body(payload)?; + + let mut err_builder = ErrorMetadata::builder(); + if let Some(code) = headers.get("x-amzn-errortype").or(code.as_deref()).map(sanitize_error_code) { + err_builder = err_builder.code(code); + } + if let Some(message) = message { + err_builder = err_builder.message(message); + } + Ok(err_builder) +} + +#[cfg(test)] +mod test { + use crate::json_errors::{parse_error_body, parse_error_metadata, sanitize_error_code}; + use aws_smithy_runtime_api::client::orchestrator::HttpResponse; + use aws_smithy_types::{body::SdkBody, error::ErrorMetadata}; + use std::borrow::Cow; + + #[test] + fn error_metadata() { + let response = HttpResponse::try_from( + http::Response::builder() + .body(SdkBody::from(r#"{ "__type": "FooError", "message": "Go to foo" }"#)) + .unwrap(), + ) + .unwrap(); + assert_eq!( + parse_error_metadata(response.body().bytes().unwrap(), response.headers()) + .unwrap() + .build(), + ErrorMetadata::builder().code("FooError").message("Go to foo").build() + ) + } + + #[test] + fn error_type() { + assert_eq!( + Some(Cow::Borrowed("FooError")), + parse_error_body(br#"{ "__type": "FooError" }"#).unwrap().code + ); + } + + #[test] + fn code_takes_priority() { + assert_eq!( + Some(Cow::Borrowed("BarError")), + parse_error_body(br#"{ "code": "BarError", "__type": "FooError" }"#).unwrap().code + ); + } + + #[test] + fn ignore_unrecognized_fields() { + assert_eq!( + Some(Cow::Borrowed("FooError")), + parse_error_body(br#"{ "__type": "FooError", "asdf": 5, "fdsa": {}, "foo": "1" }"#) + .unwrap() + .code + ); + } + + #[test] + fn sanitize_namespace_and_url() { + assert_eq!( + sanitize_error_code("aws.protocoltests.restjson#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/"), + "FooError" + ); + } + + #[test] + fn sanitize_noop() { + assert_eq!(sanitize_error_code("FooError"), "FooError"); + } + + #[test] + fn sanitize_url() { + assert_eq!( + sanitize_error_code("FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/"), + "FooError" + ); + } + + #[test] + fn sanitize_namespace() { + assert_eq!(sanitize_error_code("aws.protocoltests.restjson#FooError"), "FooError"); + } + + // services like lambda use an alternate `Message` instead of `message` + #[test] + fn alternative_error_message_names() { + let response = HttpResponse::try_from( + http::Response::builder() + .header("x-amzn-errortype", "ResourceNotFoundException") + .body(SdkBody::from( + r#"{ + "Type": "User", + "Message": "Functions from 'us-west-2' are not reachable from us-east-1" + }"#, + )) + .unwrap(), + ) + .unwrap(); + assert_eq!( + parse_error_metadata(response.body().bytes().unwrap(), response.headers()) + .unwrap() + .build(), + ErrorMetadata::builder() + .code("ResourceNotFoundException") + .message("Functions from 'us-west-2' are not reachable from us-east-1") + .build() + ); + } +} diff --git a/sdk/directoryservicedata/src/lens.rs b/sdk/directoryservicedata/src/lens.rs new file mode 100644 index 000000000000..177539123b8c --- /dev/null +++ b/sdk/directoryservicedata/src/lens.rs @@ -0,0 +1,120 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn reflens_list_group_members_output_output_next_token( + input: &crate::operation::list_group_members::ListGroupMembersOutput, +) -> ::std::option::Option<&::std::string::String> { + let input = match &input.next_token { + ::std::option::Option::None => return ::std::option::Option::None, + ::std::option::Option::Some(t) => t, + }; + ::std::option::Option::Some(input) +} + +pub(crate) fn reflens_list_groups_output_output_next_token( + input: &crate::operation::list_groups::ListGroupsOutput, +) -> ::std::option::Option<&::std::string::String> { + let input = match &input.next_token { + ::std::option::Option::None => return ::std::option::Option::None, + ::std::option::Option::Some(t) => t, + }; + ::std::option::Option::Some(input) +} + +pub(crate) fn reflens_list_groups_for_member_output_output_next_token( + input: &crate::operation::list_groups_for_member::ListGroupsForMemberOutput, +) -> ::std::option::Option<&::std::string::String> { + let input = match &input.next_token { + ::std::option::Option::None => return ::std::option::Option::None, + ::std::option::Option::Some(t) => t, + }; + ::std::option::Option::Some(input) +} + +pub(crate) fn reflens_list_users_output_output_next_token( + input: &crate::operation::list_users::ListUsersOutput, +) -> ::std::option::Option<&::std::string::String> { + let input = match &input.next_token { + ::std::option::Option::None => return ::std::option::Option::None, + ::std::option::Option::Some(t) => t, + }; + ::std::option::Option::Some(input) +} + +pub(crate) fn reflens_search_groups_output_output_next_token( + input: &crate::operation::search_groups::SearchGroupsOutput, +) -> ::std::option::Option<&::std::string::String> { + let input = match &input.next_token { + ::std::option::Option::None => return ::std::option::Option::None, + ::std::option::Option::Some(t) => t, + }; + ::std::option::Option::Some(input) +} + +pub(crate) fn reflens_search_users_output_output_next_token( + input: &crate::operation::search_users::SearchUsersOutput, +) -> ::std::option::Option<&::std::string::String> { + let input = match &input.next_token { + ::std::option::Option::None => return ::std::option::Option::None, + ::std::option::Option::Some(t) => t, + }; + ::std::option::Option::Some(input) +} + +pub(crate) fn lens_list_group_members_output_output_members( + input: crate::operation::list_group_members::ListGroupMembersOutput, +) -> ::std::option::Option<::std::vec::Vec> { + let input = match input.members { + ::std::option::Option::None => return ::std::option::Option::None, + ::std::option::Option::Some(t) => t, + }; + ::std::option::Option::Some(input) +} + +pub(crate) fn lens_list_groups_output_output_groups( + input: crate::operation::list_groups::ListGroupsOutput, +) -> ::std::option::Option<::std::vec::Vec> { + let input = match input.groups { + ::std::option::Option::None => return ::std::option::Option::None, + ::std::option::Option::Some(t) => t, + }; + ::std::option::Option::Some(input) +} + +pub(crate) fn lens_list_groups_for_member_output_output_groups( + input: crate::operation::list_groups_for_member::ListGroupsForMemberOutput, +) -> ::std::option::Option<::std::vec::Vec> { + let input = match input.groups { + ::std::option::Option::None => return ::std::option::Option::None, + ::std::option::Option::Some(t) => t, + }; + ::std::option::Option::Some(input) +} + +pub(crate) fn lens_list_users_output_output_users( + input: crate::operation::list_users::ListUsersOutput, +) -> ::std::option::Option<::std::vec::Vec> { + let input = match input.users { + ::std::option::Option::None => return ::std::option::Option::None, + ::std::option::Option::Some(t) => t, + }; + ::std::option::Option::Some(input) +} + +pub(crate) fn lens_search_groups_output_output_groups( + input: crate::operation::search_groups::SearchGroupsOutput, +) -> ::std::option::Option<::std::vec::Vec> { + let input = match input.groups { + ::std::option::Option::None => return ::std::option::Option::None, + ::std::option::Option::Some(t) => t, + }; + ::std::option::Option::Some(input) +} + +pub(crate) fn lens_search_users_output_output_users( + input: crate::operation::search_users::SearchUsersOutput, +) -> ::std::option::Option<::std::vec::Vec> { + let input = match input.users { + ::std::option::Option::None => return ::std::option::Option::None, + ::std::option::Option::Some(t) => t, + }; + ::std::option::Option::Some(input) +} diff --git a/sdk/directoryservicedata/src/lib.rs b/sdk/directoryservicedata/src/lib.rs new file mode 100644 index 000000000000..a27301806764 --- /dev/null +++ b/sdk/directoryservicedata/src/lib.rs @@ -0,0 +1,218 @@ +#![allow(deprecated)] +#![allow(unknown_lints)] +#![allow(clippy::module_inception)] +#![allow(clippy::upper_case_acronyms)] +#![allow(clippy::large_enum_variant)] +#![allow(clippy::wrong_self_convention)] +#![allow(clippy::should_implement_trait)] +#![allow(clippy::disallowed_names)] +#![allow(clippy::vec_init_then_push)] +#![allow(clippy::type_complexity)] +#![allow(clippy::needless_return)] +#![allow(clippy::derive_partial_eq_without_eq)] +#![allow(clippy::result_large_err)] +#![allow(clippy::unnecessary_map_on_constructor)] +#![allow(rustdoc::bare_urls)] +#![allow(rustdoc::redundant_explicit_links)] +#![forbid(unsafe_code)] +#![warn(missing_docs)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] +//! Amazon Web Services Directory Service Data is an extension of Directory Service. This API reference provides detailed information about Directory Service Data operations and object types. +//! +//! With Directory Service Data, you can create, read, update, and delete users, groups, and memberships from your Managed Microsoft AD without additional costs and without deploying dedicated management instances. You can also perform built-in object management tasks across directories without direct network connectivity, which simplifies provisioning and access management to achieve fully automated deployments. Directory Service Data supports user and group write operations, such as CreateUser and CreateGroup, within the organizational unit (OU) of your Managed Microsoft AD. Directory Service Data supports read operations, such as ListUsers and ListGroups, on all users, groups, and group memberships within your Managed Microsoft AD and across trusted realms. Directory Service Data supports adding and removing group members in your OU and the Amazon Web Services Delegated Groups OU, so you can grant and deny access to specific roles and permissions. For more information, see [Manage users and groups](https://docs.aws.amazon.com/directoryservice/latest/admin-guide/ms_ad_manage_users_groups.html) in the _Directory Service Administration Guide_. +//! +//! Directory Service Data connects to your Managed Microsoft AD domain controllers and performs operations on underlying directory objects. When you create your Managed Microsoft AD, you choose subnets for domain controllers that Directory Service creates on your behalf. If a domain controller is unavailable, Directory Service Data uses an available domain controller. As a result, you might notice eventual consistency while objects replicate from one domain controller to another domain controller. For more information, see [What gets created](https://docs.aws.amazon.com/directoryservice/latest/admin-guide/ms_ad_getting_started_what_gets_created.html) in the _Directory Service Administration Guide_. Directory limits vary by Managed Microsoft AD edition: +//! - __Standard edition__ – Supports 8 transactions per second (TPS) for read operations and 4 TPS for write operations per directory. There's a concurrency limit of 10 concurrent requests. +//! - __Enterprise edition__ – Supports 16 transactions per second (TPS) for read operations and 8 TPS for write operations per directory. There's a concurrency limit of 10 concurrent requests. +//! - __Amazon Web Services Account__ - Supports a total of 100 TPS for Directory Service Data operations across all directories. +//! +//! Directory Service Data only supports the Managed Microsoft AD directory type and is only available in the primary Amazon Web Services Region. For more information, see [Managed Microsoft AD](https://docs.aws.amazon.com/directoryservice/latest/admin-guide/directory_microsoft_ad.html) and [Primary vs additional Regions](https://docs.aws.amazon.com/directoryservice/latest/admin-guide/multi-region-global-primary-additional.html) in the _Directory Service Administration Guide_. +//! +//! ## Getting Started +//! +//! > Examples are available for many services and operations, check out the +//! > [examples folder in GitHub](https://github.com/awslabs/aws-sdk-rust/tree/main/examples). +//! +//! The SDK provides one crate per AWS service. You must add [Tokio](https://crates.io/crates/tokio) +//! as a dependency within your Rust project to execute asynchronous code. To add `aws-sdk-directoryservicedata` to +//! your project, add the following to your **Cargo.toml** file: +//! +//! ```toml +//! [dependencies] +//! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } +//! aws-sdk-directoryservicedata = "1.0.0" +//! tokio = { version = "1", features = ["full"] } +//! ``` +//! +//! Then in code, a client can be created with the following: +//! +//! ```rust,no_run +//! use aws_sdk_directoryservicedata as directoryservicedata; +//! +//! #[::tokio::main] +//! async fn main() -> Result<(), directoryservicedata::Error> { +//! let config = aws_config::load_from_env().await; +//! let client = aws_sdk_directoryservicedata::Client::new(&config); +//! +//! // ... make some calls with the client +//! +//! Ok(()) +//! } +//! ``` +//! +//! See the [client documentation](https://docs.rs/aws-sdk-directoryservicedata/latest/aws_sdk_directoryservicedata/client/struct.Client.html) +//! for information on what calls can be made, and the inputs and outputs for each of those calls. +//! +//! ## Using the SDK +//! +//! Until the SDK is released, we will be adding information about using the SDK to the +//! [Developer Guide](https://docs.aws.amazon.com/sdk-for-rust/latest/dg/welcome.html). Feel free to suggest +//! additional sections for the guide by opening an issue and describing what you are trying to do. +//! +//! ## Getting Help +//! +//! * [GitHub discussions](https://github.com/awslabs/aws-sdk-rust/discussions) - For ideas, RFCs & general questions +//! * [GitHub issues](https://github.com/awslabs/aws-sdk-rust/issues/new/choose) - For bug reports & feature requests +//! * [Generated Docs (latest version)](https://awslabs.github.io/aws-sdk-rust/) +//! * [Usage examples](https://github.com/awslabs/aws-sdk-rust/tree/main/examples) +//! +//! +//! # Crate Organization +//! +//! The entry point for most customers will be [`Client`], which exposes one method for each API +//! offered by AWS Directory Service Data. The return value of each of these methods is a "fluent builder", +//! where the different inputs for that API are added by builder-style function call chaining, +//! followed by calling `send()` to get a [`Future`](std::future::Future) that will result in +//! either a successful output or a [`SdkError`](crate::error::SdkError). +//! +//! Some of these API inputs may be structs or enums to provide more complex structured information. +//! These structs and enums live in [`types`](crate::types). There are some simpler types for +//! representing data such as date times or binary blobs that live in [`primitives`](crate::primitives). +//! +//! All types required to configure a client via the [`Config`](crate::Config) struct live +//! in [`config`](crate::config). +//! +//! The [`operation`](crate::operation) module has a submodule for every API, and in each submodule +//! is the input, output, and error type for that API, as well as builders to construct each of those. +//! +//! There is a top-level [`Error`](crate::Error) type that encompasses all the errors that the +//! client can return. Any other error type can be converted to this `Error` type via the +//! [`From`](std::convert::From) trait. +//! +//! The other modules within this crate are not required for normal usage. + +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use error_meta::Error; + +#[doc(inline)] +pub use config::Config; + +/// Client for calling AWS Directory Service Data. +/// ## Constructing a `Client` +/// +/// A [`Config`] is required to construct a client. For most use cases, the [`aws-config`] +/// crate should be used to automatically resolve this config using +/// [`aws_config::load_from_env()`], since this will resolve an [`SdkConfig`] which can be shared +/// across multiple different AWS SDK clients. This config resolution process can be customized +/// by calling [`aws_config::from_env()`] instead, which returns a [`ConfigLoader`] that uses +/// the [builder pattern] to customize the default config. +/// +/// In the simplest case, creating a client looks as follows: +/// ```rust,no_run +/// # async fn wrapper() { +/// let config = aws_config::load_from_env().await; +/// let client = aws_sdk_directoryservicedata::Client::new(&config); +/// # } +/// ``` +/// +/// Occasionally, SDKs may have additional service-specific values that can be set on the [`Config`] that +/// is absent from [`SdkConfig`], or slightly different settings for a specific client may be desired. +/// The [`Builder`](crate::config::Builder) struct implements `From<&SdkConfig>`, so setting these specific settings can be +/// done as follows: +/// +/// ```rust,no_run +/// # async fn wrapper() { +/// let sdk_config = ::aws_config::load_from_env().await; +/// let config = aws_sdk_directoryservicedata::config::Builder::from(&sdk_config) +/// # /* +/// .some_service_specific_setting("value") +/// # */ +/// .build(); +/// # } +/// ``` +/// +/// See the [`aws-config` docs] and [`Config`] for more information on customizing configuration. +/// +/// _Note:_ Client construction is expensive due to connection thread pool initialization, and should +/// be done once at application start-up. +/// +/// [`Config`]: crate::Config +/// [`ConfigLoader`]: https://docs.rs/aws-config/*/aws_config/struct.ConfigLoader.html +/// [`SdkConfig`]: https://docs.rs/aws-config/*/aws_config/struct.SdkConfig.html +/// [`aws-config` docs]: https://docs.rs/aws-config/* +/// [`aws-config`]: https://crates.io/crates/aws-config +/// [`aws_config::from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.from_env.html +/// [`aws_config::load_from_env()`]: https://docs.rs/aws-config/*/aws_config/fn.load_from_env.html +/// [builder pattern]: https://rust-lang.github.io/api-guidelines/type-safety.html#builders-enable-construction-of-complex-values-c-builder +/// # Using the `Client` +/// +/// A client has a function for every operation that can be performed by the service. +/// For example, the [`AddGroupMember`](crate::operation::add_group_member) operation has +/// a [`Client::add_group_member`], function which returns a builder for that operation. +/// The fluent builder ultimately has a `send()` function that returns an async future that +/// returns a result, as illustrated below: +/// +/// ```rust,ignore +/// let result = client.add_group_member() +/// .directory_id("example") +/// .send() +/// .await; +/// ``` +/// +/// The underlying HTTP requests that get made by this can be modified with the `customize_operation` +/// function on the fluent builder. See the [`customize`](crate::client::customize) module for more +/// information. +pub mod client; + +/// Configuration for AWS Directory Service Data. +pub mod config; + +/// Common errors and error handling utilities. +pub mod error; + +mod error_meta; + +/// Information about this crate. +pub mod meta; + +/// All operations that this crate can perform. +pub mod operation; + +/// Primitives such as `Blob` or `DateTime` used by other types. +pub mod primitives; + +/// Data structures used by operation inputs/outputs. +pub mod types; + +mod auth_plugin; + +pub(crate) mod client_idempotency_token; + +mod idempotency_token; + +pub(crate) mod protocol_serde; + +mod serialization_settings; + +mod endpoint_lib; + +mod lens; + +mod sdk_feature_tracker; + +mod serde_util; + +mod json_errors; + +#[doc(inline)] +pub use client::Client; diff --git a/sdk/directoryservicedata/src/meta.rs b/sdk/directoryservicedata/src/meta.rs new file mode 100644 index 000000000000..272956812a78 --- /dev/null +++ b/sdk/directoryservicedata/src/meta.rs @@ -0,0 +1,6 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) static API_METADATA: ::aws_runtime::user_agent::ApiMetadata = + ::aws_runtime::user_agent::ApiMetadata::new("directoryservicedata", crate::meta::PKG_VERSION); + +/// Crate version number. +pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION"); diff --git a/sdk/directoryservicedata/src/operation.rs b/sdk/directoryservicedata/src/operation.rs new file mode 100644 index 000000000000..7e9ad11eca8f --- /dev/null +++ b/sdk/directoryservicedata/src/operation.rs @@ -0,0 +1,53 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use ::aws_types::request_id::RequestId; + +/// Types for the `AddGroupMember` operation. +pub mod add_group_member; + +/// Types for the `CreateGroup` operation. +pub mod create_group; + +/// Types for the `CreateUser` operation. +pub mod create_user; + +/// Types for the `DeleteGroup` operation. +pub mod delete_group; + +/// Types for the `DeleteUser` operation. +pub mod delete_user; + +/// Types for the `DescribeGroup` operation. +pub mod describe_group; + +/// Types for the `DescribeUser` operation. +pub mod describe_user; + +/// Types for the `DisableUser` operation. +pub mod disable_user; + +/// Types for the `ListGroupMembers` operation. +pub mod list_group_members; + +/// Types for the `ListGroups` operation. +pub mod list_groups; + +/// Types for the `ListGroupsForMember` operation. +pub mod list_groups_for_member; + +/// Types for the `ListUsers` operation. +pub mod list_users; + +/// Types for the `RemoveGroupMember` operation. +pub mod remove_group_member; + +/// Types for the `SearchGroups` operation. +pub mod search_groups; + +/// Types for the `SearchUsers` operation. +pub mod search_users; + +/// Types for the `UpdateGroup` operation. +pub mod update_group; + +/// Types for the `UpdateUser` operation. +pub mod update_user; diff --git a/sdk/directoryservicedata/src/operation/add_group_member.rs b/sdk/directoryservicedata/src/operation/add_group_member.rs new file mode 100644 index 000000000000..6e18024e7acf --- /dev/null +++ b/sdk/directoryservicedata/src/operation/add_group_member.rs @@ -0,0 +1,455 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `AddGroupMember`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct AddGroupMember; +impl AddGroupMember { + /// Creates a new `AddGroupMember` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::add_group_member::AddGroupMemberInput, + ) -> ::std::result::Result< + crate::operation::add_group_member::AddGroupMemberOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::add_group_member::AddGroupMemberError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::add_group_member::AddGroupMemberInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point( + "directoryservicedata", + "AddGroupMember", + input, + runtime_plugins, + stop_point, + ) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins + .with_operation_plugin(crate::client_idempotency_token::IdempotencyTokenRuntimePlugin::new( + |token_provider, input| { + let input: &mut crate::operation::add_group_member::AddGroupMemberInput = input.downcast_mut().expect("correct type"); + if input.client_token.is_none() { + input.client_token = ::std::option::Option::Some(token_provider.make_idempotency_token()); + } + }, + )) + .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for AddGroupMember { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("AddGroupMember"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + AddGroupMemberRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + AddGroupMemberResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "AddGroupMember", + "directoryservicedata", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("AddGroupMember") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(AddGroupMemberEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::add_group_member::AddGroupMemberError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::add_group_member::AddGroupMemberError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::add_group_member::AddGroupMemberError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct AddGroupMemberResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for AddGroupMemberResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_add_group_member::de_add_group_member_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_add_group_member::de_add_group_member_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct AddGroupMemberRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for AddGroupMemberRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::add_group_member::AddGroupMemberInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/GroupMemberships/AddGroupMember").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + fn uri_query( + _input: &crate::operation::add_group_member::AddGroupMemberInput, + mut output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + let mut query = ::aws_smithy_http::query::Writer::new(output); + let inner_1 = &_input.directory_id; + let inner_1 = inner_1 + .as_ref() + .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("directory_id", "cannot be empty or unset"))?; + if inner_1.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "directory_id", + "cannot be empty or unset", + )); + } + query.push_kv("DirectoryId", &::aws_smithy_http::query::fmt_string(inner_1)); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::add_group_member::AddGroupMemberInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + uri_query(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_add_group_member::ser_add_group_member_input(&input)?); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct AddGroupMemberEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for AddGroupMemberEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "AddGroupMemberEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to AddGroupMemberInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `AddGroupMemberError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum AddGroupMemberError { + ///

      You don't have permission to perform the request or access the directory. It can also occur when the DirectoryId doesn't exist or the user, member, or group might be outside of your organizational unit (OU).

      + ///

      Make sure that you have the authentication and authorization to perform the action. Review the directory information in the request, and make sure that the object isn't outside of your OU.

      + AccessDeniedException(crate::types::error::AccessDeniedException), + ///

      This error will occur when you try to create a resource that conflicts with an existing object. It can also occur when adding a member to a group that the member is already in.

      + ///

      This error can be caused by a request sent within the 8-hour idempotency window with the same client token but different input parameters. Client tokens should not be re-used across different requests. After 8 hours, any request with the same client token is treated as a new request.

      + ConflictException(crate::types::error::ConflictException), + ///

      The request could not be completed due to a problem in the configuration or current state of the specified directory.

      + DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), + ///

      The operation didn't succeed because an internal error occurred. Try again later.

      + InternalServerException(crate::types::error::InternalServerException), + ///

      The resource couldn't be found.

      + ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

      The limit on the number of requests per second has been exceeded.

      + ThrottlingException(crate::types::error::ThrottlingException), + ///

      The request isn't valid. Review the details in the error message to update the invalid parameters or values in your request.

      + ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-AddGroupMemberError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl AddGroupMemberError { + /// Creates the `AddGroupMemberError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `AddGroupMemberError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::DirectoryUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `AddGroupMemberError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `AddGroupMemberError::ConflictException`. + pub fn is_conflict_exception(&self) -> bool { + matches!(self, Self::ConflictException(_)) + } + /// Returns `true` if the error kind is `AddGroupMemberError::DirectoryUnavailableException`. + pub fn is_directory_unavailable_exception(&self) -> bool { + matches!(self, Self::DirectoryUnavailableException(_)) + } + /// Returns `true` if the error kind is `AddGroupMemberError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `AddGroupMemberError::ResourceNotFoundException`. + pub fn is_resource_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceNotFoundException(_)) + } + /// Returns `true` if the error kind is `AddGroupMemberError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `AddGroupMemberError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for AddGroupMemberError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::ConflictException(_inner) => ::std::option::Option::Some(_inner), + Self::DirectoryUnavailableException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for AddGroupMemberError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::ConflictException(_inner) => _inner.fmt(f), + Self::DirectoryUnavailableException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ResourceNotFoundException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for AddGroupMemberError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::DirectoryUnavailableException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for AddGroupMemberError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::DirectoryUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for AddGroupMemberError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::add_group_member::AddGroupMemberError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::add_group_member::_add_group_member_output::AddGroupMemberOutput; + +pub use crate::operation::add_group_member::_add_group_member_input::AddGroupMemberInput; + +mod _add_group_member_input; + +mod _add_group_member_output; + +/// Builders +pub mod builders; diff --git a/sdk/directoryservicedata/src/operation/add_group_member/_add_group_member_input.rs b/sdk/directoryservicedata/src/operation/add_group_member/_add_group_member_input.rs new file mode 100644 index 000000000000..95e592769bd8 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/add_group_member/_add_group_member_input.rs @@ -0,0 +1,172 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct AddGroupMemberInput { + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub directory_id: ::std::option::Option<::std::string::String>, + ///

      The name of the group.

      + pub group_name: ::std::option::Option<::std::string::String>, + ///

      The SAMAccountName of the user, group, or computer to add as a group member.

      + pub member_name: ::std::option::Option<::std::string::String>, + ///

      The domain name that's associated with the group member. This parameter is required only when adding a member outside of your Managed Microsoft AD domain to a group inside of your Managed Microsoft AD domain. This parameter defaults to the Managed Microsoft AD domain.

      + ///

      This parameter is case insensitive.

      + ///
      + pub member_realm: ::std::option::Option<::std::string::String>, + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub client_token: ::std::option::Option<::std::string::String>, +} +impl AddGroupMemberInput { + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } + ///

      The name of the group.

      + pub fn group_name(&self) -> ::std::option::Option<&str> { + self.group_name.as_deref() + } + ///

      The SAMAccountName of the user, group, or computer to add as a group member.

      + pub fn member_name(&self) -> ::std::option::Option<&str> { + self.member_name.as_deref() + } + ///

      The domain name that's associated with the group member. This parameter is required only when adding a member outside of your Managed Microsoft AD domain to a group inside of your Managed Microsoft AD domain. This parameter defaults to the Managed Microsoft AD domain.

      + ///

      This parameter is case insensitive.

      + ///
      + pub fn member_realm(&self) -> ::std::option::Option<&str> { + self.member_realm.as_deref() + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn client_token(&self) -> ::std::option::Option<&str> { + self.client_token.as_deref() + } +} +impl AddGroupMemberInput { + /// Creates a new builder-style object to manufacture [`AddGroupMemberInput`](crate::operation::add_group_member::AddGroupMemberInput). + pub fn builder() -> crate::operation::add_group_member::builders::AddGroupMemberInputBuilder { + crate::operation::add_group_member::builders::AddGroupMemberInputBuilder::default() + } +} + +/// A builder for [`AddGroupMemberInput`](crate::operation::add_group_member::AddGroupMemberInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct AddGroupMemberInputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, + pub(crate) group_name: ::std::option::Option<::std::string::String>, + pub(crate) member_name: ::std::option::Option<::std::string::String>, + pub(crate) member_realm: ::std::option::Option<::std::string::String>, + pub(crate) client_token: ::std::option::Option<::std::string::String>, +} +impl AddGroupMemberInputBuilder { + ///

      The identifier (ID) of the directory that's associated with the group.

      + /// This field is required. + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + ///

      The name of the group.

      + /// This field is required. + pub fn group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.group_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The name of the group.

      + pub fn set_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.group_name = input; + self + } + ///

      The name of the group.

      + pub fn get_group_name(&self) -> &::std::option::Option<::std::string::String> { + &self.group_name + } + ///

      The SAMAccountName of the user, group, or computer to add as a group member.

      + /// This field is required. + pub fn member_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.member_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The SAMAccountName of the user, group, or computer to add as a group member.

      + pub fn set_member_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.member_name = input; + self + } + ///

      The SAMAccountName of the user, group, or computer to add as a group member.

      + pub fn get_member_name(&self) -> &::std::option::Option<::std::string::String> { + &self.member_name + } + ///

      The domain name that's associated with the group member. This parameter is required only when adding a member outside of your Managed Microsoft AD domain to a group inside of your Managed Microsoft AD domain. This parameter defaults to the Managed Microsoft AD domain.

      + ///

      This parameter is case insensitive.

      + ///
      + pub fn member_realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.member_realm = ::std::option::Option::Some(input.into()); + self + } + ///

      The domain name that's associated with the group member. This parameter is required only when adding a member outside of your Managed Microsoft AD domain to a group inside of your Managed Microsoft AD domain. This parameter defaults to the Managed Microsoft AD domain.

      + ///

      This parameter is case insensitive.

      + ///
      + pub fn set_member_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.member_realm = input; + self + } + ///

      The domain name that's associated with the group member. This parameter is required only when adding a member outside of your Managed Microsoft AD domain to a group inside of your Managed Microsoft AD domain. This parameter defaults to the Managed Microsoft AD domain.

      + ///

      This parameter is case insensitive.

      + ///
      + pub fn get_member_realm(&self) -> &::std::option::Option<::std::string::String> { + &self.member_realm + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.client_token = ::std::option::Option::Some(input.into()); + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.client_token = input; + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> { + &self.client_token + } + /// Consumes the builder and constructs a [`AddGroupMemberInput`](crate::operation::add_group_member::AddGroupMemberInput). + pub fn build( + self, + ) -> ::std::result::Result { + ::std::result::Result::Ok(crate::operation::add_group_member::AddGroupMemberInput { + directory_id: self.directory_id, + group_name: self.group_name, + member_name: self.member_name, + member_realm: self.member_realm, + client_token: self.client_token, + }) + } +} diff --git a/sdk/directoryservicedata/src/operation/add_group_member/_add_group_member_output.rs b/sdk/directoryservicedata/src/operation/add_group_member/_add_group_member_output.rs new file mode 100644 index 000000000000..9bf5f93fe7c3 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/add_group_member/_add_group_member_output.rs @@ -0,0 +1,42 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct AddGroupMemberOutput { + _request_id: Option, +} +impl ::aws_types::request_id::RequestId for AddGroupMemberOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl AddGroupMemberOutput { + /// Creates a new builder-style object to manufacture [`AddGroupMemberOutput`](crate::operation::add_group_member::AddGroupMemberOutput). + pub fn builder() -> crate::operation::add_group_member::builders::AddGroupMemberOutputBuilder { + crate::operation::add_group_member::builders::AddGroupMemberOutputBuilder::default() + } +} + +/// A builder for [`AddGroupMemberOutput`](crate::operation::add_group_member::AddGroupMemberOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct AddGroupMemberOutputBuilder { + _request_id: Option, +} +impl AddGroupMemberOutputBuilder { + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`AddGroupMemberOutput`](crate::operation::add_group_member::AddGroupMemberOutput). + pub fn build(self) -> crate::operation::add_group_member::AddGroupMemberOutput { + crate::operation::add_group_member::AddGroupMemberOutput { + _request_id: self._request_id, + } + } +} diff --git a/sdk/directoryservicedata/src/operation/add_group_member/builders.rs b/sdk/directoryservicedata/src/operation/add_group_member/builders.rs new file mode 100644 index 000000000000..19b5d736d86f --- /dev/null +++ b/sdk/directoryservicedata/src/operation/add_group_member/builders.rs @@ -0,0 +1,199 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::add_group_member::_add_group_member_output::AddGroupMemberOutputBuilder; + +pub use crate::operation::add_group_member::_add_group_member_input::AddGroupMemberInputBuilder; + +impl crate::operation::add_group_member::builders::AddGroupMemberInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::add_group_member::AddGroupMemberOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::add_group_member::AddGroupMemberError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.add_group_member(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `AddGroupMember`. +/// +///

      Adds an existing user, group, or computer as a group member.

      +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct AddGroupMemberFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::add_group_member::builders::AddGroupMemberInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::add_group_member::AddGroupMemberOutput, + crate::operation::add_group_member::AddGroupMemberError, + > for AddGroupMemberFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::add_group_member::AddGroupMemberOutput, + crate::operation::add_group_member::AddGroupMemberError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl AddGroupMemberFluentBuilder { + /// Creates a new `AddGroupMemberFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the AddGroupMember as a reference. + pub fn as_input(&self) -> &crate::operation::add_group_member::builders::AddGroupMemberInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::add_group_member::AddGroupMemberOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::add_group_member::AddGroupMemberError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::add_group_member::AddGroupMember::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::add_group_member::AddGroupMember::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::add_group_member::AddGroupMemberOutput, + crate::operation::add_group_member::AddGroupMemberError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.directory_id(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_directory_id(input); + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_directory_id() + } + ///

      The name of the group.

      + pub fn group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.group_name(input.into()); + self + } + ///

      The name of the group.

      + pub fn set_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_group_name(input); + self + } + ///

      The name of the group.

      + pub fn get_group_name(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_group_name() + } + ///

      The SAMAccountName of the user, group, or computer to add as a group member.

      + pub fn member_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.member_name(input.into()); + self + } + ///

      The SAMAccountName of the user, group, or computer to add as a group member.

      + pub fn set_member_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_member_name(input); + self + } + ///

      The SAMAccountName of the user, group, or computer to add as a group member.

      + pub fn get_member_name(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_member_name() + } + ///

      The domain name that's associated with the group member. This parameter is required only when adding a member outside of your Managed Microsoft AD domain to a group inside of your Managed Microsoft AD domain. This parameter defaults to the Managed Microsoft AD domain.

      + ///

      This parameter is case insensitive.

      + ///
      + pub fn member_realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.member_realm(input.into()); + self + } + ///

      The domain name that's associated with the group member. This parameter is required only when adding a member outside of your Managed Microsoft AD domain to a group inside of your Managed Microsoft AD domain. This parameter defaults to the Managed Microsoft AD domain.

      + ///

      This parameter is case insensitive.

      + ///
      + pub fn set_member_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_member_realm(input); + self + } + ///

      The domain name that's associated with the group member. This parameter is required only when adding a member outside of your Managed Microsoft AD domain to a group inside of your Managed Microsoft AD domain. This parameter defaults to the Managed Microsoft AD domain.

      + ///

      This parameter is case insensitive.

      + ///
      + pub fn get_member_realm(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_member_realm() + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.client_token(input.into()); + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_client_token(input); + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_client_token() + } +} diff --git a/sdk/directoryservicedata/src/operation/create_group.rs b/sdk/directoryservicedata/src/operation/create_group.rs new file mode 100644 index 000000000000..fd27a50fd48e --- /dev/null +++ b/sdk/directoryservicedata/src/operation/create_group.rs @@ -0,0 +1,439 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `CreateGroup`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct CreateGroup; +impl CreateGroup { + /// Creates a new `CreateGroup` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::create_group::CreateGroupInput, + ) -> ::std::result::Result< + crate::operation::create_group::CreateGroupOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::create_group::CreateGroupError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::create_group::CreateGroupInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("directoryservicedata", "CreateGroup", input, runtime_plugins, stop_point) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins + .with_operation_plugin(crate::client_idempotency_token::IdempotencyTokenRuntimePlugin::new( + |token_provider, input| { + let input: &mut crate::operation::create_group::CreateGroupInput = input.downcast_mut().expect("correct type"); + if input.client_token.is_none() { + input.client_token = ::std::option::Option::Some(token_provider.make_idempotency_token()); + } + }, + )) + .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateGroup { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("CreateGroup"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + CreateGroupRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + CreateGroupResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "CreateGroup", + "directoryservicedata", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateGroup") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(CreateGroupEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::create_group::CreateGroupError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::create_group::CreateGroupError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::create_group::CreateGroupError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct CreateGroupResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateGroupResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_create_group::de_create_group_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_create_group::de_create_group_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct CreateGroupRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateGroupRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::create_group::CreateGroupInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/Groups/CreateGroup").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + fn uri_query( + _input: &crate::operation::create_group::CreateGroupInput, + mut output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + let mut query = ::aws_smithy_http::query::Writer::new(output); + let inner_1 = &_input.directory_id; + let inner_1 = inner_1 + .as_ref() + .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("directory_id", "cannot be empty or unset"))?; + if inner_1.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "directory_id", + "cannot be empty or unset", + )); + } + query.push_kv("DirectoryId", &::aws_smithy_http::query::fmt_string(inner_1)); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::create_group::CreateGroupInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + uri_query(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_group::ser_create_group_input(&input)?); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct CreateGroupEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateGroupEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "CreateGroupEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to CreateGroupInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `CreateGroupError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum CreateGroupError { + ///

      You don't have permission to perform the request or access the directory. It can also occur when the DirectoryId doesn't exist or the user, member, or group might be outside of your organizational unit (OU).

      + ///

      Make sure that you have the authentication and authorization to perform the action. Review the directory information in the request, and make sure that the object isn't outside of your OU.

      + AccessDeniedException(crate::types::error::AccessDeniedException), + ///

      This error will occur when you try to create a resource that conflicts with an existing object. It can also occur when adding a member to a group that the member is already in.

      + ///

      This error can be caused by a request sent within the 8-hour idempotency window with the same client token but different input parameters. Client tokens should not be re-used across different requests. After 8 hours, any request with the same client token is treated as a new request.

      + ConflictException(crate::types::error::ConflictException), + ///

      The request could not be completed due to a problem in the configuration or current state of the specified directory.

      + DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), + ///

      The operation didn't succeed because an internal error occurred. Try again later.

      + InternalServerException(crate::types::error::InternalServerException), + ///

      The limit on the number of requests per second has been exceeded.

      + ThrottlingException(crate::types::error::ThrottlingException), + ///

      The request isn't valid. Review the details in the error message to update the invalid parameters or values in your request.

      + ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CreateGroupError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl CreateGroupError { + /// Creates the `CreateGroupError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `CreateGroupError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::DirectoryUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `CreateGroupError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `CreateGroupError::ConflictException`. + pub fn is_conflict_exception(&self) -> bool { + matches!(self, Self::ConflictException(_)) + } + /// Returns `true` if the error kind is `CreateGroupError::DirectoryUnavailableException`. + pub fn is_directory_unavailable_exception(&self) -> bool { + matches!(self, Self::DirectoryUnavailableException(_)) + } + /// Returns `true` if the error kind is `CreateGroupError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `CreateGroupError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `CreateGroupError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for CreateGroupError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::ConflictException(_inner) => ::std::option::Option::Some(_inner), + Self::DirectoryUnavailableException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for CreateGroupError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::ConflictException(_inner) => _inner.fmt(f), + Self::DirectoryUnavailableException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for CreateGroupError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::DirectoryUnavailableException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CreateGroupError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::DirectoryUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateGroupError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::create_group::CreateGroupError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::create_group::_create_group_output::CreateGroupOutput; + +pub use crate::operation::create_group::_create_group_input::CreateGroupInput; + +mod _create_group_input; + +mod _create_group_output; + +/// Builders +pub mod builders; diff --git a/sdk/directoryservicedata/src/operation/create_group/_create_group_input.rs b/sdk/directoryservicedata/src/operation/create_group/_create_group_input.rs new file mode 100644 index 000000000000..cfb89a1bc8c4 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/create_group/_create_group_input.rs @@ -0,0 +1,190 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct CreateGroupInput { + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub directory_id: ::std::option::Option<::std::string::String>, + ///

      The name of the group.

      + pub sam_account_name: ::std::option::Option<::std::string::String>, + ///

      The AD group type. For details, see Active Directory security group type.

      + pub group_type: ::std::option::Option, + ///

      The scope of the AD group. For details, see Active Directory security group scope.

      + pub group_scope: ::std::option::Option, + ///

      An expression that defines one or more attributes with the data type and value of each attribute.

      + pub other_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub client_token: ::std::option::Option<::std::string::String>, +} +impl CreateGroupInput { + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } + ///

      The name of the group.

      + pub fn sam_account_name(&self) -> ::std::option::Option<&str> { + self.sam_account_name.as_deref() + } + ///

      The AD group type. For details, see Active Directory security group type.

      + pub fn group_type(&self) -> ::std::option::Option<&crate::types::GroupType> { + self.group_type.as_ref() + } + ///

      The scope of the AD group. For details, see Active Directory security group scope.

      + pub fn group_scope(&self) -> ::std::option::Option<&crate::types::GroupScope> { + self.group_scope.as_ref() + } + ///

      An expression that defines one or more attributes with the data type and value of each attribute.

      + pub fn other_attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> { + self.other_attributes.as_ref() + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn client_token(&self) -> ::std::option::Option<&str> { + self.client_token.as_deref() + } +} +impl CreateGroupInput { + /// Creates a new builder-style object to manufacture [`CreateGroupInput`](crate::operation::create_group::CreateGroupInput). + pub fn builder() -> crate::operation::create_group::builders::CreateGroupInputBuilder { + crate::operation::create_group::builders::CreateGroupInputBuilder::default() + } +} + +/// A builder for [`CreateGroupInput`](crate::operation::create_group::CreateGroupInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct CreateGroupInputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, + pub(crate) sam_account_name: ::std::option::Option<::std::string::String>, + pub(crate) group_type: ::std::option::Option, + pub(crate) group_scope: ::std::option::Option, + pub(crate) other_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, + pub(crate) client_token: ::std::option::Option<::std::string::String>, +} +impl CreateGroupInputBuilder { + ///

      The identifier (ID) of the directory that's associated with the group.

      + /// This field is required. + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + ///

      The name of the group.

      + /// This field is required. + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sam_account_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The name of the group.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sam_account_name = input; + self + } + ///

      The name of the group.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + &self.sam_account_name + } + ///

      The AD group type. For details, see Active Directory security group type.

      + pub fn group_type(mut self, input: crate::types::GroupType) -> Self { + self.group_type = ::std::option::Option::Some(input); + self + } + ///

      The AD group type. For details, see Active Directory security group type.

      + pub fn set_group_type(mut self, input: ::std::option::Option) -> Self { + self.group_type = input; + self + } + ///

      The AD group type. For details, see Active Directory security group type.

      + pub fn get_group_type(&self) -> &::std::option::Option { + &self.group_type + } + ///

      The scope of the AD group. For details, see Active Directory security group scope.

      + pub fn group_scope(mut self, input: crate::types::GroupScope) -> Self { + self.group_scope = ::std::option::Option::Some(input); + self + } + ///

      The scope of the AD group. For details, see Active Directory security group scope.

      + pub fn set_group_scope(mut self, input: ::std::option::Option) -> Self { + self.group_scope = input; + self + } + ///

      The scope of the AD group. For details, see Active Directory security group scope.

      + pub fn get_group_scope(&self) -> &::std::option::Option { + &self.group_scope + } + /// Adds a key-value pair to `other_attributes`. + /// + /// To override the contents of this collection use [`set_other_attributes`](Self::set_other_attributes). + /// + ///

      An expression that defines one or more attributes with the data type and value of each attribute.

      + pub fn other_attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self { + let mut hash_map = self.other_attributes.unwrap_or_default(); + hash_map.insert(k.into(), v); + self.other_attributes = ::std::option::Option::Some(hash_map); + self + } + ///

      An expression that defines one or more attributes with the data type and value of each attribute.

      + pub fn set_other_attributes( + mut self, + input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, + ) -> Self { + self.other_attributes = input; + self + } + ///

      An expression that defines one or more attributes with the data type and value of each attribute.

      + pub fn get_other_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> { + &self.other_attributes + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.client_token = ::std::option::Option::Some(input.into()); + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.client_token = input; + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> { + &self.client_token + } + /// Consumes the builder and constructs a [`CreateGroupInput`](crate::operation::create_group::CreateGroupInput). + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::operation::create_group::CreateGroupInput { + directory_id: self.directory_id, + sam_account_name: self.sam_account_name, + group_type: self.group_type, + group_scope: self.group_scope, + other_attributes: self.other_attributes, + client_token: self.client_token, + }) + } +} diff --git a/sdk/directoryservicedata/src/operation/create_group/_create_group_output.rs b/sdk/directoryservicedata/src/operation/create_group/_create_group_output.rs new file mode 100644 index 000000000000..99abaa1984bb --- /dev/null +++ b/sdk/directoryservicedata/src/operation/create_group/_create_group_output.rs @@ -0,0 +1,110 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct CreateGroupOutput { + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub directory_id: ::std::option::Option<::std::string::String>, + ///

      The name of the group.

      + pub sam_account_name: ::std::option::Option<::std::string::String>, + ///

      The unique security identifier (SID) of the group.

      + pub sid: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl CreateGroupOutput { + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } + ///

      The name of the group.

      + pub fn sam_account_name(&self) -> ::std::option::Option<&str> { + self.sam_account_name.as_deref() + } + ///

      The unique security identifier (SID) of the group.

      + pub fn sid(&self) -> ::std::option::Option<&str> { + self.sid.as_deref() + } +} +impl ::aws_types::request_id::RequestId for CreateGroupOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl CreateGroupOutput { + /// Creates a new builder-style object to manufacture [`CreateGroupOutput`](crate::operation::create_group::CreateGroupOutput). + pub fn builder() -> crate::operation::create_group::builders::CreateGroupOutputBuilder { + crate::operation::create_group::builders::CreateGroupOutputBuilder::default() + } +} + +/// A builder for [`CreateGroupOutput`](crate::operation::create_group::CreateGroupOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct CreateGroupOutputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, + pub(crate) sam_account_name: ::std::option::Option<::std::string::String>, + pub(crate) sid: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl CreateGroupOutputBuilder { + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + ///

      The name of the group.

      + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sam_account_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The name of the group.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sam_account_name = input; + self + } + ///

      The name of the group.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + &self.sam_account_name + } + ///

      The unique security identifier (SID) of the group.

      + pub fn sid(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sid = ::std::option::Option::Some(input.into()); + self + } + ///

      The unique security identifier (SID) of the group.

      + pub fn set_sid(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sid = input; + self + } + ///

      The unique security identifier (SID) of the group.

      + pub fn get_sid(&self) -> &::std::option::Option<::std::string::String> { + &self.sid + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`CreateGroupOutput`](crate::operation::create_group::CreateGroupOutput). + pub fn build(self) -> crate::operation::create_group::CreateGroupOutput { + crate::operation::create_group::CreateGroupOutput { + directory_id: self.directory_id, + sam_account_name: self.sam_account_name, + sid: self.sid, + _request_id: self._request_id, + } + } +} diff --git a/sdk/directoryservicedata/src/operation/create_group/builders.rs b/sdk/directoryservicedata/src/operation/create_group/builders.rs new file mode 100644 index 000000000000..e788aadea879 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/create_group/builders.rs @@ -0,0 +1,215 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::create_group::_create_group_output::CreateGroupOutputBuilder; + +pub use crate::operation::create_group::_create_group_input::CreateGroupInputBuilder; + +impl crate::operation::create_group::builders::CreateGroupInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::create_group::CreateGroupOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::create_group::CreateGroupError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.create_group(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `CreateGroup`. +/// +///

      Creates a new group.

      +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct CreateGroupFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::create_group::builders::CreateGroupInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::create_group::CreateGroupOutput, + crate::operation::create_group::CreateGroupError, + > for CreateGroupFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::create_group::CreateGroupOutput, + crate::operation::create_group::CreateGroupError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl CreateGroupFluentBuilder { + /// Creates a new `CreateGroupFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the CreateGroup as a reference. + pub fn as_input(&self) -> &crate::operation::create_group::builders::CreateGroupInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::create_group::CreateGroupOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::create_group::CreateGroupError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::create_group::CreateGroup::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::create_group::CreateGroup::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::create_group::CreateGroupOutput, + crate::operation::create_group::CreateGroupError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.directory_id(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_directory_id(input); + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_directory_id() + } + ///

      The name of the group.

      + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.sam_account_name(input.into()); + self + } + ///

      The name of the group.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_sam_account_name(input); + self + } + ///

      The name of the group.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_sam_account_name() + } + ///

      The AD group type. For details, see Active Directory security group type.

      + pub fn group_type(mut self, input: crate::types::GroupType) -> Self { + self.inner = self.inner.group_type(input); + self + } + ///

      The AD group type. For details, see Active Directory security group type.

      + pub fn set_group_type(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_group_type(input); + self + } + ///

      The AD group type. For details, see Active Directory security group type.

      + pub fn get_group_type(&self) -> &::std::option::Option { + self.inner.get_group_type() + } + ///

      The scope of the AD group. For details, see Active Directory security group scope.

      + pub fn group_scope(mut self, input: crate::types::GroupScope) -> Self { + self.inner = self.inner.group_scope(input); + self + } + ///

      The scope of the AD group. For details, see Active Directory security group scope.

      + pub fn set_group_scope(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_group_scope(input); + self + } + ///

      The scope of the AD group. For details, see Active Directory security group scope.

      + pub fn get_group_scope(&self) -> &::std::option::Option { + self.inner.get_group_scope() + } + /// + /// Adds a key-value pair to `OtherAttributes`. + /// + /// To override the contents of this collection use [`set_other_attributes`](Self::set_other_attributes). + /// + ///

      An expression that defines one or more attributes with the data type and value of each attribute.

      + pub fn other_attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self { + self.inner = self.inner.other_attributes(k.into(), v); + self + } + ///

      An expression that defines one or more attributes with the data type and value of each attribute.

      + pub fn set_other_attributes( + mut self, + input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, + ) -> Self { + self.inner = self.inner.set_other_attributes(input); + self + } + ///

      An expression that defines one or more attributes with the data type and value of each attribute.

      + pub fn get_other_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> { + self.inner.get_other_attributes() + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.client_token(input.into()); + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_client_token(input); + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_client_token() + } +} diff --git a/sdk/directoryservicedata/src/operation/create_user.rs b/sdk/directoryservicedata/src/operation/create_user.rs new file mode 100644 index 000000000000..ac8792d1cd5c --- /dev/null +++ b/sdk/directoryservicedata/src/operation/create_user.rs @@ -0,0 +1,437 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `CreateUser`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct CreateUser; +impl CreateUser { + /// Creates a new `CreateUser` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::create_user::CreateUserInput, + ) -> ::std::result::Result< + crate::operation::create_user::CreateUserOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::create_user::CreateUserError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::create_user::CreateUserInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("directoryservicedata", "CreateUser", input, runtime_plugins, stop_point) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins + .with_operation_plugin(crate::client_idempotency_token::IdempotencyTokenRuntimePlugin::new( + |token_provider, input| { + let input: &mut crate::operation::create_user::CreateUserInput = input.downcast_mut().expect("correct type"); + if input.client_token.is_none() { + input.client_token = ::std::option::Option::Some(token_provider.make_idempotency_token()); + } + }, + )) + .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateUser { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("CreateUser"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + CreateUserRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + CreateUserResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "CreateUser", + "directoryservicedata", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateUser") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(CreateUserEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::create_user::CreateUserError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::create_user::CreateUserError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::create_user::CreateUserError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct CreateUserResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateUserResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_create_user::de_create_user_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_create_user::de_create_user_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct CreateUserRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateUserRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input.downcast::().expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::create_user::CreateUserInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/Users/CreateUser").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + fn uri_query( + _input: &crate::operation::create_user::CreateUserInput, + mut output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + let mut query = ::aws_smithy_http::query::Writer::new(output); + let inner_1 = &_input.directory_id; + let inner_1 = inner_1 + .as_ref() + .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("directory_id", "cannot be empty or unset"))?; + if inner_1.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "directory_id", + "cannot be empty or unset", + )); + } + query.push_kv("DirectoryId", &::aws_smithy_http::query::fmt_string(inner_1)); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::create_user::CreateUserInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + uri_query(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_user::ser_create_user_input(&input)?); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct CreateUserEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateUserEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "CreateUserEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to CreateUserInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `CreateUserError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum CreateUserError { + ///

      You don't have permission to perform the request or access the directory. It can also occur when the DirectoryId doesn't exist or the user, member, or group might be outside of your organizational unit (OU).

      + ///

      Make sure that you have the authentication and authorization to perform the action. Review the directory information in the request, and make sure that the object isn't outside of your OU.

      + AccessDeniedException(crate::types::error::AccessDeniedException), + ///

      This error will occur when you try to create a resource that conflicts with an existing object. It can also occur when adding a member to a group that the member is already in.

      + ///

      This error can be caused by a request sent within the 8-hour idempotency window with the same client token but different input parameters. Client tokens should not be re-used across different requests. After 8 hours, any request with the same client token is treated as a new request.

      + ConflictException(crate::types::error::ConflictException), + ///

      The request could not be completed due to a problem in the configuration or current state of the specified directory.

      + DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), + ///

      The operation didn't succeed because an internal error occurred. Try again later.

      + InternalServerException(crate::types::error::InternalServerException), + ///

      The limit on the number of requests per second has been exceeded.

      + ThrottlingException(crate::types::error::ThrottlingException), + ///

      The request isn't valid. Review the details in the error message to update the invalid parameters or values in your request.

      + ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CreateUserError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl CreateUserError { + /// Creates the `CreateUserError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `CreateUserError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::DirectoryUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `CreateUserError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `CreateUserError::ConflictException`. + pub fn is_conflict_exception(&self) -> bool { + matches!(self, Self::ConflictException(_)) + } + /// Returns `true` if the error kind is `CreateUserError::DirectoryUnavailableException`. + pub fn is_directory_unavailable_exception(&self) -> bool { + matches!(self, Self::DirectoryUnavailableException(_)) + } + /// Returns `true` if the error kind is `CreateUserError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `CreateUserError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `CreateUserError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for CreateUserError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::ConflictException(_inner) => ::std::option::Option::Some(_inner), + Self::DirectoryUnavailableException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for CreateUserError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::ConflictException(_inner) => _inner.fmt(f), + Self::DirectoryUnavailableException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for CreateUserError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::DirectoryUnavailableException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CreateUserError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::DirectoryUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateUserError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::create_user::CreateUserError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::create_user::_create_user_output::CreateUserOutput; + +pub use crate::operation::create_user::_create_user_input::CreateUserInput; + +mod _create_user_input; + +mod _create_user_output; + +/// Builders +pub mod builders; diff --git a/sdk/directoryservicedata/src/operation/create_user/_create_user_input.rs b/sdk/directoryservicedata/src/operation/create_user/_create_user_input.rs new file mode 100644 index 000000000000..5499a3a58456 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/create_user/_create_user_input.rs @@ -0,0 +1,248 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq)] +pub struct CreateUserInput { + ///

      The identifier (ID) of the directory that’s associated with the user.

      + pub directory_id: ::std::option::Option<::std::string::String>, + ///

      The name of the user.

      + pub sam_account_name: ::std::option::Option<::std::string::String>, + ///

      The email address of the user.

      + pub email_address: ::std::option::Option<::std::string::String>, + ///

      The first name of the user.

      + pub given_name: ::std::option::Option<::std::string::String>, + ///

      The last name of the user.

      + pub surname: ::std::option::Option<::std::string::String>, + ///

      An expression that defines one or more attribute names with the data type and value of each attribute. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.

      + ///

      Attribute names are case insensitive.

      + ///
      + pub other_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub client_token: ::std::option::Option<::std::string::String>, +} +impl CreateUserInput { + ///

      The identifier (ID) of the directory that’s associated with the user.

      + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } + ///

      The name of the user.

      + pub fn sam_account_name(&self) -> ::std::option::Option<&str> { + self.sam_account_name.as_deref() + } + ///

      The email address of the user.

      + pub fn email_address(&self) -> ::std::option::Option<&str> { + self.email_address.as_deref() + } + ///

      The first name of the user.

      + pub fn given_name(&self) -> ::std::option::Option<&str> { + self.given_name.as_deref() + } + ///

      The last name of the user.

      + pub fn surname(&self) -> ::std::option::Option<&str> { + self.surname.as_deref() + } + ///

      An expression that defines one or more attribute names with the data type and value of each attribute. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.

      + ///

      Attribute names are case insensitive.

      + ///
      + pub fn other_attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> { + self.other_attributes.as_ref() + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn client_token(&self) -> ::std::option::Option<&str> { + self.client_token.as_deref() + } +} +impl ::std::fmt::Debug for CreateUserInput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("CreateUserInput"); + formatter.field("directory_id", &self.directory_id); + formatter.field("sam_account_name", &self.sam_account_name); + formatter.field("email_address", &"*** Sensitive Data Redacted ***"); + formatter.field("given_name", &"*** Sensitive Data Redacted ***"); + formatter.field("surname", &"*** Sensitive Data Redacted ***"); + formatter.field("other_attributes", &self.other_attributes); + formatter.field("client_token", &self.client_token); + formatter.finish() + } +} +impl CreateUserInput { + /// Creates a new builder-style object to manufacture [`CreateUserInput`](crate::operation::create_user::CreateUserInput). + pub fn builder() -> crate::operation::create_user::builders::CreateUserInputBuilder { + crate::operation::create_user::builders::CreateUserInputBuilder::default() + } +} + +/// A builder for [`CreateUserInput`](crate::operation::create_user::CreateUserInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)] +#[non_exhaustive] +pub struct CreateUserInputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, + pub(crate) sam_account_name: ::std::option::Option<::std::string::String>, + pub(crate) email_address: ::std::option::Option<::std::string::String>, + pub(crate) given_name: ::std::option::Option<::std::string::String>, + pub(crate) surname: ::std::option::Option<::std::string::String>, + pub(crate) other_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, + pub(crate) client_token: ::std::option::Option<::std::string::String>, +} +impl CreateUserInputBuilder { + ///

      The identifier (ID) of the directory that’s associated with the user.

      + /// This field is required. + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

      The identifier (ID) of the directory that’s associated with the user.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

      The identifier (ID) of the directory that’s associated with the user.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + ///

      The name of the user.

      + /// This field is required. + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sam_account_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The name of the user.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sam_account_name = input; + self + } + ///

      The name of the user.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + &self.sam_account_name + } + ///

      The email address of the user.

      + pub fn email_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.email_address = ::std::option::Option::Some(input.into()); + self + } + ///

      The email address of the user.

      + pub fn set_email_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.email_address = input; + self + } + ///

      The email address of the user.

      + pub fn get_email_address(&self) -> &::std::option::Option<::std::string::String> { + &self.email_address + } + ///

      The first name of the user.

      + pub fn given_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.given_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The first name of the user.

      + pub fn set_given_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.given_name = input; + self + } + ///

      The first name of the user.

      + pub fn get_given_name(&self) -> &::std::option::Option<::std::string::String> { + &self.given_name + } + ///

      The last name of the user.

      + pub fn surname(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.surname = ::std::option::Option::Some(input.into()); + self + } + ///

      The last name of the user.

      + pub fn set_surname(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.surname = input; + self + } + ///

      The last name of the user.

      + pub fn get_surname(&self) -> &::std::option::Option<::std::string::String> { + &self.surname + } + /// Adds a key-value pair to `other_attributes`. + /// + /// To override the contents of this collection use [`set_other_attributes`](Self::set_other_attributes). + /// + ///

      An expression that defines one or more attribute names with the data type and value of each attribute. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.

      + ///

      Attribute names are case insensitive.

      + ///
      + pub fn other_attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self { + let mut hash_map = self.other_attributes.unwrap_or_default(); + hash_map.insert(k.into(), v); + self.other_attributes = ::std::option::Option::Some(hash_map); + self + } + ///

      An expression that defines one or more attribute names with the data type and value of each attribute. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.

      + ///

      Attribute names are case insensitive.

      + ///
      + pub fn set_other_attributes( + mut self, + input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, + ) -> Self { + self.other_attributes = input; + self + } + ///

      An expression that defines one or more attribute names with the data type and value of each attribute. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.

      + ///

      Attribute names are case insensitive.

      + ///
      + pub fn get_other_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> { + &self.other_attributes + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.client_token = ::std::option::Option::Some(input.into()); + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.client_token = input; + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> { + &self.client_token + } + /// Consumes the builder and constructs a [`CreateUserInput`](crate::operation::create_user::CreateUserInput). + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::operation::create_user::CreateUserInput { + directory_id: self.directory_id, + sam_account_name: self.sam_account_name, + email_address: self.email_address, + given_name: self.given_name, + surname: self.surname, + other_attributes: self.other_attributes, + client_token: self.client_token, + }) + } +} +impl ::std::fmt::Debug for CreateUserInputBuilder { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("CreateUserInputBuilder"); + formatter.field("directory_id", &self.directory_id); + formatter.field("sam_account_name", &self.sam_account_name); + formatter.field("email_address", &"*** Sensitive Data Redacted ***"); + formatter.field("given_name", &"*** Sensitive Data Redacted ***"); + formatter.field("surname", &"*** Sensitive Data Redacted ***"); + formatter.field("other_attributes", &self.other_attributes); + formatter.field("client_token", &self.client_token); + formatter.finish() + } +} diff --git a/sdk/directoryservicedata/src/operation/create_user/_create_user_output.rs b/sdk/directoryservicedata/src/operation/create_user/_create_user_output.rs new file mode 100644 index 000000000000..1f9256b0edb6 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/create_user/_create_user_output.rs @@ -0,0 +1,110 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct CreateUserOutput { + ///

      The identifier (ID) of the directory where the address block is added.

      + pub directory_id: ::std::option::Option<::std::string::String>, + ///

      The unique security identifier (SID) of the user.

      + pub sid: ::std::option::Option<::std::string::String>, + ///

      The name of the user.

      + pub sam_account_name: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl CreateUserOutput { + ///

      The identifier (ID) of the directory where the address block is added.

      + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } + ///

      The unique security identifier (SID) of the user.

      + pub fn sid(&self) -> ::std::option::Option<&str> { + self.sid.as_deref() + } + ///

      The name of the user.

      + pub fn sam_account_name(&self) -> ::std::option::Option<&str> { + self.sam_account_name.as_deref() + } +} +impl ::aws_types::request_id::RequestId for CreateUserOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl CreateUserOutput { + /// Creates a new builder-style object to manufacture [`CreateUserOutput`](crate::operation::create_user::CreateUserOutput). + pub fn builder() -> crate::operation::create_user::builders::CreateUserOutputBuilder { + crate::operation::create_user::builders::CreateUserOutputBuilder::default() + } +} + +/// A builder for [`CreateUserOutput`](crate::operation::create_user::CreateUserOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct CreateUserOutputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, + pub(crate) sid: ::std::option::Option<::std::string::String>, + pub(crate) sam_account_name: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl CreateUserOutputBuilder { + ///

      The identifier (ID) of the directory where the address block is added.

      + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

      The identifier (ID) of the directory where the address block is added.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

      The identifier (ID) of the directory where the address block is added.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + ///

      The unique security identifier (SID) of the user.

      + pub fn sid(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sid = ::std::option::Option::Some(input.into()); + self + } + ///

      The unique security identifier (SID) of the user.

      + pub fn set_sid(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sid = input; + self + } + ///

      The unique security identifier (SID) of the user.

      + pub fn get_sid(&self) -> &::std::option::Option<::std::string::String> { + &self.sid + } + ///

      The name of the user.

      + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sam_account_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The name of the user.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sam_account_name = input; + self + } + ///

      The name of the user.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + &self.sam_account_name + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`CreateUserOutput`](crate::operation::create_user::CreateUserOutput). + pub fn build(self) -> crate::operation::create_user::CreateUserOutput { + crate::operation::create_user::CreateUserOutput { + directory_id: self.directory_id, + sid: self.sid, + sam_account_name: self.sam_account_name, + _request_id: self._request_id, + } + } +} diff --git a/sdk/directoryservicedata/src/operation/create_user/builders.rs b/sdk/directoryservicedata/src/operation/create_user/builders.rs new file mode 100644 index 000000000000..5ba907c1d15e --- /dev/null +++ b/sdk/directoryservicedata/src/operation/create_user/builders.rs @@ -0,0 +1,235 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::create_user::_create_user_output::CreateUserOutputBuilder; + +pub use crate::operation::create_user::_create_user_input::CreateUserInputBuilder; + +impl crate::operation::create_user::builders::CreateUserInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::create_user::CreateUserOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::create_user::CreateUserError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.create_user(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `CreateUser`. +/// +///

      Creates a new user.

      +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct CreateUserFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::create_user::builders::CreateUserInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::create_user::CreateUserOutput, + crate::operation::create_user::CreateUserError, + > for CreateUserFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::create_user::CreateUserOutput, + crate::operation::create_user::CreateUserError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl CreateUserFluentBuilder { + /// Creates a new `CreateUserFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the CreateUser as a reference. + pub fn as_input(&self) -> &crate::operation::create_user::builders::CreateUserInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::create_user::CreateUserOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::create_user::CreateUserError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::create_user::CreateUser::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::create_user::CreateUser::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::create_user::CreateUserOutput, + crate::operation::create_user::CreateUserError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

      The identifier (ID) of the directory that’s associated with the user.

      + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.directory_id(input.into()); + self + } + ///

      The identifier (ID) of the directory that’s associated with the user.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_directory_id(input); + self + } + ///

      The identifier (ID) of the directory that’s associated with the user.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_directory_id() + } + ///

      The name of the user.

      + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.sam_account_name(input.into()); + self + } + ///

      The name of the user.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_sam_account_name(input); + self + } + ///

      The name of the user.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_sam_account_name() + } + ///

      The email address of the user.

      + pub fn email_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.email_address(input.into()); + self + } + ///

      The email address of the user.

      + pub fn set_email_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_email_address(input); + self + } + ///

      The email address of the user.

      + pub fn get_email_address(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_email_address() + } + ///

      The first name of the user.

      + pub fn given_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.given_name(input.into()); + self + } + ///

      The first name of the user.

      + pub fn set_given_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_given_name(input); + self + } + ///

      The first name of the user.

      + pub fn get_given_name(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_given_name() + } + ///

      The last name of the user.

      + pub fn surname(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.surname(input.into()); + self + } + ///

      The last name of the user.

      + pub fn set_surname(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_surname(input); + self + } + ///

      The last name of the user.

      + pub fn get_surname(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_surname() + } + /// + /// Adds a key-value pair to `OtherAttributes`. + /// + /// To override the contents of this collection use [`set_other_attributes`](Self::set_other_attributes). + /// + ///

      An expression that defines one or more attribute names with the data type and value of each attribute. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.

      + ///

      Attribute names are case insensitive.

      + ///
      + pub fn other_attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self { + self.inner = self.inner.other_attributes(k.into(), v); + self + } + ///

      An expression that defines one or more attribute names with the data type and value of each attribute. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.

      + ///

      Attribute names are case insensitive.

      + ///
      + pub fn set_other_attributes( + mut self, + input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, + ) -> Self { + self.inner = self.inner.set_other_attributes(input); + self + } + ///

      An expression that defines one or more attribute names with the data type and value of each attribute. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.

      + ///

      Attribute names are case insensitive.

      + ///
      + pub fn get_other_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> { + self.inner.get_other_attributes() + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.client_token(input.into()); + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_client_token(input); + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_client_token() + } +} diff --git a/sdk/directoryservicedata/src/operation/delete_group.rs b/sdk/directoryservicedata/src/operation/delete_group.rs new file mode 100644 index 000000000000..f6a4dc18f559 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/delete_group.rs @@ -0,0 +1,449 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `DeleteGroup`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct DeleteGroup; +impl DeleteGroup { + /// Creates a new `DeleteGroup` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::delete_group::DeleteGroupInput, + ) -> ::std::result::Result< + crate::operation::delete_group::DeleteGroupOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::delete_group::DeleteGroupError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::delete_group::DeleteGroupInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("directoryservicedata", "DeleteGroup", input, runtime_plugins, stop_point) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins + .with_operation_plugin(crate::client_idempotency_token::IdempotencyTokenRuntimePlugin::new( + |token_provider, input| { + let input: &mut crate::operation::delete_group::DeleteGroupInput = input.downcast_mut().expect("correct type"); + if input.client_token.is_none() { + input.client_token = ::std::option::Option::Some(token_provider.make_idempotency_token()); + } + }, + )) + .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteGroup { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("DeleteGroup"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + DeleteGroupRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + DeleteGroupResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "DeleteGroup", + "directoryservicedata", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DeleteGroup") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(DeleteGroupEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::delete_group::DeleteGroupError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::delete_group::DeleteGroupError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::delete_group::DeleteGroupError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct DeleteGroupResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DeleteGroupResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_delete_group::de_delete_group_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_delete_group::de_delete_group_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct DeleteGroupRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DeleteGroupRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::delete_group::DeleteGroupInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/Groups/DeleteGroup").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + fn uri_query( + _input: &crate::operation::delete_group::DeleteGroupInput, + mut output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + let mut query = ::aws_smithy_http::query::Writer::new(output); + let inner_1 = &_input.directory_id; + let inner_1 = inner_1 + .as_ref() + .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("directory_id", "cannot be empty or unset"))?; + if inner_1.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "directory_id", + "cannot be empty or unset", + )); + } + query.push_kv("DirectoryId", &::aws_smithy_http::query::fmt_string(inner_1)); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::delete_group::DeleteGroupInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + uri_query(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_delete_group::ser_delete_group_input(&input)?); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct DeleteGroupEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DeleteGroupEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "DeleteGroupEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to DeleteGroupInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `DeleteGroupError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum DeleteGroupError { + ///

      You don't have permission to perform the request or access the directory. It can also occur when the DirectoryId doesn't exist or the user, member, or group might be outside of your organizational unit (OU).

      + ///

      Make sure that you have the authentication and authorization to perform the action. Review the directory information in the request, and make sure that the object isn't outside of your OU.

      + AccessDeniedException(crate::types::error::AccessDeniedException), + ///

      This error will occur when you try to create a resource that conflicts with an existing object. It can also occur when adding a member to a group that the member is already in.

      + ///

      This error can be caused by a request sent within the 8-hour idempotency window with the same client token but different input parameters. Client tokens should not be re-used across different requests. After 8 hours, any request with the same client token is treated as a new request.

      + ConflictException(crate::types::error::ConflictException), + ///

      The request could not be completed due to a problem in the configuration or current state of the specified directory.

      + DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), + ///

      The operation didn't succeed because an internal error occurred. Try again later.

      + InternalServerException(crate::types::error::InternalServerException), + ///

      The resource couldn't be found.

      + ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

      The limit on the number of requests per second has been exceeded.

      + ThrottlingException(crate::types::error::ThrottlingException), + ///

      The request isn't valid. Review the details in the error message to update the invalid parameters or values in your request.

      + ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-DeleteGroupError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl DeleteGroupError { + /// Creates the `DeleteGroupError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `DeleteGroupError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::DirectoryUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `DeleteGroupError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `DeleteGroupError::ConflictException`. + pub fn is_conflict_exception(&self) -> bool { + matches!(self, Self::ConflictException(_)) + } + /// Returns `true` if the error kind is `DeleteGroupError::DirectoryUnavailableException`. + pub fn is_directory_unavailable_exception(&self) -> bool { + matches!(self, Self::DirectoryUnavailableException(_)) + } + /// Returns `true` if the error kind is `DeleteGroupError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `DeleteGroupError::ResourceNotFoundException`. + pub fn is_resource_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceNotFoundException(_)) + } + /// Returns `true` if the error kind is `DeleteGroupError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `DeleteGroupError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for DeleteGroupError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::ConflictException(_inner) => ::std::option::Option::Some(_inner), + Self::DirectoryUnavailableException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for DeleteGroupError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::ConflictException(_inner) => _inner.fmt(f), + Self::DirectoryUnavailableException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ResourceNotFoundException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for DeleteGroupError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::DirectoryUnavailableException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for DeleteGroupError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::DirectoryUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DeleteGroupError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::delete_group::DeleteGroupError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::delete_group::_delete_group_output::DeleteGroupOutput; + +pub use crate::operation::delete_group::_delete_group_input::DeleteGroupInput; + +mod _delete_group_input; + +mod _delete_group_output; + +/// Builders +pub mod builders; diff --git a/sdk/directoryservicedata/src/operation/delete_group/_delete_group_input.rs b/sdk/directoryservicedata/src/operation/delete_group/_delete_group_input.rs new file mode 100644 index 000000000000..82bbe55c2aa5 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/delete_group/_delete_group_input.rs @@ -0,0 +1,115 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct DeleteGroupInput { + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub directory_id: ::std::option::Option<::std::string::String>, + ///

      The name of the group.

      + pub sam_account_name: ::std::option::Option<::std::string::String>, + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub client_token: ::std::option::Option<::std::string::String>, +} +impl DeleteGroupInput { + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } + ///

      The name of the group.

      + pub fn sam_account_name(&self) -> ::std::option::Option<&str> { + self.sam_account_name.as_deref() + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn client_token(&self) -> ::std::option::Option<&str> { + self.client_token.as_deref() + } +} +impl DeleteGroupInput { + /// Creates a new builder-style object to manufacture [`DeleteGroupInput`](crate::operation::delete_group::DeleteGroupInput). + pub fn builder() -> crate::operation::delete_group::builders::DeleteGroupInputBuilder { + crate::operation::delete_group::builders::DeleteGroupInputBuilder::default() + } +} + +/// A builder for [`DeleteGroupInput`](crate::operation::delete_group::DeleteGroupInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct DeleteGroupInputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, + pub(crate) sam_account_name: ::std::option::Option<::std::string::String>, + pub(crate) client_token: ::std::option::Option<::std::string::String>, +} +impl DeleteGroupInputBuilder { + ///

      The identifier (ID) of the directory that's associated with the group.

      + /// This field is required. + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + ///

      The name of the group.

      + /// This field is required. + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sam_account_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The name of the group.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sam_account_name = input; + self + } + ///

      The name of the group.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + &self.sam_account_name + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.client_token = ::std::option::Option::Some(input.into()); + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.client_token = input; + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> { + &self.client_token + } + /// Consumes the builder and constructs a [`DeleteGroupInput`](crate::operation::delete_group::DeleteGroupInput). + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::operation::delete_group::DeleteGroupInput { + directory_id: self.directory_id, + sam_account_name: self.sam_account_name, + client_token: self.client_token, + }) + } +} diff --git a/sdk/directoryservicedata/src/operation/delete_group/_delete_group_output.rs b/sdk/directoryservicedata/src/operation/delete_group/_delete_group_output.rs new file mode 100644 index 000000000000..dc7b787d33a6 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/delete_group/_delete_group_output.rs @@ -0,0 +1,42 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct DeleteGroupOutput { + _request_id: Option, +} +impl ::aws_types::request_id::RequestId for DeleteGroupOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl DeleteGroupOutput { + /// Creates a new builder-style object to manufacture [`DeleteGroupOutput`](crate::operation::delete_group::DeleteGroupOutput). + pub fn builder() -> crate::operation::delete_group::builders::DeleteGroupOutputBuilder { + crate::operation::delete_group::builders::DeleteGroupOutputBuilder::default() + } +} + +/// A builder for [`DeleteGroupOutput`](crate::operation::delete_group::DeleteGroupOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct DeleteGroupOutputBuilder { + _request_id: Option, +} +impl DeleteGroupOutputBuilder { + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`DeleteGroupOutput`](crate::operation::delete_group::DeleteGroupOutput). + pub fn build(self) -> crate::operation::delete_group::DeleteGroupOutput { + crate::operation::delete_group::DeleteGroupOutput { + _request_id: self._request_id, + } + } +} diff --git a/sdk/directoryservicedata/src/operation/delete_group/builders.rs b/sdk/directoryservicedata/src/operation/delete_group/builders.rs new file mode 100644 index 000000000000..7ab8cc251b08 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/delete_group/builders.rs @@ -0,0 +1,165 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::delete_group::_delete_group_output::DeleteGroupOutputBuilder; + +pub use crate::operation::delete_group::_delete_group_input::DeleteGroupInputBuilder; + +impl crate::operation::delete_group::builders::DeleteGroupInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::delete_group::DeleteGroupOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::delete_group::DeleteGroupError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.delete_group(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `DeleteGroup`. +/// +///

      Deletes a group.

      +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct DeleteGroupFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::delete_group::builders::DeleteGroupInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::delete_group::DeleteGroupOutput, + crate::operation::delete_group::DeleteGroupError, + > for DeleteGroupFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::delete_group::DeleteGroupOutput, + crate::operation::delete_group::DeleteGroupError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl DeleteGroupFluentBuilder { + /// Creates a new `DeleteGroupFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the DeleteGroup as a reference. + pub fn as_input(&self) -> &crate::operation::delete_group::builders::DeleteGroupInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::delete_group::DeleteGroupOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::delete_group::DeleteGroupError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::delete_group::DeleteGroup::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::delete_group::DeleteGroup::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::delete_group::DeleteGroupOutput, + crate::operation::delete_group::DeleteGroupError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.directory_id(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_directory_id(input); + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_directory_id() + } + ///

      The name of the group.

      + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.sam_account_name(input.into()); + self + } + ///

      The name of the group.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_sam_account_name(input); + self + } + ///

      The name of the group.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_sam_account_name() + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.client_token(input.into()); + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_client_token(input); + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_client_token() + } +} diff --git a/sdk/directoryservicedata/src/operation/delete_user.rs b/sdk/directoryservicedata/src/operation/delete_user.rs new file mode 100644 index 000000000000..82cc589b8ef7 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/delete_user.rs @@ -0,0 +1,447 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `DeleteUser`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct DeleteUser; +impl DeleteUser { + /// Creates a new `DeleteUser` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::delete_user::DeleteUserInput, + ) -> ::std::result::Result< + crate::operation::delete_user::DeleteUserOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::delete_user::DeleteUserError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::delete_user::DeleteUserInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("directoryservicedata", "DeleteUser", input, runtime_plugins, stop_point) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins + .with_operation_plugin(crate::client_idempotency_token::IdempotencyTokenRuntimePlugin::new( + |token_provider, input| { + let input: &mut crate::operation::delete_user::DeleteUserInput = input.downcast_mut().expect("correct type"); + if input.client_token.is_none() { + input.client_token = ::std::option::Option::Some(token_provider.make_idempotency_token()); + } + }, + )) + .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteUser { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("DeleteUser"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + DeleteUserRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + DeleteUserResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "DeleteUser", + "directoryservicedata", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DeleteUser") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(DeleteUserEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::delete_user::DeleteUserError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::delete_user::DeleteUserError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::delete_user::DeleteUserError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct DeleteUserResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DeleteUserResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_delete_user::de_delete_user_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_delete_user::de_delete_user_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct DeleteUserRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DeleteUserRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input.downcast::().expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::delete_user::DeleteUserInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/Users/DeleteUser").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + fn uri_query( + _input: &crate::operation::delete_user::DeleteUserInput, + mut output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + let mut query = ::aws_smithy_http::query::Writer::new(output); + let inner_1 = &_input.directory_id; + let inner_1 = inner_1 + .as_ref() + .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("directory_id", "cannot be empty or unset"))?; + if inner_1.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "directory_id", + "cannot be empty or unset", + )); + } + query.push_kv("DirectoryId", &::aws_smithy_http::query::fmt_string(inner_1)); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::delete_user::DeleteUserInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + uri_query(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_delete_user::ser_delete_user_input(&input)?); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct DeleteUserEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DeleteUserEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "DeleteUserEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to DeleteUserInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `DeleteUserError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum DeleteUserError { + ///

      You don't have permission to perform the request or access the directory. It can also occur when the DirectoryId doesn't exist or the user, member, or group might be outside of your organizational unit (OU).

      + ///

      Make sure that you have the authentication and authorization to perform the action. Review the directory information in the request, and make sure that the object isn't outside of your OU.

      + AccessDeniedException(crate::types::error::AccessDeniedException), + ///

      This error will occur when you try to create a resource that conflicts with an existing object. It can also occur when adding a member to a group that the member is already in.

      + ///

      This error can be caused by a request sent within the 8-hour idempotency window with the same client token but different input parameters. Client tokens should not be re-used across different requests. After 8 hours, any request with the same client token is treated as a new request.

      + ConflictException(crate::types::error::ConflictException), + ///

      The request could not be completed due to a problem in the configuration or current state of the specified directory.

      + DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), + ///

      The operation didn't succeed because an internal error occurred. Try again later.

      + InternalServerException(crate::types::error::InternalServerException), + ///

      The resource couldn't be found.

      + ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

      The limit on the number of requests per second has been exceeded.

      + ThrottlingException(crate::types::error::ThrottlingException), + ///

      The request isn't valid. Review the details in the error message to update the invalid parameters or values in your request.

      + ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-DeleteUserError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl DeleteUserError { + /// Creates the `DeleteUserError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `DeleteUserError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::DirectoryUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `DeleteUserError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `DeleteUserError::ConflictException`. + pub fn is_conflict_exception(&self) -> bool { + matches!(self, Self::ConflictException(_)) + } + /// Returns `true` if the error kind is `DeleteUserError::DirectoryUnavailableException`. + pub fn is_directory_unavailable_exception(&self) -> bool { + matches!(self, Self::DirectoryUnavailableException(_)) + } + /// Returns `true` if the error kind is `DeleteUserError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `DeleteUserError::ResourceNotFoundException`. + pub fn is_resource_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceNotFoundException(_)) + } + /// Returns `true` if the error kind is `DeleteUserError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `DeleteUserError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for DeleteUserError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::ConflictException(_inner) => ::std::option::Option::Some(_inner), + Self::DirectoryUnavailableException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for DeleteUserError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::ConflictException(_inner) => _inner.fmt(f), + Self::DirectoryUnavailableException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ResourceNotFoundException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for DeleteUserError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::DirectoryUnavailableException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for DeleteUserError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::DirectoryUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DeleteUserError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::delete_user::DeleteUserError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::delete_user::_delete_user_output::DeleteUserOutput; + +pub use crate::operation::delete_user::_delete_user_input::DeleteUserInput; + +mod _delete_user_input; + +mod _delete_user_output; + +/// Builders +pub mod builders; diff --git a/sdk/directoryservicedata/src/operation/delete_user/_delete_user_input.rs b/sdk/directoryservicedata/src/operation/delete_user/_delete_user_input.rs new file mode 100644 index 000000000000..5db2d044f621 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/delete_user/_delete_user_input.rs @@ -0,0 +1,115 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct DeleteUserInput { + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub directory_id: ::std::option::Option<::std::string::String>, + ///

      The name of the user.

      + pub sam_account_name: ::std::option::Option<::std::string::String>, + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub client_token: ::std::option::Option<::std::string::String>, +} +impl DeleteUserInput { + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } + ///

      The name of the user.

      + pub fn sam_account_name(&self) -> ::std::option::Option<&str> { + self.sam_account_name.as_deref() + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn client_token(&self) -> ::std::option::Option<&str> { + self.client_token.as_deref() + } +} +impl DeleteUserInput { + /// Creates a new builder-style object to manufacture [`DeleteUserInput`](crate::operation::delete_user::DeleteUserInput). + pub fn builder() -> crate::operation::delete_user::builders::DeleteUserInputBuilder { + crate::operation::delete_user::builders::DeleteUserInputBuilder::default() + } +} + +/// A builder for [`DeleteUserInput`](crate::operation::delete_user::DeleteUserInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct DeleteUserInputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, + pub(crate) sam_account_name: ::std::option::Option<::std::string::String>, + pub(crate) client_token: ::std::option::Option<::std::string::String>, +} +impl DeleteUserInputBuilder { + ///

      The identifier (ID) of the directory that's associated with the user.

      + /// This field is required. + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + ///

      The name of the user.

      + /// This field is required. + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sam_account_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The name of the user.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sam_account_name = input; + self + } + ///

      The name of the user.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + &self.sam_account_name + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.client_token = ::std::option::Option::Some(input.into()); + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.client_token = input; + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> { + &self.client_token + } + /// Consumes the builder and constructs a [`DeleteUserInput`](crate::operation::delete_user::DeleteUserInput). + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::operation::delete_user::DeleteUserInput { + directory_id: self.directory_id, + sam_account_name: self.sam_account_name, + client_token: self.client_token, + }) + } +} diff --git a/sdk/directoryservicedata/src/operation/delete_user/_delete_user_output.rs b/sdk/directoryservicedata/src/operation/delete_user/_delete_user_output.rs new file mode 100644 index 000000000000..3296bd92467f --- /dev/null +++ b/sdk/directoryservicedata/src/operation/delete_user/_delete_user_output.rs @@ -0,0 +1,42 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct DeleteUserOutput { + _request_id: Option, +} +impl ::aws_types::request_id::RequestId for DeleteUserOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl DeleteUserOutput { + /// Creates a new builder-style object to manufacture [`DeleteUserOutput`](crate::operation::delete_user::DeleteUserOutput). + pub fn builder() -> crate::operation::delete_user::builders::DeleteUserOutputBuilder { + crate::operation::delete_user::builders::DeleteUserOutputBuilder::default() + } +} + +/// A builder for [`DeleteUserOutput`](crate::operation::delete_user::DeleteUserOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct DeleteUserOutputBuilder { + _request_id: Option, +} +impl DeleteUserOutputBuilder { + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`DeleteUserOutput`](crate::operation::delete_user::DeleteUserOutput). + pub fn build(self) -> crate::operation::delete_user::DeleteUserOutput { + crate::operation::delete_user::DeleteUserOutput { + _request_id: self._request_id, + } + } +} diff --git a/sdk/directoryservicedata/src/operation/delete_user/builders.rs b/sdk/directoryservicedata/src/operation/delete_user/builders.rs new file mode 100644 index 000000000000..eb8695b365c0 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/delete_user/builders.rs @@ -0,0 +1,165 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::delete_user::_delete_user_output::DeleteUserOutputBuilder; + +pub use crate::operation::delete_user::_delete_user_input::DeleteUserInputBuilder; + +impl crate::operation::delete_user::builders::DeleteUserInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::delete_user::DeleteUserOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::delete_user::DeleteUserError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.delete_user(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `DeleteUser`. +/// +///

      Deletes a user.

      +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct DeleteUserFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::delete_user::builders::DeleteUserInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::delete_user::DeleteUserOutput, + crate::operation::delete_user::DeleteUserError, + > for DeleteUserFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::delete_user::DeleteUserOutput, + crate::operation::delete_user::DeleteUserError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl DeleteUserFluentBuilder { + /// Creates a new `DeleteUserFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the DeleteUser as a reference. + pub fn as_input(&self) -> &crate::operation::delete_user::builders::DeleteUserInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::delete_user::DeleteUserOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::delete_user::DeleteUserError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::delete_user::DeleteUser::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::delete_user::DeleteUser::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::delete_user::DeleteUserOutput, + crate::operation::delete_user::DeleteUserError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.directory_id(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_directory_id(input); + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_directory_id() + } + ///

      The name of the user.

      + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.sam_account_name(input.into()); + self + } + ///

      The name of the user.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_sam_account_name(input); + self + } + ///

      The name of the user.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_sam_account_name() + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.client_token(input.into()); + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_client_token(input); + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_client_token() + } +} diff --git a/sdk/directoryservicedata/src/operation/describe_group.rs b/sdk/directoryservicedata/src/operation/describe_group.rs new file mode 100644 index 000000000000..a56a5b182aa0 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/describe_group.rs @@ -0,0 +1,436 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `DescribeGroup`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct DescribeGroup; +impl DescribeGroup { + /// Creates a new `DescribeGroup` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::describe_group::DescribeGroupInput, + ) -> ::std::result::Result< + crate::operation::describe_group::DescribeGroupOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::describe_group::DescribeGroupError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::describe_group::DescribeGroupInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point( + "directoryservicedata", + "DescribeGroup", + input, + runtime_plugins, + stop_point, + ) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DescribeGroup { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("DescribeGroup"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + DescribeGroupRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + DescribeGroupResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput); + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "DescribeGroup", + "directoryservicedata", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DescribeGroup") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(DescribeGroupEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::describe_group::DescribeGroupError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::describe_group::DescribeGroupError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::describe_group::DescribeGroupError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct DescribeGroupResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DescribeGroupResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_describe_group::de_describe_group_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_describe_group::de_describe_group_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct DescribeGroupRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DescribeGroupRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::describe_group::DescribeGroupInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/Groups/DescribeGroup").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + fn uri_query( + _input: &crate::operation::describe_group::DescribeGroupInput, + mut output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + let mut query = ::aws_smithy_http::query::Writer::new(output); + let inner_1 = &_input.directory_id; + let inner_1 = inner_1 + .as_ref() + .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("directory_id", "cannot be empty or unset"))?; + if inner_1.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "directory_id", + "cannot be empty or unset", + )); + } + query.push_kv("DirectoryId", &::aws_smithy_http::query::fmt_string(inner_1)); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::describe_group::DescribeGroupInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + uri_query(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_describe_group::ser_describe_group_input(&input)?); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct DescribeGroupEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DescribeGroupEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "DescribeGroupEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to DescribeGroupInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `DescribeGroupError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum DescribeGroupError { + ///

      You don't have permission to perform the request or access the directory. It can also occur when the DirectoryId doesn't exist or the user, member, or group might be outside of your organizational unit (OU).

      + ///

      Make sure that you have the authentication and authorization to perform the action. Review the directory information in the request, and make sure that the object isn't outside of your OU.

      + AccessDeniedException(crate::types::error::AccessDeniedException), + ///

      The request could not be completed due to a problem in the configuration or current state of the specified directory.

      + DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), + ///

      The operation didn't succeed because an internal error occurred. Try again later.

      + InternalServerException(crate::types::error::InternalServerException), + ///

      The resource couldn't be found.

      + ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

      The limit on the number of requests per second has been exceeded.

      + ThrottlingException(crate::types::error::ThrottlingException), + ///

      The request isn't valid. Review the details in the error message to update the invalid parameters or values in your request.

      + ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-DescribeGroupError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl DescribeGroupError { + /// Creates the `DescribeGroupError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `DescribeGroupError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::DirectoryUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `DescribeGroupError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `DescribeGroupError::DirectoryUnavailableException`. + pub fn is_directory_unavailable_exception(&self) -> bool { + matches!(self, Self::DirectoryUnavailableException(_)) + } + /// Returns `true` if the error kind is `DescribeGroupError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `DescribeGroupError::ResourceNotFoundException`. + pub fn is_resource_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceNotFoundException(_)) + } + /// Returns `true` if the error kind is `DescribeGroupError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `DescribeGroupError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for DescribeGroupError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::DirectoryUnavailableException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for DescribeGroupError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::DirectoryUnavailableException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ResourceNotFoundException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for DescribeGroupError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::DirectoryUnavailableException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for DescribeGroupError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::DirectoryUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DescribeGroupError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::describe_group::DescribeGroupError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::describe_group::_describe_group_output::DescribeGroupOutput; + +pub use crate::operation::describe_group::_describe_group_input::DescribeGroupInput; + +mod _describe_group_input; + +mod _describe_group_output; + +/// Builders +pub mod builders; diff --git a/sdk/directoryservicedata/src/operation/describe_group/_describe_group_input.rs b/sdk/directoryservicedata/src/operation/describe_group/_describe_group_input.rs new file mode 100644 index 000000000000..a7cecb4dde4e --- /dev/null +++ b/sdk/directoryservicedata/src/operation/describe_group/_describe_group_input.rs @@ -0,0 +1,142 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct DescribeGroupInput { + ///

      The Identifier (ID) of the directory associated with the group.

      + pub directory_id: ::std::option::Option<::std::string::String>, + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub realm: ::std::option::Option<::std::string::String>, + ///

      The name of the group.

      + pub sam_account_name: ::std::option::Option<::std::string::String>, + ///

      One or more attributes to be returned for the group. For a list of supported attributes, see Directory Service Data Attributes.

      + pub other_attributes: ::std::option::Option<::std::vec::Vec<::std::string::String>>, +} +impl DescribeGroupInput { + ///

      The Identifier (ID) of the directory associated with the group.

      + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn realm(&self) -> ::std::option::Option<&str> { + self.realm.as_deref() + } + ///

      The name of the group.

      + pub fn sam_account_name(&self) -> ::std::option::Option<&str> { + self.sam_account_name.as_deref() + } + ///

      One or more attributes to be returned for the group. For a list of supported attributes, see Directory Service Data Attributes.

      + /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.other_attributes.is_none()`. + pub fn other_attributes(&self) -> &[::std::string::String] { + self.other_attributes.as_deref().unwrap_or_default() + } +} +impl DescribeGroupInput { + /// Creates a new builder-style object to manufacture [`DescribeGroupInput`](crate::operation::describe_group::DescribeGroupInput). + pub fn builder() -> crate::operation::describe_group::builders::DescribeGroupInputBuilder { + crate::operation::describe_group::builders::DescribeGroupInputBuilder::default() + } +} + +/// A builder for [`DescribeGroupInput`](crate::operation::describe_group::DescribeGroupInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct DescribeGroupInputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, + pub(crate) realm: ::std::option::Option<::std::string::String>, + pub(crate) sam_account_name: ::std::option::Option<::std::string::String>, + pub(crate) other_attributes: ::std::option::Option<::std::vec::Vec<::std::string::String>>, +} +impl DescribeGroupInputBuilder { + ///

      The Identifier (ID) of the directory associated with the group.

      + /// This field is required. + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

      The Identifier (ID) of the directory associated with the group.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

      The Identifier (ID) of the directory associated with the group.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.realm = ::std::option::Option::Some(input.into()); + self + } + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn set_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.realm = input; + self + } + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn get_realm(&self) -> &::std::option::Option<::std::string::String> { + &self.realm + } + ///

      The name of the group.

      + /// This field is required. + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sam_account_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The name of the group.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sam_account_name = input; + self + } + ///

      The name of the group.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + &self.sam_account_name + } + /// Appends an item to `other_attributes`. + /// + /// To override the contents of this collection use [`set_other_attributes`](Self::set_other_attributes). + /// + ///

      One or more attributes to be returned for the group. For a list of supported attributes, see Directory Service Data Attributes.

      + pub fn other_attributes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + let mut v = self.other_attributes.unwrap_or_default(); + v.push(input.into()); + self.other_attributes = ::std::option::Option::Some(v); + self + } + ///

      One or more attributes to be returned for the group. For a list of supported attributes, see Directory Service Data Attributes.

      + pub fn set_other_attributes(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { + self.other_attributes = input; + self + } + ///

      One or more attributes to be returned for the group. For a list of supported attributes, see Directory Service Data Attributes.

      + pub fn get_other_attributes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { + &self.other_attributes + } + /// Consumes the builder and constructs a [`DescribeGroupInput`](crate::operation::describe_group::DescribeGroupInput). + pub fn build( + self, + ) -> ::std::result::Result { + ::std::result::Result::Ok(crate::operation::describe_group::DescribeGroupInput { + directory_id: self.directory_id, + realm: self.realm, + sam_account_name: self.sam_account_name, + other_attributes: self.other_attributes, + }) + } +} diff --git a/sdk/directoryservicedata/src/operation/describe_group/_describe_group_output.rs b/sdk/directoryservicedata/src/operation/describe_group/_describe_group_output.rs new file mode 100644 index 000000000000..610e9a14207e --- /dev/null +++ b/sdk/directoryservicedata/src/operation/describe_group/_describe_group_output.rs @@ -0,0 +1,259 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq)] +pub struct DescribeGroupOutput { + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub directory_id: ::std::option::Option<::std::string::String>, + ///

      The domain name that's associated with the group.

      + pub realm: ::std::option::Option<::std::string::String>, + ///

      The unique security identifier (SID) of the group.

      + pub sid: ::std::option::Option<::std::string::String>, + ///

      The name of the group.

      + pub sam_account_name: ::std::option::Option<::std::string::String>, + ///

      The distinguished name of the object.

      + pub distinguished_name: ::std::option::Option<::std::string::String>, + ///

      The AD group type. For details, see Active Directory security group type.

      + pub group_type: ::std::option::Option, + ///

      The scope of the AD group. For details, see Active Directory security groups.

      + pub group_scope: ::std::option::Option, + ///

      The attribute values that are returned for the attribute names that are included in the request.

      + pub other_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, + _request_id: Option, +} +impl DescribeGroupOutput { + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } + ///

      The domain name that's associated with the group.

      + pub fn realm(&self) -> ::std::option::Option<&str> { + self.realm.as_deref() + } + ///

      The unique security identifier (SID) of the group.

      + pub fn sid(&self) -> ::std::option::Option<&str> { + self.sid.as_deref() + } + ///

      The name of the group.

      + pub fn sam_account_name(&self) -> ::std::option::Option<&str> { + self.sam_account_name.as_deref() + } + ///

      The distinguished name of the object.

      + pub fn distinguished_name(&self) -> ::std::option::Option<&str> { + self.distinguished_name.as_deref() + } + ///

      The AD group type. For details, see Active Directory security group type.

      + pub fn group_type(&self) -> ::std::option::Option<&crate::types::GroupType> { + self.group_type.as_ref() + } + ///

      The scope of the AD group. For details, see Active Directory security groups.

      + pub fn group_scope(&self) -> ::std::option::Option<&crate::types::GroupScope> { + self.group_scope.as_ref() + } + ///

      The attribute values that are returned for the attribute names that are included in the request.

      + pub fn other_attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> { + self.other_attributes.as_ref() + } +} +impl ::std::fmt::Debug for DescribeGroupOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("DescribeGroupOutput"); + formatter.field("directory_id", &self.directory_id); + formatter.field("realm", &self.realm); + formatter.field("sid", &self.sid); + formatter.field("sam_account_name", &self.sam_account_name); + formatter.field("distinguished_name", &"*** Sensitive Data Redacted ***"); + formatter.field("group_type", &self.group_type); + formatter.field("group_scope", &self.group_scope); + formatter.field("other_attributes", &self.other_attributes); + formatter.field("_request_id", &self._request_id); + formatter.finish() + } +} +impl ::aws_types::request_id::RequestId for DescribeGroupOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl DescribeGroupOutput { + /// Creates a new builder-style object to manufacture [`DescribeGroupOutput`](crate::operation::describe_group::DescribeGroupOutput). + pub fn builder() -> crate::operation::describe_group::builders::DescribeGroupOutputBuilder { + crate::operation::describe_group::builders::DescribeGroupOutputBuilder::default() + } +} + +/// A builder for [`DescribeGroupOutput`](crate::operation::describe_group::DescribeGroupOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)] +#[non_exhaustive] +pub struct DescribeGroupOutputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, + pub(crate) realm: ::std::option::Option<::std::string::String>, + pub(crate) sid: ::std::option::Option<::std::string::String>, + pub(crate) sam_account_name: ::std::option::Option<::std::string::String>, + pub(crate) distinguished_name: ::std::option::Option<::std::string::String>, + pub(crate) group_type: ::std::option::Option, + pub(crate) group_scope: ::std::option::Option, + pub(crate) other_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, + _request_id: Option, +} +impl DescribeGroupOutputBuilder { + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + ///

      The domain name that's associated with the group.

      + pub fn realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.realm = ::std::option::Option::Some(input.into()); + self + } + ///

      The domain name that's associated with the group.

      + pub fn set_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.realm = input; + self + } + ///

      The domain name that's associated with the group.

      + pub fn get_realm(&self) -> &::std::option::Option<::std::string::String> { + &self.realm + } + ///

      The unique security identifier (SID) of the group.

      + pub fn sid(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sid = ::std::option::Option::Some(input.into()); + self + } + ///

      The unique security identifier (SID) of the group.

      + pub fn set_sid(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sid = input; + self + } + ///

      The unique security identifier (SID) of the group.

      + pub fn get_sid(&self) -> &::std::option::Option<::std::string::String> { + &self.sid + } + ///

      The name of the group.

      + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sam_account_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The name of the group.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sam_account_name = input; + self + } + ///

      The name of the group.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + &self.sam_account_name + } + ///

      The distinguished name of the object.

      + pub fn distinguished_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.distinguished_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The distinguished name of the object.

      + pub fn set_distinguished_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.distinguished_name = input; + self + } + ///

      The distinguished name of the object.

      + pub fn get_distinguished_name(&self) -> &::std::option::Option<::std::string::String> { + &self.distinguished_name + } + ///

      The AD group type. For details, see Active Directory security group type.

      + pub fn group_type(mut self, input: crate::types::GroupType) -> Self { + self.group_type = ::std::option::Option::Some(input); + self + } + ///

      The AD group type. For details, see Active Directory security group type.

      + pub fn set_group_type(mut self, input: ::std::option::Option) -> Self { + self.group_type = input; + self + } + ///

      The AD group type. For details, see Active Directory security group type.

      + pub fn get_group_type(&self) -> &::std::option::Option { + &self.group_type + } + ///

      The scope of the AD group. For details, see Active Directory security groups.

      + pub fn group_scope(mut self, input: crate::types::GroupScope) -> Self { + self.group_scope = ::std::option::Option::Some(input); + self + } + ///

      The scope of the AD group. For details, see Active Directory security groups.

      + pub fn set_group_scope(mut self, input: ::std::option::Option) -> Self { + self.group_scope = input; + self + } + ///

      The scope of the AD group. For details, see Active Directory security groups.

      + pub fn get_group_scope(&self) -> &::std::option::Option { + &self.group_scope + } + /// Adds a key-value pair to `other_attributes`. + /// + /// To override the contents of this collection use [`set_other_attributes`](Self::set_other_attributes). + /// + ///

      The attribute values that are returned for the attribute names that are included in the request.

      + pub fn other_attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self { + let mut hash_map = self.other_attributes.unwrap_or_default(); + hash_map.insert(k.into(), v); + self.other_attributes = ::std::option::Option::Some(hash_map); + self + } + ///

      The attribute values that are returned for the attribute names that are included in the request.

      + pub fn set_other_attributes( + mut self, + input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, + ) -> Self { + self.other_attributes = input; + self + } + ///

      The attribute values that are returned for the attribute names that are included in the request.

      + pub fn get_other_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> { + &self.other_attributes + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`DescribeGroupOutput`](crate::operation::describe_group::DescribeGroupOutput). + pub fn build(self) -> crate::operation::describe_group::DescribeGroupOutput { + crate::operation::describe_group::DescribeGroupOutput { + directory_id: self.directory_id, + realm: self.realm, + sid: self.sid, + sam_account_name: self.sam_account_name, + distinguished_name: self.distinguished_name, + group_type: self.group_type, + group_scope: self.group_scope, + other_attributes: self.other_attributes, + _request_id: self._request_id, + } + } +} +impl ::std::fmt::Debug for DescribeGroupOutputBuilder { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("DescribeGroupOutputBuilder"); + formatter.field("directory_id", &self.directory_id); + formatter.field("realm", &self.realm); + formatter.field("sid", &self.sid); + formatter.field("sam_account_name", &self.sam_account_name); + formatter.field("distinguished_name", &"*** Sensitive Data Redacted ***"); + formatter.field("group_type", &self.group_type); + formatter.field("group_scope", &self.group_scope); + formatter.field("other_attributes", &self.other_attributes); + formatter.field("_request_id", &self._request_id); + formatter.finish() + } +} diff --git a/sdk/directoryservicedata/src/operation/describe_group/builders.rs b/sdk/directoryservicedata/src/operation/describe_group/builders.rs new file mode 100644 index 000000000000..737efccb67f0 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/describe_group/builders.rs @@ -0,0 +1,181 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::describe_group::_describe_group_output::DescribeGroupOutputBuilder; + +pub use crate::operation::describe_group::_describe_group_input::DescribeGroupInputBuilder; + +impl crate::operation::describe_group::builders::DescribeGroupInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::describe_group::DescribeGroupOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::describe_group::DescribeGroupError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.describe_group(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `DescribeGroup`. +/// +///

      Returns information about a specific group.

      +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct DescribeGroupFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::describe_group::builders::DescribeGroupInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::describe_group::DescribeGroupOutput, + crate::operation::describe_group::DescribeGroupError, + > for DescribeGroupFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::describe_group::DescribeGroupOutput, + crate::operation::describe_group::DescribeGroupError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl DescribeGroupFluentBuilder { + /// Creates a new `DescribeGroupFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the DescribeGroup as a reference. + pub fn as_input(&self) -> &crate::operation::describe_group::builders::DescribeGroupInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::describe_group::DescribeGroupOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::describe_group::DescribeGroupError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::describe_group::DescribeGroup::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::describe_group::DescribeGroup::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::describe_group::DescribeGroupOutput, + crate::operation::describe_group::DescribeGroupError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

      The Identifier (ID) of the directory associated with the group.

      + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.directory_id(input.into()); + self + } + ///

      The Identifier (ID) of the directory associated with the group.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_directory_id(input); + self + } + ///

      The Identifier (ID) of the directory associated with the group.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_directory_id() + } + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.realm(input.into()); + self + } + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn set_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_realm(input); + self + } + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn get_realm(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_realm() + } + ///

      The name of the group.

      + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.sam_account_name(input.into()); + self + } + ///

      The name of the group.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_sam_account_name(input); + self + } + ///

      The name of the group.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_sam_account_name() + } + /// + /// Appends an item to `OtherAttributes`. + /// + /// To override the contents of this collection use [`set_other_attributes`](Self::set_other_attributes). + /// + ///

      One or more attributes to be returned for the group. For a list of supported attributes, see Directory Service Data Attributes.

      + pub fn other_attributes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.other_attributes(input.into()); + self + } + ///

      One or more attributes to be returned for the group. For a list of supported attributes, see Directory Service Data Attributes.

      + pub fn set_other_attributes(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { + self.inner = self.inner.set_other_attributes(input); + self + } + ///

      One or more attributes to be returned for the group. For a list of supported attributes, see Directory Service Data Attributes.

      + pub fn get_other_attributes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { + self.inner.get_other_attributes() + } +} diff --git a/sdk/directoryservicedata/src/operation/describe_user.rs b/sdk/directoryservicedata/src/operation/describe_user.rs new file mode 100644 index 000000000000..a70acb3e192c --- /dev/null +++ b/sdk/directoryservicedata/src/operation/describe_user.rs @@ -0,0 +1,430 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `DescribeUser`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct DescribeUser; +impl DescribeUser { + /// Creates a new `DescribeUser` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::describe_user::DescribeUserInput, + ) -> ::std::result::Result< + crate::operation::describe_user::DescribeUserOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::describe_user::DescribeUserError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::describe_user::DescribeUserInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("directoryservicedata", "DescribeUser", input, runtime_plugins, stop_point) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DescribeUser { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("DescribeUser"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + DescribeUserRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + DescribeUserResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput); + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "DescribeUser", + "directoryservicedata", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DescribeUser") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(DescribeUserEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::describe_user::DescribeUserError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::describe_user::DescribeUserError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::describe_user::DescribeUserError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct DescribeUserResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DescribeUserResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_describe_user::de_describe_user_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_describe_user::de_describe_user_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct DescribeUserRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DescribeUserRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::describe_user::DescribeUserInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/Users/DescribeUser").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + fn uri_query( + _input: &crate::operation::describe_user::DescribeUserInput, + mut output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + let mut query = ::aws_smithy_http::query::Writer::new(output); + let inner_1 = &_input.directory_id; + let inner_1 = inner_1 + .as_ref() + .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("directory_id", "cannot be empty or unset"))?; + if inner_1.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "directory_id", + "cannot be empty or unset", + )); + } + query.push_kv("DirectoryId", &::aws_smithy_http::query::fmt_string(inner_1)); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::describe_user::DescribeUserInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + uri_query(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_describe_user::ser_describe_user_input(&input)?); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct DescribeUserEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DescribeUserEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "DescribeUserEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to DescribeUserInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `DescribeUserError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum DescribeUserError { + ///

      You don't have permission to perform the request or access the directory. It can also occur when the DirectoryId doesn't exist or the user, member, or group might be outside of your organizational unit (OU).

      + ///

      Make sure that you have the authentication and authorization to perform the action. Review the directory information in the request, and make sure that the object isn't outside of your OU.

      + AccessDeniedException(crate::types::error::AccessDeniedException), + ///

      The request could not be completed due to a problem in the configuration or current state of the specified directory.

      + DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), + ///

      The operation didn't succeed because an internal error occurred. Try again later.

      + InternalServerException(crate::types::error::InternalServerException), + ///

      The resource couldn't be found.

      + ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

      The limit on the number of requests per second has been exceeded.

      + ThrottlingException(crate::types::error::ThrottlingException), + ///

      The request isn't valid. Review the details in the error message to update the invalid parameters or values in your request.

      + ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-DescribeUserError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl DescribeUserError { + /// Creates the `DescribeUserError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `DescribeUserError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::DirectoryUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `DescribeUserError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `DescribeUserError::DirectoryUnavailableException`. + pub fn is_directory_unavailable_exception(&self) -> bool { + matches!(self, Self::DirectoryUnavailableException(_)) + } + /// Returns `true` if the error kind is `DescribeUserError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `DescribeUserError::ResourceNotFoundException`. + pub fn is_resource_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceNotFoundException(_)) + } + /// Returns `true` if the error kind is `DescribeUserError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `DescribeUserError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for DescribeUserError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::DirectoryUnavailableException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for DescribeUserError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::DirectoryUnavailableException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ResourceNotFoundException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for DescribeUserError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::DirectoryUnavailableException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for DescribeUserError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::DirectoryUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DescribeUserError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::describe_user::DescribeUserError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::describe_user::_describe_user_output::DescribeUserOutput; + +pub use crate::operation::describe_user::_describe_user_input::DescribeUserInput; + +mod _describe_user_input; + +mod _describe_user_output; + +/// Builders +pub mod builders; diff --git a/sdk/directoryservicedata/src/operation/describe_user/_describe_user_input.rs b/sdk/directoryservicedata/src/operation/describe_user/_describe_user_input.rs new file mode 100644 index 000000000000..72fb1dbcff98 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/describe_user/_describe_user_input.rs @@ -0,0 +1,142 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct DescribeUserInput { + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub directory_id: ::std::option::Option<::std::string::String>, + ///

      The name of the user.

      + pub sam_account_name: ::std::option::Option<::std::string::String>, + ///

      One or more attribute names to be returned for the user. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.

      + pub other_attributes: ::std::option::Option<::std::vec::Vec<::std::string::String>>, + ///

      The domain name that's associated with the user.

      + ///

      This parameter is optional, so you can return users outside your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub realm: ::std::option::Option<::std::string::String>, +} +impl DescribeUserInput { + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } + ///

      The name of the user.

      + pub fn sam_account_name(&self) -> ::std::option::Option<&str> { + self.sam_account_name.as_deref() + } + ///

      One or more attribute names to be returned for the user. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.

      + /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.other_attributes.is_none()`. + pub fn other_attributes(&self) -> &[::std::string::String] { + self.other_attributes.as_deref().unwrap_or_default() + } + ///

      The domain name that's associated with the user.

      + ///

      This parameter is optional, so you can return users outside your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn realm(&self) -> ::std::option::Option<&str> { + self.realm.as_deref() + } +} +impl DescribeUserInput { + /// Creates a new builder-style object to manufacture [`DescribeUserInput`](crate::operation::describe_user::DescribeUserInput). + pub fn builder() -> crate::operation::describe_user::builders::DescribeUserInputBuilder { + crate::operation::describe_user::builders::DescribeUserInputBuilder::default() + } +} + +/// A builder for [`DescribeUserInput`](crate::operation::describe_user::DescribeUserInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct DescribeUserInputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, + pub(crate) sam_account_name: ::std::option::Option<::std::string::String>, + pub(crate) other_attributes: ::std::option::Option<::std::vec::Vec<::std::string::String>>, + pub(crate) realm: ::std::option::Option<::std::string::String>, +} +impl DescribeUserInputBuilder { + ///

      The identifier (ID) of the directory that's associated with the user.

      + /// This field is required. + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + ///

      The name of the user.

      + /// This field is required. + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sam_account_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The name of the user.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sam_account_name = input; + self + } + ///

      The name of the user.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + &self.sam_account_name + } + /// Appends an item to `other_attributes`. + /// + /// To override the contents of this collection use [`set_other_attributes`](Self::set_other_attributes). + /// + ///

      One or more attribute names to be returned for the user. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.

      + pub fn other_attributes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + let mut v = self.other_attributes.unwrap_or_default(); + v.push(input.into()); + self.other_attributes = ::std::option::Option::Some(v); + self + } + ///

      One or more attribute names to be returned for the user. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.

      + pub fn set_other_attributes(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { + self.other_attributes = input; + self + } + ///

      One or more attribute names to be returned for the user. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.

      + pub fn get_other_attributes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { + &self.other_attributes + } + ///

      The domain name that's associated with the user.

      + ///

      This parameter is optional, so you can return users outside your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.realm = ::std::option::Option::Some(input.into()); + self + } + ///

      The domain name that's associated with the user.

      + ///

      This parameter is optional, so you can return users outside your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn set_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.realm = input; + self + } + ///

      The domain name that's associated with the user.

      + ///

      This parameter is optional, so you can return users outside your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn get_realm(&self) -> &::std::option::Option<::std::string::String> { + &self.realm + } + /// Consumes the builder and constructs a [`DescribeUserInput`](crate::operation::describe_user::DescribeUserInput). + pub fn build( + self, + ) -> ::std::result::Result { + ::std::result::Result::Ok(crate::operation::describe_user::DescribeUserInput { + directory_id: self.directory_id, + sam_account_name: self.sam_account_name, + other_attributes: self.other_attributes, + realm: self.realm, + }) + } +} diff --git a/sdk/directoryservicedata/src/operation/describe_user/_describe_user_output.rs b/sdk/directoryservicedata/src/operation/describe_user/_describe_user_output.rs new file mode 100644 index 000000000000..5947f4310841 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/describe_user/_describe_user_output.rs @@ -0,0 +1,341 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq)] +pub struct DescribeUserOutput { + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub directory_id: ::std::option::Option<::std::string::String>, + ///

      The domain name that's associated with the user.

      + pub realm: ::std::option::Option<::std::string::String>, + ///

      The unique security identifier (SID) of the user.

      + pub sid: ::std::option::Option<::std::string::String>, + ///

      The name of the user.

      + pub sam_account_name: ::std::option::Option<::std::string::String>, + ///

      The distinguished name of the object.

      + pub distinguished_name: ::std::option::Option<::std::string::String>, + ///

      The UPN that is an Internet-style login name for a user and is based on the Internet standard RFC 822. The UPN is shorter than the distinguished name and easier to remember.

      + pub user_principal_name: ::std::option::Option<::std::string::String>, + ///

      The email address of the user.

      + pub email_address: ::std::option::Option<::std::string::String>, + ///

      The first name of the user.

      + pub given_name: ::std::option::Option<::std::string::String>, + ///

      The last name of the user.

      + pub surname: ::std::option::Option<::std::string::String>, + ///

      Indicates whether the user account is active.

      + pub enabled: ::std::option::Option, + ///

      The attribute values that are returned for the attribute names that are included in the request.

      + ///

      Attribute names are case insensitive.

      + ///
      + pub other_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, + _request_id: Option, +} +impl DescribeUserOutput { + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } + ///

      The domain name that's associated with the user.

      + pub fn realm(&self) -> ::std::option::Option<&str> { + self.realm.as_deref() + } + ///

      The unique security identifier (SID) of the user.

      + pub fn sid(&self) -> ::std::option::Option<&str> { + self.sid.as_deref() + } + ///

      The name of the user.

      + pub fn sam_account_name(&self) -> ::std::option::Option<&str> { + self.sam_account_name.as_deref() + } + ///

      The distinguished name of the object.

      + pub fn distinguished_name(&self) -> ::std::option::Option<&str> { + self.distinguished_name.as_deref() + } + ///

      The UPN that is an Internet-style login name for a user and is based on the Internet standard RFC 822. The UPN is shorter than the distinguished name and easier to remember.

      + pub fn user_principal_name(&self) -> ::std::option::Option<&str> { + self.user_principal_name.as_deref() + } + ///

      The email address of the user.

      + pub fn email_address(&self) -> ::std::option::Option<&str> { + self.email_address.as_deref() + } + ///

      The first name of the user.

      + pub fn given_name(&self) -> ::std::option::Option<&str> { + self.given_name.as_deref() + } + ///

      The last name of the user.

      + pub fn surname(&self) -> ::std::option::Option<&str> { + self.surname.as_deref() + } + ///

      Indicates whether the user account is active.

      + pub fn enabled(&self) -> ::std::option::Option { + self.enabled + } + ///

      The attribute values that are returned for the attribute names that are included in the request.

      + ///

      Attribute names are case insensitive.

      + ///
      + pub fn other_attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> { + self.other_attributes.as_ref() + } +} +impl ::std::fmt::Debug for DescribeUserOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("DescribeUserOutput"); + formatter.field("directory_id", &self.directory_id); + formatter.field("realm", &self.realm); + formatter.field("sid", &self.sid); + formatter.field("sam_account_name", &self.sam_account_name); + formatter.field("distinguished_name", &"*** Sensitive Data Redacted ***"); + formatter.field("user_principal_name", &"*** Sensitive Data Redacted ***"); + formatter.field("email_address", &"*** Sensitive Data Redacted ***"); + formatter.field("given_name", &"*** Sensitive Data Redacted ***"); + formatter.field("surname", &"*** Sensitive Data Redacted ***"); + formatter.field("enabled", &self.enabled); + formatter.field("other_attributes", &self.other_attributes); + formatter.field("_request_id", &self._request_id); + formatter.finish() + } +} +impl ::aws_types::request_id::RequestId for DescribeUserOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl DescribeUserOutput { + /// Creates a new builder-style object to manufacture [`DescribeUserOutput`](crate::operation::describe_user::DescribeUserOutput). + pub fn builder() -> crate::operation::describe_user::builders::DescribeUserOutputBuilder { + crate::operation::describe_user::builders::DescribeUserOutputBuilder::default() + } +} + +/// A builder for [`DescribeUserOutput`](crate::operation::describe_user::DescribeUserOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)] +#[non_exhaustive] +pub struct DescribeUserOutputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, + pub(crate) realm: ::std::option::Option<::std::string::String>, + pub(crate) sid: ::std::option::Option<::std::string::String>, + pub(crate) sam_account_name: ::std::option::Option<::std::string::String>, + pub(crate) distinguished_name: ::std::option::Option<::std::string::String>, + pub(crate) user_principal_name: ::std::option::Option<::std::string::String>, + pub(crate) email_address: ::std::option::Option<::std::string::String>, + pub(crate) given_name: ::std::option::Option<::std::string::String>, + pub(crate) surname: ::std::option::Option<::std::string::String>, + pub(crate) enabled: ::std::option::Option, + pub(crate) other_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, + _request_id: Option, +} +impl DescribeUserOutputBuilder { + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + ///

      The domain name that's associated with the user.

      + pub fn realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.realm = ::std::option::Option::Some(input.into()); + self + } + ///

      The domain name that's associated with the user.

      + pub fn set_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.realm = input; + self + } + ///

      The domain name that's associated with the user.

      + pub fn get_realm(&self) -> &::std::option::Option<::std::string::String> { + &self.realm + } + ///

      The unique security identifier (SID) of the user.

      + pub fn sid(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sid = ::std::option::Option::Some(input.into()); + self + } + ///

      The unique security identifier (SID) of the user.

      + pub fn set_sid(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sid = input; + self + } + ///

      The unique security identifier (SID) of the user.

      + pub fn get_sid(&self) -> &::std::option::Option<::std::string::String> { + &self.sid + } + ///

      The name of the user.

      + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sam_account_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The name of the user.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sam_account_name = input; + self + } + ///

      The name of the user.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + &self.sam_account_name + } + ///

      The distinguished name of the object.

      + pub fn distinguished_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.distinguished_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The distinguished name of the object.

      + pub fn set_distinguished_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.distinguished_name = input; + self + } + ///

      The distinguished name of the object.

      + pub fn get_distinguished_name(&self) -> &::std::option::Option<::std::string::String> { + &self.distinguished_name + } + ///

      The UPN that is an Internet-style login name for a user and is based on the Internet standard RFC 822. The UPN is shorter than the distinguished name and easier to remember.

      + pub fn user_principal_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.user_principal_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The UPN that is an Internet-style login name for a user and is based on the Internet standard RFC 822. The UPN is shorter than the distinguished name and easier to remember.

      + pub fn set_user_principal_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.user_principal_name = input; + self + } + ///

      The UPN that is an Internet-style login name for a user and is based on the Internet standard RFC 822. The UPN is shorter than the distinguished name and easier to remember.

      + pub fn get_user_principal_name(&self) -> &::std::option::Option<::std::string::String> { + &self.user_principal_name + } + ///

      The email address of the user.

      + pub fn email_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.email_address = ::std::option::Option::Some(input.into()); + self + } + ///

      The email address of the user.

      + pub fn set_email_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.email_address = input; + self + } + ///

      The email address of the user.

      + pub fn get_email_address(&self) -> &::std::option::Option<::std::string::String> { + &self.email_address + } + ///

      The first name of the user.

      + pub fn given_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.given_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The first name of the user.

      + pub fn set_given_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.given_name = input; + self + } + ///

      The first name of the user.

      + pub fn get_given_name(&self) -> &::std::option::Option<::std::string::String> { + &self.given_name + } + ///

      The last name of the user.

      + pub fn surname(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.surname = ::std::option::Option::Some(input.into()); + self + } + ///

      The last name of the user.

      + pub fn set_surname(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.surname = input; + self + } + ///

      The last name of the user.

      + pub fn get_surname(&self) -> &::std::option::Option<::std::string::String> { + &self.surname + } + ///

      Indicates whether the user account is active.

      + pub fn enabled(mut self, input: bool) -> Self { + self.enabled = ::std::option::Option::Some(input); + self + } + ///

      Indicates whether the user account is active.

      + pub fn set_enabled(mut self, input: ::std::option::Option) -> Self { + self.enabled = input; + self + } + ///

      Indicates whether the user account is active.

      + pub fn get_enabled(&self) -> &::std::option::Option { + &self.enabled + } + /// Adds a key-value pair to `other_attributes`. + /// + /// To override the contents of this collection use [`set_other_attributes`](Self::set_other_attributes). + /// + ///

      The attribute values that are returned for the attribute names that are included in the request.

      + ///

      Attribute names are case insensitive.

      + ///
      + pub fn other_attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self { + let mut hash_map = self.other_attributes.unwrap_or_default(); + hash_map.insert(k.into(), v); + self.other_attributes = ::std::option::Option::Some(hash_map); + self + } + ///

      The attribute values that are returned for the attribute names that are included in the request.

      + ///

      Attribute names are case insensitive.

      + ///
      + pub fn set_other_attributes( + mut self, + input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, + ) -> Self { + self.other_attributes = input; + self + } + ///

      The attribute values that are returned for the attribute names that are included in the request.

      + ///

      Attribute names are case insensitive.

      + ///
      + pub fn get_other_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> { + &self.other_attributes + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`DescribeUserOutput`](crate::operation::describe_user::DescribeUserOutput). + pub fn build(self) -> crate::operation::describe_user::DescribeUserOutput { + crate::operation::describe_user::DescribeUserOutput { + directory_id: self.directory_id, + realm: self.realm, + sid: self.sid, + sam_account_name: self.sam_account_name, + distinguished_name: self.distinguished_name, + user_principal_name: self.user_principal_name, + email_address: self.email_address, + given_name: self.given_name, + surname: self.surname, + enabled: self.enabled, + other_attributes: self.other_attributes, + _request_id: self._request_id, + } + } +} +impl ::std::fmt::Debug for DescribeUserOutputBuilder { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("DescribeUserOutputBuilder"); + formatter.field("directory_id", &self.directory_id); + formatter.field("realm", &self.realm); + formatter.field("sid", &self.sid); + formatter.field("sam_account_name", &self.sam_account_name); + formatter.field("distinguished_name", &"*** Sensitive Data Redacted ***"); + formatter.field("user_principal_name", &"*** Sensitive Data Redacted ***"); + formatter.field("email_address", &"*** Sensitive Data Redacted ***"); + formatter.field("given_name", &"*** Sensitive Data Redacted ***"); + formatter.field("surname", &"*** Sensitive Data Redacted ***"); + formatter.field("enabled", &self.enabled); + formatter.field("other_attributes", &self.other_attributes); + formatter.field("_request_id", &self._request_id); + formatter.finish() + } +} diff --git a/sdk/directoryservicedata/src/operation/describe_user/builders.rs b/sdk/directoryservicedata/src/operation/describe_user/builders.rs new file mode 100644 index 000000000000..2a95373f5f99 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/describe_user/builders.rs @@ -0,0 +1,181 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::describe_user::_describe_user_output::DescribeUserOutputBuilder; + +pub use crate::operation::describe_user::_describe_user_input::DescribeUserInputBuilder; + +impl crate::operation::describe_user::builders::DescribeUserInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::describe_user::DescribeUserOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::describe_user::DescribeUserError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.describe_user(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `DescribeUser`. +/// +///

      Returns information about a specific user.

      +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct DescribeUserFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::describe_user::builders::DescribeUserInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::describe_user::DescribeUserOutput, + crate::operation::describe_user::DescribeUserError, + > for DescribeUserFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::describe_user::DescribeUserOutput, + crate::operation::describe_user::DescribeUserError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl DescribeUserFluentBuilder { + /// Creates a new `DescribeUserFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the DescribeUser as a reference. + pub fn as_input(&self) -> &crate::operation::describe_user::builders::DescribeUserInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::describe_user::DescribeUserOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::describe_user::DescribeUserError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::describe_user::DescribeUser::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::describe_user::DescribeUser::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::describe_user::DescribeUserOutput, + crate::operation::describe_user::DescribeUserError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.directory_id(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_directory_id(input); + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_directory_id() + } + ///

      The name of the user.

      + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.sam_account_name(input.into()); + self + } + ///

      The name of the user.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_sam_account_name(input); + self + } + ///

      The name of the user.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_sam_account_name() + } + /// + /// Appends an item to `OtherAttributes`. + /// + /// To override the contents of this collection use [`set_other_attributes`](Self::set_other_attributes). + /// + ///

      One or more attribute names to be returned for the user. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.

      + pub fn other_attributes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.other_attributes(input.into()); + self + } + ///

      One or more attribute names to be returned for the user. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.

      + pub fn set_other_attributes(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { + self.inner = self.inner.set_other_attributes(input); + self + } + ///

      One or more attribute names to be returned for the user. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.

      + pub fn get_other_attributes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { + self.inner.get_other_attributes() + } + ///

      The domain name that's associated with the user.

      + ///

      This parameter is optional, so you can return users outside your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.realm(input.into()); + self + } + ///

      The domain name that's associated with the user.

      + ///

      This parameter is optional, so you can return users outside your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn set_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_realm(input); + self + } + ///

      The domain name that's associated with the user.

      + ///

      This parameter is optional, so you can return users outside your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn get_realm(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_realm() + } +} diff --git a/sdk/directoryservicedata/src/operation/disable_user.rs b/sdk/directoryservicedata/src/operation/disable_user.rs new file mode 100644 index 000000000000..616963f91fb4 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/disable_user.rs @@ -0,0 +1,449 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `DisableUser`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct DisableUser; +impl DisableUser { + /// Creates a new `DisableUser` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::disable_user::DisableUserInput, + ) -> ::std::result::Result< + crate::operation::disable_user::DisableUserOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::disable_user::DisableUserError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::disable_user::DisableUserInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("directoryservicedata", "DisableUser", input, runtime_plugins, stop_point) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins + .with_operation_plugin(crate::client_idempotency_token::IdempotencyTokenRuntimePlugin::new( + |token_provider, input| { + let input: &mut crate::operation::disable_user::DisableUserInput = input.downcast_mut().expect("correct type"); + if input.client_token.is_none() { + input.client_token = ::std::option::Option::Some(token_provider.make_idempotency_token()); + } + }, + )) + .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DisableUser { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("DisableUser"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + DisableUserRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + DisableUserResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "DisableUser", + "directoryservicedata", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DisableUser") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(DisableUserEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::disable_user::DisableUserError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::disable_user::DisableUserError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::disable_user::DisableUserError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct DisableUserResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DisableUserResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_disable_user::de_disable_user_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_disable_user::de_disable_user_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct DisableUserRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DisableUserRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::disable_user::DisableUserInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/Users/DisableUser").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + fn uri_query( + _input: &crate::operation::disable_user::DisableUserInput, + mut output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + let mut query = ::aws_smithy_http::query::Writer::new(output); + let inner_1 = &_input.directory_id; + let inner_1 = inner_1 + .as_ref() + .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("directory_id", "cannot be empty or unset"))?; + if inner_1.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "directory_id", + "cannot be empty or unset", + )); + } + query.push_kv("DirectoryId", &::aws_smithy_http::query::fmt_string(inner_1)); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::disable_user::DisableUserInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + uri_query(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_disable_user::ser_disable_user_input(&input)?); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct DisableUserEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DisableUserEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "DisableUserEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to DisableUserInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `DisableUserError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum DisableUserError { + ///

      You don't have permission to perform the request or access the directory. It can also occur when the DirectoryId doesn't exist or the user, member, or group might be outside of your organizational unit (OU).

      + ///

      Make sure that you have the authentication and authorization to perform the action. Review the directory information in the request, and make sure that the object isn't outside of your OU.

      + AccessDeniedException(crate::types::error::AccessDeniedException), + ///

      This error will occur when you try to create a resource that conflicts with an existing object. It can also occur when adding a member to a group that the member is already in.

      + ///

      This error can be caused by a request sent within the 8-hour idempotency window with the same client token but different input parameters. Client tokens should not be re-used across different requests. After 8 hours, any request with the same client token is treated as a new request.

      + ConflictException(crate::types::error::ConflictException), + ///

      The request could not be completed due to a problem in the configuration or current state of the specified directory.

      + DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), + ///

      The operation didn't succeed because an internal error occurred. Try again later.

      + InternalServerException(crate::types::error::InternalServerException), + ///

      The resource couldn't be found.

      + ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

      The limit on the number of requests per second has been exceeded.

      + ThrottlingException(crate::types::error::ThrottlingException), + ///

      The request isn't valid. Review the details in the error message to update the invalid parameters or values in your request.

      + ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-DisableUserError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl DisableUserError { + /// Creates the `DisableUserError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `DisableUserError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::DirectoryUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `DisableUserError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `DisableUserError::ConflictException`. + pub fn is_conflict_exception(&self) -> bool { + matches!(self, Self::ConflictException(_)) + } + /// Returns `true` if the error kind is `DisableUserError::DirectoryUnavailableException`. + pub fn is_directory_unavailable_exception(&self) -> bool { + matches!(self, Self::DirectoryUnavailableException(_)) + } + /// Returns `true` if the error kind is `DisableUserError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `DisableUserError::ResourceNotFoundException`. + pub fn is_resource_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceNotFoundException(_)) + } + /// Returns `true` if the error kind is `DisableUserError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `DisableUserError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for DisableUserError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::ConflictException(_inner) => ::std::option::Option::Some(_inner), + Self::DirectoryUnavailableException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for DisableUserError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::ConflictException(_inner) => _inner.fmt(f), + Self::DirectoryUnavailableException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ResourceNotFoundException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for DisableUserError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::DirectoryUnavailableException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for DisableUserError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::DirectoryUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DisableUserError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::disable_user::DisableUserError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::disable_user::_disable_user_output::DisableUserOutput; + +pub use crate::operation::disable_user::_disable_user_input::DisableUserInput; + +mod _disable_user_input; + +mod _disable_user_output; + +/// Builders +pub mod builders; diff --git a/sdk/directoryservicedata/src/operation/disable_user/_disable_user_input.rs b/sdk/directoryservicedata/src/operation/disable_user/_disable_user_input.rs new file mode 100644 index 000000000000..246e591bd99c --- /dev/null +++ b/sdk/directoryservicedata/src/operation/disable_user/_disable_user_input.rs @@ -0,0 +1,115 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct DisableUserInput { + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub directory_id: ::std::option::Option<::std::string::String>, + ///

      The name of the user.

      + pub sam_account_name: ::std::option::Option<::std::string::String>, + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub client_token: ::std::option::Option<::std::string::String>, +} +impl DisableUserInput { + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } + ///

      The name of the user.

      + pub fn sam_account_name(&self) -> ::std::option::Option<&str> { + self.sam_account_name.as_deref() + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn client_token(&self) -> ::std::option::Option<&str> { + self.client_token.as_deref() + } +} +impl DisableUserInput { + /// Creates a new builder-style object to manufacture [`DisableUserInput`](crate::operation::disable_user::DisableUserInput). + pub fn builder() -> crate::operation::disable_user::builders::DisableUserInputBuilder { + crate::operation::disable_user::builders::DisableUserInputBuilder::default() + } +} + +/// A builder for [`DisableUserInput`](crate::operation::disable_user::DisableUserInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct DisableUserInputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, + pub(crate) sam_account_name: ::std::option::Option<::std::string::String>, + pub(crate) client_token: ::std::option::Option<::std::string::String>, +} +impl DisableUserInputBuilder { + ///

      The identifier (ID) of the directory that's associated with the user.

      + /// This field is required. + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + ///

      The name of the user.

      + /// This field is required. + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sam_account_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The name of the user.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sam_account_name = input; + self + } + ///

      The name of the user.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + &self.sam_account_name + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.client_token = ::std::option::Option::Some(input.into()); + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.client_token = input; + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> { + &self.client_token + } + /// Consumes the builder and constructs a [`DisableUserInput`](crate::operation::disable_user::DisableUserInput). + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::operation::disable_user::DisableUserInput { + directory_id: self.directory_id, + sam_account_name: self.sam_account_name, + client_token: self.client_token, + }) + } +} diff --git a/sdk/directoryservicedata/src/operation/disable_user/_disable_user_output.rs b/sdk/directoryservicedata/src/operation/disable_user/_disable_user_output.rs new file mode 100644 index 000000000000..70f33e1af854 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/disable_user/_disable_user_output.rs @@ -0,0 +1,42 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct DisableUserOutput { + _request_id: Option, +} +impl ::aws_types::request_id::RequestId for DisableUserOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl DisableUserOutput { + /// Creates a new builder-style object to manufacture [`DisableUserOutput`](crate::operation::disable_user::DisableUserOutput). + pub fn builder() -> crate::operation::disable_user::builders::DisableUserOutputBuilder { + crate::operation::disable_user::builders::DisableUserOutputBuilder::default() + } +} + +/// A builder for [`DisableUserOutput`](crate::operation::disable_user::DisableUserOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct DisableUserOutputBuilder { + _request_id: Option, +} +impl DisableUserOutputBuilder { + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`DisableUserOutput`](crate::operation::disable_user::DisableUserOutput). + pub fn build(self) -> crate::operation::disable_user::DisableUserOutput { + crate::operation::disable_user::DisableUserOutput { + _request_id: self._request_id, + } + } +} diff --git a/sdk/directoryservicedata/src/operation/disable_user/builders.rs b/sdk/directoryservicedata/src/operation/disable_user/builders.rs new file mode 100644 index 000000000000..725dcbbcb624 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/disable_user/builders.rs @@ -0,0 +1,165 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::disable_user::_disable_user_output::DisableUserOutputBuilder; + +pub use crate::operation::disable_user::_disable_user_input::DisableUserInputBuilder; + +impl crate::operation::disable_user::builders::DisableUserInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::disable_user::DisableUserOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::disable_user::DisableUserError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.disable_user(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `DisableUser`. +/// +///

      Deactivates an active user account. For information about how to enable an inactive user account, see ResetUserPassword in the Directory Service API Reference.

      +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct DisableUserFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::disable_user::builders::DisableUserInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::disable_user::DisableUserOutput, + crate::operation::disable_user::DisableUserError, + > for DisableUserFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::disable_user::DisableUserOutput, + crate::operation::disable_user::DisableUserError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl DisableUserFluentBuilder { + /// Creates a new `DisableUserFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the DisableUser as a reference. + pub fn as_input(&self) -> &crate::operation::disable_user::builders::DisableUserInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::disable_user::DisableUserOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::disable_user::DisableUserError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::disable_user::DisableUser::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::disable_user::DisableUser::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::disable_user::DisableUserOutput, + crate::operation::disable_user::DisableUserError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.directory_id(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_directory_id(input); + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_directory_id() + } + ///

      The name of the user.

      + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.sam_account_name(input.into()); + self + } + ///

      The name of the user.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_sam_account_name(input); + self + } + ///

      The name of the user.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_sam_account_name() + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.client_token(input.into()); + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_client_token(input); + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_client_token() + } +} diff --git a/sdk/directoryservicedata/src/operation/list_group_members.rs b/sdk/directoryservicedata/src/operation/list_group_members.rs new file mode 100644 index 000000000000..4965756dc8bb --- /dev/null +++ b/sdk/directoryservicedata/src/operation/list_group_members.rs @@ -0,0 +1,439 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `ListGroupMembers`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ListGroupMembers; +impl ListGroupMembers { + /// Creates a new `ListGroupMembers` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::list_group_members::ListGroupMembersInput, + ) -> ::std::result::Result< + crate::operation::list_group_members::ListGroupMembersOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_group_members::ListGroupMembersError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::list_group_members::ListGroupMembersInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point( + "directoryservicedata", + "ListGroupMembers", + input, + runtime_plugins, + stop_point, + ) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListGroupMembers { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ListGroupMembers"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + ListGroupMembersRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + ListGroupMembersResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput); + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "ListGroupMembers", + "directoryservicedata", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListGroupMembers") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(ListGroupMembersEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::list_group_members::ListGroupMembersError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::list_group_members::ListGroupMembersError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::list_group_members::ListGroupMembersError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct ListGroupMembersResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListGroupMembersResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_list_group_members::de_list_group_members_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_list_group_members::de_list_group_members_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct ListGroupMembersRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListGroupMembersRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::list_group_members::ListGroupMembersInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/GroupMemberships/ListGroupMembers").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + fn uri_query( + _input: &crate::operation::list_group_members::ListGroupMembersInput, + mut output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + let mut query = ::aws_smithy_http::query::Writer::new(output); + let inner_1 = &_input.directory_id; + let inner_1 = inner_1 + .as_ref() + .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("directory_id", "cannot be empty or unset"))?; + if inner_1.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "directory_id", + "cannot be empty or unset", + )); + } + query.push_kv("DirectoryId", &::aws_smithy_http::query::fmt_string(inner_1)); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::list_group_members::ListGroupMembersInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + uri_query(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_list_group_members::ser_list_group_members_input(&input)?); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct ListGroupMembersEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListGroupMembersEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "ListGroupMembersEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to ListGroupMembersInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `ListGroupMembersError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum ListGroupMembersError { + ///

      You don't have permission to perform the request or access the directory. It can also occur when the DirectoryId doesn't exist or the user, member, or group might be outside of your organizational unit (OU).

      + ///

      Make sure that you have the authentication and authorization to perform the action. Review the directory information in the request, and make sure that the object isn't outside of your OU.

      + AccessDeniedException(crate::types::error::AccessDeniedException), + ///

      The request could not be completed due to a problem in the configuration or current state of the specified directory.

      + DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), + ///

      The operation didn't succeed because an internal error occurred. Try again later.

      + InternalServerException(crate::types::error::InternalServerException), + ///

      The resource couldn't be found.

      + ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

      The limit on the number of requests per second has been exceeded.

      + ThrottlingException(crate::types::error::ThrottlingException), + ///

      The request isn't valid. Review the details in the error message to update the invalid parameters or values in your request.

      + ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ListGroupMembersError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl ListGroupMembersError { + /// Creates the `ListGroupMembersError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `ListGroupMembersError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::DirectoryUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `ListGroupMembersError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `ListGroupMembersError::DirectoryUnavailableException`. + pub fn is_directory_unavailable_exception(&self) -> bool { + matches!(self, Self::DirectoryUnavailableException(_)) + } + /// Returns `true` if the error kind is `ListGroupMembersError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `ListGroupMembersError::ResourceNotFoundException`. + pub fn is_resource_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceNotFoundException(_)) + } + /// Returns `true` if the error kind is `ListGroupMembersError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `ListGroupMembersError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for ListGroupMembersError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::DirectoryUnavailableException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for ListGroupMembersError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::DirectoryUnavailableException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ResourceNotFoundException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for ListGroupMembersError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::DirectoryUnavailableException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ListGroupMembersError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::DirectoryUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListGroupMembersError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::list_group_members::ListGroupMembersError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::list_group_members::_list_group_members_output::ListGroupMembersOutput; + +pub use crate::operation::list_group_members::_list_group_members_input::ListGroupMembersInput; + +mod _list_group_members_input; + +mod _list_group_members_output; + +/// Builders +pub mod builders; + +/// Paginator for this operation +pub mod paginator; diff --git a/sdk/directoryservicedata/src/operation/list_group_members/_list_group_members_input.rs b/sdk/directoryservicedata/src/operation/list_group_members/_list_group_members_input.rs new file mode 100644 index 000000000000..86af69cc4cf4 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/list_group_members/_list_group_members_input.rs @@ -0,0 +1,212 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq)] +pub struct ListGroupMembersInput { + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub directory_id: ::std::option::Option<::std::string::String>, + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return members from a group outside of your Managed Microsoft AD domain. When no value is defined, only members of your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub realm: ::std::option::Option<::std::string::String>, + ///

      The domain name that's associated with the group member. This parameter defaults to the Managed Microsoft AD domain.

      + ///

      This parameter is optional and case insensitive.

      + ///
      + pub member_realm: ::std::option::Option<::std::string::String>, + ///

      The name of the group.

      + pub sam_account_name: ::std::option::Option<::std::string::String>, + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub next_token: ::std::option::Option<::std::string::String>, + ///

      The maximum number of results to be returned per request.

      + pub max_results: ::std::option::Option, +} +impl ListGroupMembersInput { + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return members from a group outside of your Managed Microsoft AD domain. When no value is defined, only members of your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn realm(&self) -> ::std::option::Option<&str> { + self.realm.as_deref() + } + ///

      The domain name that's associated with the group member. This parameter defaults to the Managed Microsoft AD domain.

      + ///

      This parameter is optional and case insensitive.

      + ///
      + pub fn member_realm(&self) -> ::std::option::Option<&str> { + self.member_realm.as_deref() + } + ///

      The name of the group.

      + pub fn sam_account_name(&self) -> ::std::option::Option<&str> { + self.sam_account_name.as_deref() + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } + ///

      The maximum number of results to be returned per request.

      + pub fn max_results(&self) -> ::std::option::Option { + self.max_results + } +} +impl ::std::fmt::Debug for ListGroupMembersInput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("ListGroupMembersInput"); + formatter.field("directory_id", &self.directory_id); + formatter.field("realm", &self.realm); + formatter.field("member_realm", &self.member_realm); + formatter.field("sam_account_name", &self.sam_account_name); + formatter.field("next_token", &"*** Sensitive Data Redacted ***"); + formatter.field("max_results", &self.max_results); + formatter.finish() + } +} +impl ListGroupMembersInput { + /// Creates a new builder-style object to manufacture [`ListGroupMembersInput`](crate::operation::list_group_members::ListGroupMembersInput). + pub fn builder() -> crate::operation::list_group_members::builders::ListGroupMembersInputBuilder { + crate::operation::list_group_members::builders::ListGroupMembersInputBuilder::default() + } +} + +/// A builder for [`ListGroupMembersInput`](crate::operation::list_group_members::ListGroupMembersInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)] +#[non_exhaustive] +pub struct ListGroupMembersInputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, + pub(crate) realm: ::std::option::Option<::std::string::String>, + pub(crate) member_realm: ::std::option::Option<::std::string::String>, + pub(crate) sam_account_name: ::std::option::Option<::std::string::String>, + pub(crate) next_token: ::std::option::Option<::std::string::String>, + pub(crate) max_results: ::std::option::Option, +} +impl ListGroupMembersInputBuilder { + ///

      The identifier (ID) of the directory that's associated with the group.

      + /// This field is required. + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return members from a group outside of your Managed Microsoft AD domain. When no value is defined, only members of your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.realm = ::std::option::Option::Some(input.into()); + self + } + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return members from a group outside of your Managed Microsoft AD domain. When no value is defined, only members of your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn set_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.realm = input; + self + } + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return members from a group outside of your Managed Microsoft AD domain. When no value is defined, only members of your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn get_realm(&self) -> &::std::option::Option<::std::string::String> { + &self.realm + } + ///

      The domain name that's associated with the group member. This parameter defaults to the Managed Microsoft AD domain.

      + ///

      This parameter is optional and case insensitive.

      + ///
      + pub fn member_realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.member_realm = ::std::option::Option::Some(input.into()); + self + } + ///

      The domain name that's associated with the group member. This parameter defaults to the Managed Microsoft AD domain.

      + ///

      This parameter is optional and case insensitive.

      + ///
      + pub fn set_member_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.member_realm = input; + self + } + ///

      The domain name that's associated with the group member. This parameter defaults to the Managed Microsoft AD domain.

      + ///

      This parameter is optional and case insensitive.

      + ///
      + pub fn get_member_realm(&self) -> &::std::option::Option<::std::string::String> { + &self.member_realm + } + ///

      The name of the group.

      + /// This field is required. + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sam_account_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The name of the group.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sam_account_name = input; + self + } + ///

      The name of the group.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + &self.sam_account_name + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + ///

      The maximum number of results to be returned per request.

      + pub fn max_results(mut self, input: i32) -> Self { + self.max_results = ::std::option::Option::Some(input); + self + } + ///

      The maximum number of results to be returned per request.

      + pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.max_results = input; + self + } + ///

      The maximum number of results to be returned per request.

      + pub fn get_max_results(&self) -> &::std::option::Option { + &self.max_results + } + /// Consumes the builder and constructs a [`ListGroupMembersInput`](crate::operation::list_group_members::ListGroupMembersInput). + pub fn build( + self, + ) -> ::std::result::Result { + ::std::result::Result::Ok(crate::operation::list_group_members::ListGroupMembersInput { + directory_id: self.directory_id, + realm: self.realm, + member_realm: self.member_realm, + sam_account_name: self.sam_account_name, + next_token: self.next_token, + max_results: self.max_results, + }) + } +} +impl ::std::fmt::Debug for ListGroupMembersInputBuilder { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("ListGroupMembersInputBuilder"); + formatter.field("directory_id", &self.directory_id); + formatter.field("realm", &self.realm); + formatter.field("member_realm", &self.member_realm); + formatter.field("sam_account_name", &self.sam_account_name); + formatter.field("next_token", &"*** Sensitive Data Redacted ***"); + formatter.field("max_results", &self.max_results); + formatter.finish() + } +} diff --git a/sdk/directoryservicedata/src/operation/list_group_members/_list_group_members_output.rs b/sdk/directoryservicedata/src/operation/list_group_members/_list_group_members_output.rs new file mode 100644 index 000000000000..6b800eb502b4 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/list_group_members/_list_group_members_output.rs @@ -0,0 +1,186 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq)] +pub struct ListGroupMembersOutput { + ///

      Identifier (ID) of the directory associated with the group.

      + pub directory_id: ::std::option::Option<::std::string::String>, + ///

      The domain name that's associated with the group.

      + pub realm: ::std::option::Option<::std::string::String>, + ///

      The domain name that's associated with the member.

      + pub member_realm: ::std::option::Option<::std::string::String>, + ///

      The member information that the request returns.

      + pub members: ::std::option::Option<::std::vec::Vec>, + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl ListGroupMembersOutput { + ///

      Identifier (ID) of the directory associated with the group.

      + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } + ///

      The domain name that's associated with the group.

      + pub fn realm(&self) -> ::std::option::Option<&str> { + self.realm.as_deref() + } + ///

      The domain name that's associated with the member.

      + pub fn member_realm(&self) -> ::std::option::Option<&str> { + self.member_realm.as_deref() + } + ///

      The member information that the request returns.

      + /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.members.is_none()`. + pub fn members(&self) -> &[crate::types::Member] { + self.members.as_deref().unwrap_or_default() + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } +} +impl ::std::fmt::Debug for ListGroupMembersOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("ListGroupMembersOutput"); + formatter.field("directory_id", &self.directory_id); + formatter.field("realm", &self.realm); + formatter.field("member_realm", &self.member_realm); + formatter.field("members", &self.members); + formatter.field("next_token", &"*** Sensitive Data Redacted ***"); + formatter.field("_request_id", &self._request_id); + formatter.finish() + } +} +impl ::aws_types::request_id::RequestId for ListGroupMembersOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl ListGroupMembersOutput { + /// Creates a new builder-style object to manufacture [`ListGroupMembersOutput`](crate::operation::list_group_members::ListGroupMembersOutput). + pub fn builder() -> crate::operation::list_group_members::builders::ListGroupMembersOutputBuilder { + crate::operation::list_group_members::builders::ListGroupMembersOutputBuilder::default() + } +} + +/// A builder for [`ListGroupMembersOutput`](crate::operation::list_group_members::ListGroupMembersOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)] +#[non_exhaustive] +pub struct ListGroupMembersOutputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, + pub(crate) realm: ::std::option::Option<::std::string::String>, + pub(crate) member_realm: ::std::option::Option<::std::string::String>, + pub(crate) members: ::std::option::Option<::std::vec::Vec>, + pub(crate) next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl ListGroupMembersOutputBuilder { + ///

      Identifier (ID) of the directory associated with the group.

      + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

      Identifier (ID) of the directory associated with the group.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

      Identifier (ID) of the directory associated with the group.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + ///

      The domain name that's associated with the group.

      + pub fn realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.realm = ::std::option::Option::Some(input.into()); + self + } + ///

      The domain name that's associated with the group.

      + pub fn set_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.realm = input; + self + } + ///

      The domain name that's associated with the group.

      + pub fn get_realm(&self) -> &::std::option::Option<::std::string::String> { + &self.realm + } + ///

      The domain name that's associated with the member.

      + pub fn member_realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.member_realm = ::std::option::Option::Some(input.into()); + self + } + ///

      The domain name that's associated with the member.

      + pub fn set_member_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.member_realm = input; + self + } + ///

      The domain name that's associated with the member.

      + pub fn get_member_realm(&self) -> &::std::option::Option<::std::string::String> { + &self.member_realm + } + /// Appends an item to `members`. + /// + /// To override the contents of this collection use [`set_members`](Self::set_members). + /// + ///

      The member information that the request returns.

      + pub fn members(mut self, input: crate::types::Member) -> Self { + let mut v = self.members.unwrap_or_default(); + v.push(input); + self.members = ::std::option::Option::Some(v); + self + } + ///

      The member information that the request returns.

      + pub fn set_members(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.members = input; + self + } + ///

      The member information that the request returns.

      + pub fn get_members(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.members + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`ListGroupMembersOutput`](crate::operation::list_group_members::ListGroupMembersOutput). + pub fn build(self) -> crate::operation::list_group_members::ListGroupMembersOutput { + crate::operation::list_group_members::ListGroupMembersOutput { + directory_id: self.directory_id, + realm: self.realm, + member_realm: self.member_realm, + members: self.members, + next_token: self.next_token, + _request_id: self._request_id, + } + } +} +impl ::std::fmt::Debug for ListGroupMembersOutputBuilder { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("ListGroupMembersOutputBuilder"); + formatter.field("directory_id", &self.directory_id); + formatter.field("realm", &self.realm); + formatter.field("member_realm", &self.member_realm); + formatter.field("members", &self.members); + formatter.field("next_token", &"*** Sensitive Data Redacted ***"); + formatter.field("_request_id", &self._request_id); + formatter.finish() + } +} diff --git a/sdk/directoryservicedata/src/operation/list_group_members/builders.rs b/sdk/directoryservicedata/src/operation/list_group_members/builders.rs new file mode 100644 index 000000000000..0e1693c079ef --- /dev/null +++ b/sdk/directoryservicedata/src/operation/list_group_members/builders.rs @@ -0,0 +1,218 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::list_group_members::_list_group_members_output::ListGroupMembersOutputBuilder; + +pub use crate::operation::list_group_members::_list_group_members_input::ListGroupMembersInputBuilder; + +impl crate::operation::list_group_members::builders::ListGroupMembersInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::list_group_members::ListGroupMembersOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_group_members::ListGroupMembersError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.list_group_members(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `ListGroupMembers`. +/// +///

      Returns member information for the specified group.

      +///

      This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the ListGroupMembers.NextToken member contains a token that you pass in the next call to ListGroupMembers. This retrieves the next set of items.

      +///

      You can also specify a maximum number of return results with the MaxResults parameter.

      +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct ListGroupMembersFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::list_group_members::builders::ListGroupMembersInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::list_group_members::ListGroupMembersOutput, + crate::operation::list_group_members::ListGroupMembersError, + > for ListGroupMembersFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::list_group_members::ListGroupMembersOutput, + crate::operation::list_group_members::ListGroupMembersError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl ListGroupMembersFluentBuilder { + /// Creates a new `ListGroupMembersFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the ListGroupMembers as a reference. + pub fn as_input(&self) -> &crate::operation::list_group_members::builders::ListGroupMembersInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::list_group_members::ListGroupMembersOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_group_members::ListGroupMembersError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::list_group_members::ListGroupMembers::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::list_group_members::ListGroupMembers::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::list_group_members::ListGroupMembersOutput, + crate::operation::list_group_members::ListGroupMembersError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + /// Create a paginator for this request + /// + /// Paginators are used by calling [`send().await`](crate::operation::list_group_members::paginator::ListGroupMembersPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream). + pub fn into_paginator(self) -> crate::operation::list_group_members::paginator::ListGroupMembersPaginator { + crate::operation::list_group_members::paginator::ListGroupMembersPaginator::new(self.handle, self.inner) + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.directory_id(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_directory_id(input); + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_directory_id() + } + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return members from a group outside of your Managed Microsoft AD domain. When no value is defined, only members of your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.realm(input.into()); + self + } + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return members from a group outside of your Managed Microsoft AD domain. When no value is defined, only members of your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn set_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_realm(input); + self + } + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return members from a group outside of your Managed Microsoft AD domain. When no value is defined, only members of your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn get_realm(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_realm() + } + ///

      The domain name that's associated with the group member. This parameter defaults to the Managed Microsoft AD domain.

      + ///

      This parameter is optional and case insensitive.

      + ///
      + pub fn member_realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.member_realm(input.into()); + self + } + ///

      The domain name that's associated with the group member. This parameter defaults to the Managed Microsoft AD domain.

      + ///

      This parameter is optional and case insensitive.

      + ///
      + pub fn set_member_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_member_realm(input); + self + } + ///

      The domain name that's associated with the group member. This parameter defaults to the Managed Microsoft AD domain.

      + ///

      This parameter is optional and case insensitive.

      + ///
      + pub fn get_member_realm(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_member_realm() + } + ///

      The name of the group.

      + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.sam_account_name(input.into()); + self + } + ///

      The name of the group.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_sam_account_name(input); + self + } + ///

      The name of the group.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_sam_account_name() + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.next_token(input.into()); + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_next_token(input); + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_next_token() + } + ///

      The maximum number of results to be returned per request.

      + pub fn max_results(mut self, input: i32) -> Self { + self.inner = self.inner.max_results(input); + self + } + ///

      The maximum number of results to be returned per request.

      + pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_max_results(input); + self + } + ///

      The maximum number of results to be returned per request.

      + pub fn get_max_results(&self) -> &::std::option::Option { + self.inner.get_max_results() + } +} diff --git a/sdk/directoryservicedata/src/operation/list_group_members/paginator.rs b/sdk/directoryservicedata/src/operation/list_group_members/paginator.rs new file mode 100644 index 000000000000..13b0bfe5fcf3 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/list_group_members/paginator.rs @@ -0,0 +1,148 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Paginator for [`ListGroupMembers`](crate::operation::list_group_members::ListGroupMembers) +pub struct ListGroupMembersPaginator { + handle: std::sync::Arc, + builder: crate::operation::list_group_members::builders::ListGroupMembersInputBuilder, + stop_on_duplicate_token: bool, +} + +impl ListGroupMembersPaginator { + /// Create a new paginator-wrapper + pub(crate) fn new( + handle: std::sync::Arc, + builder: crate::operation::list_group_members::builders::ListGroupMembersInputBuilder, + ) -> Self { + Self { + handle, + builder, + stop_on_duplicate_token: true, + } + } + + /// Set the page size + /// + /// _Note: this method will override any previously set value for `max_results`_ + pub fn page_size(mut self, limit: i32) -> Self { + self.builder.max_results = ::std::option::Option::Some(limit); + self + } + + /// Create a flattened paginator + /// + /// This paginator automatically flattens results using `members`. Queries to the underlying service + /// are dispatched lazily. + pub fn items(self) -> crate::operation::list_group_members::paginator::ListGroupMembersPaginatorItems { + crate::operation::list_group_members::paginator::ListGroupMembersPaginatorItems(self) + } + + /// Stop paginating when the service returns the same pagination token twice in a row. + /// + /// Defaults to true. + /// + /// For certain operations, it may be useful to continue on duplicate token. For example, + /// if an operation is for tailing a log file in real-time, then continuing may be desired. + /// This option can be set to `false` to accommodate these use cases. + pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self { + self.stop_on_duplicate_token = stop_on_duplicate_token; + self + } + + /// Create the pagination stream + /// + /// _Note:_ No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::operation::list_group_members::ListGroupMembersOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_group_members::ListGroupMembersError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + // Move individual fields out of self for the borrow checker + let builder = self.builder; + let handle = self.handle; + let runtime_plugins = crate::operation::list_group_members::ListGroupMembers::operation_runtime_plugins( + handle.runtime_plugins.clone(), + &handle.conf, + ::std::option::Option::None, + ) + .with_operation_plugin(crate::sdk_feature_tracker::paginator::PaginatorFeatureTrackerRuntimePlugin::new()); + ::aws_smithy_async::future::pagination_stream::PaginationStream::new(::aws_smithy_async::future::pagination_stream::fn_stream::FnStream::new( + move |tx| { + ::std::boxed::Box::pin(async move { + // Build the input for the first time. If required fields are missing, this is where we'll produce an early error. + let mut input = match builder + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure) + { + ::std::result::Result::Ok(input) => input, + ::std::result::Result::Err(e) => { + let _ = tx.send(::std::result::Result::Err(e)).await; + return; + } + }; + loop { + let resp = crate::operation::list_group_members::ListGroupMembers::orchestrate(&runtime_plugins, input.clone()).await; + // If the input member is None or it was an error + let done = match resp { + ::std::result::Result::Ok(ref resp) => { + let new_token = crate::lens::reflens_list_group_members_output_output_next_token(resp); + // Pagination is exhausted when the next token is an empty string + let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true); + if !is_empty && new_token == input.next_token.as_ref() && self.stop_on_duplicate_token { + true + } else { + input.next_token = new_token.cloned(); + is_empty + } + } + ::std::result::Result::Err(_) => true, + }; + if tx.send(resp).await.is_err() { + // receiving end was dropped + return; + } + if done { + return; + } + } + }) + }, + )) + } +} + +/// Flattened paginator for `ListGroupMembersPaginator` +/// +/// This is created with [`.items()`](ListGroupMembersPaginator::items) +pub struct ListGroupMembersPaginatorItems(ListGroupMembersPaginator); + +impl ListGroupMembersPaginatorItems { + /// Create the pagination stream + /// + /// _Note_: No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + /// + /// To read the entirety of the paginator, use [`.collect::, _>()`](aws_smithy_async::future::pagination_stream::PaginationStream::collect). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::types::Member, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_group_members::ListGroupMembersError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + ::aws_smithy_async::future::pagination_stream::TryFlatMap::new(self.0.send()).flat_map(|page| { + crate::lens::lens_list_group_members_output_output_members(page) + .unwrap_or_default() + .into_iter() + }) + } +} diff --git a/sdk/directoryservicedata/src/operation/list_groups.rs b/sdk/directoryservicedata/src/operation/list_groups.rs new file mode 100644 index 000000000000..fbe1b04fe305 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/list_groups.rs @@ -0,0 +1,421 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `ListGroups`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ListGroups; +impl ListGroups { + /// Creates a new `ListGroups` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::list_groups::ListGroupsInput, + ) -> ::std::result::Result< + crate::operation::list_groups::ListGroupsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_groups::ListGroupsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::list_groups::ListGroupsInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("directoryservicedata", "ListGroups", input, runtime_plugins, stop_point) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListGroups { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ListGroups"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + ListGroupsRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + ListGroupsResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput); + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "ListGroups", + "directoryservicedata", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListGroups") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(ListGroupsEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::list_groups::ListGroupsError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::list_groups::ListGroupsError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::list_groups::ListGroupsError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct ListGroupsResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListGroupsResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_list_groups::de_list_groups_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_list_groups::de_list_groups_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct ListGroupsRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListGroupsRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input.downcast::().expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::list_groups::ListGroupsInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/Groups/ListGroups").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + fn uri_query( + _input: &crate::operation::list_groups::ListGroupsInput, + mut output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + let mut query = ::aws_smithy_http::query::Writer::new(output); + let inner_1 = &_input.directory_id; + let inner_1 = inner_1 + .as_ref() + .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("directory_id", "cannot be empty or unset"))?; + if inner_1.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "directory_id", + "cannot be empty or unset", + )); + } + query.push_kv("DirectoryId", &::aws_smithy_http::query::fmt_string(inner_1)); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::list_groups::ListGroupsInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + uri_query(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_list_groups::ser_list_groups_input(&input)?); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct ListGroupsEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListGroupsEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "ListGroupsEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to ListGroupsInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `ListGroupsError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum ListGroupsError { + ///

      You don't have permission to perform the request or access the directory. It can also occur when the DirectoryId doesn't exist or the user, member, or group might be outside of your organizational unit (OU).

      + ///

      Make sure that you have the authentication and authorization to perform the action. Review the directory information in the request, and make sure that the object isn't outside of your OU.

      + AccessDeniedException(crate::types::error::AccessDeniedException), + ///

      The request could not be completed due to a problem in the configuration or current state of the specified directory.

      + DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), + ///

      The operation didn't succeed because an internal error occurred. Try again later.

      + InternalServerException(crate::types::error::InternalServerException), + ///

      The limit on the number of requests per second has been exceeded.

      + ThrottlingException(crate::types::error::ThrottlingException), + ///

      The request isn't valid. Review the details in the error message to update the invalid parameters or values in your request.

      + ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ListGroupsError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl ListGroupsError { + /// Creates the `ListGroupsError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `ListGroupsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::DirectoryUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `ListGroupsError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `ListGroupsError::DirectoryUnavailableException`. + pub fn is_directory_unavailable_exception(&self) -> bool { + matches!(self, Self::DirectoryUnavailableException(_)) + } + /// Returns `true` if the error kind is `ListGroupsError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `ListGroupsError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `ListGroupsError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for ListGroupsError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::DirectoryUnavailableException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for ListGroupsError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::DirectoryUnavailableException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for ListGroupsError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::DirectoryUnavailableException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ListGroupsError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::DirectoryUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListGroupsError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::list_groups::ListGroupsError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::list_groups::_list_groups_output::ListGroupsOutput; + +pub use crate::operation::list_groups::_list_groups_input::ListGroupsInput; + +mod _list_groups_input; + +mod _list_groups_output; + +/// Builders +pub mod builders; + +/// Paginator for this operation +pub mod paginator; diff --git a/sdk/directoryservicedata/src/operation/list_groups/_list_groups_input.rs b/sdk/directoryservicedata/src/operation/list_groups/_list_groups_input.rs new file mode 100644 index 000000000000..452f7298ddcd --- /dev/null +++ b/sdk/directoryservicedata/src/operation/list_groups/_list_groups_input.rs @@ -0,0 +1,151 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq)] +pub struct ListGroupsInput { + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub directory_id: ::std::option::Option<::std::string::String>, + ///

      The domain name associated with the directory.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub realm: ::std::option::Option<::std::string::String>, + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub next_token: ::std::option::Option<::std::string::String>, + ///

      The maximum number of results to be returned per request.

      + pub max_results: ::std::option::Option, +} +impl ListGroupsInput { + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } + ///

      The domain name associated with the directory.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn realm(&self) -> ::std::option::Option<&str> { + self.realm.as_deref() + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } + ///

      The maximum number of results to be returned per request.

      + pub fn max_results(&self) -> ::std::option::Option { + self.max_results + } +} +impl ::std::fmt::Debug for ListGroupsInput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("ListGroupsInput"); + formatter.field("directory_id", &self.directory_id); + formatter.field("realm", &self.realm); + formatter.field("next_token", &"*** Sensitive Data Redacted ***"); + formatter.field("max_results", &self.max_results); + formatter.finish() + } +} +impl ListGroupsInput { + /// Creates a new builder-style object to manufacture [`ListGroupsInput`](crate::operation::list_groups::ListGroupsInput). + pub fn builder() -> crate::operation::list_groups::builders::ListGroupsInputBuilder { + crate::operation::list_groups::builders::ListGroupsInputBuilder::default() + } +} + +/// A builder for [`ListGroupsInput`](crate::operation::list_groups::ListGroupsInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)] +#[non_exhaustive] +pub struct ListGroupsInputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, + pub(crate) realm: ::std::option::Option<::std::string::String>, + pub(crate) next_token: ::std::option::Option<::std::string::String>, + pub(crate) max_results: ::std::option::Option, +} +impl ListGroupsInputBuilder { + ///

      The identifier (ID) of the directory that's associated with the group.

      + /// This field is required. + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + ///

      The domain name associated with the directory.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.realm = ::std::option::Option::Some(input.into()); + self + } + ///

      The domain name associated with the directory.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn set_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.realm = input; + self + } + ///

      The domain name associated with the directory.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn get_realm(&self) -> &::std::option::Option<::std::string::String> { + &self.realm + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + ///

      The maximum number of results to be returned per request.

      + pub fn max_results(mut self, input: i32) -> Self { + self.max_results = ::std::option::Option::Some(input); + self + } + ///

      The maximum number of results to be returned per request.

      + pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.max_results = input; + self + } + ///

      The maximum number of results to be returned per request.

      + pub fn get_max_results(&self) -> &::std::option::Option { + &self.max_results + } + /// Consumes the builder and constructs a [`ListGroupsInput`](crate::operation::list_groups::ListGroupsInput). + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::operation::list_groups::ListGroupsInput { + directory_id: self.directory_id, + realm: self.realm, + next_token: self.next_token, + max_results: self.max_results, + }) + } +} +impl ::std::fmt::Debug for ListGroupsInputBuilder { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("ListGroupsInputBuilder"); + formatter.field("directory_id", &self.directory_id); + formatter.field("realm", &self.realm); + formatter.field("next_token", &"*** Sensitive Data Redacted ***"); + formatter.field("max_results", &self.max_results); + formatter.finish() + } +} diff --git a/sdk/directoryservicedata/src/operation/list_groups/_list_groups_output.rs b/sdk/directoryservicedata/src/operation/list_groups/_list_groups_output.rs new file mode 100644 index 000000000000..50b976d2e976 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/list_groups/_list_groups_output.rs @@ -0,0 +1,162 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq)] +pub struct ListGroupsOutput { + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub directory_id: ::std::option::Option<::std::string::String>, + ///

      The domain name associated with the group.

      + pub realm: ::std::option::Option<::std::string::String>, + ///

      The group information that the request returns.

      + pub groups: ::std::option::Option<::std::vec::Vec>, + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl ListGroupsOutput { + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } + ///

      The domain name associated with the group.

      + pub fn realm(&self) -> ::std::option::Option<&str> { + self.realm.as_deref() + } + ///

      The group information that the request returns.

      + /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.groups.is_none()`. + pub fn groups(&self) -> &[crate::types::GroupSummary] { + self.groups.as_deref().unwrap_or_default() + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } +} +impl ::std::fmt::Debug for ListGroupsOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("ListGroupsOutput"); + formatter.field("directory_id", &self.directory_id); + formatter.field("realm", &self.realm); + formatter.field("groups", &self.groups); + formatter.field("next_token", &"*** Sensitive Data Redacted ***"); + formatter.field("_request_id", &self._request_id); + formatter.finish() + } +} +impl ::aws_types::request_id::RequestId for ListGroupsOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl ListGroupsOutput { + /// Creates a new builder-style object to manufacture [`ListGroupsOutput`](crate::operation::list_groups::ListGroupsOutput). + pub fn builder() -> crate::operation::list_groups::builders::ListGroupsOutputBuilder { + crate::operation::list_groups::builders::ListGroupsOutputBuilder::default() + } +} + +/// A builder for [`ListGroupsOutput`](crate::operation::list_groups::ListGroupsOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)] +#[non_exhaustive] +pub struct ListGroupsOutputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, + pub(crate) realm: ::std::option::Option<::std::string::String>, + pub(crate) groups: ::std::option::Option<::std::vec::Vec>, + pub(crate) next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl ListGroupsOutputBuilder { + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + ///

      The domain name associated with the group.

      + pub fn realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.realm = ::std::option::Option::Some(input.into()); + self + } + ///

      The domain name associated with the group.

      + pub fn set_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.realm = input; + self + } + ///

      The domain name associated with the group.

      + pub fn get_realm(&self) -> &::std::option::Option<::std::string::String> { + &self.realm + } + /// Appends an item to `groups`. + /// + /// To override the contents of this collection use [`set_groups`](Self::set_groups). + /// + ///

      The group information that the request returns.

      + pub fn groups(mut self, input: crate::types::GroupSummary) -> Self { + let mut v = self.groups.unwrap_or_default(); + v.push(input); + self.groups = ::std::option::Option::Some(v); + self + } + ///

      The group information that the request returns.

      + pub fn set_groups(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.groups = input; + self + } + ///

      The group information that the request returns.

      + pub fn get_groups(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.groups + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`ListGroupsOutput`](crate::operation::list_groups::ListGroupsOutput). + pub fn build(self) -> crate::operation::list_groups::ListGroupsOutput { + crate::operation::list_groups::ListGroupsOutput { + directory_id: self.directory_id, + realm: self.realm, + groups: self.groups, + next_token: self.next_token, + _request_id: self._request_id, + } + } +} +impl ::std::fmt::Debug for ListGroupsOutputBuilder { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("ListGroupsOutputBuilder"); + formatter.field("directory_id", &self.directory_id); + formatter.field("realm", &self.realm); + formatter.field("groups", &self.groups); + formatter.field("next_token", &"*** Sensitive Data Redacted ***"); + formatter.field("_request_id", &self._request_id); + formatter.finish() + } +} diff --git a/sdk/directoryservicedata/src/operation/list_groups/builders.rs b/sdk/directoryservicedata/src/operation/list_groups/builders.rs new file mode 100644 index 000000000000..72669367df2e --- /dev/null +++ b/sdk/directoryservicedata/src/operation/list_groups/builders.rs @@ -0,0 +1,184 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::list_groups::_list_groups_output::ListGroupsOutputBuilder; + +pub use crate::operation::list_groups::_list_groups_input::ListGroupsInputBuilder; + +impl crate::operation::list_groups::builders::ListGroupsInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::list_groups::ListGroupsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_groups::ListGroupsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.list_groups(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `ListGroups`. +/// +///

      Returns group information for the specified directory.

      +///

      This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the ListGroups.NextToken member contains a token that you pass in the next call to ListGroups. This retrieves the next set of items.

      +///

      You can also specify a maximum number of return results with the MaxResults parameter.

      +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct ListGroupsFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::list_groups::builders::ListGroupsInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::list_groups::ListGroupsOutput, + crate::operation::list_groups::ListGroupsError, + > for ListGroupsFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::list_groups::ListGroupsOutput, + crate::operation::list_groups::ListGroupsError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl ListGroupsFluentBuilder { + /// Creates a new `ListGroupsFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the ListGroups as a reference. + pub fn as_input(&self) -> &crate::operation::list_groups::builders::ListGroupsInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::list_groups::ListGroupsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_groups::ListGroupsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::list_groups::ListGroups::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::list_groups::ListGroups::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::list_groups::ListGroupsOutput, + crate::operation::list_groups::ListGroupsError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + /// Create a paginator for this request + /// + /// Paginators are used by calling [`send().await`](crate::operation::list_groups::paginator::ListGroupsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream). + pub fn into_paginator(self) -> crate::operation::list_groups::paginator::ListGroupsPaginator { + crate::operation::list_groups::paginator::ListGroupsPaginator::new(self.handle, self.inner) + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.directory_id(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_directory_id(input); + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_directory_id() + } + ///

      The domain name associated with the directory.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.realm(input.into()); + self + } + ///

      The domain name associated with the directory.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn set_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_realm(input); + self + } + ///

      The domain name associated with the directory.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn get_realm(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_realm() + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.next_token(input.into()); + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_next_token(input); + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_next_token() + } + ///

      The maximum number of results to be returned per request.

      + pub fn max_results(mut self, input: i32) -> Self { + self.inner = self.inner.max_results(input); + self + } + ///

      The maximum number of results to be returned per request.

      + pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_max_results(input); + self + } + ///

      The maximum number of results to be returned per request.

      + pub fn get_max_results(&self) -> &::std::option::Option { + self.inner.get_max_results() + } +} diff --git a/sdk/directoryservicedata/src/operation/list_groups/paginator.rs b/sdk/directoryservicedata/src/operation/list_groups/paginator.rs new file mode 100644 index 000000000000..28d2edbbcb5d --- /dev/null +++ b/sdk/directoryservicedata/src/operation/list_groups/paginator.rs @@ -0,0 +1,145 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Paginator for [`ListGroups`](crate::operation::list_groups::ListGroups) +pub struct ListGroupsPaginator { + handle: std::sync::Arc, + builder: crate::operation::list_groups::builders::ListGroupsInputBuilder, + stop_on_duplicate_token: bool, +} + +impl ListGroupsPaginator { + /// Create a new paginator-wrapper + pub(crate) fn new( + handle: std::sync::Arc, + builder: crate::operation::list_groups::builders::ListGroupsInputBuilder, + ) -> Self { + Self { + handle, + builder, + stop_on_duplicate_token: true, + } + } + + /// Set the page size + /// + /// _Note: this method will override any previously set value for `max_results`_ + pub fn page_size(mut self, limit: i32) -> Self { + self.builder.max_results = ::std::option::Option::Some(limit); + self + } + + /// Create a flattened paginator + /// + /// This paginator automatically flattens results using `groups`. Queries to the underlying service + /// are dispatched lazily. + pub fn items(self) -> crate::operation::list_groups::paginator::ListGroupsPaginatorItems { + crate::operation::list_groups::paginator::ListGroupsPaginatorItems(self) + } + + /// Stop paginating when the service returns the same pagination token twice in a row. + /// + /// Defaults to true. + /// + /// For certain operations, it may be useful to continue on duplicate token. For example, + /// if an operation is for tailing a log file in real-time, then continuing may be desired. + /// This option can be set to `false` to accommodate these use cases. + pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self { + self.stop_on_duplicate_token = stop_on_duplicate_token; + self + } + + /// Create the pagination stream + /// + /// _Note:_ No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::operation::list_groups::ListGroupsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_groups::ListGroupsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + // Move individual fields out of self for the borrow checker + let builder = self.builder; + let handle = self.handle; + let runtime_plugins = crate::operation::list_groups::ListGroups::operation_runtime_plugins( + handle.runtime_plugins.clone(), + &handle.conf, + ::std::option::Option::None, + ) + .with_operation_plugin(crate::sdk_feature_tracker::paginator::PaginatorFeatureTrackerRuntimePlugin::new()); + ::aws_smithy_async::future::pagination_stream::PaginationStream::new(::aws_smithy_async::future::pagination_stream::fn_stream::FnStream::new( + move |tx| { + ::std::boxed::Box::pin(async move { + // Build the input for the first time. If required fields are missing, this is where we'll produce an early error. + let mut input = match builder + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure) + { + ::std::result::Result::Ok(input) => input, + ::std::result::Result::Err(e) => { + let _ = tx.send(::std::result::Result::Err(e)).await; + return; + } + }; + loop { + let resp = crate::operation::list_groups::ListGroups::orchestrate(&runtime_plugins, input.clone()).await; + // If the input member is None or it was an error + let done = match resp { + ::std::result::Result::Ok(ref resp) => { + let new_token = crate::lens::reflens_list_groups_output_output_next_token(resp); + // Pagination is exhausted when the next token is an empty string + let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true); + if !is_empty && new_token == input.next_token.as_ref() && self.stop_on_duplicate_token { + true + } else { + input.next_token = new_token.cloned(); + is_empty + } + } + ::std::result::Result::Err(_) => true, + }; + if tx.send(resp).await.is_err() { + // receiving end was dropped + return; + } + if done { + return; + } + } + }) + }, + )) + } +} + +/// Flattened paginator for `ListGroupsPaginator` +/// +/// This is created with [`.items()`](ListGroupsPaginator::items) +pub struct ListGroupsPaginatorItems(ListGroupsPaginator); + +impl ListGroupsPaginatorItems { + /// Create the pagination stream + /// + /// _Note_: No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + /// + /// To read the entirety of the paginator, use [`.collect::, _>()`](aws_smithy_async::future::pagination_stream::PaginationStream::collect). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::types::GroupSummary, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_groups::ListGroupsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + ::aws_smithy_async::future::pagination_stream::TryFlatMap::new(self.0.send()) + .flat_map(|page| crate::lens::lens_list_groups_output_output_groups(page).unwrap_or_default().into_iter()) + } +} diff --git a/sdk/directoryservicedata/src/operation/list_groups_for_member.rs b/sdk/directoryservicedata/src/operation/list_groups_for_member.rs new file mode 100644 index 000000000000..22bcd0c59f93 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/list_groups_for_member.rs @@ -0,0 +1,441 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `ListGroupsForMember`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ListGroupsForMember; +impl ListGroupsForMember { + /// Creates a new `ListGroupsForMember` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::list_groups_for_member::ListGroupsForMemberInput, + ) -> ::std::result::Result< + crate::operation::list_groups_for_member::ListGroupsForMemberOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_groups_for_member::ListGroupsForMemberError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::list_groups_for_member::ListGroupsForMemberInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point( + "directoryservicedata", + "ListGroupsForMember", + input, + runtime_plugins, + stop_point, + ) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListGroupsForMember { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ListGroupsForMember"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + ListGroupsForMemberRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + ListGroupsForMemberResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput); + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "ListGroupsForMember", + "directoryservicedata", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListGroupsForMember") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(ListGroupsForMemberEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::list_groups_for_member::ListGroupsForMemberError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::list_groups_for_member::ListGroupsForMemberError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::list_groups_for_member::ListGroupsForMemberError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct ListGroupsForMemberResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListGroupsForMemberResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_list_groups_for_member::de_list_groups_for_member_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_list_groups_for_member::de_list_groups_for_member_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct ListGroupsForMemberRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListGroupsForMemberRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::list_groups_for_member::ListGroupsForMemberInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/GroupMemberships/ListGroupsForMember").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + fn uri_query( + _input: &crate::operation::list_groups_for_member::ListGroupsForMemberInput, + mut output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + let mut query = ::aws_smithy_http::query::Writer::new(output); + let inner_1 = &_input.directory_id; + let inner_1 = inner_1 + .as_ref() + .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("directory_id", "cannot be empty or unset"))?; + if inner_1.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "directory_id", + "cannot be empty or unset", + )); + } + query.push_kv("DirectoryId", &::aws_smithy_http::query::fmt_string(inner_1)); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::list_groups_for_member::ListGroupsForMemberInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + uri_query(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_list_groups_for_member::ser_list_groups_for_member_input( + &input, + )?); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct ListGroupsForMemberEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListGroupsForMemberEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "ListGroupsForMemberEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to ListGroupsForMemberInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `ListGroupsForMemberError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum ListGroupsForMemberError { + ///

      You don't have permission to perform the request or access the directory. It can also occur when the DirectoryId doesn't exist or the user, member, or group might be outside of your organizational unit (OU).

      + ///

      Make sure that you have the authentication and authorization to perform the action. Review the directory information in the request, and make sure that the object isn't outside of your OU.

      + AccessDeniedException(crate::types::error::AccessDeniedException), + ///

      The request could not be completed due to a problem in the configuration or current state of the specified directory.

      + DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), + ///

      The operation didn't succeed because an internal error occurred. Try again later.

      + InternalServerException(crate::types::error::InternalServerException), + ///

      The resource couldn't be found.

      + ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

      The limit on the number of requests per second has been exceeded.

      + ThrottlingException(crate::types::error::ThrottlingException), + ///

      The request isn't valid. Review the details in the error message to update the invalid parameters or values in your request.

      + ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ListGroupsForMemberError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl ListGroupsForMemberError { + /// Creates the `ListGroupsForMemberError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `ListGroupsForMemberError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::DirectoryUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `ListGroupsForMemberError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `ListGroupsForMemberError::DirectoryUnavailableException`. + pub fn is_directory_unavailable_exception(&self) -> bool { + matches!(self, Self::DirectoryUnavailableException(_)) + } + /// Returns `true` if the error kind is `ListGroupsForMemberError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `ListGroupsForMemberError::ResourceNotFoundException`. + pub fn is_resource_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceNotFoundException(_)) + } + /// Returns `true` if the error kind is `ListGroupsForMemberError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `ListGroupsForMemberError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for ListGroupsForMemberError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::DirectoryUnavailableException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for ListGroupsForMemberError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::DirectoryUnavailableException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ResourceNotFoundException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for ListGroupsForMemberError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::DirectoryUnavailableException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ListGroupsForMemberError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::DirectoryUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListGroupsForMemberError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::list_groups_for_member::ListGroupsForMemberError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::list_groups_for_member::_list_groups_for_member_output::ListGroupsForMemberOutput; + +pub use crate::operation::list_groups_for_member::_list_groups_for_member_input::ListGroupsForMemberInput; + +mod _list_groups_for_member_input; + +mod _list_groups_for_member_output; + +/// Builders +pub mod builders; + +/// Paginator for this operation +pub mod paginator; diff --git a/sdk/directoryservicedata/src/operation/list_groups_for_member/_list_groups_for_member_input.rs b/sdk/directoryservicedata/src/operation/list_groups_for_member/_list_groups_for_member_input.rs new file mode 100644 index 000000000000..6d1ee2bcd1be --- /dev/null +++ b/sdk/directoryservicedata/src/operation/list_groups_for_member/_list_groups_for_member_input.rs @@ -0,0 +1,218 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq)] +pub struct ListGroupsForMemberInput { + ///

      The identifier (ID) of the directory that's associated with the member.

      + pub directory_id: ::std::option::Option<::std::string::String>, + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive and defaults to your Managed Microsoft AD domain.

      + ///
      + pub realm: ::std::option::Option<::std::string::String>, + ///

      The domain name that's associated with the group member.

      + ///

      This parameter is optional, so you can limit your results to the group members in a specific domain.

      + ///

      This parameter is case insensitive and defaults to Realm

      + ///
      + pub member_realm: ::std::option::Option<::std::string::String>, + ///

      The SAMAccountName of the user, group, or computer that's a member of the group.

      + pub sam_account_name: ::std::option::Option<::std::string::String>, + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub next_token: ::std::option::Option<::std::string::String>, + ///

      The maximum number of results to be returned per request.

      + pub max_results: ::std::option::Option, +} +impl ListGroupsForMemberInput { + ///

      The identifier (ID) of the directory that's associated with the member.

      + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive and defaults to your Managed Microsoft AD domain.

      + ///
      + pub fn realm(&self) -> ::std::option::Option<&str> { + self.realm.as_deref() + } + ///

      The domain name that's associated with the group member.

      + ///

      This parameter is optional, so you can limit your results to the group members in a specific domain.

      + ///

      This parameter is case insensitive and defaults to Realm

      + ///
      + pub fn member_realm(&self) -> ::std::option::Option<&str> { + self.member_realm.as_deref() + } + ///

      The SAMAccountName of the user, group, or computer that's a member of the group.

      + pub fn sam_account_name(&self) -> ::std::option::Option<&str> { + self.sam_account_name.as_deref() + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } + ///

      The maximum number of results to be returned per request.

      + pub fn max_results(&self) -> ::std::option::Option { + self.max_results + } +} +impl ::std::fmt::Debug for ListGroupsForMemberInput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("ListGroupsForMemberInput"); + formatter.field("directory_id", &self.directory_id); + formatter.field("realm", &self.realm); + formatter.field("member_realm", &self.member_realm); + formatter.field("sam_account_name", &self.sam_account_name); + formatter.field("next_token", &"*** Sensitive Data Redacted ***"); + formatter.field("max_results", &self.max_results); + formatter.finish() + } +} +impl ListGroupsForMemberInput { + /// Creates a new builder-style object to manufacture [`ListGroupsForMemberInput`](crate::operation::list_groups_for_member::ListGroupsForMemberInput). + pub fn builder() -> crate::operation::list_groups_for_member::builders::ListGroupsForMemberInputBuilder { + crate::operation::list_groups_for_member::builders::ListGroupsForMemberInputBuilder::default() + } +} + +/// A builder for [`ListGroupsForMemberInput`](crate::operation::list_groups_for_member::ListGroupsForMemberInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)] +#[non_exhaustive] +pub struct ListGroupsForMemberInputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, + pub(crate) realm: ::std::option::Option<::std::string::String>, + pub(crate) member_realm: ::std::option::Option<::std::string::String>, + pub(crate) sam_account_name: ::std::option::Option<::std::string::String>, + pub(crate) next_token: ::std::option::Option<::std::string::String>, + pub(crate) max_results: ::std::option::Option, +} +impl ListGroupsForMemberInputBuilder { + ///

      The identifier (ID) of the directory that's associated with the member.

      + /// This field is required. + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the member.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

      The identifier (ID) of the directory that's associated with the member.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive and defaults to your Managed Microsoft AD domain.

      + ///
      + pub fn realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.realm = ::std::option::Option::Some(input.into()); + self + } + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive and defaults to your Managed Microsoft AD domain.

      + ///
      + pub fn set_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.realm = input; + self + } + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive and defaults to your Managed Microsoft AD domain.

      + ///
      + pub fn get_realm(&self) -> &::std::option::Option<::std::string::String> { + &self.realm + } + ///

      The domain name that's associated with the group member.

      + ///

      This parameter is optional, so you can limit your results to the group members in a specific domain.

      + ///

      This parameter is case insensitive and defaults to Realm

      + ///
      + pub fn member_realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.member_realm = ::std::option::Option::Some(input.into()); + self + } + ///

      The domain name that's associated with the group member.

      + ///

      This parameter is optional, so you can limit your results to the group members in a specific domain.

      + ///

      This parameter is case insensitive and defaults to Realm

      + ///
      + pub fn set_member_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.member_realm = input; + self + } + ///

      The domain name that's associated with the group member.

      + ///

      This parameter is optional, so you can limit your results to the group members in a specific domain.

      + ///

      This parameter is case insensitive and defaults to Realm

      + ///
      + pub fn get_member_realm(&self) -> &::std::option::Option<::std::string::String> { + &self.member_realm + } + ///

      The SAMAccountName of the user, group, or computer that's a member of the group.

      + /// This field is required. + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sam_account_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The SAMAccountName of the user, group, or computer that's a member of the group.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sam_account_name = input; + self + } + ///

      The SAMAccountName of the user, group, or computer that's a member of the group.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + &self.sam_account_name + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + ///

      The maximum number of results to be returned per request.

      + pub fn max_results(mut self, input: i32) -> Self { + self.max_results = ::std::option::Option::Some(input); + self + } + ///

      The maximum number of results to be returned per request.

      + pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.max_results = input; + self + } + ///

      The maximum number of results to be returned per request.

      + pub fn get_max_results(&self) -> &::std::option::Option { + &self.max_results + } + /// Consumes the builder and constructs a [`ListGroupsForMemberInput`](crate::operation::list_groups_for_member::ListGroupsForMemberInput). + pub fn build( + self, + ) -> ::std::result::Result + { + ::std::result::Result::Ok(crate::operation::list_groups_for_member::ListGroupsForMemberInput { + directory_id: self.directory_id, + realm: self.realm, + member_realm: self.member_realm, + sam_account_name: self.sam_account_name, + next_token: self.next_token, + max_results: self.max_results, + }) + } +} +impl ::std::fmt::Debug for ListGroupsForMemberInputBuilder { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("ListGroupsForMemberInputBuilder"); + formatter.field("directory_id", &self.directory_id); + formatter.field("realm", &self.realm); + formatter.field("member_realm", &self.member_realm); + formatter.field("sam_account_name", &self.sam_account_name); + formatter.field("next_token", &"*** Sensitive Data Redacted ***"); + formatter.field("max_results", &self.max_results); + formatter.finish() + } +} diff --git a/sdk/directoryservicedata/src/operation/list_groups_for_member/_list_groups_for_member_output.rs b/sdk/directoryservicedata/src/operation/list_groups_for_member/_list_groups_for_member_output.rs new file mode 100644 index 000000000000..00828242979e --- /dev/null +++ b/sdk/directoryservicedata/src/operation/list_groups_for_member/_list_groups_for_member_output.rs @@ -0,0 +1,186 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq)] +pub struct ListGroupsForMemberOutput { + ///

      The identifier (ID) of the directory that's associated with the member.

      + pub directory_id: ::std::option::Option<::std::string::String>, + ///

      The domain that's associated with the group.

      + pub realm: ::std::option::Option<::std::string::String>, + ///

      The domain that's associated with the member.

      + pub member_realm: ::std::option::Option<::std::string::String>, + ///

      The group information that the request returns.

      + pub groups: ::std::option::Option<::std::vec::Vec>, + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl ListGroupsForMemberOutput { + ///

      The identifier (ID) of the directory that's associated with the member.

      + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } + ///

      The domain that's associated with the group.

      + pub fn realm(&self) -> ::std::option::Option<&str> { + self.realm.as_deref() + } + ///

      The domain that's associated with the member.

      + pub fn member_realm(&self) -> ::std::option::Option<&str> { + self.member_realm.as_deref() + } + ///

      The group information that the request returns.

      + /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.groups.is_none()`. + pub fn groups(&self) -> &[crate::types::GroupSummary] { + self.groups.as_deref().unwrap_or_default() + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } +} +impl ::std::fmt::Debug for ListGroupsForMemberOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("ListGroupsForMemberOutput"); + formatter.field("directory_id", &self.directory_id); + formatter.field("realm", &self.realm); + formatter.field("member_realm", &self.member_realm); + formatter.field("groups", &self.groups); + formatter.field("next_token", &"*** Sensitive Data Redacted ***"); + formatter.field("_request_id", &self._request_id); + formatter.finish() + } +} +impl ::aws_types::request_id::RequestId for ListGroupsForMemberOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl ListGroupsForMemberOutput { + /// Creates a new builder-style object to manufacture [`ListGroupsForMemberOutput`](crate::operation::list_groups_for_member::ListGroupsForMemberOutput). + pub fn builder() -> crate::operation::list_groups_for_member::builders::ListGroupsForMemberOutputBuilder { + crate::operation::list_groups_for_member::builders::ListGroupsForMemberOutputBuilder::default() + } +} + +/// A builder for [`ListGroupsForMemberOutput`](crate::operation::list_groups_for_member::ListGroupsForMemberOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)] +#[non_exhaustive] +pub struct ListGroupsForMemberOutputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, + pub(crate) realm: ::std::option::Option<::std::string::String>, + pub(crate) member_realm: ::std::option::Option<::std::string::String>, + pub(crate) groups: ::std::option::Option<::std::vec::Vec>, + pub(crate) next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl ListGroupsForMemberOutputBuilder { + ///

      The identifier (ID) of the directory that's associated with the member.

      + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the member.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

      The identifier (ID) of the directory that's associated with the member.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + ///

      The domain that's associated with the group.

      + pub fn realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.realm = ::std::option::Option::Some(input.into()); + self + } + ///

      The domain that's associated with the group.

      + pub fn set_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.realm = input; + self + } + ///

      The domain that's associated with the group.

      + pub fn get_realm(&self) -> &::std::option::Option<::std::string::String> { + &self.realm + } + ///

      The domain that's associated with the member.

      + pub fn member_realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.member_realm = ::std::option::Option::Some(input.into()); + self + } + ///

      The domain that's associated with the member.

      + pub fn set_member_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.member_realm = input; + self + } + ///

      The domain that's associated with the member.

      + pub fn get_member_realm(&self) -> &::std::option::Option<::std::string::String> { + &self.member_realm + } + /// Appends an item to `groups`. + /// + /// To override the contents of this collection use [`set_groups`](Self::set_groups). + /// + ///

      The group information that the request returns.

      + pub fn groups(mut self, input: crate::types::GroupSummary) -> Self { + let mut v = self.groups.unwrap_or_default(); + v.push(input); + self.groups = ::std::option::Option::Some(v); + self + } + ///

      The group information that the request returns.

      + pub fn set_groups(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.groups = input; + self + } + ///

      The group information that the request returns.

      + pub fn get_groups(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.groups + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`ListGroupsForMemberOutput`](crate::operation::list_groups_for_member::ListGroupsForMemberOutput). + pub fn build(self) -> crate::operation::list_groups_for_member::ListGroupsForMemberOutput { + crate::operation::list_groups_for_member::ListGroupsForMemberOutput { + directory_id: self.directory_id, + realm: self.realm, + member_realm: self.member_realm, + groups: self.groups, + next_token: self.next_token, + _request_id: self._request_id, + } + } +} +impl ::std::fmt::Debug for ListGroupsForMemberOutputBuilder { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("ListGroupsForMemberOutputBuilder"); + formatter.field("directory_id", &self.directory_id); + formatter.field("realm", &self.realm); + formatter.field("member_realm", &self.member_realm); + formatter.field("groups", &self.groups); + formatter.field("next_token", &"*** Sensitive Data Redacted ***"); + formatter.field("_request_id", &self._request_id); + formatter.finish() + } +} diff --git a/sdk/directoryservicedata/src/operation/list_groups_for_member/builders.rs b/sdk/directoryservicedata/src/operation/list_groups_for_member/builders.rs new file mode 100644 index 000000000000..e520036acba2 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/list_groups_for_member/builders.rs @@ -0,0 +1,221 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::list_groups_for_member::_list_groups_for_member_output::ListGroupsForMemberOutputBuilder; + +pub use crate::operation::list_groups_for_member::_list_groups_for_member_input::ListGroupsForMemberInputBuilder; + +impl crate::operation::list_groups_for_member::builders::ListGroupsForMemberInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::list_groups_for_member::ListGroupsForMemberOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_groups_for_member::ListGroupsForMemberError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.list_groups_for_member(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `ListGroupsForMember`. +/// +///

      Returns group information for the specified member.

      +///

      This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the ListGroupsForMember.NextToken member contains a token that you pass in the next call to ListGroupsForMember. This retrieves the next set of items.

      +///

      You can also specify a maximum number of return results with the MaxResults parameter.

      +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct ListGroupsForMemberFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::list_groups_for_member::builders::ListGroupsForMemberInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::list_groups_for_member::ListGroupsForMemberOutput, + crate::operation::list_groups_for_member::ListGroupsForMemberError, + > for ListGroupsForMemberFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::list_groups_for_member::ListGroupsForMemberOutput, + crate::operation::list_groups_for_member::ListGroupsForMemberError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl ListGroupsForMemberFluentBuilder { + /// Creates a new `ListGroupsForMemberFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the ListGroupsForMember as a reference. + pub fn as_input(&self) -> &crate::operation::list_groups_for_member::builders::ListGroupsForMemberInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::list_groups_for_member::ListGroupsForMemberOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_groups_for_member::ListGroupsForMemberError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::list_groups_for_member::ListGroupsForMember::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::list_groups_for_member::ListGroupsForMember::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::list_groups_for_member::ListGroupsForMemberOutput, + crate::operation::list_groups_for_member::ListGroupsForMemberError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + /// Create a paginator for this request + /// + /// Paginators are used by calling [`send().await`](crate::operation::list_groups_for_member::paginator::ListGroupsForMemberPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream). + pub fn into_paginator(self) -> crate::operation::list_groups_for_member::paginator::ListGroupsForMemberPaginator { + crate::operation::list_groups_for_member::paginator::ListGroupsForMemberPaginator::new(self.handle, self.inner) + } + ///

      The identifier (ID) of the directory that's associated with the member.

      + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.directory_id(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the member.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_directory_id(input); + self + } + ///

      The identifier (ID) of the directory that's associated with the member.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_directory_id() + } + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive and defaults to your Managed Microsoft AD domain.

      + ///
      + pub fn realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.realm(input.into()); + self + } + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive and defaults to your Managed Microsoft AD domain.

      + ///
      + pub fn set_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_realm(input); + self + } + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive and defaults to your Managed Microsoft AD domain.

      + ///
      + pub fn get_realm(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_realm() + } + ///

      The domain name that's associated with the group member.

      + ///

      This parameter is optional, so you can limit your results to the group members in a specific domain.

      + ///

      This parameter is case insensitive and defaults to Realm

      + ///
      + pub fn member_realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.member_realm(input.into()); + self + } + ///

      The domain name that's associated with the group member.

      + ///

      This parameter is optional, so you can limit your results to the group members in a specific domain.

      + ///

      This parameter is case insensitive and defaults to Realm

      + ///
      + pub fn set_member_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_member_realm(input); + self + } + ///

      The domain name that's associated with the group member.

      + ///

      This parameter is optional, so you can limit your results to the group members in a specific domain.

      + ///

      This parameter is case insensitive and defaults to Realm

      + ///
      + pub fn get_member_realm(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_member_realm() + } + ///

      The SAMAccountName of the user, group, or computer that's a member of the group.

      + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.sam_account_name(input.into()); + self + } + ///

      The SAMAccountName of the user, group, or computer that's a member of the group.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_sam_account_name(input); + self + } + ///

      The SAMAccountName of the user, group, or computer that's a member of the group.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_sam_account_name() + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.next_token(input.into()); + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_next_token(input); + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_next_token() + } + ///

      The maximum number of results to be returned per request.

      + pub fn max_results(mut self, input: i32) -> Self { + self.inner = self.inner.max_results(input); + self + } + ///

      The maximum number of results to be returned per request.

      + pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_max_results(input); + self + } + ///

      The maximum number of results to be returned per request.

      + pub fn get_max_results(&self) -> &::std::option::Option { + self.inner.get_max_results() + } +} diff --git a/sdk/directoryservicedata/src/operation/list_groups_for_member/paginator.rs b/sdk/directoryservicedata/src/operation/list_groups_for_member/paginator.rs new file mode 100644 index 000000000000..08cb029c0c05 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/list_groups_for_member/paginator.rs @@ -0,0 +1,148 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Paginator for [`ListGroupsForMember`](crate::operation::list_groups_for_member::ListGroupsForMember) +pub struct ListGroupsForMemberPaginator { + handle: std::sync::Arc, + builder: crate::operation::list_groups_for_member::builders::ListGroupsForMemberInputBuilder, + stop_on_duplicate_token: bool, +} + +impl ListGroupsForMemberPaginator { + /// Create a new paginator-wrapper + pub(crate) fn new( + handle: std::sync::Arc, + builder: crate::operation::list_groups_for_member::builders::ListGroupsForMemberInputBuilder, + ) -> Self { + Self { + handle, + builder, + stop_on_duplicate_token: true, + } + } + + /// Set the page size + /// + /// _Note: this method will override any previously set value for `max_results`_ + pub fn page_size(mut self, limit: i32) -> Self { + self.builder.max_results = ::std::option::Option::Some(limit); + self + } + + /// Create a flattened paginator + /// + /// This paginator automatically flattens results using `groups`. Queries to the underlying service + /// are dispatched lazily. + pub fn items(self) -> crate::operation::list_groups_for_member::paginator::ListGroupsForMemberPaginatorItems { + crate::operation::list_groups_for_member::paginator::ListGroupsForMemberPaginatorItems(self) + } + + /// Stop paginating when the service returns the same pagination token twice in a row. + /// + /// Defaults to true. + /// + /// For certain operations, it may be useful to continue on duplicate token. For example, + /// if an operation is for tailing a log file in real-time, then continuing may be desired. + /// This option can be set to `false` to accommodate these use cases. + pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self { + self.stop_on_duplicate_token = stop_on_duplicate_token; + self + } + + /// Create the pagination stream + /// + /// _Note:_ No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::operation::list_groups_for_member::ListGroupsForMemberOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_groups_for_member::ListGroupsForMemberError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + // Move individual fields out of self for the borrow checker + let builder = self.builder; + let handle = self.handle; + let runtime_plugins = crate::operation::list_groups_for_member::ListGroupsForMember::operation_runtime_plugins( + handle.runtime_plugins.clone(), + &handle.conf, + ::std::option::Option::None, + ) + .with_operation_plugin(crate::sdk_feature_tracker::paginator::PaginatorFeatureTrackerRuntimePlugin::new()); + ::aws_smithy_async::future::pagination_stream::PaginationStream::new(::aws_smithy_async::future::pagination_stream::fn_stream::FnStream::new( + move |tx| { + ::std::boxed::Box::pin(async move { + // Build the input for the first time. If required fields are missing, this is where we'll produce an early error. + let mut input = match builder + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure) + { + ::std::result::Result::Ok(input) => input, + ::std::result::Result::Err(e) => { + let _ = tx.send(::std::result::Result::Err(e)).await; + return; + } + }; + loop { + let resp = crate::operation::list_groups_for_member::ListGroupsForMember::orchestrate(&runtime_plugins, input.clone()).await; + // If the input member is None or it was an error + let done = match resp { + ::std::result::Result::Ok(ref resp) => { + let new_token = crate::lens::reflens_list_groups_for_member_output_output_next_token(resp); + // Pagination is exhausted when the next token is an empty string + let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true); + if !is_empty && new_token == input.next_token.as_ref() && self.stop_on_duplicate_token { + true + } else { + input.next_token = new_token.cloned(); + is_empty + } + } + ::std::result::Result::Err(_) => true, + }; + if tx.send(resp).await.is_err() { + // receiving end was dropped + return; + } + if done { + return; + } + } + }) + }, + )) + } +} + +/// Flattened paginator for `ListGroupsForMemberPaginator` +/// +/// This is created with [`.items()`](ListGroupsForMemberPaginator::items) +pub struct ListGroupsForMemberPaginatorItems(ListGroupsForMemberPaginator); + +impl ListGroupsForMemberPaginatorItems { + /// Create the pagination stream + /// + /// _Note_: No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + /// + /// To read the entirety of the paginator, use [`.collect::, _>()`](aws_smithy_async::future::pagination_stream::PaginationStream::collect). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::types::GroupSummary, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_groups_for_member::ListGroupsForMemberError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + ::aws_smithy_async::future::pagination_stream::TryFlatMap::new(self.0.send()).flat_map(|page| { + crate::lens::lens_list_groups_for_member_output_output_groups(page) + .unwrap_or_default() + .into_iter() + }) + } +} diff --git a/sdk/directoryservicedata/src/operation/list_users.rs b/sdk/directoryservicedata/src/operation/list_users.rs new file mode 100644 index 000000000000..f984a6579430 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/list_users.rs @@ -0,0 +1,421 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `ListUsers`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ListUsers; +impl ListUsers { + /// Creates a new `ListUsers` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::list_users::ListUsersInput, + ) -> ::std::result::Result< + crate::operation::list_users::ListUsersOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_users::ListUsersError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::list_users::ListUsersInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("directoryservicedata", "ListUsers", input, runtime_plugins, stop_point) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListUsers { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ListUsers"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + ListUsersRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + ListUsersResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput); + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "ListUsers", + "directoryservicedata", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListUsers") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(ListUsersEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::list_users::ListUsersError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::list_users::ListUsersError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::list_users::ListUsersError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct ListUsersResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListUsersResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_list_users::de_list_users_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_list_users::de_list_users_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct ListUsersRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListUsersRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input.downcast::().expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::list_users::ListUsersInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/Users/ListUsers").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + fn uri_query( + _input: &crate::operation::list_users::ListUsersInput, + mut output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + let mut query = ::aws_smithy_http::query::Writer::new(output); + let inner_1 = &_input.directory_id; + let inner_1 = inner_1 + .as_ref() + .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("directory_id", "cannot be empty or unset"))?; + if inner_1.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "directory_id", + "cannot be empty or unset", + )); + } + query.push_kv("DirectoryId", &::aws_smithy_http::query::fmt_string(inner_1)); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::list_users::ListUsersInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + uri_query(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_list_users::ser_list_users_input(&input)?); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct ListUsersEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListUsersEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "ListUsersEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to ListUsersInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `ListUsersError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum ListUsersError { + ///

      You don't have permission to perform the request or access the directory. It can also occur when the DirectoryId doesn't exist or the user, member, or group might be outside of your organizational unit (OU).

      + ///

      Make sure that you have the authentication and authorization to perform the action. Review the directory information in the request, and make sure that the object isn't outside of your OU.

      + AccessDeniedException(crate::types::error::AccessDeniedException), + ///

      The request could not be completed due to a problem in the configuration or current state of the specified directory.

      + DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), + ///

      The operation didn't succeed because an internal error occurred. Try again later.

      + InternalServerException(crate::types::error::InternalServerException), + ///

      The limit on the number of requests per second has been exceeded.

      + ThrottlingException(crate::types::error::ThrottlingException), + ///

      The request isn't valid. Review the details in the error message to update the invalid parameters or values in your request.

      + ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ListUsersError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl ListUsersError { + /// Creates the `ListUsersError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `ListUsersError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::DirectoryUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `ListUsersError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `ListUsersError::DirectoryUnavailableException`. + pub fn is_directory_unavailable_exception(&self) -> bool { + matches!(self, Self::DirectoryUnavailableException(_)) + } + /// Returns `true` if the error kind is `ListUsersError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `ListUsersError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `ListUsersError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for ListUsersError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::DirectoryUnavailableException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for ListUsersError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::DirectoryUnavailableException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for ListUsersError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::DirectoryUnavailableException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ListUsersError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::DirectoryUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListUsersError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::list_users::ListUsersError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::list_users::_list_users_output::ListUsersOutput; + +pub use crate::operation::list_users::_list_users_input::ListUsersInput; + +mod _list_users_input; + +mod _list_users_output; + +/// Builders +pub mod builders; + +/// Paginator for this operation +pub mod paginator; diff --git a/sdk/directoryservicedata/src/operation/list_users/_list_users_input.rs b/sdk/directoryservicedata/src/operation/list_users/_list_users_input.rs new file mode 100644 index 000000000000..99a0b6f06f8f --- /dev/null +++ b/sdk/directoryservicedata/src/operation/list_users/_list_users_input.rs @@ -0,0 +1,151 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq)] +pub struct ListUsersInput { + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub directory_id: ::std::option::Option<::std::string::String>, + ///

      The domain name that's associated with the user.

      + ///

      This parameter is optional, so you can return users outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub realm: ::std::option::Option<::std::string::String>, + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub next_token: ::std::option::Option<::std::string::String>, + ///

      The maximum number of results to be returned per request.

      + pub max_results: ::std::option::Option, +} +impl ListUsersInput { + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } + ///

      The domain name that's associated with the user.

      + ///

      This parameter is optional, so you can return users outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn realm(&self) -> ::std::option::Option<&str> { + self.realm.as_deref() + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } + ///

      The maximum number of results to be returned per request.

      + pub fn max_results(&self) -> ::std::option::Option { + self.max_results + } +} +impl ::std::fmt::Debug for ListUsersInput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("ListUsersInput"); + formatter.field("directory_id", &self.directory_id); + formatter.field("realm", &self.realm); + formatter.field("next_token", &"*** Sensitive Data Redacted ***"); + formatter.field("max_results", &self.max_results); + formatter.finish() + } +} +impl ListUsersInput { + /// Creates a new builder-style object to manufacture [`ListUsersInput`](crate::operation::list_users::ListUsersInput). + pub fn builder() -> crate::operation::list_users::builders::ListUsersInputBuilder { + crate::operation::list_users::builders::ListUsersInputBuilder::default() + } +} + +/// A builder for [`ListUsersInput`](crate::operation::list_users::ListUsersInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)] +#[non_exhaustive] +pub struct ListUsersInputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, + pub(crate) realm: ::std::option::Option<::std::string::String>, + pub(crate) next_token: ::std::option::Option<::std::string::String>, + pub(crate) max_results: ::std::option::Option, +} +impl ListUsersInputBuilder { + ///

      The identifier (ID) of the directory that's associated with the user.

      + /// This field is required. + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + ///

      The domain name that's associated with the user.

      + ///

      This parameter is optional, so you can return users outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.realm = ::std::option::Option::Some(input.into()); + self + } + ///

      The domain name that's associated with the user.

      + ///

      This parameter is optional, so you can return users outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn set_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.realm = input; + self + } + ///

      The domain name that's associated with the user.

      + ///

      This parameter is optional, so you can return users outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn get_realm(&self) -> &::std::option::Option<::std::string::String> { + &self.realm + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + ///

      The maximum number of results to be returned per request.

      + pub fn max_results(mut self, input: i32) -> Self { + self.max_results = ::std::option::Option::Some(input); + self + } + ///

      The maximum number of results to be returned per request.

      + pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.max_results = input; + self + } + ///

      The maximum number of results to be returned per request.

      + pub fn get_max_results(&self) -> &::std::option::Option { + &self.max_results + } + /// Consumes the builder and constructs a [`ListUsersInput`](crate::operation::list_users::ListUsersInput). + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::operation::list_users::ListUsersInput { + directory_id: self.directory_id, + realm: self.realm, + next_token: self.next_token, + max_results: self.max_results, + }) + } +} +impl ::std::fmt::Debug for ListUsersInputBuilder { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("ListUsersInputBuilder"); + formatter.field("directory_id", &self.directory_id); + formatter.field("realm", &self.realm); + formatter.field("next_token", &"*** Sensitive Data Redacted ***"); + formatter.field("max_results", &self.max_results); + formatter.finish() + } +} diff --git a/sdk/directoryservicedata/src/operation/list_users/_list_users_output.rs b/sdk/directoryservicedata/src/operation/list_users/_list_users_output.rs new file mode 100644 index 000000000000..c3395df7036e --- /dev/null +++ b/sdk/directoryservicedata/src/operation/list_users/_list_users_output.rs @@ -0,0 +1,162 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq)] +pub struct ListUsersOutput { + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub directory_id: ::std::option::Option<::std::string::String>, + ///

      The domain that's associated with the user.

      + pub realm: ::std::option::Option<::std::string::String>, + ///

      The user information that the request returns.

      + pub users: ::std::option::Option<::std::vec::Vec>, + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl ListUsersOutput { + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } + ///

      The domain that's associated with the user.

      + pub fn realm(&self) -> ::std::option::Option<&str> { + self.realm.as_deref() + } + ///

      The user information that the request returns.

      + /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.users.is_none()`. + pub fn users(&self) -> &[crate::types::UserSummary] { + self.users.as_deref().unwrap_or_default() + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } +} +impl ::std::fmt::Debug for ListUsersOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("ListUsersOutput"); + formatter.field("directory_id", &self.directory_id); + formatter.field("realm", &self.realm); + formatter.field("users", &self.users); + formatter.field("next_token", &"*** Sensitive Data Redacted ***"); + formatter.field("_request_id", &self._request_id); + formatter.finish() + } +} +impl ::aws_types::request_id::RequestId for ListUsersOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl ListUsersOutput { + /// Creates a new builder-style object to manufacture [`ListUsersOutput`](crate::operation::list_users::ListUsersOutput). + pub fn builder() -> crate::operation::list_users::builders::ListUsersOutputBuilder { + crate::operation::list_users::builders::ListUsersOutputBuilder::default() + } +} + +/// A builder for [`ListUsersOutput`](crate::operation::list_users::ListUsersOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)] +#[non_exhaustive] +pub struct ListUsersOutputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, + pub(crate) realm: ::std::option::Option<::std::string::String>, + pub(crate) users: ::std::option::Option<::std::vec::Vec>, + pub(crate) next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl ListUsersOutputBuilder { + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + ///

      The domain that's associated with the user.

      + pub fn realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.realm = ::std::option::Option::Some(input.into()); + self + } + ///

      The domain that's associated with the user.

      + pub fn set_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.realm = input; + self + } + ///

      The domain that's associated with the user.

      + pub fn get_realm(&self) -> &::std::option::Option<::std::string::String> { + &self.realm + } + /// Appends an item to `users`. + /// + /// To override the contents of this collection use [`set_users`](Self::set_users). + /// + ///

      The user information that the request returns.

      + pub fn users(mut self, input: crate::types::UserSummary) -> Self { + let mut v = self.users.unwrap_or_default(); + v.push(input); + self.users = ::std::option::Option::Some(v); + self + } + ///

      The user information that the request returns.

      + pub fn set_users(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.users = input; + self + } + ///

      The user information that the request returns.

      + pub fn get_users(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.users + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`ListUsersOutput`](crate::operation::list_users::ListUsersOutput). + pub fn build(self) -> crate::operation::list_users::ListUsersOutput { + crate::operation::list_users::ListUsersOutput { + directory_id: self.directory_id, + realm: self.realm, + users: self.users, + next_token: self.next_token, + _request_id: self._request_id, + } + } +} +impl ::std::fmt::Debug for ListUsersOutputBuilder { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("ListUsersOutputBuilder"); + formatter.field("directory_id", &self.directory_id); + formatter.field("realm", &self.realm); + formatter.field("users", &self.users); + formatter.field("next_token", &"*** Sensitive Data Redacted ***"); + formatter.field("_request_id", &self._request_id); + formatter.finish() + } +} diff --git a/sdk/directoryservicedata/src/operation/list_users/builders.rs b/sdk/directoryservicedata/src/operation/list_users/builders.rs new file mode 100644 index 000000000000..d514b89feffb --- /dev/null +++ b/sdk/directoryservicedata/src/operation/list_users/builders.rs @@ -0,0 +1,178 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::list_users::_list_users_output::ListUsersOutputBuilder; + +pub use crate::operation::list_users::_list_users_input::ListUsersInputBuilder; + +impl crate::operation::list_users::builders::ListUsersInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::list_users::ListUsersOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_users::ListUsersError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.list_users(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `ListUsers`. +/// +///

      Returns user information for the specified directory.

      +///

      This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the ListUsers.NextToken member contains a token that you pass in the next call to ListUsers. This retrieves the next set of items.

      +///

      You can also specify a maximum number of return results with the MaxResults parameter.

      +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct ListUsersFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::list_users::builders::ListUsersInputBuilder, + config_override: ::std::option::Option, +} +impl crate::client::customize::internal::CustomizableSend + for ListUsersFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl ListUsersFluentBuilder { + /// Creates a new `ListUsersFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the ListUsers as a reference. + pub fn as_input(&self) -> &crate::operation::list_users::builders::ListUsersInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::list_users::ListUsersOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_users::ListUsersError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::list_users::ListUsers::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::list_users::ListUsers::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::list_users::ListUsersOutput, + crate::operation::list_users::ListUsersError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + /// Create a paginator for this request + /// + /// Paginators are used by calling [`send().await`](crate::operation::list_users::paginator::ListUsersPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream). + pub fn into_paginator(self) -> crate::operation::list_users::paginator::ListUsersPaginator { + crate::operation::list_users::paginator::ListUsersPaginator::new(self.handle, self.inner) + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.directory_id(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_directory_id(input); + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_directory_id() + } + ///

      The domain name that's associated with the user.

      + ///

      This parameter is optional, so you can return users outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.realm(input.into()); + self + } + ///

      The domain name that's associated with the user.

      + ///

      This parameter is optional, so you can return users outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn set_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_realm(input); + self + } + ///

      The domain name that's associated with the user.

      + ///

      This parameter is optional, so you can return users outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn get_realm(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_realm() + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.next_token(input.into()); + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_next_token(input); + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_next_token() + } + ///

      The maximum number of results to be returned per request.

      + pub fn max_results(mut self, input: i32) -> Self { + self.inner = self.inner.max_results(input); + self + } + ///

      The maximum number of results to be returned per request.

      + pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_max_results(input); + self + } + ///

      The maximum number of results to be returned per request.

      + pub fn get_max_results(&self) -> &::std::option::Option { + self.inner.get_max_results() + } +} diff --git a/sdk/directoryservicedata/src/operation/list_users/paginator.rs b/sdk/directoryservicedata/src/operation/list_users/paginator.rs new file mode 100644 index 000000000000..872a00665d8d --- /dev/null +++ b/sdk/directoryservicedata/src/operation/list_users/paginator.rs @@ -0,0 +1,142 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Paginator for [`ListUsers`](crate::operation::list_users::ListUsers) +pub struct ListUsersPaginator { + handle: std::sync::Arc, + builder: crate::operation::list_users::builders::ListUsersInputBuilder, + stop_on_duplicate_token: bool, +} + +impl ListUsersPaginator { + /// Create a new paginator-wrapper + pub(crate) fn new(handle: std::sync::Arc, builder: crate::operation::list_users::builders::ListUsersInputBuilder) -> Self { + Self { + handle, + builder, + stop_on_duplicate_token: true, + } + } + + /// Set the page size + /// + /// _Note: this method will override any previously set value for `max_results`_ + pub fn page_size(mut self, limit: i32) -> Self { + self.builder.max_results = ::std::option::Option::Some(limit); + self + } + + /// Create a flattened paginator + /// + /// This paginator automatically flattens results using `users`. Queries to the underlying service + /// are dispatched lazily. + pub fn items(self) -> crate::operation::list_users::paginator::ListUsersPaginatorItems { + crate::operation::list_users::paginator::ListUsersPaginatorItems(self) + } + + /// Stop paginating when the service returns the same pagination token twice in a row. + /// + /// Defaults to true. + /// + /// For certain operations, it may be useful to continue on duplicate token. For example, + /// if an operation is for tailing a log file in real-time, then continuing may be desired. + /// This option can be set to `false` to accommodate these use cases. + pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self { + self.stop_on_duplicate_token = stop_on_duplicate_token; + self + } + + /// Create the pagination stream + /// + /// _Note:_ No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::operation::list_users::ListUsersOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_users::ListUsersError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + // Move individual fields out of self for the borrow checker + let builder = self.builder; + let handle = self.handle; + let runtime_plugins = crate::operation::list_users::ListUsers::operation_runtime_plugins( + handle.runtime_plugins.clone(), + &handle.conf, + ::std::option::Option::None, + ) + .with_operation_plugin(crate::sdk_feature_tracker::paginator::PaginatorFeatureTrackerRuntimePlugin::new()); + ::aws_smithy_async::future::pagination_stream::PaginationStream::new(::aws_smithy_async::future::pagination_stream::fn_stream::FnStream::new( + move |tx| { + ::std::boxed::Box::pin(async move { + // Build the input for the first time. If required fields are missing, this is where we'll produce an early error. + let mut input = match builder + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure) + { + ::std::result::Result::Ok(input) => input, + ::std::result::Result::Err(e) => { + let _ = tx.send(::std::result::Result::Err(e)).await; + return; + } + }; + loop { + let resp = crate::operation::list_users::ListUsers::orchestrate(&runtime_plugins, input.clone()).await; + // If the input member is None or it was an error + let done = match resp { + ::std::result::Result::Ok(ref resp) => { + let new_token = crate::lens::reflens_list_users_output_output_next_token(resp); + // Pagination is exhausted when the next token is an empty string + let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true); + if !is_empty && new_token == input.next_token.as_ref() && self.stop_on_duplicate_token { + true + } else { + input.next_token = new_token.cloned(); + is_empty + } + } + ::std::result::Result::Err(_) => true, + }; + if tx.send(resp).await.is_err() { + // receiving end was dropped + return; + } + if done { + return; + } + } + }) + }, + )) + } +} + +/// Flattened paginator for `ListUsersPaginator` +/// +/// This is created with [`.items()`](ListUsersPaginator::items) +pub struct ListUsersPaginatorItems(ListUsersPaginator); + +impl ListUsersPaginatorItems { + /// Create the pagination stream + /// + /// _Note_: No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + /// + /// To read the entirety of the paginator, use [`.collect::, _>()`](aws_smithy_async::future::pagination_stream::PaginationStream::collect). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::types::UserSummary, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::list_users::ListUsersError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + ::aws_smithy_async::future::pagination_stream::TryFlatMap::new(self.0.send()) + .flat_map(|page| crate::lens::lens_list_users_output_output_users(page).unwrap_or_default().into_iter()) + } +} diff --git a/sdk/directoryservicedata/src/operation/remove_group_member.rs b/sdk/directoryservicedata/src/operation/remove_group_member.rs new file mode 100644 index 000000000000..9b1b4f7014c4 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/remove_group_member.rs @@ -0,0 +1,455 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `RemoveGroupMember`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct RemoveGroupMember; +impl RemoveGroupMember { + /// Creates a new `RemoveGroupMember` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::remove_group_member::RemoveGroupMemberInput, + ) -> ::std::result::Result< + crate::operation::remove_group_member::RemoveGroupMemberOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::remove_group_member::RemoveGroupMemberError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::remove_group_member::RemoveGroupMemberInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point( + "directoryservicedata", + "RemoveGroupMember", + input, + runtime_plugins, + stop_point, + ) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins + .with_operation_plugin(crate::client_idempotency_token::IdempotencyTokenRuntimePlugin::new( + |token_provider, input| { + let input: &mut crate::operation::remove_group_member::RemoveGroupMemberInput = input.downcast_mut().expect("correct type"); + if input.client_token.is_none() { + input.client_token = ::std::option::Option::Some(token_provider.make_idempotency_token()); + } + }, + )) + .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for RemoveGroupMember { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("RemoveGroupMember"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + RemoveGroupMemberRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + RemoveGroupMemberResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "RemoveGroupMember", + "directoryservicedata", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("RemoveGroupMember") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(RemoveGroupMemberEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::remove_group_member::RemoveGroupMemberError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::remove_group_member::RemoveGroupMemberError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::remove_group_member::RemoveGroupMemberError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct RemoveGroupMemberResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for RemoveGroupMemberResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_remove_group_member::de_remove_group_member_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_remove_group_member::de_remove_group_member_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct RemoveGroupMemberRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for RemoveGroupMemberRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::remove_group_member::RemoveGroupMemberInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/GroupMemberships/RemoveGroupMember").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + fn uri_query( + _input: &crate::operation::remove_group_member::RemoveGroupMemberInput, + mut output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + let mut query = ::aws_smithy_http::query::Writer::new(output); + let inner_1 = &_input.directory_id; + let inner_1 = inner_1 + .as_ref() + .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("directory_id", "cannot be empty or unset"))?; + if inner_1.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "directory_id", + "cannot be empty or unset", + )); + } + query.push_kv("DirectoryId", &::aws_smithy_http::query::fmt_string(inner_1)); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::remove_group_member::RemoveGroupMemberInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + uri_query(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_remove_group_member::ser_remove_group_member_input(&input)?); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct RemoveGroupMemberEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for RemoveGroupMemberEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "RemoveGroupMemberEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to RemoveGroupMemberInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `RemoveGroupMemberError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum RemoveGroupMemberError { + ///

      You don't have permission to perform the request or access the directory. It can also occur when the DirectoryId doesn't exist or the user, member, or group might be outside of your organizational unit (OU).

      + ///

      Make sure that you have the authentication and authorization to perform the action. Review the directory information in the request, and make sure that the object isn't outside of your OU.

      + AccessDeniedException(crate::types::error::AccessDeniedException), + ///

      This error will occur when you try to create a resource that conflicts with an existing object. It can also occur when adding a member to a group that the member is already in.

      + ///

      This error can be caused by a request sent within the 8-hour idempotency window with the same client token but different input parameters. Client tokens should not be re-used across different requests. After 8 hours, any request with the same client token is treated as a new request.

      + ConflictException(crate::types::error::ConflictException), + ///

      The request could not be completed due to a problem in the configuration or current state of the specified directory.

      + DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), + ///

      The operation didn't succeed because an internal error occurred. Try again later.

      + InternalServerException(crate::types::error::InternalServerException), + ///

      The resource couldn't be found.

      + ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

      The limit on the number of requests per second has been exceeded.

      + ThrottlingException(crate::types::error::ThrottlingException), + ///

      The request isn't valid. Review the details in the error message to update the invalid parameters or values in your request.

      + ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-RemoveGroupMemberError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl RemoveGroupMemberError { + /// Creates the `RemoveGroupMemberError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `RemoveGroupMemberError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::DirectoryUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `RemoveGroupMemberError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `RemoveGroupMemberError::ConflictException`. + pub fn is_conflict_exception(&self) -> bool { + matches!(self, Self::ConflictException(_)) + } + /// Returns `true` if the error kind is `RemoveGroupMemberError::DirectoryUnavailableException`. + pub fn is_directory_unavailable_exception(&self) -> bool { + matches!(self, Self::DirectoryUnavailableException(_)) + } + /// Returns `true` if the error kind is `RemoveGroupMemberError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `RemoveGroupMemberError::ResourceNotFoundException`. + pub fn is_resource_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceNotFoundException(_)) + } + /// Returns `true` if the error kind is `RemoveGroupMemberError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `RemoveGroupMemberError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for RemoveGroupMemberError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::ConflictException(_inner) => ::std::option::Option::Some(_inner), + Self::DirectoryUnavailableException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for RemoveGroupMemberError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::ConflictException(_inner) => _inner.fmt(f), + Self::DirectoryUnavailableException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ResourceNotFoundException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for RemoveGroupMemberError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::DirectoryUnavailableException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for RemoveGroupMemberError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::DirectoryUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for RemoveGroupMemberError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::remove_group_member::RemoveGroupMemberError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::remove_group_member::_remove_group_member_output::RemoveGroupMemberOutput; + +pub use crate::operation::remove_group_member::_remove_group_member_input::RemoveGroupMemberInput; + +mod _remove_group_member_input; + +mod _remove_group_member_output; + +/// Builders +pub mod builders; diff --git a/sdk/directoryservicedata/src/operation/remove_group_member/_remove_group_member_input.rs b/sdk/directoryservicedata/src/operation/remove_group_member/_remove_group_member_input.rs new file mode 100644 index 000000000000..ebc9037d5dd5 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/remove_group_member/_remove_group_member_input.rs @@ -0,0 +1,172 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct RemoveGroupMemberInput { + ///

      The identifier (ID) of the directory that's associated with the member.

      + pub directory_id: ::std::option::Option<::std::string::String>, + ///

      The name of the group.

      + pub group_name: ::std::option::Option<::std::string::String>, + ///

      The SAMAccountName of the user, group, or computer to remove from the group.

      + pub member_name: ::std::option::Option<::std::string::String>, + ///

      The domain name that's associated with the group member. This parameter defaults to the Managed Microsoft AD domain.

      + ///

      This parameter is optional and case insensitive.

      + ///
      + pub member_realm: ::std::option::Option<::std::string::String>, + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub client_token: ::std::option::Option<::std::string::String>, +} +impl RemoveGroupMemberInput { + ///

      The identifier (ID) of the directory that's associated with the member.

      + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } + ///

      The name of the group.

      + pub fn group_name(&self) -> ::std::option::Option<&str> { + self.group_name.as_deref() + } + ///

      The SAMAccountName of the user, group, or computer to remove from the group.

      + pub fn member_name(&self) -> ::std::option::Option<&str> { + self.member_name.as_deref() + } + ///

      The domain name that's associated with the group member. This parameter defaults to the Managed Microsoft AD domain.

      + ///

      This parameter is optional and case insensitive.

      + ///
      + pub fn member_realm(&self) -> ::std::option::Option<&str> { + self.member_realm.as_deref() + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn client_token(&self) -> ::std::option::Option<&str> { + self.client_token.as_deref() + } +} +impl RemoveGroupMemberInput { + /// Creates a new builder-style object to manufacture [`RemoveGroupMemberInput`](crate::operation::remove_group_member::RemoveGroupMemberInput). + pub fn builder() -> crate::operation::remove_group_member::builders::RemoveGroupMemberInputBuilder { + crate::operation::remove_group_member::builders::RemoveGroupMemberInputBuilder::default() + } +} + +/// A builder for [`RemoveGroupMemberInput`](crate::operation::remove_group_member::RemoveGroupMemberInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct RemoveGroupMemberInputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, + pub(crate) group_name: ::std::option::Option<::std::string::String>, + pub(crate) member_name: ::std::option::Option<::std::string::String>, + pub(crate) member_realm: ::std::option::Option<::std::string::String>, + pub(crate) client_token: ::std::option::Option<::std::string::String>, +} +impl RemoveGroupMemberInputBuilder { + ///

      The identifier (ID) of the directory that's associated with the member.

      + /// This field is required. + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the member.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

      The identifier (ID) of the directory that's associated with the member.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + ///

      The name of the group.

      + /// This field is required. + pub fn group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.group_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The name of the group.

      + pub fn set_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.group_name = input; + self + } + ///

      The name of the group.

      + pub fn get_group_name(&self) -> &::std::option::Option<::std::string::String> { + &self.group_name + } + ///

      The SAMAccountName of the user, group, or computer to remove from the group.

      + /// This field is required. + pub fn member_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.member_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The SAMAccountName of the user, group, or computer to remove from the group.

      + pub fn set_member_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.member_name = input; + self + } + ///

      The SAMAccountName of the user, group, or computer to remove from the group.

      + pub fn get_member_name(&self) -> &::std::option::Option<::std::string::String> { + &self.member_name + } + ///

      The domain name that's associated with the group member. This parameter defaults to the Managed Microsoft AD domain.

      + ///

      This parameter is optional and case insensitive.

      + ///
      + pub fn member_realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.member_realm = ::std::option::Option::Some(input.into()); + self + } + ///

      The domain name that's associated with the group member. This parameter defaults to the Managed Microsoft AD domain.

      + ///

      This parameter is optional and case insensitive.

      + ///
      + pub fn set_member_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.member_realm = input; + self + } + ///

      The domain name that's associated with the group member. This parameter defaults to the Managed Microsoft AD domain.

      + ///

      This parameter is optional and case insensitive.

      + ///
      + pub fn get_member_realm(&self) -> &::std::option::Option<::std::string::String> { + &self.member_realm + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.client_token = ::std::option::Option::Some(input.into()); + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.client_token = input; + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> { + &self.client_token + } + /// Consumes the builder and constructs a [`RemoveGroupMemberInput`](crate::operation::remove_group_member::RemoveGroupMemberInput). + pub fn build( + self, + ) -> ::std::result::Result { + ::std::result::Result::Ok(crate::operation::remove_group_member::RemoveGroupMemberInput { + directory_id: self.directory_id, + group_name: self.group_name, + member_name: self.member_name, + member_realm: self.member_realm, + client_token: self.client_token, + }) + } +} diff --git a/sdk/directoryservicedata/src/operation/remove_group_member/_remove_group_member_output.rs b/sdk/directoryservicedata/src/operation/remove_group_member/_remove_group_member_output.rs new file mode 100644 index 000000000000..6b2c837fa736 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/remove_group_member/_remove_group_member_output.rs @@ -0,0 +1,42 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct RemoveGroupMemberOutput { + _request_id: Option, +} +impl ::aws_types::request_id::RequestId for RemoveGroupMemberOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl RemoveGroupMemberOutput { + /// Creates a new builder-style object to manufacture [`RemoveGroupMemberOutput`](crate::operation::remove_group_member::RemoveGroupMemberOutput). + pub fn builder() -> crate::operation::remove_group_member::builders::RemoveGroupMemberOutputBuilder { + crate::operation::remove_group_member::builders::RemoveGroupMemberOutputBuilder::default() + } +} + +/// A builder for [`RemoveGroupMemberOutput`](crate::operation::remove_group_member::RemoveGroupMemberOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct RemoveGroupMemberOutputBuilder { + _request_id: Option, +} +impl RemoveGroupMemberOutputBuilder { + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`RemoveGroupMemberOutput`](crate::operation::remove_group_member::RemoveGroupMemberOutput). + pub fn build(self) -> crate::operation::remove_group_member::RemoveGroupMemberOutput { + crate::operation::remove_group_member::RemoveGroupMemberOutput { + _request_id: self._request_id, + } + } +} diff --git a/sdk/directoryservicedata/src/operation/remove_group_member/builders.rs b/sdk/directoryservicedata/src/operation/remove_group_member/builders.rs new file mode 100644 index 000000000000..a343db56bad0 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/remove_group_member/builders.rs @@ -0,0 +1,199 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::remove_group_member::_remove_group_member_output::RemoveGroupMemberOutputBuilder; + +pub use crate::operation::remove_group_member::_remove_group_member_input::RemoveGroupMemberInputBuilder; + +impl crate::operation::remove_group_member::builders::RemoveGroupMemberInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::remove_group_member::RemoveGroupMemberOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::remove_group_member::RemoveGroupMemberError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.remove_group_member(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `RemoveGroupMember`. +/// +///

      Removes a member from a group.

      +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct RemoveGroupMemberFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::remove_group_member::builders::RemoveGroupMemberInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::remove_group_member::RemoveGroupMemberOutput, + crate::operation::remove_group_member::RemoveGroupMemberError, + > for RemoveGroupMemberFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::remove_group_member::RemoveGroupMemberOutput, + crate::operation::remove_group_member::RemoveGroupMemberError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl RemoveGroupMemberFluentBuilder { + /// Creates a new `RemoveGroupMemberFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the RemoveGroupMember as a reference. + pub fn as_input(&self) -> &crate::operation::remove_group_member::builders::RemoveGroupMemberInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::remove_group_member::RemoveGroupMemberOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::remove_group_member::RemoveGroupMemberError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::remove_group_member::RemoveGroupMember::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::remove_group_member::RemoveGroupMember::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::remove_group_member::RemoveGroupMemberOutput, + crate::operation::remove_group_member::RemoveGroupMemberError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

      The identifier (ID) of the directory that's associated with the member.

      + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.directory_id(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the member.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_directory_id(input); + self + } + ///

      The identifier (ID) of the directory that's associated with the member.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_directory_id() + } + ///

      The name of the group.

      + pub fn group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.group_name(input.into()); + self + } + ///

      The name of the group.

      + pub fn set_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_group_name(input); + self + } + ///

      The name of the group.

      + pub fn get_group_name(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_group_name() + } + ///

      The SAMAccountName of the user, group, or computer to remove from the group.

      + pub fn member_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.member_name(input.into()); + self + } + ///

      The SAMAccountName of the user, group, or computer to remove from the group.

      + pub fn set_member_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_member_name(input); + self + } + ///

      The SAMAccountName of the user, group, or computer to remove from the group.

      + pub fn get_member_name(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_member_name() + } + ///

      The domain name that's associated with the group member. This parameter defaults to the Managed Microsoft AD domain.

      + ///

      This parameter is optional and case insensitive.

      + ///
      + pub fn member_realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.member_realm(input.into()); + self + } + ///

      The domain name that's associated with the group member. This parameter defaults to the Managed Microsoft AD domain.

      + ///

      This parameter is optional and case insensitive.

      + ///
      + pub fn set_member_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_member_realm(input); + self + } + ///

      The domain name that's associated with the group member. This parameter defaults to the Managed Microsoft AD domain.

      + ///

      This parameter is optional and case insensitive.

      + ///
      + pub fn get_member_realm(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_member_realm() + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.client_token(input.into()); + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_client_token(input); + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_client_token() + } +} diff --git a/sdk/directoryservicedata/src/operation/search_groups.rs b/sdk/directoryservicedata/src/operation/search_groups.rs new file mode 100644 index 000000000000..8bf259c838ed --- /dev/null +++ b/sdk/directoryservicedata/src/operation/search_groups.rs @@ -0,0 +1,423 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `SearchGroups`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct SearchGroups; +impl SearchGroups { + /// Creates a new `SearchGroups` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::search_groups::SearchGroupsInput, + ) -> ::std::result::Result< + crate::operation::search_groups::SearchGroupsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::search_groups::SearchGroupsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::search_groups::SearchGroupsInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("directoryservicedata", "SearchGroups", input, runtime_plugins, stop_point) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for SearchGroups { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("SearchGroups"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + SearchGroupsRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + SearchGroupsResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput); + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "SearchGroups", + "directoryservicedata", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("SearchGroups") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(SearchGroupsEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::search_groups::SearchGroupsError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::search_groups::SearchGroupsError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::search_groups::SearchGroupsError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct SearchGroupsResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for SearchGroupsResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_search_groups::de_search_groups_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_search_groups::de_search_groups_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct SearchGroupsRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for SearchGroupsRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::search_groups::SearchGroupsInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/Groups/SearchGroups").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + fn uri_query( + _input: &crate::operation::search_groups::SearchGroupsInput, + mut output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + let mut query = ::aws_smithy_http::query::Writer::new(output); + let inner_1 = &_input.directory_id; + let inner_1 = inner_1 + .as_ref() + .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("directory_id", "cannot be empty or unset"))?; + if inner_1.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "directory_id", + "cannot be empty or unset", + )); + } + query.push_kv("DirectoryId", &::aws_smithy_http::query::fmt_string(inner_1)); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::search_groups::SearchGroupsInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + uri_query(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_search_groups::ser_search_groups_input(&input)?); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct SearchGroupsEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for SearchGroupsEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "SearchGroupsEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to SearchGroupsInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `SearchGroupsError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum SearchGroupsError { + ///

      You don't have permission to perform the request or access the directory. It can also occur when the DirectoryId doesn't exist or the user, member, or group might be outside of your organizational unit (OU).

      + ///

      Make sure that you have the authentication and authorization to perform the action. Review the directory information in the request, and make sure that the object isn't outside of your OU.

      + AccessDeniedException(crate::types::error::AccessDeniedException), + ///

      The request could not be completed due to a problem in the configuration or current state of the specified directory.

      + DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), + ///

      The operation didn't succeed because an internal error occurred. Try again later.

      + InternalServerException(crate::types::error::InternalServerException), + ///

      The limit on the number of requests per second has been exceeded.

      + ThrottlingException(crate::types::error::ThrottlingException), + ///

      The request isn't valid. Review the details in the error message to update the invalid parameters or values in your request.

      + ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-SearchGroupsError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl SearchGroupsError { + /// Creates the `SearchGroupsError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `SearchGroupsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::DirectoryUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `SearchGroupsError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `SearchGroupsError::DirectoryUnavailableException`. + pub fn is_directory_unavailable_exception(&self) -> bool { + matches!(self, Self::DirectoryUnavailableException(_)) + } + /// Returns `true` if the error kind is `SearchGroupsError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `SearchGroupsError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `SearchGroupsError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for SearchGroupsError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::DirectoryUnavailableException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for SearchGroupsError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::DirectoryUnavailableException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for SearchGroupsError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::DirectoryUnavailableException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for SearchGroupsError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::DirectoryUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for SearchGroupsError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::search_groups::SearchGroupsError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::search_groups::_search_groups_output::SearchGroupsOutput; + +pub use crate::operation::search_groups::_search_groups_input::SearchGroupsInput; + +mod _search_groups_input; + +mod _search_groups_output; + +/// Builders +pub mod builders; + +/// Paginator for this operation +pub mod paginator; diff --git a/sdk/directoryservicedata/src/operation/search_groups/_search_groups_input.rs b/sdk/directoryservicedata/src/operation/search_groups/_search_groups_input.rs new file mode 100644 index 000000000000..3c889577c62d --- /dev/null +++ b/sdk/directoryservicedata/src/operation/search_groups/_search_groups_input.rs @@ -0,0 +1,220 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq)] +pub struct SearchGroupsInput { + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub directory_id: ::std::option::Option<::std::string::String>, + ///

      The attribute value that you want to search for.

      + ///

      Wildcard (*) searches aren't supported. For a list of supported attributes, see Directory Service Data Attributes.

      + ///
      + pub search_string: ::std::option::Option<::std::string::String>, + ///

      One or more data attributes that are used to search for a group. For a list of supported attributes, see Directory Service Data Attributes.

      + pub search_attributes: ::std::option::Option<::std::vec::Vec<::std::string::String>>, + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub realm: ::std::option::Option<::std::string::String>, + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub next_token: ::std::option::Option<::std::string::String>, + ///

      The maximum number of results to be returned per request.

      + pub max_results: ::std::option::Option, +} +impl SearchGroupsInput { + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } + ///

      The attribute value that you want to search for.

      + ///

      Wildcard (*) searches aren't supported. For a list of supported attributes, see Directory Service Data Attributes.

      + ///
      + pub fn search_string(&self) -> ::std::option::Option<&str> { + self.search_string.as_deref() + } + ///

      One or more data attributes that are used to search for a group. For a list of supported attributes, see Directory Service Data Attributes.

      + /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.search_attributes.is_none()`. + pub fn search_attributes(&self) -> &[::std::string::String] { + self.search_attributes.as_deref().unwrap_or_default() + } + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn realm(&self) -> ::std::option::Option<&str> { + self.realm.as_deref() + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } + ///

      The maximum number of results to be returned per request.

      + pub fn max_results(&self) -> ::std::option::Option { + self.max_results + } +} +impl ::std::fmt::Debug for SearchGroupsInput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("SearchGroupsInput"); + formatter.field("directory_id", &self.directory_id); + formatter.field("search_string", &"*** Sensitive Data Redacted ***"); + formatter.field("search_attributes", &self.search_attributes); + formatter.field("realm", &self.realm); + formatter.field("next_token", &"*** Sensitive Data Redacted ***"); + formatter.field("max_results", &self.max_results); + formatter.finish() + } +} +impl SearchGroupsInput { + /// Creates a new builder-style object to manufacture [`SearchGroupsInput`](crate::operation::search_groups::SearchGroupsInput). + pub fn builder() -> crate::operation::search_groups::builders::SearchGroupsInputBuilder { + crate::operation::search_groups::builders::SearchGroupsInputBuilder::default() + } +} + +/// A builder for [`SearchGroupsInput`](crate::operation::search_groups::SearchGroupsInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)] +#[non_exhaustive] +pub struct SearchGroupsInputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, + pub(crate) search_string: ::std::option::Option<::std::string::String>, + pub(crate) search_attributes: ::std::option::Option<::std::vec::Vec<::std::string::String>>, + pub(crate) realm: ::std::option::Option<::std::string::String>, + pub(crate) next_token: ::std::option::Option<::std::string::String>, + pub(crate) max_results: ::std::option::Option, +} +impl SearchGroupsInputBuilder { + ///

      The identifier (ID) of the directory that's associated with the group.

      + /// This field is required. + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + ///

      The attribute value that you want to search for.

      + ///

      Wildcard (*) searches aren't supported. For a list of supported attributes, see Directory Service Data Attributes.

      + ///
      + /// This field is required. + pub fn search_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.search_string = ::std::option::Option::Some(input.into()); + self + } + ///

      The attribute value that you want to search for.

      + ///

      Wildcard (*) searches aren't supported. For a list of supported attributes, see Directory Service Data Attributes.

      + ///
      + pub fn set_search_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.search_string = input; + self + } + ///

      The attribute value that you want to search for.

      + ///

      Wildcard (*) searches aren't supported. For a list of supported attributes, see Directory Service Data Attributes.

      + ///
      + pub fn get_search_string(&self) -> &::std::option::Option<::std::string::String> { + &self.search_string + } + /// Appends an item to `search_attributes`. + /// + /// To override the contents of this collection use [`set_search_attributes`](Self::set_search_attributes). + /// + ///

      One or more data attributes that are used to search for a group. For a list of supported attributes, see Directory Service Data Attributes.

      + pub fn search_attributes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + let mut v = self.search_attributes.unwrap_or_default(); + v.push(input.into()); + self.search_attributes = ::std::option::Option::Some(v); + self + } + ///

      One or more data attributes that are used to search for a group. For a list of supported attributes, see Directory Service Data Attributes.

      + pub fn set_search_attributes(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { + self.search_attributes = input; + self + } + ///

      One or more data attributes that are used to search for a group. For a list of supported attributes, see Directory Service Data Attributes.

      + pub fn get_search_attributes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { + &self.search_attributes + } + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.realm = ::std::option::Option::Some(input.into()); + self + } + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn set_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.realm = input; + self + } + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn get_realm(&self) -> &::std::option::Option<::std::string::String> { + &self.realm + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + ///

      The maximum number of results to be returned per request.

      + pub fn max_results(mut self, input: i32) -> Self { + self.max_results = ::std::option::Option::Some(input); + self + } + ///

      The maximum number of results to be returned per request.

      + pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.max_results = input; + self + } + ///

      The maximum number of results to be returned per request.

      + pub fn get_max_results(&self) -> &::std::option::Option { + &self.max_results + } + /// Consumes the builder and constructs a [`SearchGroupsInput`](crate::operation::search_groups::SearchGroupsInput). + pub fn build( + self, + ) -> ::std::result::Result { + ::std::result::Result::Ok(crate::operation::search_groups::SearchGroupsInput { + directory_id: self.directory_id, + search_string: self.search_string, + search_attributes: self.search_attributes, + realm: self.realm, + next_token: self.next_token, + max_results: self.max_results, + }) + } +} +impl ::std::fmt::Debug for SearchGroupsInputBuilder { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("SearchGroupsInputBuilder"); + formatter.field("directory_id", &self.directory_id); + formatter.field("search_string", &"*** Sensitive Data Redacted ***"); + formatter.field("search_attributes", &self.search_attributes); + formatter.field("realm", &self.realm); + formatter.field("next_token", &"*** Sensitive Data Redacted ***"); + formatter.field("max_results", &self.max_results); + formatter.finish() + } +} diff --git a/sdk/directoryservicedata/src/operation/search_groups/_search_groups_output.rs b/sdk/directoryservicedata/src/operation/search_groups/_search_groups_output.rs new file mode 100644 index 000000000000..249623322951 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/search_groups/_search_groups_output.rs @@ -0,0 +1,162 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq)] +pub struct SearchGroupsOutput { + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub directory_id: ::std::option::Option<::std::string::String>, + ///

      The domain that's associated with the group.

      + pub realm: ::std::option::Option<::std::string::String>, + ///

      The group information that the request returns.

      + pub groups: ::std::option::Option<::std::vec::Vec>, + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl SearchGroupsOutput { + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } + ///

      The domain that's associated with the group.

      + pub fn realm(&self) -> ::std::option::Option<&str> { + self.realm.as_deref() + } + ///

      The group information that the request returns.

      + /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.groups.is_none()`. + pub fn groups(&self) -> &[crate::types::Group] { + self.groups.as_deref().unwrap_or_default() + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } +} +impl ::std::fmt::Debug for SearchGroupsOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("SearchGroupsOutput"); + formatter.field("directory_id", &self.directory_id); + formatter.field("realm", &self.realm); + formatter.field("groups", &self.groups); + formatter.field("next_token", &"*** Sensitive Data Redacted ***"); + formatter.field("_request_id", &self._request_id); + formatter.finish() + } +} +impl ::aws_types::request_id::RequestId for SearchGroupsOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl SearchGroupsOutput { + /// Creates a new builder-style object to manufacture [`SearchGroupsOutput`](crate::operation::search_groups::SearchGroupsOutput). + pub fn builder() -> crate::operation::search_groups::builders::SearchGroupsOutputBuilder { + crate::operation::search_groups::builders::SearchGroupsOutputBuilder::default() + } +} + +/// A builder for [`SearchGroupsOutput`](crate::operation::search_groups::SearchGroupsOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)] +#[non_exhaustive] +pub struct SearchGroupsOutputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, + pub(crate) realm: ::std::option::Option<::std::string::String>, + pub(crate) groups: ::std::option::Option<::std::vec::Vec>, + pub(crate) next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl SearchGroupsOutputBuilder { + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + ///

      The domain that's associated with the group.

      + pub fn realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.realm = ::std::option::Option::Some(input.into()); + self + } + ///

      The domain that's associated with the group.

      + pub fn set_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.realm = input; + self + } + ///

      The domain that's associated with the group.

      + pub fn get_realm(&self) -> &::std::option::Option<::std::string::String> { + &self.realm + } + /// Appends an item to `groups`. + /// + /// To override the contents of this collection use [`set_groups`](Self::set_groups). + /// + ///

      The group information that the request returns.

      + pub fn groups(mut self, input: crate::types::Group) -> Self { + let mut v = self.groups.unwrap_or_default(); + v.push(input); + self.groups = ::std::option::Option::Some(v); + self + } + ///

      The group information that the request returns.

      + pub fn set_groups(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.groups = input; + self + } + ///

      The group information that the request returns.

      + pub fn get_groups(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.groups + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`SearchGroupsOutput`](crate::operation::search_groups::SearchGroupsOutput). + pub fn build(self) -> crate::operation::search_groups::SearchGroupsOutput { + crate::operation::search_groups::SearchGroupsOutput { + directory_id: self.directory_id, + realm: self.realm, + groups: self.groups, + next_token: self.next_token, + _request_id: self._request_id, + } + } +} +impl ::std::fmt::Debug for SearchGroupsOutputBuilder { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("SearchGroupsOutputBuilder"); + formatter.field("directory_id", &self.directory_id); + formatter.field("realm", &self.realm); + formatter.field("groups", &self.groups); + formatter.field("next_token", &"*** Sensitive Data Redacted ***"); + formatter.field("_request_id", &self._request_id); + formatter.finish() + } +} diff --git a/sdk/directoryservicedata/src/operation/search_groups/builders.rs b/sdk/directoryservicedata/src/operation/search_groups/builders.rs new file mode 100644 index 000000000000..c30976ba371e --- /dev/null +++ b/sdk/directoryservicedata/src/operation/search_groups/builders.rs @@ -0,0 +1,223 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::search_groups::_search_groups_output::SearchGroupsOutputBuilder; + +pub use crate::operation::search_groups::_search_groups_input::SearchGroupsInputBuilder; + +impl crate::operation::search_groups::builders::SearchGroupsInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::search_groups::SearchGroupsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::search_groups::SearchGroupsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.search_groups(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `SearchGroups`. +/// +///

      Searches the specified directory for a group. You can find groups that match the SearchString parameter with the value of their attributes included in the SearchString parameter.

      +///

      This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the SearchGroups.NextToken member contains a token that you pass in the next call to SearchGroups. This retrieves the next set of items.

      +///

      You can also specify a maximum number of return results with the MaxResults parameter.

      +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct SearchGroupsFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::search_groups::builders::SearchGroupsInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::search_groups::SearchGroupsOutput, + crate::operation::search_groups::SearchGroupsError, + > for SearchGroupsFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::search_groups::SearchGroupsOutput, + crate::operation::search_groups::SearchGroupsError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl SearchGroupsFluentBuilder { + /// Creates a new `SearchGroupsFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the SearchGroups as a reference. + pub fn as_input(&self) -> &crate::operation::search_groups::builders::SearchGroupsInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::search_groups::SearchGroupsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::search_groups::SearchGroupsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::search_groups::SearchGroups::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::search_groups::SearchGroups::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::search_groups::SearchGroupsOutput, + crate::operation::search_groups::SearchGroupsError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + /// Create a paginator for this request + /// + /// Paginators are used by calling [`send().await`](crate::operation::search_groups::paginator::SearchGroupsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream). + pub fn into_paginator(self) -> crate::operation::search_groups::paginator::SearchGroupsPaginator { + crate::operation::search_groups::paginator::SearchGroupsPaginator::new(self.handle, self.inner) + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.directory_id(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_directory_id(input); + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_directory_id() + } + ///

      The attribute value that you want to search for.

      + ///

      Wildcard (*) searches aren't supported. For a list of supported attributes, see Directory Service Data Attributes.

      + ///
      + pub fn search_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.search_string(input.into()); + self + } + ///

      The attribute value that you want to search for.

      + ///

      Wildcard (*) searches aren't supported. For a list of supported attributes, see Directory Service Data Attributes.

      + ///
      + pub fn set_search_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_search_string(input); + self + } + ///

      The attribute value that you want to search for.

      + ///

      Wildcard (*) searches aren't supported. For a list of supported attributes, see Directory Service Data Attributes.

      + ///
      + pub fn get_search_string(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_search_string() + } + /// + /// Appends an item to `SearchAttributes`. + /// + /// To override the contents of this collection use [`set_search_attributes`](Self::set_search_attributes). + /// + ///

      One or more data attributes that are used to search for a group. For a list of supported attributes, see Directory Service Data Attributes.

      + pub fn search_attributes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.search_attributes(input.into()); + self + } + ///

      One or more data attributes that are used to search for a group. For a list of supported attributes, see Directory Service Data Attributes.

      + pub fn set_search_attributes(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { + self.inner = self.inner.set_search_attributes(input); + self + } + ///

      One or more data attributes that are used to search for a group. For a list of supported attributes, see Directory Service Data Attributes.

      + pub fn get_search_attributes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { + self.inner.get_search_attributes() + } + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.realm(input.into()); + self + } + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn set_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_realm(input); + self + } + ///

      The domain name that's associated with the group.

      + ///

      This parameter is optional, so you can return groups outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD groups are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn get_realm(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_realm() + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.next_token(input.into()); + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_next_token(input); + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_next_token() + } + ///

      The maximum number of results to be returned per request.

      + pub fn max_results(mut self, input: i32) -> Self { + self.inner = self.inner.max_results(input); + self + } + ///

      The maximum number of results to be returned per request.

      + pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_max_results(input); + self + } + ///

      The maximum number of results to be returned per request.

      + pub fn get_max_results(&self) -> &::std::option::Option { + self.inner.get_max_results() + } +} diff --git a/sdk/directoryservicedata/src/operation/search_groups/paginator.rs b/sdk/directoryservicedata/src/operation/search_groups/paginator.rs new file mode 100644 index 000000000000..5e4aa25b4d5e --- /dev/null +++ b/sdk/directoryservicedata/src/operation/search_groups/paginator.rs @@ -0,0 +1,145 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Paginator for [`SearchGroups`](crate::operation::search_groups::SearchGroups) +pub struct SearchGroupsPaginator { + handle: std::sync::Arc, + builder: crate::operation::search_groups::builders::SearchGroupsInputBuilder, + stop_on_duplicate_token: bool, +} + +impl SearchGroupsPaginator { + /// Create a new paginator-wrapper + pub(crate) fn new( + handle: std::sync::Arc, + builder: crate::operation::search_groups::builders::SearchGroupsInputBuilder, + ) -> Self { + Self { + handle, + builder, + stop_on_duplicate_token: true, + } + } + + /// Set the page size + /// + /// _Note: this method will override any previously set value for `max_results`_ + pub fn page_size(mut self, limit: i32) -> Self { + self.builder.max_results = ::std::option::Option::Some(limit); + self + } + + /// Create a flattened paginator + /// + /// This paginator automatically flattens results using `groups`. Queries to the underlying service + /// are dispatched lazily. + pub fn items(self) -> crate::operation::search_groups::paginator::SearchGroupsPaginatorItems { + crate::operation::search_groups::paginator::SearchGroupsPaginatorItems(self) + } + + /// Stop paginating when the service returns the same pagination token twice in a row. + /// + /// Defaults to true. + /// + /// For certain operations, it may be useful to continue on duplicate token. For example, + /// if an operation is for tailing a log file in real-time, then continuing may be desired. + /// This option can be set to `false` to accommodate these use cases. + pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self { + self.stop_on_duplicate_token = stop_on_duplicate_token; + self + } + + /// Create the pagination stream + /// + /// _Note:_ No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::operation::search_groups::SearchGroupsOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::search_groups::SearchGroupsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + // Move individual fields out of self for the borrow checker + let builder = self.builder; + let handle = self.handle; + let runtime_plugins = crate::operation::search_groups::SearchGroups::operation_runtime_plugins( + handle.runtime_plugins.clone(), + &handle.conf, + ::std::option::Option::None, + ) + .with_operation_plugin(crate::sdk_feature_tracker::paginator::PaginatorFeatureTrackerRuntimePlugin::new()); + ::aws_smithy_async::future::pagination_stream::PaginationStream::new(::aws_smithy_async::future::pagination_stream::fn_stream::FnStream::new( + move |tx| { + ::std::boxed::Box::pin(async move { + // Build the input for the first time. If required fields are missing, this is where we'll produce an early error. + let mut input = match builder + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure) + { + ::std::result::Result::Ok(input) => input, + ::std::result::Result::Err(e) => { + let _ = tx.send(::std::result::Result::Err(e)).await; + return; + } + }; + loop { + let resp = crate::operation::search_groups::SearchGroups::orchestrate(&runtime_plugins, input.clone()).await; + // If the input member is None or it was an error + let done = match resp { + ::std::result::Result::Ok(ref resp) => { + let new_token = crate::lens::reflens_search_groups_output_output_next_token(resp); + // Pagination is exhausted when the next token is an empty string + let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true); + if !is_empty && new_token == input.next_token.as_ref() && self.stop_on_duplicate_token { + true + } else { + input.next_token = new_token.cloned(); + is_empty + } + } + ::std::result::Result::Err(_) => true, + }; + if tx.send(resp).await.is_err() { + // receiving end was dropped + return; + } + if done { + return; + } + } + }) + }, + )) + } +} + +/// Flattened paginator for `SearchGroupsPaginator` +/// +/// This is created with [`.items()`](SearchGroupsPaginator::items) +pub struct SearchGroupsPaginatorItems(SearchGroupsPaginator); + +impl SearchGroupsPaginatorItems { + /// Create the pagination stream + /// + /// _Note_: No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + /// + /// To read the entirety of the paginator, use [`.collect::, _>()`](aws_smithy_async::future::pagination_stream::PaginationStream::collect). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::types::Group, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::search_groups::SearchGroupsError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + ::aws_smithy_async::future::pagination_stream::TryFlatMap::new(self.0.send()) + .flat_map(|page| crate::lens::lens_search_groups_output_output_groups(page).unwrap_or_default().into_iter()) + } +} diff --git a/sdk/directoryservicedata/src/operation/search_users.rs b/sdk/directoryservicedata/src/operation/search_users.rs new file mode 100644 index 000000000000..ad6d9f422b88 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/search_users.rs @@ -0,0 +1,423 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `SearchUsers`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct SearchUsers; +impl SearchUsers { + /// Creates a new `SearchUsers` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::search_users::SearchUsersInput, + ) -> ::std::result::Result< + crate::operation::search_users::SearchUsersOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::search_users::SearchUsersError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::search_users::SearchUsersInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("directoryservicedata", "SearchUsers", input, runtime_plugins, stop_point) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for SearchUsers { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("SearchUsers"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + SearchUsersRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + SearchUsersResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput); + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "SearchUsers", + "directoryservicedata", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("SearchUsers") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(SearchUsersEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::search_users::SearchUsersError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::search_users::SearchUsersError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::search_users::SearchUsersError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct SearchUsersResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for SearchUsersResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_search_users::de_search_users_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_search_users::de_search_users_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct SearchUsersRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for SearchUsersRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::search_users::SearchUsersInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/Users/SearchUsers").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + fn uri_query( + _input: &crate::operation::search_users::SearchUsersInput, + mut output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + let mut query = ::aws_smithy_http::query::Writer::new(output); + let inner_1 = &_input.directory_id; + let inner_1 = inner_1 + .as_ref() + .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("directory_id", "cannot be empty or unset"))?; + if inner_1.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "directory_id", + "cannot be empty or unset", + )); + } + query.push_kv("DirectoryId", &::aws_smithy_http::query::fmt_string(inner_1)); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::search_users::SearchUsersInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + uri_query(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_search_users::ser_search_users_input(&input)?); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct SearchUsersEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for SearchUsersEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "SearchUsersEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to SearchUsersInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `SearchUsersError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum SearchUsersError { + ///

      You don't have permission to perform the request or access the directory. It can also occur when the DirectoryId doesn't exist or the user, member, or group might be outside of your organizational unit (OU).

      + ///

      Make sure that you have the authentication and authorization to perform the action. Review the directory information in the request, and make sure that the object isn't outside of your OU.

      + AccessDeniedException(crate::types::error::AccessDeniedException), + ///

      The request could not be completed due to a problem in the configuration or current state of the specified directory.

      + DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), + ///

      The operation didn't succeed because an internal error occurred. Try again later.

      + InternalServerException(crate::types::error::InternalServerException), + ///

      The limit on the number of requests per second has been exceeded.

      + ThrottlingException(crate::types::error::ThrottlingException), + ///

      The request isn't valid. Review the details in the error message to update the invalid parameters or values in your request.

      + ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-SearchUsersError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl SearchUsersError { + /// Creates the `SearchUsersError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `SearchUsersError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::DirectoryUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `SearchUsersError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `SearchUsersError::DirectoryUnavailableException`. + pub fn is_directory_unavailable_exception(&self) -> bool { + matches!(self, Self::DirectoryUnavailableException(_)) + } + /// Returns `true` if the error kind is `SearchUsersError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `SearchUsersError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `SearchUsersError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for SearchUsersError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::DirectoryUnavailableException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for SearchUsersError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::DirectoryUnavailableException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for SearchUsersError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::DirectoryUnavailableException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for SearchUsersError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::DirectoryUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for SearchUsersError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::search_users::SearchUsersError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::search_users::_search_users_output::SearchUsersOutput; + +pub use crate::operation::search_users::_search_users_input::SearchUsersInput; + +mod _search_users_input; + +mod _search_users_output; + +/// Builders +pub mod builders; + +/// Paginator for this operation +pub mod paginator; diff --git a/sdk/directoryservicedata/src/operation/search_users/_search_users_input.rs b/sdk/directoryservicedata/src/operation/search_users/_search_users_input.rs new file mode 100644 index 000000000000..517cdc0ee262 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/search_users/_search_users_input.rs @@ -0,0 +1,218 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq)] +pub struct SearchUsersInput { + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub directory_id: ::std::option::Option<::std::string::String>, + ///

      The domain name that's associated with the user.

      + ///

      This parameter is optional, so you can return users outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub realm: ::std::option::Option<::std::string::String>, + ///

      The attribute value that you want to search for.

      + ///

      Wildcard (*) searches aren't supported. For a list of supported attributes, see Directory Service Data Attributes.

      + ///
      + pub search_string: ::std::option::Option<::std::string::String>, + ///

      One or more data attributes that are used to search for a user. For a list of supported attributes, see Directory Service Data Attributes.

      + pub search_attributes: ::std::option::Option<::std::vec::Vec<::std::string::String>>, + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub next_token: ::std::option::Option<::std::string::String>, + ///

      The maximum number of results to be returned per request.

      + pub max_results: ::std::option::Option, +} +impl SearchUsersInput { + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } + ///

      The domain name that's associated with the user.

      + ///

      This parameter is optional, so you can return users outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn realm(&self) -> ::std::option::Option<&str> { + self.realm.as_deref() + } + ///

      The attribute value that you want to search for.

      + ///

      Wildcard (*) searches aren't supported. For a list of supported attributes, see Directory Service Data Attributes.

      + ///
      + pub fn search_string(&self) -> ::std::option::Option<&str> { + self.search_string.as_deref() + } + ///

      One or more data attributes that are used to search for a user. For a list of supported attributes, see Directory Service Data Attributes.

      + /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.search_attributes.is_none()`. + pub fn search_attributes(&self) -> &[::std::string::String] { + self.search_attributes.as_deref().unwrap_or_default() + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } + ///

      The maximum number of results to be returned per request.

      + pub fn max_results(&self) -> ::std::option::Option { + self.max_results + } +} +impl ::std::fmt::Debug for SearchUsersInput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("SearchUsersInput"); + formatter.field("directory_id", &self.directory_id); + formatter.field("realm", &self.realm); + formatter.field("search_string", &"*** Sensitive Data Redacted ***"); + formatter.field("search_attributes", &self.search_attributes); + formatter.field("next_token", &"*** Sensitive Data Redacted ***"); + formatter.field("max_results", &self.max_results); + formatter.finish() + } +} +impl SearchUsersInput { + /// Creates a new builder-style object to manufacture [`SearchUsersInput`](crate::operation::search_users::SearchUsersInput). + pub fn builder() -> crate::operation::search_users::builders::SearchUsersInputBuilder { + crate::operation::search_users::builders::SearchUsersInputBuilder::default() + } +} + +/// A builder for [`SearchUsersInput`](crate::operation::search_users::SearchUsersInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)] +#[non_exhaustive] +pub struct SearchUsersInputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, + pub(crate) realm: ::std::option::Option<::std::string::String>, + pub(crate) search_string: ::std::option::Option<::std::string::String>, + pub(crate) search_attributes: ::std::option::Option<::std::vec::Vec<::std::string::String>>, + pub(crate) next_token: ::std::option::Option<::std::string::String>, + pub(crate) max_results: ::std::option::Option, +} +impl SearchUsersInputBuilder { + ///

      The identifier (ID) of the directory that's associated with the user.

      + /// This field is required. + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + ///

      The domain name that's associated with the user.

      + ///

      This parameter is optional, so you can return users outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.realm = ::std::option::Option::Some(input.into()); + self + } + ///

      The domain name that's associated with the user.

      + ///

      This parameter is optional, so you can return users outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn set_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.realm = input; + self + } + ///

      The domain name that's associated with the user.

      + ///

      This parameter is optional, so you can return users outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn get_realm(&self) -> &::std::option::Option<::std::string::String> { + &self.realm + } + ///

      The attribute value that you want to search for.

      + ///

      Wildcard (*) searches aren't supported. For a list of supported attributes, see Directory Service Data Attributes.

      + ///
      + /// This field is required. + pub fn search_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.search_string = ::std::option::Option::Some(input.into()); + self + } + ///

      The attribute value that you want to search for.

      + ///

      Wildcard (*) searches aren't supported. For a list of supported attributes, see Directory Service Data Attributes.

      + ///
      + pub fn set_search_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.search_string = input; + self + } + ///

      The attribute value that you want to search for.

      + ///

      Wildcard (*) searches aren't supported. For a list of supported attributes, see Directory Service Data Attributes.

      + ///
      + pub fn get_search_string(&self) -> &::std::option::Option<::std::string::String> { + &self.search_string + } + /// Appends an item to `search_attributes`. + /// + /// To override the contents of this collection use [`set_search_attributes`](Self::set_search_attributes). + /// + ///

      One or more data attributes that are used to search for a user. For a list of supported attributes, see Directory Service Data Attributes.

      + pub fn search_attributes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + let mut v = self.search_attributes.unwrap_or_default(); + v.push(input.into()); + self.search_attributes = ::std::option::Option::Some(v); + self + } + ///

      One or more data attributes that are used to search for a user. For a list of supported attributes, see Directory Service Data Attributes.

      + pub fn set_search_attributes(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { + self.search_attributes = input; + self + } + ///

      One or more data attributes that are used to search for a user. For a list of supported attributes, see Directory Service Data Attributes.

      + pub fn get_search_attributes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { + &self.search_attributes + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + ///

      The maximum number of results to be returned per request.

      + pub fn max_results(mut self, input: i32) -> Self { + self.max_results = ::std::option::Option::Some(input); + self + } + ///

      The maximum number of results to be returned per request.

      + pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.max_results = input; + self + } + ///

      The maximum number of results to be returned per request.

      + pub fn get_max_results(&self) -> &::std::option::Option { + &self.max_results + } + /// Consumes the builder and constructs a [`SearchUsersInput`](crate::operation::search_users::SearchUsersInput). + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::operation::search_users::SearchUsersInput { + directory_id: self.directory_id, + realm: self.realm, + search_string: self.search_string, + search_attributes: self.search_attributes, + next_token: self.next_token, + max_results: self.max_results, + }) + } +} +impl ::std::fmt::Debug for SearchUsersInputBuilder { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("SearchUsersInputBuilder"); + formatter.field("directory_id", &self.directory_id); + formatter.field("realm", &self.realm); + formatter.field("search_string", &"*** Sensitive Data Redacted ***"); + formatter.field("search_attributes", &self.search_attributes); + formatter.field("next_token", &"*** Sensitive Data Redacted ***"); + formatter.field("max_results", &self.max_results); + formatter.finish() + } +} diff --git a/sdk/directoryservicedata/src/operation/search_users/_search_users_output.rs b/sdk/directoryservicedata/src/operation/search_users/_search_users_output.rs new file mode 100644 index 000000000000..e3bf5cbd8793 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/search_users/_search_users_output.rs @@ -0,0 +1,162 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq)] +pub struct SearchUsersOutput { + ///

      The identifier (ID) of the directory where the address block is added.

      + pub directory_id: ::std::option::Option<::std::string::String>, + ///

      The domain that's associated with the user.

      + pub realm: ::std::option::Option<::std::string::String>, + ///

      The user information that the request returns.

      + pub users: ::std::option::Option<::std::vec::Vec>, + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl SearchUsersOutput { + ///

      The identifier (ID) of the directory where the address block is added.

      + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } + ///

      The domain that's associated with the user.

      + pub fn realm(&self) -> ::std::option::Option<&str> { + self.realm.as_deref() + } + ///

      The user information that the request returns.

      + /// + /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.users.is_none()`. + pub fn users(&self) -> &[crate::types::User] { + self.users.as_deref().unwrap_or_default() + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(&self) -> ::std::option::Option<&str> { + self.next_token.as_deref() + } +} +impl ::std::fmt::Debug for SearchUsersOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("SearchUsersOutput"); + formatter.field("directory_id", &self.directory_id); + formatter.field("realm", &self.realm); + formatter.field("users", &self.users); + formatter.field("next_token", &"*** Sensitive Data Redacted ***"); + formatter.field("_request_id", &self._request_id); + formatter.finish() + } +} +impl ::aws_types::request_id::RequestId for SearchUsersOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl SearchUsersOutput { + /// Creates a new builder-style object to manufacture [`SearchUsersOutput`](crate::operation::search_users::SearchUsersOutput). + pub fn builder() -> crate::operation::search_users::builders::SearchUsersOutputBuilder { + crate::operation::search_users::builders::SearchUsersOutputBuilder::default() + } +} + +/// A builder for [`SearchUsersOutput`](crate::operation::search_users::SearchUsersOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)] +#[non_exhaustive] +pub struct SearchUsersOutputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, + pub(crate) realm: ::std::option::Option<::std::string::String>, + pub(crate) users: ::std::option::Option<::std::vec::Vec>, + pub(crate) next_token: ::std::option::Option<::std::string::String>, + _request_id: Option, +} +impl SearchUsersOutputBuilder { + ///

      The identifier (ID) of the directory where the address block is added.

      + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

      The identifier (ID) of the directory where the address block is added.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

      The identifier (ID) of the directory where the address block is added.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + ///

      The domain that's associated with the user.

      + pub fn realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.realm = ::std::option::Option::Some(input.into()); + self + } + ///

      The domain that's associated with the user.

      + pub fn set_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.realm = input; + self + } + ///

      The domain that's associated with the user.

      + pub fn get_realm(&self) -> &::std::option::Option<::std::string::String> { + &self.realm + } + /// Appends an item to `users`. + /// + /// To override the contents of this collection use [`set_users`](Self::set_users). + /// + ///

      The user information that the request returns.

      + pub fn users(mut self, input: crate::types::User) -> Self { + let mut v = self.users.unwrap_or_default(); + v.push(input); + self.users = ::std::option::Option::Some(v); + self + } + ///

      The user information that the request returns.

      + pub fn set_users(mut self, input: ::std::option::Option<::std::vec::Vec>) -> Self { + self.users = input; + self + } + ///

      The user information that the request returns.

      + pub fn get_users(&self) -> &::std::option::Option<::std::vec::Vec> { + &self.users + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.next_token = ::std::option::Option::Some(input.into()); + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.next_token = input; + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + &self.next_token + } + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`SearchUsersOutput`](crate::operation::search_users::SearchUsersOutput). + pub fn build(self) -> crate::operation::search_users::SearchUsersOutput { + crate::operation::search_users::SearchUsersOutput { + directory_id: self.directory_id, + realm: self.realm, + users: self.users, + next_token: self.next_token, + _request_id: self._request_id, + } + } +} +impl ::std::fmt::Debug for SearchUsersOutputBuilder { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("SearchUsersOutputBuilder"); + formatter.field("directory_id", &self.directory_id); + formatter.field("realm", &self.realm); + formatter.field("users", &self.users); + formatter.field("next_token", &"*** Sensitive Data Redacted ***"); + formatter.field("_request_id", &self._request_id); + formatter.finish() + } +} diff --git a/sdk/directoryservicedata/src/operation/search_users/builders.rs b/sdk/directoryservicedata/src/operation/search_users/builders.rs new file mode 100644 index 000000000000..8d788ad3110c --- /dev/null +++ b/sdk/directoryservicedata/src/operation/search_users/builders.rs @@ -0,0 +1,223 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::search_users::_search_users_output::SearchUsersOutputBuilder; + +pub use crate::operation::search_users::_search_users_input::SearchUsersInputBuilder; + +impl crate::operation::search_users::builders::SearchUsersInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::search_users::SearchUsersOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::search_users::SearchUsersError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.search_users(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `SearchUsers`. +/// +///

      Searches the specified directory for a user. You can find users that match the SearchString parameter with the value of their attributes included in the SearchString parameter.

      +///

      This operation supports pagination with the use of the NextToken request and response parameters. If more results are available, the SearchUsers.NextToken member contains a token that you pass in the next call to SearchUsers. This retrieves the next set of items.

      +///

      You can also specify a maximum number of return results with the MaxResults parameter.

      +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct SearchUsersFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::search_users::builders::SearchUsersInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::search_users::SearchUsersOutput, + crate::operation::search_users::SearchUsersError, + > for SearchUsersFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::search_users::SearchUsersOutput, + crate::operation::search_users::SearchUsersError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl SearchUsersFluentBuilder { + /// Creates a new `SearchUsersFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the SearchUsers as a reference. + pub fn as_input(&self) -> &crate::operation::search_users::builders::SearchUsersInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::search_users::SearchUsersOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::search_users::SearchUsersError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::search_users::SearchUsers::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::search_users::SearchUsers::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::search_users::SearchUsersOutput, + crate::operation::search_users::SearchUsersError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + /// Create a paginator for this request + /// + /// Paginators are used by calling [`send().await`](crate::operation::search_users::paginator::SearchUsersPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream). + pub fn into_paginator(self) -> crate::operation::search_users::paginator::SearchUsersPaginator { + crate::operation::search_users::paginator::SearchUsersPaginator::new(self.handle, self.inner) + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.directory_id(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_directory_id(input); + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_directory_id() + } + ///

      The domain name that's associated with the user.

      + ///

      This parameter is optional, so you can return users outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn realm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.realm(input.into()); + self + } + ///

      The domain name that's associated with the user.

      + ///

      This parameter is optional, so you can return users outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn set_realm(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_realm(input); + self + } + ///

      The domain name that's associated with the user.

      + ///

      This parameter is optional, so you can return users outside of your Managed Microsoft AD domain. When no value is defined, only your Managed Microsoft AD users are returned.

      + ///

      This value is case insensitive.

      + ///
      + pub fn get_realm(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_realm() + } + ///

      The attribute value that you want to search for.

      + ///

      Wildcard (*) searches aren't supported. For a list of supported attributes, see Directory Service Data Attributes.

      + ///
      + pub fn search_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.search_string(input.into()); + self + } + ///

      The attribute value that you want to search for.

      + ///

      Wildcard (*) searches aren't supported. For a list of supported attributes, see Directory Service Data Attributes.

      + ///
      + pub fn set_search_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_search_string(input); + self + } + ///

      The attribute value that you want to search for.

      + ///

      Wildcard (*) searches aren't supported. For a list of supported attributes, see Directory Service Data Attributes.

      + ///
      + pub fn get_search_string(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_search_string() + } + /// + /// Appends an item to `SearchAttributes`. + /// + /// To override the contents of this collection use [`set_search_attributes`](Self::set_search_attributes). + /// + ///

      One or more data attributes that are used to search for a user. For a list of supported attributes, see Directory Service Data Attributes.

      + pub fn search_attributes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.search_attributes(input.into()); + self + } + ///

      One or more data attributes that are used to search for a user. For a list of supported attributes, see Directory Service Data Attributes.

      + pub fn set_search_attributes(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self { + self.inner = self.inner.set_search_attributes(input); + self + } + ///

      One or more data attributes that are used to search for a user. For a list of supported attributes, see Directory Service Data Attributes.

      + pub fn get_search_attributes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> { + self.inner.get_search_attributes() + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.next_token(input.into()); + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_next_token(input); + self + } + ///

      An encoded paging token for paginated calls that can be passed back to retrieve the next page.

      + pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_next_token() + } + ///

      The maximum number of results to be returned per request.

      + pub fn max_results(mut self, input: i32) -> Self { + self.inner = self.inner.max_results(input); + self + } + ///

      The maximum number of results to be returned per request.

      + pub fn set_max_results(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_max_results(input); + self + } + ///

      The maximum number of results to be returned per request.

      + pub fn get_max_results(&self) -> &::std::option::Option { + self.inner.get_max_results() + } +} diff --git a/sdk/directoryservicedata/src/operation/search_users/paginator.rs b/sdk/directoryservicedata/src/operation/search_users/paginator.rs new file mode 100644 index 000000000000..d8ba882385c8 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/search_users/paginator.rs @@ -0,0 +1,145 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Paginator for [`SearchUsers`](crate::operation::search_users::SearchUsers) +pub struct SearchUsersPaginator { + handle: std::sync::Arc, + builder: crate::operation::search_users::builders::SearchUsersInputBuilder, + stop_on_duplicate_token: bool, +} + +impl SearchUsersPaginator { + /// Create a new paginator-wrapper + pub(crate) fn new( + handle: std::sync::Arc, + builder: crate::operation::search_users::builders::SearchUsersInputBuilder, + ) -> Self { + Self { + handle, + builder, + stop_on_duplicate_token: true, + } + } + + /// Set the page size + /// + /// _Note: this method will override any previously set value for `max_results`_ + pub fn page_size(mut self, limit: i32) -> Self { + self.builder.max_results = ::std::option::Option::Some(limit); + self + } + + /// Create a flattened paginator + /// + /// This paginator automatically flattens results using `users`. Queries to the underlying service + /// are dispatched lazily. + pub fn items(self) -> crate::operation::search_users::paginator::SearchUsersPaginatorItems { + crate::operation::search_users::paginator::SearchUsersPaginatorItems(self) + } + + /// Stop paginating when the service returns the same pagination token twice in a row. + /// + /// Defaults to true. + /// + /// For certain operations, it may be useful to continue on duplicate token. For example, + /// if an operation is for tailing a log file in real-time, then continuing may be desired. + /// This option can be set to `false` to accommodate these use cases. + pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self { + self.stop_on_duplicate_token = stop_on_duplicate_token; + self + } + + /// Create the pagination stream + /// + /// _Note:_ No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::operation::search_users::SearchUsersOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::search_users::SearchUsersError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + // Move individual fields out of self for the borrow checker + let builder = self.builder; + let handle = self.handle; + let runtime_plugins = crate::operation::search_users::SearchUsers::operation_runtime_plugins( + handle.runtime_plugins.clone(), + &handle.conf, + ::std::option::Option::None, + ) + .with_operation_plugin(crate::sdk_feature_tracker::paginator::PaginatorFeatureTrackerRuntimePlugin::new()); + ::aws_smithy_async::future::pagination_stream::PaginationStream::new(::aws_smithy_async::future::pagination_stream::fn_stream::FnStream::new( + move |tx| { + ::std::boxed::Box::pin(async move { + // Build the input for the first time. If required fields are missing, this is where we'll produce an early error. + let mut input = match builder + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure) + { + ::std::result::Result::Ok(input) => input, + ::std::result::Result::Err(e) => { + let _ = tx.send(::std::result::Result::Err(e)).await; + return; + } + }; + loop { + let resp = crate::operation::search_users::SearchUsers::orchestrate(&runtime_plugins, input.clone()).await; + // If the input member is None or it was an error + let done = match resp { + ::std::result::Result::Ok(ref resp) => { + let new_token = crate::lens::reflens_search_users_output_output_next_token(resp); + // Pagination is exhausted when the next token is an empty string + let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true); + if !is_empty && new_token == input.next_token.as_ref() && self.stop_on_duplicate_token { + true + } else { + input.next_token = new_token.cloned(); + is_empty + } + } + ::std::result::Result::Err(_) => true, + }; + if tx.send(resp).await.is_err() { + // receiving end was dropped + return; + } + if done { + return; + } + } + }) + }, + )) + } +} + +/// Flattened paginator for `SearchUsersPaginator` +/// +/// This is created with [`.items()`](SearchUsersPaginator::items) +pub struct SearchUsersPaginatorItems(SearchUsersPaginator); + +impl SearchUsersPaginatorItems { + /// Create the pagination stream + /// + /// _Note_: No requests will be dispatched until the stream is used + /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method). + /// + /// To read the entirety of the paginator, use [`.collect::, _>()`](aws_smithy_async::future::pagination_stream::PaginationStream::collect). + pub fn send( + self, + ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream< + ::std::result::Result< + crate::types::User, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::search_users::SearchUsersError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + >, + > { + ::aws_smithy_async::future::pagination_stream::TryFlatMap::new(self.0.send()) + .flat_map(|page| crate::lens::lens_search_users_output_output_users(page).unwrap_or_default().into_iter()) + } +} diff --git a/sdk/directoryservicedata/src/operation/update_group.rs b/sdk/directoryservicedata/src/operation/update_group.rs new file mode 100644 index 000000000000..b0879dff8afc --- /dev/null +++ b/sdk/directoryservicedata/src/operation/update_group.rs @@ -0,0 +1,449 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `UpdateGroup`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct UpdateGroup; +impl UpdateGroup { + /// Creates a new `UpdateGroup` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::update_group::UpdateGroupInput, + ) -> ::std::result::Result< + crate::operation::update_group::UpdateGroupOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::update_group::UpdateGroupError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::update_group::UpdateGroupInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("directoryservicedata", "UpdateGroup", input, runtime_plugins, stop_point) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins + .with_operation_plugin(crate::client_idempotency_token::IdempotencyTokenRuntimePlugin::new( + |token_provider, input| { + let input: &mut crate::operation::update_group::UpdateGroupInput = input.downcast_mut().expect("correct type"); + if input.client_token.is_none() { + input.client_token = ::std::option::Option::Some(token_provider.make_idempotency_token()); + } + }, + )) + .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateGroup { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("UpdateGroup"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + UpdateGroupRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + UpdateGroupResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "UpdateGroup", + "directoryservicedata", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("UpdateGroup") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(UpdateGroupEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::update_group::UpdateGroupError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::update_group::UpdateGroupError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::update_group::UpdateGroupError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct UpdateGroupResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateGroupResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_update_group::de_update_group_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_update_group::de_update_group_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct UpdateGroupRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for UpdateGroupRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input + .downcast::() + .expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::update_group::UpdateGroupInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/Groups/UpdateGroup").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + fn uri_query( + _input: &crate::operation::update_group::UpdateGroupInput, + mut output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + let mut query = ::aws_smithy_http::query::Writer::new(output); + let inner_1 = &_input.directory_id; + let inner_1 = inner_1 + .as_ref() + .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("directory_id", "cannot be empty or unset"))?; + if inner_1.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "directory_id", + "cannot be empty or unset", + )); + } + query.push_kv("DirectoryId", &::aws_smithy_http::query::fmt_string(inner_1)); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::update_group::UpdateGroupInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + uri_query(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_update_group::ser_update_group_input(&input)?); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct UpdateGroupEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateGroupEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "UpdateGroupEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to UpdateGroupInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `UpdateGroupError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum UpdateGroupError { + ///

      You don't have permission to perform the request or access the directory. It can also occur when the DirectoryId doesn't exist or the user, member, or group might be outside of your organizational unit (OU).

      + ///

      Make sure that you have the authentication and authorization to perform the action. Review the directory information in the request, and make sure that the object isn't outside of your OU.

      + AccessDeniedException(crate::types::error::AccessDeniedException), + ///

      This error will occur when you try to create a resource that conflicts with an existing object. It can also occur when adding a member to a group that the member is already in.

      + ///

      This error can be caused by a request sent within the 8-hour idempotency window with the same client token but different input parameters. Client tokens should not be re-used across different requests. After 8 hours, any request with the same client token is treated as a new request.

      + ConflictException(crate::types::error::ConflictException), + ///

      The request could not be completed due to a problem in the configuration or current state of the specified directory.

      + DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), + ///

      The operation didn't succeed because an internal error occurred. Try again later.

      + InternalServerException(crate::types::error::InternalServerException), + ///

      The resource couldn't be found.

      + ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

      The limit on the number of requests per second has been exceeded.

      + ThrottlingException(crate::types::error::ThrottlingException), + ///

      The request isn't valid. Review the details in the error message to update the invalid parameters or values in your request.

      + ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-UpdateGroupError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl UpdateGroupError { + /// Creates the `UpdateGroupError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `UpdateGroupError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::DirectoryUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `UpdateGroupError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `UpdateGroupError::ConflictException`. + pub fn is_conflict_exception(&self) -> bool { + matches!(self, Self::ConflictException(_)) + } + /// Returns `true` if the error kind is `UpdateGroupError::DirectoryUnavailableException`. + pub fn is_directory_unavailable_exception(&self) -> bool { + matches!(self, Self::DirectoryUnavailableException(_)) + } + /// Returns `true` if the error kind is `UpdateGroupError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `UpdateGroupError::ResourceNotFoundException`. + pub fn is_resource_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceNotFoundException(_)) + } + /// Returns `true` if the error kind is `UpdateGroupError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `UpdateGroupError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for UpdateGroupError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::ConflictException(_inner) => ::std::option::Option::Some(_inner), + Self::DirectoryUnavailableException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for UpdateGroupError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::ConflictException(_inner) => _inner.fmt(f), + Self::DirectoryUnavailableException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ResourceNotFoundException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for UpdateGroupError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::DirectoryUnavailableException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for UpdateGroupError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::DirectoryUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for UpdateGroupError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::update_group::UpdateGroupError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::update_group::_update_group_output::UpdateGroupOutput; + +pub use crate::operation::update_group::_update_group_input::UpdateGroupInput; + +mod _update_group_input; + +mod _update_group_output; + +/// Builders +pub mod builders; diff --git a/sdk/directoryservicedata/src/operation/update_group/_update_group_input.rs b/sdk/directoryservicedata/src/operation/update_group/_update_group_input.rs new file mode 100644 index 000000000000..17157b580b65 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/update_group/_update_group_input.rs @@ -0,0 +1,212 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct UpdateGroupInput { + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub directory_id: ::std::option::Option<::std::string::String>, + ///

      The name of the group.

      + pub sam_account_name: ::std::option::Option<::std::string::String>, + ///

      The AD group type. For details, see Active Directory security group type.

      + pub group_type: ::std::option::Option, + ///

      The scope of the AD group. For details, see Active Directory security groups.

      + pub group_scope: ::std::option::Option, + ///

      An expression that defines one or more attributes with the data type and the value of each attribute.

      + pub other_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, + ///

      The type of update to be performed. If no value exists for the attribute, use ADD. Otherwise, use REPLACE to change an attribute value or REMOVE to clear the attribute value.

      + pub update_type: ::std::option::Option, + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub client_token: ::std::option::Option<::std::string::String>, +} +impl UpdateGroupInput { + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } + ///

      The name of the group.

      + pub fn sam_account_name(&self) -> ::std::option::Option<&str> { + self.sam_account_name.as_deref() + } + ///

      The AD group type. For details, see Active Directory security group type.

      + pub fn group_type(&self) -> ::std::option::Option<&crate::types::GroupType> { + self.group_type.as_ref() + } + ///

      The scope of the AD group. For details, see Active Directory security groups.

      + pub fn group_scope(&self) -> ::std::option::Option<&crate::types::GroupScope> { + self.group_scope.as_ref() + } + ///

      An expression that defines one or more attributes with the data type and the value of each attribute.

      + pub fn other_attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> { + self.other_attributes.as_ref() + } + ///

      The type of update to be performed. If no value exists for the attribute, use ADD. Otherwise, use REPLACE to change an attribute value or REMOVE to clear the attribute value.

      + pub fn update_type(&self) -> ::std::option::Option<&crate::types::UpdateType> { + self.update_type.as_ref() + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn client_token(&self) -> ::std::option::Option<&str> { + self.client_token.as_deref() + } +} +impl UpdateGroupInput { + /// Creates a new builder-style object to manufacture [`UpdateGroupInput`](crate::operation::update_group::UpdateGroupInput). + pub fn builder() -> crate::operation::update_group::builders::UpdateGroupInputBuilder { + crate::operation::update_group::builders::UpdateGroupInputBuilder::default() + } +} + +/// A builder for [`UpdateGroupInput`](crate::operation::update_group::UpdateGroupInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct UpdateGroupInputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, + pub(crate) sam_account_name: ::std::option::Option<::std::string::String>, + pub(crate) group_type: ::std::option::Option, + pub(crate) group_scope: ::std::option::Option, + pub(crate) other_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, + pub(crate) update_type: ::std::option::Option, + pub(crate) client_token: ::std::option::Option<::std::string::String>, +} +impl UpdateGroupInputBuilder { + ///

      The identifier (ID) of the directory that's associated with the group.

      + /// This field is required. + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + ///

      The name of the group.

      + /// This field is required. + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sam_account_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The name of the group.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sam_account_name = input; + self + } + ///

      The name of the group.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + &self.sam_account_name + } + ///

      The AD group type. For details, see Active Directory security group type.

      + pub fn group_type(mut self, input: crate::types::GroupType) -> Self { + self.group_type = ::std::option::Option::Some(input); + self + } + ///

      The AD group type. For details, see Active Directory security group type.

      + pub fn set_group_type(mut self, input: ::std::option::Option) -> Self { + self.group_type = input; + self + } + ///

      The AD group type. For details, see Active Directory security group type.

      + pub fn get_group_type(&self) -> &::std::option::Option { + &self.group_type + } + ///

      The scope of the AD group. For details, see Active Directory security groups.

      + pub fn group_scope(mut self, input: crate::types::GroupScope) -> Self { + self.group_scope = ::std::option::Option::Some(input); + self + } + ///

      The scope of the AD group. For details, see Active Directory security groups.

      + pub fn set_group_scope(mut self, input: ::std::option::Option) -> Self { + self.group_scope = input; + self + } + ///

      The scope of the AD group. For details, see Active Directory security groups.

      + pub fn get_group_scope(&self) -> &::std::option::Option { + &self.group_scope + } + /// Adds a key-value pair to `other_attributes`. + /// + /// To override the contents of this collection use [`set_other_attributes`](Self::set_other_attributes). + /// + ///

      An expression that defines one or more attributes with the data type and the value of each attribute.

      + pub fn other_attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self { + let mut hash_map = self.other_attributes.unwrap_or_default(); + hash_map.insert(k.into(), v); + self.other_attributes = ::std::option::Option::Some(hash_map); + self + } + ///

      An expression that defines one or more attributes with the data type and the value of each attribute.

      + pub fn set_other_attributes( + mut self, + input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, + ) -> Self { + self.other_attributes = input; + self + } + ///

      An expression that defines one or more attributes with the data type and the value of each attribute.

      + pub fn get_other_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> { + &self.other_attributes + } + ///

      The type of update to be performed. If no value exists for the attribute, use ADD. Otherwise, use REPLACE to change an attribute value or REMOVE to clear the attribute value.

      + pub fn update_type(mut self, input: crate::types::UpdateType) -> Self { + self.update_type = ::std::option::Option::Some(input); + self + } + ///

      The type of update to be performed. If no value exists for the attribute, use ADD. Otherwise, use REPLACE to change an attribute value or REMOVE to clear the attribute value.

      + pub fn set_update_type(mut self, input: ::std::option::Option) -> Self { + self.update_type = input; + self + } + ///

      The type of update to be performed. If no value exists for the attribute, use ADD. Otherwise, use REPLACE to change an attribute value or REMOVE to clear the attribute value.

      + pub fn get_update_type(&self) -> &::std::option::Option { + &self.update_type + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.client_token = ::std::option::Option::Some(input.into()); + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.client_token = input; + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> { + &self.client_token + } + /// Consumes the builder and constructs a [`UpdateGroupInput`](crate::operation::update_group::UpdateGroupInput). + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::operation::update_group::UpdateGroupInput { + directory_id: self.directory_id, + sam_account_name: self.sam_account_name, + group_type: self.group_type, + group_scope: self.group_scope, + other_attributes: self.other_attributes, + update_type: self.update_type, + client_token: self.client_token, + }) + } +} diff --git a/sdk/directoryservicedata/src/operation/update_group/_update_group_output.rs b/sdk/directoryservicedata/src/operation/update_group/_update_group_output.rs new file mode 100644 index 000000000000..d3f3cdd4eee9 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/update_group/_update_group_output.rs @@ -0,0 +1,42 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct UpdateGroupOutput { + _request_id: Option, +} +impl ::aws_types::request_id::RequestId for UpdateGroupOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl UpdateGroupOutput { + /// Creates a new builder-style object to manufacture [`UpdateGroupOutput`](crate::operation::update_group::UpdateGroupOutput). + pub fn builder() -> crate::operation::update_group::builders::UpdateGroupOutputBuilder { + crate::operation::update_group::builders::UpdateGroupOutputBuilder::default() + } +} + +/// A builder for [`UpdateGroupOutput`](crate::operation::update_group::UpdateGroupOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct UpdateGroupOutputBuilder { + _request_id: Option, +} +impl UpdateGroupOutputBuilder { + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`UpdateGroupOutput`](crate::operation::update_group::UpdateGroupOutput). + pub fn build(self) -> crate::operation::update_group::UpdateGroupOutput { + crate::operation::update_group::UpdateGroupOutput { + _request_id: self._request_id, + } + } +} diff --git a/sdk/directoryservicedata/src/operation/update_group/builders.rs b/sdk/directoryservicedata/src/operation/update_group/builders.rs new file mode 100644 index 000000000000..56d0063cfecf --- /dev/null +++ b/sdk/directoryservicedata/src/operation/update_group/builders.rs @@ -0,0 +1,229 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::update_group::_update_group_output::UpdateGroupOutputBuilder; + +pub use crate::operation::update_group::_update_group_input::UpdateGroupInputBuilder; + +impl crate::operation::update_group::builders::UpdateGroupInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::update_group::UpdateGroupOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::update_group::UpdateGroupError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.update_group(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `UpdateGroup`. +/// +///

      Updates group information.

      +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct UpdateGroupFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::update_group::builders::UpdateGroupInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::update_group::UpdateGroupOutput, + crate::operation::update_group::UpdateGroupError, + > for UpdateGroupFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::update_group::UpdateGroupOutput, + crate::operation::update_group::UpdateGroupError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl UpdateGroupFluentBuilder { + /// Creates a new `UpdateGroupFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the UpdateGroup as a reference. + pub fn as_input(&self) -> &crate::operation::update_group::builders::UpdateGroupInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::update_group::UpdateGroupOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::update_group::UpdateGroupError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::update_group::UpdateGroup::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::update_group::UpdateGroup::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::update_group::UpdateGroupOutput, + crate::operation::update_group::UpdateGroupError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.directory_id(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_directory_id(input); + self + } + ///

      The identifier (ID) of the directory that's associated with the group.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_directory_id() + } + ///

      The name of the group.

      + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.sam_account_name(input.into()); + self + } + ///

      The name of the group.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_sam_account_name(input); + self + } + ///

      The name of the group.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_sam_account_name() + } + ///

      The AD group type. For details, see Active Directory security group type.

      + pub fn group_type(mut self, input: crate::types::GroupType) -> Self { + self.inner = self.inner.group_type(input); + self + } + ///

      The AD group type. For details, see Active Directory security group type.

      + pub fn set_group_type(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_group_type(input); + self + } + ///

      The AD group type. For details, see Active Directory security group type.

      + pub fn get_group_type(&self) -> &::std::option::Option { + self.inner.get_group_type() + } + ///

      The scope of the AD group. For details, see Active Directory security groups.

      + pub fn group_scope(mut self, input: crate::types::GroupScope) -> Self { + self.inner = self.inner.group_scope(input); + self + } + ///

      The scope of the AD group. For details, see Active Directory security groups.

      + pub fn set_group_scope(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_group_scope(input); + self + } + ///

      The scope of the AD group. For details, see Active Directory security groups.

      + pub fn get_group_scope(&self) -> &::std::option::Option { + self.inner.get_group_scope() + } + /// + /// Adds a key-value pair to `OtherAttributes`. + /// + /// To override the contents of this collection use [`set_other_attributes`](Self::set_other_attributes). + /// + ///

      An expression that defines one or more attributes with the data type and the value of each attribute.

      + pub fn other_attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self { + self.inner = self.inner.other_attributes(k.into(), v); + self + } + ///

      An expression that defines one or more attributes with the data type and the value of each attribute.

      + pub fn set_other_attributes( + mut self, + input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, + ) -> Self { + self.inner = self.inner.set_other_attributes(input); + self + } + ///

      An expression that defines one or more attributes with the data type and the value of each attribute.

      + pub fn get_other_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> { + self.inner.get_other_attributes() + } + ///

      The type of update to be performed. If no value exists for the attribute, use ADD. Otherwise, use REPLACE to change an attribute value or REMOVE to clear the attribute value.

      + pub fn update_type(mut self, input: crate::types::UpdateType) -> Self { + self.inner = self.inner.update_type(input); + self + } + ///

      The type of update to be performed. If no value exists for the attribute, use ADD. Otherwise, use REPLACE to change an attribute value or REMOVE to clear the attribute value.

      + pub fn set_update_type(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_update_type(input); + self + } + ///

      The type of update to be performed. If no value exists for the attribute, use ADD. Otherwise, use REPLACE to change an attribute value or REMOVE to clear the attribute value.

      + pub fn get_update_type(&self) -> &::std::option::Option { + self.inner.get_update_type() + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.client_token(input.into()); + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_client_token(input); + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_client_token() + } +} diff --git a/sdk/directoryservicedata/src/operation/update_user.rs b/sdk/directoryservicedata/src/operation/update_user.rs new file mode 100644 index 000000000000..bb23de72af0d --- /dev/null +++ b/sdk/directoryservicedata/src/operation/update_user.rs @@ -0,0 +1,447 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Orchestration and serialization glue logic for `UpdateUser`. +#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct UpdateUser; +impl UpdateUser { + /// Creates a new `UpdateUser` + pub fn new() -> Self { + Self + } + pub(crate) async fn orchestrate( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::update_user::UpdateUserInput, + ) -> ::std::result::Result< + crate::operation::update_user::UpdateUserOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::update_user::UpdateUserError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >| { + err.map_service_error(|err| { + err.downcast::() + .expect("correct error type") + }) + }; + let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None) + .await + .map_err(map_err)?; + let output = context.finalize().map_err(map_err)?; + ::std::result::Result::Ok( + output + .downcast::() + .expect("correct output type"), + ) + } + + pub(crate) async fn orchestrate_with_stop_point( + runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + input: crate::operation::update_user::UpdateUserInput, + stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint, + ) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext, + ::aws_smithy_runtime_api::client::result::SdkError< + ::aws_smithy_runtime_api::client::interceptors::context::Error, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input); + ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("directoryservicedata", "UpdateUser", input, runtime_plugins, stop_point) + .await + } + + pub(crate) fn operation_runtime_plugins( + client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, + client_config: &crate::config::Config, + config_override: ::std::option::Option, + ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { + let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); + runtime_plugins = runtime_plugins + .with_operation_plugin(crate::client_idempotency_token::IdempotencyTokenRuntimePlugin::new( + |token_provider, input| { + let input: &mut crate::operation::update_user::UpdateUserInput = input.downcast_mut().expect("correct type"); + if input.client_token.is_none() { + input.client_token = ::std::option::Option::Some(token_provider.make_idempotency_token()); + } + }, + )) + .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![ + ::aws_runtime::auth::sigv4::SCHEME_ID, + ])); + if let ::std::option::Option::Some(config_override) = config_override { + for plugin in config_override.runtime_plugins.iter().cloned() { + runtime_plugins = runtime_plugins.with_operation_plugin(plugin); + } + runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new( + config_override, + client_config.config.clone(), + &client_config.runtime_components, + )); + } + runtime_plugins + } +} +impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateUser { + fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> { + let mut cfg = ::aws_smithy_types::config_bag::Layer::new("UpdateUser"); + + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new( + UpdateUserRequestSerializer, + )); + cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new( + UpdateUserResponseDeserializer, + )); + + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(), + )); + + cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( + "UpdateUser", + "directoryservicedata", + )); + let mut signing_options = ::aws_runtime::auth::SigningOptions::default(); + signing_options.double_uri_encode = true; + signing_options.content_sha256_header = false; + signing_options.normalize_uri_path = true; + signing_options.payload_override = None; + + cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig { + signing_options, + ..::std::default::Default::default() + }); + + ::std::option::Option::Some(cfg.freeze()) + } + + fn runtime_components( + &self, + _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder, + ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { + #[allow(unused_mut)] + let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("UpdateUser") + .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) + .with_interceptor(UpdateUserEndpointParamsInterceptor) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::< + crate::operation::update_user::UpdateUserError, + >::new()) + .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::< + crate::operation::update_user::UpdateUserError, + >::new()) + .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::< + crate::operation::update_user::UpdateUserError, + >::new()); + + ::std::borrow::Cow::Owned(rcb) + } +} + +#[derive(Debug)] +struct UpdateUserResponseDeserializer; +impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateUserResponseDeserializer { + fn deserialize_nonstreaming( + &self, + response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + let (success, status) = (response.status().is_success(), response.status().as_u16()); + let headers = response.headers(); + let body = response.body().bytes().expect("body loaded"); + #[allow(unused_mut)] + let mut force_error = false; + ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response)); + let parse_result = if !success && status != 200 || force_error { + crate::protocol_serde::shape_update_user::de_update_user_http_error(status, headers, body) + } else { + crate::protocol_serde::shape_update_user::de_update_user_http_response(status, headers, body) + }; + crate::protocol_serde::type_erase_result(parse_result) + } +} +#[derive(Debug)] +struct UpdateUserRequestSerializer; +impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for UpdateUserRequestSerializer { + #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)] + fn serialize_input( + &self, + input: ::aws_smithy_runtime_api::client::interceptors::context::Input, + _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> { + let input = input.downcast::().expect("correct type"); + let _header_serialization_settings = _cfg + .load::() + .cloned() + .unwrap_or_default(); + let mut request_builder = { + fn uri_base( + _input: &crate::operation::update_user::UpdateUserInput, + output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + use ::std::fmt::Write as _; + ::std::write!(output, "/Users/UpdateUser").expect("formatting should succeed"); + ::std::result::Result::Ok(()) + } + fn uri_query( + _input: &crate::operation::update_user::UpdateUserInput, + mut output: &mut ::std::string::String, + ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + let mut query = ::aws_smithy_http::query::Writer::new(output); + let inner_1 = &_input.directory_id; + let inner_1 = inner_1 + .as_ref() + .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("directory_id", "cannot be empty or unset"))?; + if inner_1.is_empty() { + return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field( + "directory_id", + "cannot be empty or unset", + )); + } + query.push_kv("DirectoryId", &::aws_smithy_http::query::fmt_string(inner_1)); + ::std::result::Result::Ok(()) + } + #[allow(clippy::unnecessary_wraps)] + fn update_http_builder( + input: &crate::operation::update_user::UpdateUserInput, + builder: ::http::request::Builder, + ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + let mut uri = ::std::string::String::new(); + uri_base(input, &mut uri)?; + uri_query(input, &mut uri)?; + ::std::result::Result::Ok(builder.method("POST").uri(uri)) + } + let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; + builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); + builder + }; + let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_update_user::ser_update_user_input(&input)?); + if let Some(content_length) = body.content_length() { + let content_length = content_length.to_string(); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + } + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) + } +} +#[derive(Debug)] +struct UpdateUserEndpointParamsInterceptor; + +impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateUserEndpointParamsInterceptor { + fn name(&self) -> &'static str { + "UpdateUserEndpointParamsInterceptor" + } + + fn read_before_execution( + &self, + context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef< + '_, + ::aws_smithy_runtime_api::client::interceptors::context::Input, + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::interceptors::context::Error, + >, + cfg: &mut ::aws_smithy_types::config_bag::ConfigBag, + ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> { + let _input = context + .input() + .downcast_ref::() + .ok_or("failed to downcast to UpdateUserInput")?; + + let params = crate::config::endpoint::Params::builder() + .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned())) + .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0)) + .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0)) + .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone())) + .build() + .map_err(|err| { + ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err) + })?; + cfg.interceptor_state() + .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); + ::std::result::Result::Ok(()) + } +} + +// The get_* functions below are generated from JMESPath expressions in the +// operationContextParams trait. They target the operation's input shape. + +/// Error type for the `UpdateUserError` operation. +#[non_exhaustive] +#[derive(::std::fmt::Debug)] +pub enum UpdateUserError { + ///

      You don't have permission to perform the request or access the directory. It can also occur when the DirectoryId doesn't exist or the user, member, or group might be outside of your organizational unit (OU).

      + ///

      Make sure that you have the authentication and authorization to perform the action. Review the directory information in the request, and make sure that the object isn't outside of your OU.

      + AccessDeniedException(crate::types::error::AccessDeniedException), + ///

      This error will occur when you try to create a resource that conflicts with an existing object. It can also occur when adding a member to a group that the member is already in.

      + ///

      This error can be caused by a request sent within the 8-hour idempotency window with the same client token but different input parameters. Client tokens should not be re-used across different requests. After 8 hours, any request with the same client token is treated as a new request.

      + ConflictException(crate::types::error::ConflictException), + ///

      The request could not be completed due to a problem in the configuration or current state of the specified directory.

      + DirectoryUnavailableException(crate::types::error::DirectoryUnavailableException), + ///

      The operation didn't succeed because an internal error occurred. Try again later.

      + InternalServerException(crate::types::error::InternalServerException), + ///

      The resource couldn't be found.

      + ResourceNotFoundException(crate::types::error::ResourceNotFoundException), + ///

      The limit on the number of requests per second has been exceeded.

      + ThrottlingException(crate::types::error::ThrottlingException), + ///

      The request isn't valid. Review the details in the error message to update the invalid parameters or values in your request.

      + ValidationException(crate::types::error::ValidationException), + /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code). + #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \ + variable wildcard pattern and check `.code()`: + \ +    `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }` + \ + See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-UpdateUserError) for what information is available for the error.")] + Unhandled(crate::error::sealed_unhandled::Unhandled), +} +impl UpdateUserError { + /// Creates the `UpdateUserError::Unhandled` variant from any error type. + pub fn unhandled( + err: impl ::std::convert::Into<::std::boxed::Box>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.into(), + meta: ::std::default::Default::default(), + }) + } + + /// Creates the `UpdateUserError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). + pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source: err.clone().into(), + meta: err, + }) + } + /// + /// Returns error metadata, which includes the error code, message, + /// request ID, and potentially additional information. + /// + pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::DirectoryUnavailableException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), + Self::Unhandled(e) => &e.meta, + } + } + /// Returns `true` if the error kind is `UpdateUserError::AccessDeniedException`. + pub fn is_access_denied_exception(&self) -> bool { + matches!(self, Self::AccessDeniedException(_)) + } + /// Returns `true` if the error kind is `UpdateUserError::ConflictException`. + pub fn is_conflict_exception(&self) -> bool { + matches!(self, Self::ConflictException(_)) + } + /// Returns `true` if the error kind is `UpdateUserError::DirectoryUnavailableException`. + pub fn is_directory_unavailable_exception(&self) -> bool { + matches!(self, Self::DirectoryUnavailableException(_)) + } + /// Returns `true` if the error kind is `UpdateUserError::InternalServerException`. + pub fn is_internal_server_exception(&self) -> bool { + matches!(self, Self::InternalServerException(_)) + } + /// Returns `true` if the error kind is `UpdateUserError::ResourceNotFoundException`. + pub fn is_resource_not_found_exception(&self) -> bool { + matches!(self, Self::ResourceNotFoundException(_)) + } + /// Returns `true` if the error kind is `UpdateUserError::ThrottlingException`. + pub fn is_throttling_exception(&self) -> bool { + matches!(self, Self::ThrottlingException(_)) + } + /// Returns `true` if the error kind is `UpdateUserError::ValidationException`. + pub fn is_validation_exception(&self) -> bool { + matches!(self, Self::ValidationException(_)) + } +} +impl ::std::error::Error for UpdateUserError { + fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> { + match self { + Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner), + Self::ConflictException(_inner) => ::std::option::Option::Some(_inner), + Self::DirectoryUnavailableException(_inner) => ::std::option::Option::Some(_inner), + Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner), + Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner), + Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner), + Self::ValidationException(_inner) => ::std::option::Option::Some(_inner), + Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source), + } + } +} +impl ::std::fmt::Display for UpdateUserError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + Self::AccessDeniedException(_inner) => _inner.fmt(f), + Self::ConflictException(_inner) => _inner.fmt(f), + Self::DirectoryUnavailableException(_inner) => _inner.fmt(f), + Self::InternalServerException(_inner) => _inner.fmt(f), + Self::ResourceNotFoundException(_inner) => _inner.fmt(f), + Self::ThrottlingException(_inner) => _inner.fmt(f), + Self::ValidationException(_inner) => _inner.fmt(f), + Self::Unhandled(_inner) => { + if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) { + write!(f, "unhandled error ({code})") + } else { + f.write_str("unhandled error") + } + } + } + } +} +impl ::aws_smithy_types::retry::ProvideErrorKind for UpdateUserError { + fn code(&self) -> ::std::option::Option<&str> { + ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) + } + fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> { + match self { + Self::DirectoryUnavailableException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::InternalServerException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + Self::ThrottlingException(inner) => ::std::option::Option::Some(inner.retryable_error_kind()), + _ => ::std::option::Option::None, + } + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for UpdateUserError { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + match self { + Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::DirectoryUnavailableException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner), + Self::Unhandled(_inner) => &_inner.meta, + } + } +} +impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for UpdateUserError { + fn create_unhandled_error( + source: ::std::boxed::Box, + meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>, + ) -> Self { + Self::Unhandled(crate::error::sealed_unhandled::Unhandled { + source, + meta: meta.unwrap_or_default(), + }) + } +} +impl ::aws_types::request_id::RequestId for crate::operation::update_user::UpdateUserError { + fn request_id(&self) -> Option<&str> { + self.meta().request_id() + } +} + +pub use crate::operation::update_user::_update_user_output::UpdateUserOutput; + +pub use crate::operation::update_user::_update_user_input::UpdateUserInput; + +mod _update_user_input; + +mod _update_user_output; + +/// Builders +pub mod builders; diff --git a/sdk/directoryservicedata/src/operation/update_user/_update_user_input.rs b/sdk/directoryservicedata/src/operation/update_user/_update_user_input.rs new file mode 100644 index 000000000000..a20e625cef99 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/update_user/_update_user_input.rs @@ -0,0 +1,272 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq)] +pub struct UpdateUserInput { + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub directory_id: ::std::option::Option<::std::string::String>, + ///

      The name of the user.

      + pub sam_account_name: ::std::option::Option<::std::string::String>, + ///

      The email address of the user.

      + pub email_address: ::std::option::Option<::std::string::String>, + ///

      The first name of the user.

      + pub given_name: ::std::option::Option<::std::string::String>, + ///

      The last name of the user.

      + pub surname: ::std::option::Option<::std::string::String>, + ///

      An expression that defines one or more attribute names with the data type and value of each attribute. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.

      + ///

      Attribute names are case insensitive.

      + ///
      + pub other_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, + ///

      The type of update to be performed. If no value exists for the attribute, use ADD. Otherwise, use REPLACE to change an attribute value or REMOVE to clear the attribute value.

      + pub update_type: ::std::option::Option, + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub client_token: ::std::option::Option<::std::string::String>, +} +impl UpdateUserInput { + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn directory_id(&self) -> ::std::option::Option<&str> { + self.directory_id.as_deref() + } + ///

      The name of the user.

      + pub fn sam_account_name(&self) -> ::std::option::Option<&str> { + self.sam_account_name.as_deref() + } + ///

      The email address of the user.

      + pub fn email_address(&self) -> ::std::option::Option<&str> { + self.email_address.as_deref() + } + ///

      The first name of the user.

      + pub fn given_name(&self) -> ::std::option::Option<&str> { + self.given_name.as_deref() + } + ///

      The last name of the user.

      + pub fn surname(&self) -> ::std::option::Option<&str> { + self.surname.as_deref() + } + ///

      An expression that defines one or more attribute names with the data type and value of each attribute. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.

      + ///

      Attribute names are case insensitive.

      + ///
      + pub fn other_attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> { + self.other_attributes.as_ref() + } + ///

      The type of update to be performed. If no value exists for the attribute, use ADD. Otherwise, use REPLACE to change an attribute value or REMOVE to clear the attribute value.

      + pub fn update_type(&self) -> ::std::option::Option<&crate::types::UpdateType> { + self.update_type.as_ref() + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn client_token(&self) -> ::std::option::Option<&str> { + self.client_token.as_deref() + } +} +impl ::std::fmt::Debug for UpdateUserInput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("UpdateUserInput"); + formatter.field("directory_id", &self.directory_id); + formatter.field("sam_account_name", &self.sam_account_name); + formatter.field("email_address", &"*** Sensitive Data Redacted ***"); + formatter.field("given_name", &"*** Sensitive Data Redacted ***"); + formatter.field("surname", &"*** Sensitive Data Redacted ***"); + formatter.field("other_attributes", &self.other_attributes); + formatter.field("update_type", &self.update_type); + formatter.field("client_token", &self.client_token); + formatter.finish() + } +} +impl UpdateUserInput { + /// Creates a new builder-style object to manufacture [`UpdateUserInput`](crate::operation::update_user::UpdateUserInput). + pub fn builder() -> crate::operation::update_user::builders::UpdateUserInputBuilder { + crate::operation::update_user::builders::UpdateUserInputBuilder::default() + } +} + +/// A builder for [`UpdateUserInput`](crate::operation::update_user::UpdateUserInput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)] +#[non_exhaustive] +pub struct UpdateUserInputBuilder { + pub(crate) directory_id: ::std::option::Option<::std::string::String>, + pub(crate) sam_account_name: ::std::option::Option<::std::string::String>, + pub(crate) email_address: ::std::option::Option<::std::string::String>, + pub(crate) given_name: ::std::option::Option<::std::string::String>, + pub(crate) surname: ::std::option::Option<::std::string::String>, + pub(crate) other_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, + pub(crate) update_type: ::std::option::Option, + pub(crate) client_token: ::std::option::Option<::std::string::String>, +} +impl UpdateUserInputBuilder { + ///

      The identifier (ID) of the directory that's associated with the user.

      + /// This field is required. + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.directory_id = ::std::option::Option::Some(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.directory_id = input; + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + &self.directory_id + } + ///

      The name of the user.

      + /// This field is required. + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sam_account_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The name of the user.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sam_account_name = input; + self + } + ///

      The name of the user.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + &self.sam_account_name + } + ///

      The email address of the user.

      + pub fn email_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.email_address = ::std::option::Option::Some(input.into()); + self + } + ///

      The email address of the user.

      + pub fn set_email_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.email_address = input; + self + } + ///

      The email address of the user.

      + pub fn get_email_address(&self) -> &::std::option::Option<::std::string::String> { + &self.email_address + } + ///

      The first name of the user.

      + pub fn given_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.given_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The first name of the user.

      + pub fn set_given_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.given_name = input; + self + } + ///

      The first name of the user.

      + pub fn get_given_name(&self) -> &::std::option::Option<::std::string::String> { + &self.given_name + } + ///

      The last name of the user.

      + pub fn surname(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.surname = ::std::option::Option::Some(input.into()); + self + } + ///

      The last name of the user.

      + pub fn set_surname(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.surname = input; + self + } + ///

      The last name of the user.

      + pub fn get_surname(&self) -> &::std::option::Option<::std::string::String> { + &self.surname + } + /// Adds a key-value pair to `other_attributes`. + /// + /// To override the contents of this collection use [`set_other_attributes`](Self::set_other_attributes). + /// + ///

      An expression that defines one or more attribute names with the data type and value of each attribute. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.

      + ///

      Attribute names are case insensitive.

      + ///
      + pub fn other_attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self { + let mut hash_map = self.other_attributes.unwrap_or_default(); + hash_map.insert(k.into(), v); + self.other_attributes = ::std::option::Option::Some(hash_map); + self + } + ///

      An expression that defines one or more attribute names with the data type and value of each attribute. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.

      + ///

      Attribute names are case insensitive.

      + ///
      + pub fn set_other_attributes( + mut self, + input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, + ) -> Self { + self.other_attributes = input; + self + } + ///

      An expression that defines one or more attribute names with the data type and value of each attribute. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.

      + ///

      Attribute names are case insensitive.

      + ///
      + pub fn get_other_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> { + &self.other_attributes + } + ///

      The type of update to be performed. If no value exists for the attribute, use ADD. Otherwise, use REPLACE to change an attribute value or REMOVE to clear the attribute value.

      + pub fn update_type(mut self, input: crate::types::UpdateType) -> Self { + self.update_type = ::std::option::Option::Some(input); + self + } + ///

      The type of update to be performed. If no value exists for the attribute, use ADD. Otherwise, use REPLACE to change an attribute value or REMOVE to clear the attribute value.

      + pub fn set_update_type(mut self, input: ::std::option::Option) -> Self { + self.update_type = input; + self + } + ///

      The type of update to be performed. If no value exists for the attribute, use ADD. Otherwise, use REPLACE to change an attribute value or REMOVE to clear the attribute value.

      + pub fn get_update_type(&self) -> &::std::option::Option { + &self.update_type + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.client_token = ::std::option::Option::Some(input.into()); + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.client_token = input; + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> { + &self.client_token + } + /// Consumes the builder and constructs a [`UpdateUserInput`](crate::operation::update_user::UpdateUserInput). + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::operation::update_user::UpdateUserInput { + directory_id: self.directory_id, + sam_account_name: self.sam_account_name, + email_address: self.email_address, + given_name: self.given_name, + surname: self.surname, + other_attributes: self.other_attributes, + update_type: self.update_type, + client_token: self.client_token, + }) + } +} +impl ::std::fmt::Debug for UpdateUserInputBuilder { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("UpdateUserInputBuilder"); + formatter.field("directory_id", &self.directory_id); + formatter.field("sam_account_name", &self.sam_account_name); + formatter.field("email_address", &"*** Sensitive Data Redacted ***"); + formatter.field("given_name", &"*** Sensitive Data Redacted ***"); + formatter.field("surname", &"*** Sensitive Data Redacted ***"); + formatter.field("other_attributes", &self.other_attributes); + formatter.field("update_type", &self.update_type); + formatter.field("client_token", &self.client_token); + formatter.finish() + } +} diff --git a/sdk/directoryservicedata/src/operation/update_user/_update_user_output.rs b/sdk/directoryservicedata/src/operation/update_user/_update_user_output.rs new file mode 100644 index 000000000000..26e174b3d5a0 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/update_user/_update_user_output.rs @@ -0,0 +1,42 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct UpdateUserOutput { + _request_id: Option, +} +impl ::aws_types::request_id::RequestId for UpdateUserOutput { + fn request_id(&self) -> Option<&str> { + self._request_id.as_deref() + } +} +impl UpdateUserOutput { + /// Creates a new builder-style object to manufacture [`UpdateUserOutput`](crate::operation::update_user::UpdateUserOutput). + pub fn builder() -> crate::operation::update_user::builders::UpdateUserOutputBuilder { + crate::operation::update_user::builders::UpdateUserOutputBuilder::default() + } +} + +/// A builder for [`UpdateUserOutput`](crate::operation::update_user::UpdateUserOutput). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct UpdateUserOutputBuilder { + _request_id: Option, +} +impl UpdateUserOutputBuilder { + pub(crate) fn _request_id(mut self, request_id: impl Into) -> Self { + self._request_id = Some(request_id.into()); + self + } + + pub(crate) fn _set_request_id(&mut self, request_id: Option) -> &mut Self { + self._request_id = request_id; + self + } + /// Consumes the builder and constructs a [`UpdateUserOutput`](crate::operation::update_user::UpdateUserOutput). + pub fn build(self) -> crate::operation::update_user::UpdateUserOutput { + crate::operation::update_user::UpdateUserOutput { + _request_id: self._request_id, + } + } +} diff --git a/sdk/directoryservicedata/src/operation/update_user/builders.rs b/sdk/directoryservicedata/src/operation/update_user/builders.rs new file mode 100644 index 000000000000..9b640cde8ec5 --- /dev/null +++ b/sdk/directoryservicedata/src/operation/update_user/builders.rs @@ -0,0 +1,249 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::operation::update_user::_update_user_output::UpdateUserOutputBuilder; + +pub use crate::operation::update_user::_update_user_input::UpdateUserInputBuilder; + +impl crate::operation::update_user::builders::UpdateUserInputBuilder { + /// Sends a request with this input using the given client. + pub async fn send_with( + self, + client: &crate::Client, + ) -> ::std::result::Result< + crate::operation::update_user::UpdateUserOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::update_user::UpdateUserError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let mut fluent_builder = client.update_user(); + fluent_builder.inner = self; + fluent_builder.send().await + } +} +/// Fluent builder constructing a request to `UpdateUser`. +/// +///

      Updates user information.

      +#[derive(::std::clone::Clone, ::std::fmt::Debug)] +pub struct UpdateUserFluentBuilder { + handle: ::std::sync::Arc, + inner: crate::operation::update_user::builders::UpdateUserInputBuilder, + config_override: ::std::option::Option, +} +impl + crate::client::customize::internal::CustomizableSend< + crate::operation::update_user::UpdateUserOutput, + crate::operation::update_user::UpdateUserError, + > for UpdateUserFluentBuilder +{ + fn send( + self, + config_override: crate::config::Builder, + ) -> crate::client::customize::internal::BoxFuture< + crate::client::customize::internal::SendResult< + crate::operation::update_user::UpdateUserOutput, + crate::operation::update_user::UpdateUserError, + >, + > { + ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await }) + } +} +impl UpdateUserFluentBuilder { + /// Creates a new `UpdateUserFluentBuilder`. + pub(crate) fn new(handle: ::std::sync::Arc) -> Self { + Self { + handle, + inner: ::std::default::Default::default(), + config_override: ::std::option::Option::None, + } + } + /// Access the UpdateUser as a reference. + pub fn as_input(&self) -> &crate::operation::update_user::builders::UpdateUserInputBuilder { + &self.inner + } + /// Sends the request and returns the response. + /// + /// If an error occurs, an `SdkError` will be returned with additional details that + /// can be matched against. + /// + /// By default, any retryable failures will be retried twice. Retry behavior + /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be + /// set when configuring the client. + pub async fn send( + self, + ) -> ::std::result::Result< + crate::operation::update_user::UpdateUserOutput, + ::aws_smithy_runtime_api::client::result::SdkError< + crate::operation::update_user::UpdateUserError, + ::aws_smithy_runtime_api::client::orchestrator::HttpResponse, + >, + > { + let input = self + .inner + .build() + .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?; + let runtime_plugins = crate::operation::update_user::UpdateUser::operation_runtime_plugins( + self.handle.runtime_plugins.clone(), + &self.handle.conf, + self.config_override, + ); + crate::operation::update_user::UpdateUser::orchestrate(&runtime_plugins, input).await + } + + /// Consumes this builder, creating a customizable operation that can be modified before being sent. + pub fn customize( + self, + ) -> crate::client::customize::CustomizableOperation< + crate::operation::update_user::UpdateUserOutput, + crate::operation::update_user::UpdateUserError, + Self, + > { + crate::client::customize::CustomizableOperation::new(self) + } + pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into) -> Self { + self.set_config_override(::std::option::Option::Some(config_override.into())); + self + } + + pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option) -> &mut Self { + self.config_override = config_override; + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn directory_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.directory_id(input.into()); + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn set_directory_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_directory_id(input); + self + } + ///

      The identifier (ID) of the directory that's associated with the user.

      + pub fn get_directory_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_directory_id() + } + ///

      The name of the user.

      + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.sam_account_name(input.into()); + self + } + ///

      The name of the user.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_sam_account_name(input); + self + } + ///

      The name of the user.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_sam_account_name() + } + ///

      The email address of the user.

      + pub fn email_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.email_address(input.into()); + self + } + ///

      The email address of the user.

      + pub fn set_email_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_email_address(input); + self + } + ///

      The email address of the user.

      + pub fn get_email_address(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_email_address() + } + ///

      The first name of the user.

      + pub fn given_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.given_name(input.into()); + self + } + ///

      The first name of the user.

      + pub fn set_given_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_given_name(input); + self + } + ///

      The first name of the user.

      + pub fn get_given_name(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_given_name() + } + ///

      The last name of the user.

      + pub fn surname(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.surname(input.into()); + self + } + ///

      The last name of the user.

      + pub fn set_surname(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_surname(input); + self + } + ///

      The last name of the user.

      + pub fn get_surname(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_surname() + } + /// + /// Adds a key-value pair to `OtherAttributes`. + /// + /// To override the contents of this collection use [`set_other_attributes`](Self::set_other_attributes). + /// + ///

      An expression that defines one or more attribute names with the data type and value of each attribute. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.

      + ///

      Attribute names are case insensitive.

      + ///
      + pub fn other_attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self { + self.inner = self.inner.other_attributes(k.into(), v); + self + } + ///

      An expression that defines one or more attribute names with the data type and value of each attribute. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.

      + ///

      Attribute names are case insensitive.

      + ///
      + pub fn set_other_attributes( + mut self, + input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, + ) -> Self { + self.inner = self.inner.set_other_attributes(input); + self + } + ///

      An expression that defines one or more attribute names with the data type and value of each attribute. A key is an attribute name, and the value is a list of maps. For a list of supported attributes, see Directory Service Data Attributes.

      + ///

      Attribute names are case insensitive.

      + ///
      + pub fn get_other_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> { + self.inner.get_other_attributes() + } + ///

      The type of update to be performed. If no value exists for the attribute, use ADD. Otherwise, use REPLACE to change an attribute value or REMOVE to clear the attribute value.

      + pub fn update_type(mut self, input: crate::types::UpdateType) -> Self { + self.inner = self.inner.update_type(input); + self + } + ///

      The type of update to be performed. If no value exists for the attribute, use ADD. Otherwise, use REPLACE to change an attribute value or REMOVE to clear the attribute value.

      + pub fn set_update_type(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_update_type(input); + self + } + ///

      The type of update to be performed. If no value exists for the attribute, use ADD. Otherwise, use REPLACE to change an attribute value or REMOVE to clear the attribute value.

      + pub fn get_update_type(&self) -> &::std::option::Option { + self.inner.get_update_type() + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.client_token(input.into()); + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_client_token(input); + self + } + ///

      A unique and case-sensitive identifier that you provide to make sure the idempotency of the request, so multiple identical calls have the same effect as one single call.

      + ///

      A client token is valid for 8 hours after the first request that uses it completes. After 8 hours, any request with the same client token is treated as a new request. If the request succeeds, any future uses of that token will be idempotent for another 8 hours.

      + ///

      If you submit a request with the same client token but change one of the other parameters within the 8-hour idempotency window, Directory Service Data returns an ConflictException.

      + ///

      This parameter is optional when using the CLI or SDK.

      + ///
      + pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_client_token() + } +} diff --git a/sdk/directoryservicedata/src/primitives.rs b/sdk/directoryservicedata/src/primitives.rs new file mode 100644 index 000000000000..391aa9d59c9d --- /dev/null +++ b/sdk/directoryservicedata/src/primitives.rs @@ -0,0 +1,6 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// Event stream related primitives such as `Message` or `Header`. +pub mod event_stream; + +pub(crate) mod sealed_enum_unknown; diff --git a/sdk/directoryservicedata/src/primitives/event_stream.rs b/sdk/directoryservicedata/src/primitives/event_stream.rs new file mode 100644 index 000000000000..ddd9e04a924d --- /dev/null +++ b/sdk/directoryservicedata/src/primitives/event_stream.rs @@ -0,0 +1 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. diff --git a/sdk/directoryservicedata/src/primitives/sealed_enum_unknown.rs b/sdk/directoryservicedata/src/primitives/sealed_enum_unknown.rs new file mode 100644 index 000000000000..746e172e83bf --- /dev/null +++ b/sdk/directoryservicedata/src/primitives/sealed_enum_unknown.rs @@ -0,0 +1,21 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// Opaque struct used as inner data for the `Unknown` variant defined in enums in +/// the crate. +/// +/// This is not intended to be used directly. +#[non_exhaustive] +#[derive( + ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash, +)] +pub struct UnknownVariantValue(pub(crate) ::std::string::String); +impl UnknownVariantValue { + pub(crate) fn as_str(&self) -> &str { + &self.0 + } +} +impl ::std::fmt::Display for UnknownVariantValue { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + write!(f, "{}", self.0) + } +} diff --git a/sdk/directoryservicedata/src/protocol_serde.rs b/sdk/directoryservicedata/src/protocol_serde.rs new file mode 100644 index 000000000000..63847639b83f --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde.rs @@ -0,0 +1,140 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn type_erase_result( + result: ::std::result::Result, +) -> ::std::result::Result< + ::aws_smithy_runtime_api::client::interceptors::context::Output, + ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError<::aws_smithy_runtime_api::client::interceptors::context::Error>, +> +where + O: ::std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static, + E: ::std::error::Error + std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static, +{ + result + .map(|output| ::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output)) + .map_err(|error| ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(error)) + .map_err(::std::convert::Into::into) +} + +pub fn parse_http_error_metadata( + _response_status: u16, + response_headers: &::aws_smithy_runtime_api::http::Headers, + response_body: &[u8], +) -> Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> { + crate::json_errors::parse_error_metadata(response_body, response_headers) +} + +pub(crate) mod shape_add_group_member; + +pub(crate) mod shape_create_group; + +pub(crate) mod shape_create_user; + +pub(crate) mod shape_delete_group; + +pub(crate) mod shape_delete_user; + +pub(crate) mod shape_describe_group; + +pub(crate) mod shape_describe_user; + +pub(crate) mod shape_disable_user; + +pub(crate) mod shape_list_group_members; + +pub(crate) mod shape_list_groups; + +pub(crate) mod shape_list_groups_for_member; + +pub(crate) mod shape_list_users; + +pub(crate) mod shape_remove_group_member; + +pub(crate) mod shape_search_groups; + +pub(crate) mod shape_search_users; + +pub(crate) mod shape_update_group; + +pub(crate) mod shape_update_user; + +pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] { + if data.is_empty() { + b"{}" + } else { + data + } +} + +pub(crate) mod shape_access_denied_exception; + +pub(crate) mod shape_add_group_member_input; + +pub(crate) mod shape_conflict_exception; + +pub(crate) mod shape_create_group_input; + +pub(crate) mod shape_create_user_input; + +pub(crate) mod shape_delete_group_input; + +pub(crate) mod shape_delete_user_input; + +pub(crate) mod shape_describe_group_input; + +pub(crate) mod shape_describe_user_input; + +pub(crate) mod shape_directory_unavailable_exception; + +pub(crate) mod shape_disable_user_input; + +pub(crate) mod shape_internal_server_exception; + +pub(crate) mod shape_list_group_members_input; + +pub(crate) mod shape_list_groups_for_member_input; + +pub(crate) mod shape_list_groups_input; + +pub(crate) mod shape_list_users_input; + +pub(crate) mod shape_remove_group_member_input; + +pub(crate) mod shape_resource_not_found_exception; + +pub(crate) mod shape_search_groups_input; + +pub(crate) mod shape_search_users_input; + +pub(crate) mod shape_throttling_exception; + +pub(crate) mod shape_update_group_input; + +pub(crate) mod shape_update_user_input; + +pub(crate) mod shape_validation_exception; + +pub(crate) mod shape_attribute_value; + +pub(crate) mod shape_attributes; + +pub(crate) mod shape_group_list; + +pub(crate) mod shape_group_summary_list; + +pub(crate) mod shape_member_list; + +pub(crate) mod shape_user_list; + +pub(crate) mod shape_user_summary_list; + +pub(crate) mod shape_group; + +pub(crate) mod shape_group_summary; + +pub(crate) mod shape_member; + +pub(crate) mod shape_user; + +pub(crate) mod shape_user_summary; + +pub(crate) mod shape_string_set_attribute_value; diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_access_denied_exception.rs b/sdk/directoryservicedata/src/protocol_serde/shape_access_denied_exception.rs new file mode 100644 index 000000000000..36547269813b --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_access_denied_exception.rs @@ -0,0 +1,43 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_access_denied_exception_json_err( + value: &[u8], + mut builder: crate::types::error::builders::AccessDeniedExceptionBuilder, +) -> Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "Message" => { + builder = builder.set_message( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Reason" => { + builder = builder.set_reason( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::AccessDeniedReason::from(u.as_ref()))) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_add_group_member.rs b/sdk/directoryservicedata/src/protocol_serde/shape_add_group_member.rs new file mode 100644 index 000000000000..7e29161b57d5 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_add_group_member.rs @@ -0,0 +1,158 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_add_group_member_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::add_group_member::AddGroupMemberError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::add_group_member::AddGroupMemberError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "AccessDeniedException" => crate::operation::add_group_member::AddGroupMemberError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::add_group_member::AddGroupMemberError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ConflictException" => crate::operation::add_group_member::AddGroupMemberError::ConflictException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ConflictExceptionBuilder::default(); + output = crate::protocol_serde::shape_conflict_exception::de_conflict_exception_json_err(_response_body, output) + .map_err(crate::operation::add_group_member::AddGroupMemberError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "DirectoryUnavailableException" => crate::operation::add_group_member::AddGroupMemberError::DirectoryUnavailableException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::DirectoryUnavailableExceptionBuilder::default(); + output = + crate::protocol_serde::shape_directory_unavailable_exception::de_directory_unavailable_exception_json_err(_response_body, output) + .map_err(crate::operation::add_group_member::AddGroupMemberError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "InternalServerException" => crate::operation::add_group_member::AddGroupMemberError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::add_group_member::AddGroupMemberError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ResourceNotFoundException" => crate::operation::add_group_member::AddGroupMemberError::ResourceNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output) + .map_err(crate::operation::add_group_member::AddGroupMemberError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ThrottlingException" => crate::operation::add_group_member::AddGroupMemberError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::add_group_member::AddGroupMemberError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::add_group_member::AddGroupMemberError::unhandled( + "Failed to parse RetryAfterSeconds from header `Retry-After", + ) + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::add_group_member::AddGroupMemberError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::add_group_member::AddGroupMemberError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::add_group_member::AddGroupMemberError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + _ => crate::operation::add_group_member::AddGroupMemberError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_add_group_member_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::add_group_member::builders::AddGroupMemberOutputBuilder::default(); + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub fn ser_add_group_member_input( + input: &crate::operation::add_group_member::AddGroupMemberInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_add_group_member_input::ser_add_group_member_input_input(&mut object, input)?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_add_group_member_input.rs b/sdk/directoryservicedata/src/protocol_serde/shape_add_group_member_input.rs new file mode 100644 index 000000000000..b5475ccb4ef9 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_add_group_member_input.rs @@ -0,0 +1,19 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_add_group_member_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::add_group_member::AddGroupMemberInput, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.client_token { + object.key("ClientToken").string(var_1.as_str()); + } + if let Some(var_2) = &input.group_name { + object.key("GroupName").string(var_2.as_str()); + } + if let Some(var_3) = &input.member_name { + object.key("MemberName").string(var_3.as_str()); + } + if let Some(var_4) = &input.member_realm { + object.key("MemberRealm").string(var_4.as_str()); + } + Ok(()) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_attribute_value.rs b/sdk/directoryservicedata/src/protocol_serde/shape_attribute_value.rs new file mode 100644 index 000000000000..d230aa4bcbaf --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_attribute_value.rs @@ -0,0 +1,113 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_attribute_value( + object_8: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::types::AttributeValue, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + match input { + crate::types::AttributeValue::S(inner) => { + object_8.key("S").string(inner.as_str()); + } + crate::types::AttributeValue::N(inner) => { + object_8.key("N").number( + #[allow(clippy::useless_conversion)] + ::aws_smithy_types::Number::NegInt((*inner).into()), + ); + } + crate::types::AttributeValue::Bool(inner) => { + object_8.key("BOOL").boolean(*inner); + } + crate::types::AttributeValue::Ss(inner) => { + let mut array_1 = object_8.key("SS").start_array(); + for item_2 in inner { + { + array_1.value().string(item_2.as_str()); + } + } + array_1.finish(); + } + crate::types::AttributeValue::Unknown => { + return Err(::aws_smithy_types::error::operation::SerializationError::unknown_variant( + "AttributeValue", + )) + } + } + Ok(()) +} + +pub(crate) fn de_attribute_value<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + let mut variant = None; + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { + if let ::std::option::Option::Some(::std::result::Result::Ok(::aws_smithy_json::deserialize::Token::ValueNull { .. })) = + tokens.peek() + { + let _ = tokens.next().expect("peek returned a token")?; + continue; + } + let key = key.to_unescaped()?; + if key == "__type" { + ::aws_smithy_json::deserialize::token::skip_value(tokens)?; + continue; + } + if variant.is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "encountered mixed variants in union", + )); + } + variant = match key.as_ref() { + "S" => Some(crate::types::AttributeValue::S( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()? + .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'S' cannot be null"))?, + )), + "N" => Some(crate::types::AttributeValue::N( + ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())? + .map(i64::try_from) + .transpose()? + .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'N' cannot be null"))?, + )), + "BOOL" => Some(crate::types::AttributeValue::Bool( + ::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())? + .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'BOOL' cannot be null"))?, + )), + "SS" => Some(crate::types::AttributeValue::Ss( + crate::protocol_serde::shape_string_set_attribute_value::de_string_set_attribute_value(tokens)? + .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'SS' cannot be null"))?, + )), + _ => { + ::aws_smithy_json::deserialize::token::skip_value(tokens)?; + Some(crate::types::AttributeValue::Unknown) + } + }; + } + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + }, + _ => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )) + } + } + if variant.is_none() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "Union did not contain a valid variant.", + )); + } + Ok(variant) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_attributes.rs b/sdk/directoryservicedata/src/protocol_serde/shape_attributes.rs new file mode 100644 index 000000000000..b5c66e1ad5f7 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_attributes.rs @@ -0,0 +1,39 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_attributes<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result< + Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, + ::aws_smithy_json::deserialize::error::DeserializeError, +> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + let mut map = ::std::collections::HashMap::new(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => { + let key = key.to_unescaped().map(|u| u.into_owned())?; + let value = crate::protocol_serde::shape_attribute_value::de_attribute_value(tokens)?; + if let Some(value) = value { + map.insert(key, value); + } + } + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(map)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_conflict_exception.rs b/sdk/directoryservicedata/src/protocol_serde/shape_conflict_exception.rs new file mode 100644 index 000000000000..1ab282b013a5 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_conflict_exception.rs @@ -0,0 +1,36 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_conflict_exception_json_err( + value: &[u8], + mut builder: crate::types::error::builders::ConflictExceptionBuilder, +) -> Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "Message" => { + builder = builder.set_message( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_create_group.rs b/sdk/directoryservicedata/src/protocol_serde/shape_create_group.rs new file mode 100644 index 000000000000..1b1735609d15 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_create_group.rs @@ -0,0 +1,193 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_create_group_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::create_group::CreateGroupError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::create_group::CreateGroupError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "AccessDeniedException" => crate::operation::create_group::CreateGroupError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::create_group::CreateGroupError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ConflictException" => crate::operation::create_group::CreateGroupError::ConflictException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ConflictExceptionBuilder::default(); + output = crate::protocol_serde::shape_conflict_exception::de_conflict_exception_json_err(_response_body, output) + .map_err(crate::operation::create_group::CreateGroupError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "DirectoryUnavailableException" => crate::operation::create_group::CreateGroupError::DirectoryUnavailableException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::DirectoryUnavailableExceptionBuilder::default(); + output = + crate::protocol_serde::shape_directory_unavailable_exception::de_directory_unavailable_exception_json_err(_response_body, output) + .map_err(crate::operation::create_group::CreateGroupError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "InternalServerException" => crate::operation::create_group::CreateGroupError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::create_group::CreateGroupError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ThrottlingException" => crate::operation::create_group::CreateGroupError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::create_group::CreateGroupError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::create_group::CreateGroupError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After") + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::create_group::CreateGroupError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::create_group::CreateGroupError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::create_group::CreateGroupError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + _ => crate::operation::create_group::CreateGroupError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_create_group_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::create_group::builders::CreateGroupOutputBuilder::default(); + output = crate::protocol_serde::shape_create_group::de_create_group(_response_body, output) + .map_err(crate::operation::create_group::CreateGroupError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub fn ser_create_group_input( + input: &crate::operation::create_group::CreateGroupInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_create_group_input::ser_create_group_input_input(&mut object, input)?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} + +pub(crate) fn de_create_group( + value: &[u8], + mut builder: crate::operation::create_group::builders::CreateGroupOutputBuilder, +) -> Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "DirectoryId" => { + builder = builder.set_directory_id( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "SAMAccountName" => { + builder = builder.set_sam_account_name( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "SID" => { + builder = builder.set_sid( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_create_group_input.rs b/sdk/directoryservicedata/src/protocol_serde/shape_create_group_input.rs new file mode 100644 index 000000000000..cce1d729c24b --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_create_group_input.rs @@ -0,0 +1,32 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_create_group_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::create_group::CreateGroupInput, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.client_token { + object.key("ClientToken").string(var_1.as_str()); + } + if let Some(var_2) = &input.group_scope { + object.key("GroupScope").string(var_2.as_str()); + } + if let Some(var_3) = &input.group_type { + object.key("GroupType").string(var_3.as_str()); + } + if let Some(var_4) = &input.other_attributes { + #[allow(unused_mut)] + let mut object_5 = object.key("OtherAttributes").start_object(); + for (key_6, value_7) in var_4 { + { + #[allow(unused_mut)] + let mut object_8 = object_5.key(key_6.as_str()).start_object(); + crate::protocol_serde::shape_attribute_value::ser_attribute_value(&mut object_8, value_7)?; + object_8.finish(); + } + } + object_5.finish(); + } + if let Some(var_9) = &input.sam_account_name { + object.key("SAMAccountName").string(var_9.as_str()); + } + Ok(()) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_create_user.rs b/sdk/directoryservicedata/src/protocol_serde/shape_create_user.rs new file mode 100644 index 000000000000..f1584b47cce1 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_create_user.rs @@ -0,0 +1,193 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_create_user_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::create_user::CreateUserError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::create_user::CreateUserError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "AccessDeniedException" => crate::operation::create_user::CreateUserError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::create_user::CreateUserError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ConflictException" => crate::operation::create_user::CreateUserError::ConflictException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ConflictExceptionBuilder::default(); + output = crate::protocol_serde::shape_conflict_exception::de_conflict_exception_json_err(_response_body, output) + .map_err(crate::operation::create_user::CreateUserError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "DirectoryUnavailableException" => crate::operation::create_user::CreateUserError::DirectoryUnavailableException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::DirectoryUnavailableExceptionBuilder::default(); + output = + crate::protocol_serde::shape_directory_unavailable_exception::de_directory_unavailable_exception_json_err(_response_body, output) + .map_err(crate::operation::create_user::CreateUserError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "InternalServerException" => crate::operation::create_user::CreateUserError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::create_user::CreateUserError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ThrottlingException" => crate::operation::create_user::CreateUserError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::create_user::CreateUserError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::create_user::CreateUserError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After") + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::create_user::CreateUserError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::create_user::CreateUserError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::create_user::CreateUserError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + _ => crate::operation::create_user::CreateUserError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_create_user_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::create_user::builders::CreateUserOutputBuilder::default(); + output = crate::protocol_serde::shape_create_user::de_create_user(_response_body, output) + .map_err(crate::operation::create_user::CreateUserError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub fn ser_create_user_input( + input: &crate::operation::create_user::CreateUserInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_create_user_input::ser_create_user_input_input(&mut object, input)?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} + +pub(crate) fn de_create_user( + value: &[u8], + mut builder: crate::operation::create_user::builders::CreateUserOutputBuilder, +) -> Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "DirectoryId" => { + builder = builder.set_directory_id( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "SAMAccountName" => { + builder = builder.set_sam_account_name( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "SID" => { + builder = builder.set_sid( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_create_user_input.rs b/sdk/directoryservicedata/src/protocol_serde/shape_create_user_input.rs new file mode 100644 index 000000000000..ba6be749427a --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_create_user_input.rs @@ -0,0 +1,35 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_create_user_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::create_user::CreateUserInput, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.client_token { + object.key("ClientToken").string(var_1.as_str()); + } + if let Some(var_2) = &input.email_address { + object.key("EmailAddress").string(var_2.as_str()); + } + if let Some(var_3) = &input.given_name { + object.key("GivenName").string(var_3.as_str()); + } + if let Some(var_4) = &input.other_attributes { + #[allow(unused_mut)] + let mut object_5 = object.key("OtherAttributes").start_object(); + for (key_6, value_7) in var_4 { + { + #[allow(unused_mut)] + let mut object_8 = object_5.key(key_6.as_str()).start_object(); + crate::protocol_serde::shape_attribute_value::ser_attribute_value(&mut object_8, value_7)?; + object_8.finish(); + } + } + object_5.finish(); + } + if let Some(var_9) = &input.sam_account_name { + object.key("SAMAccountName").string(var_9.as_str()); + } + if let Some(var_10) = &input.surname { + object.key("Surname").string(var_10.as_str()); + } + Ok(()) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_delete_group.rs b/sdk/directoryservicedata/src/protocol_serde/shape_delete_group.rs new file mode 100644 index 000000000000..0537b73868f4 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_delete_group.rs @@ -0,0 +1,156 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_delete_group_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::delete_group::DeleteGroupError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::delete_group::DeleteGroupError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "AccessDeniedException" => crate::operation::delete_group::DeleteGroupError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::delete_group::DeleteGroupError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ConflictException" => crate::operation::delete_group::DeleteGroupError::ConflictException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ConflictExceptionBuilder::default(); + output = crate::protocol_serde::shape_conflict_exception::de_conflict_exception_json_err(_response_body, output) + .map_err(crate::operation::delete_group::DeleteGroupError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "DirectoryUnavailableException" => crate::operation::delete_group::DeleteGroupError::DirectoryUnavailableException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::DirectoryUnavailableExceptionBuilder::default(); + output = + crate::protocol_serde::shape_directory_unavailable_exception::de_directory_unavailable_exception_json_err(_response_body, output) + .map_err(crate::operation::delete_group::DeleteGroupError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "InternalServerException" => crate::operation::delete_group::DeleteGroupError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::delete_group::DeleteGroupError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ResourceNotFoundException" => crate::operation::delete_group::DeleteGroupError::ResourceNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output) + .map_err(crate::operation::delete_group::DeleteGroupError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ThrottlingException" => crate::operation::delete_group::DeleteGroupError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::delete_group::DeleteGroupError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::delete_group::DeleteGroupError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After") + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::delete_group::DeleteGroupError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::delete_group::DeleteGroupError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::delete_group::DeleteGroupError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + _ => crate::operation::delete_group::DeleteGroupError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_delete_group_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::delete_group::builders::DeleteGroupOutputBuilder::default(); + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub fn ser_delete_group_input( + input: &crate::operation::delete_group::DeleteGroupInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_delete_group_input::ser_delete_group_input_input(&mut object, input)?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_delete_group_input.rs b/sdk/directoryservicedata/src/protocol_serde/shape_delete_group_input.rs new file mode 100644 index 000000000000..aeff3f8a50b5 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_delete_group_input.rs @@ -0,0 +1,13 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_delete_group_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::delete_group::DeleteGroupInput, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.client_token { + object.key("ClientToken").string(var_1.as_str()); + } + if let Some(var_2) = &input.sam_account_name { + object.key("SAMAccountName").string(var_2.as_str()); + } + Ok(()) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_delete_user.rs b/sdk/directoryservicedata/src/protocol_serde/shape_delete_user.rs new file mode 100644 index 000000000000..756adcc90efa --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_delete_user.rs @@ -0,0 +1,156 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_delete_user_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::delete_user::DeleteUserError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::delete_user::DeleteUserError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "AccessDeniedException" => crate::operation::delete_user::DeleteUserError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::delete_user::DeleteUserError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ConflictException" => crate::operation::delete_user::DeleteUserError::ConflictException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ConflictExceptionBuilder::default(); + output = crate::protocol_serde::shape_conflict_exception::de_conflict_exception_json_err(_response_body, output) + .map_err(crate::operation::delete_user::DeleteUserError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "DirectoryUnavailableException" => crate::operation::delete_user::DeleteUserError::DirectoryUnavailableException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::DirectoryUnavailableExceptionBuilder::default(); + output = + crate::protocol_serde::shape_directory_unavailable_exception::de_directory_unavailable_exception_json_err(_response_body, output) + .map_err(crate::operation::delete_user::DeleteUserError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "InternalServerException" => crate::operation::delete_user::DeleteUserError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::delete_user::DeleteUserError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ResourceNotFoundException" => crate::operation::delete_user::DeleteUserError::ResourceNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output) + .map_err(crate::operation::delete_user::DeleteUserError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ThrottlingException" => crate::operation::delete_user::DeleteUserError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::delete_user::DeleteUserError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::delete_user::DeleteUserError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After") + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::delete_user::DeleteUserError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::delete_user::DeleteUserError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::delete_user::DeleteUserError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + _ => crate::operation::delete_user::DeleteUserError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_delete_user_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::delete_user::builders::DeleteUserOutputBuilder::default(); + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub fn ser_delete_user_input( + input: &crate::operation::delete_user::DeleteUserInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_delete_user_input::ser_delete_user_input_input(&mut object, input)?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_delete_user_input.rs b/sdk/directoryservicedata/src/protocol_serde/shape_delete_user_input.rs new file mode 100644 index 000000000000..3706771bc351 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_delete_user_input.rs @@ -0,0 +1,13 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_delete_user_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::delete_user::DeleteUserInput, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.client_token { + object.key("ClientToken").string(var_1.as_str()); + } + if let Some(var_2) = &input.sam_account_name { + object.key("SAMAccountName").string(var_2.as_str()); + } + Ok(()) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_describe_group.rs b/sdk/directoryservicedata/src/protocol_serde/shape_describe_group.rs new file mode 100644 index 000000000000..3b4ecd8592d2 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_describe_group.rs @@ -0,0 +1,224 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_describe_group_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::describe_group::DescribeGroupError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::describe_group::DescribeGroupError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "AccessDeniedException" => crate::operation::describe_group::DescribeGroupError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::describe_group::DescribeGroupError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "DirectoryUnavailableException" => crate::operation::describe_group::DescribeGroupError::DirectoryUnavailableException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::DirectoryUnavailableExceptionBuilder::default(); + output = + crate::protocol_serde::shape_directory_unavailable_exception::de_directory_unavailable_exception_json_err(_response_body, output) + .map_err(crate::operation::describe_group::DescribeGroupError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "InternalServerException" => crate::operation::describe_group::DescribeGroupError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::describe_group::DescribeGroupError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ResourceNotFoundException" => crate::operation::describe_group::DescribeGroupError::ResourceNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output) + .map_err(crate::operation::describe_group::DescribeGroupError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ThrottlingException" => crate::operation::describe_group::DescribeGroupError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::describe_group::DescribeGroupError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::describe_group::DescribeGroupError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After") + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::describe_group::DescribeGroupError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::describe_group::DescribeGroupError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::describe_group::DescribeGroupError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + _ => crate::operation::describe_group::DescribeGroupError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_describe_group_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::describe_group::builders::DescribeGroupOutputBuilder::default(); + output = crate::protocol_serde::shape_describe_group::de_describe_group(_response_body, output) + .map_err(crate::operation::describe_group::DescribeGroupError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub fn ser_describe_group_input( + input: &crate::operation::describe_group::DescribeGroupInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_describe_group_input::ser_describe_group_input_input(&mut object, input)?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} + +pub(crate) fn de_describe_group( + value: &[u8], + mut builder: crate::operation::describe_group::builders::DescribeGroupOutputBuilder, +) -> Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "DirectoryId" => { + builder = builder.set_directory_id( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "DistinguishedName" => { + builder = builder.set_distinguished_name( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "GroupScope" => { + builder = builder.set_group_scope( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::GroupScope::from(u.as_ref()))) + .transpose()?, + ); + } + "GroupType" => { + builder = builder.set_group_type( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::GroupType::from(u.as_ref()))) + .transpose()?, + ); + } + "OtherAttributes" => { + builder = builder.set_other_attributes(crate::protocol_serde::shape_attributes::de_attributes(tokens)?); + } + "Realm" => { + builder = builder.set_realm( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "SAMAccountName" => { + builder = builder.set_sam_account_name( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "SID" => { + builder = builder.set_sid( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_describe_group_input.rs b/sdk/directoryservicedata/src/protocol_serde/shape_describe_group_input.rs new file mode 100644 index 000000000000..da969c57009b --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_describe_group_input.rs @@ -0,0 +1,22 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_describe_group_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::describe_group::DescribeGroupInput, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.other_attributes { + let mut array_2 = object.key("OtherAttributes").start_array(); + for item_3 in var_1 { + { + array_2.value().string(item_3.as_str()); + } + } + array_2.finish(); + } + if let Some(var_4) = &input.realm { + object.key("Realm").string(var_4.as_str()); + } + if let Some(var_5) = &input.sam_account_name { + object.key("SAMAccountName").string(var_5.as_str()); + } + Ok(()) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_describe_user.rs b/sdk/directoryservicedata/src/protocol_serde/shape_describe_user.rs new file mode 100644 index 000000000000..1b233053859b --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_describe_user.rs @@ -0,0 +1,241 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_describe_user_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::describe_user::DescribeUserError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::describe_user::DescribeUserError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "AccessDeniedException" => crate::operation::describe_user::DescribeUserError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::describe_user::DescribeUserError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "DirectoryUnavailableException" => crate::operation::describe_user::DescribeUserError::DirectoryUnavailableException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::DirectoryUnavailableExceptionBuilder::default(); + output = + crate::protocol_serde::shape_directory_unavailable_exception::de_directory_unavailable_exception_json_err(_response_body, output) + .map_err(crate::operation::describe_user::DescribeUserError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "InternalServerException" => crate::operation::describe_user::DescribeUserError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::describe_user::DescribeUserError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ResourceNotFoundException" => crate::operation::describe_user::DescribeUserError::ResourceNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output) + .map_err(crate::operation::describe_user::DescribeUserError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ThrottlingException" => crate::operation::describe_user::DescribeUserError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::describe_user::DescribeUserError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::describe_user::DescribeUserError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After") + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::describe_user::DescribeUserError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::describe_user::DescribeUserError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::describe_user::DescribeUserError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + _ => crate::operation::describe_user::DescribeUserError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_describe_user_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::describe_user::builders::DescribeUserOutputBuilder::default(); + output = crate::protocol_serde::shape_describe_user::de_describe_user(_response_body, output) + .map_err(crate::operation::describe_user::DescribeUserError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub fn ser_describe_user_input( + input: &crate::operation::describe_user::DescribeUserInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_describe_user_input::ser_describe_user_input_input(&mut object, input)?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} + +pub(crate) fn de_describe_user( + value: &[u8], + mut builder: crate::operation::describe_user::builders::DescribeUserOutputBuilder, +) -> Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "DirectoryId" => { + builder = builder.set_directory_id( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "DistinguishedName" => { + builder = builder.set_distinguished_name( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "EmailAddress" => { + builder = builder.set_email_address( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Enabled" => { + builder = builder.set_enabled(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?); + } + "GivenName" => { + builder = builder.set_given_name( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "OtherAttributes" => { + builder = builder.set_other_attributes(crate::protocol_serde::shape_attributes::de_attributes(tokens)?); + } + "Realm" => { + builder = builder.set_realm( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "SAMAccountName" => { + builder = builder.set_sam_account_name( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "SID" => { + builder = builder.set_sid( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Surname" => { + builder = builder.set_surname( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "UserPrincipalName" => { + builder = builder.set_user_principal_name( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_describe_user_input.rs b/sdk/directoryservicedata/src/protocol_serde/shape_describe_user_input.rs new file mode 100644 index 000000000000..3ba27f30f531 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_describe_user_input.rs @@ -0,0 +1,22 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_describe_user_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::describe_user::DescribeUserInput, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.other_attributes { + let mut array_2 = object.key("OtherAttributes").start_array(); + for item_3 in var_1 { + { + array_2.value().string(item_3.as_str()); + } + } + array_2.finish(); + } + if let Some(var_4) = &input.realm { + object.key("Realm").string(var_4.as_str()); + } + if let Some(var_5) = &input.sam_account_name { + object.key("SAMAccountName").string(var_5.as_str()); + } + Ok(()) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_directory_unavailable_exception.rs b/sdk/directoryservicedata/src/protocol_serde/shape_directory_unavailable_exception.rs new file mode 100644 index 000000000000..0783d813d244 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_directory_unavailable_exception.rs @@ -0,0 +1,43 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_directory_unavailable_exception_json_err( + value: &[u8], + mut builder: crate::types::error::builders::DirectoryUnavailableExceptionBuilder, +) -> Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "Message" => { + builder = builder.set_message( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Reason" => { + builder = builder.set_reason( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::DirectoryUnavailableReason::from(u.as_ref()))) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_disable_user.rs b/sdk/directoryservicedata/src/protocol_serde/shape_disable_user.rs new file mode 100644 index 000000000000..ca95ddce1382 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_disable_user.rs @@ -0,0 +1,156 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_disable_user_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::disable_user::DisableUserError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::disable_user::DisableUserError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "AccessDeniedException" => crate::operation::disable_user::DisableUserError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::disable_user::DisableUserError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ConflictException" => crate::operation::disable_user::DisableUserError::ConflictException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ConflictExceptionBuilder::default(); + output = crate::protocol_serde::shape_conflict_exception::de_conflict_exception_json_err(_response_body, output) + .map_err(crate::operation::disable_user::DisableUserError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "DirectoryUnavailableException" => crate::operation::disable_user::DisableUserError::DirectoryUnavailableException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::DirectoryUnavailableExceptionBuilder::default(); + output = + crate::protocol_serde::shape_directory_unavailable_exception::de_directory_unavailable_exception_json_err(_response_body, output) + .map_err(crate::operation::disable_user::DisableUserError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "InternalServerException" => crate::operation::disable_user::DisableUserError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::disable_user::DisableUserError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ResourceNotFoundException" => crate::operation::disable_user::DisableUserError::ResourceNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output) + .map_err(crate::operation::disable_user::DisableUserError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ThrottlingException" => crate::operation::disable_user::DisableUserError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::disable_user::DisableUserError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::disable_user::DisableUserError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After") + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::disable_user::DisableUserError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::disable_user::DisableUserError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::disable_user::DisableUserError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + _ => crate::operation::disable_user::DisableUserError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_disable_user_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::disable_user::builders::DisableUserOutputBuilder::default(); + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub fn ser_disable_user_input( + input: &crate::operation::disable_user::DisableUserInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_disable_user_input::ser_disable_user_input_input(&mut object, input)?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_disable_user_input.rs b/sdk/directoryservicedata/src/protocol_serde/shape_disable_user_input.rs new file mode 100644 index 000000000000..805b14d3dc69 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_disable_user_input.rs @@ -0,0 +1,13 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_disable_user_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::disable_user::DisableUserInput, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.client_token { + object.key("ClientToken").string(var_1.as_str()); + } + if let Some(var_2) = &input.sam_account_name { + object.key("SAMAccountName").string(var_2.as_str()); + } + Ok(()) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_group.rs b/sdk/directoryservicedata/src/protocol_serde/shape_group.rs new file mode 100644 index 000000000000..ba8ee9718f5b --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_group.rs @@ -0,0 +1,73 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_group<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = crate::types::builders::GroupBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "SID" => { + builder = builder.set_sid( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "SAMAccountName" => { + builder = builder.set_sam_account_name( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "DistinguishedName" => { + builder = builder.set_distinguished_name( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "GroupType" => { + builder = builder.set_group_type( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::GroupType::from(u.as_ref()))) + .transpose()?, + ); + } + "GroupScope" => { + builder = builder.set_group_scope( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::GroupScope::from(u.as_ref()))) + .transpose()?, + ); + } + "OtherAttributes" => { + builder = builder.set_other_attributes(crate::protocol_serde::shape_attributes::de_attributes(tokens)?); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(crate::serde_util::group_correct_errors(builder).build().map_err(|err| { + ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err) + })?)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_group_list.rs b/sdk/directoryservicedata/src/protocol_serde/shape_group_list.rs new file mode 100644 index 000000000000..8c0a80e5cbeb --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_group_list.rs @@ -0,0 +1,32 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_group_list<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { + let mut items = Vec::new(); + loop { + match tokens.peek() { + Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => { + tokens.next().transpose().unwrap(); + break; + } + _ => { + let value = crate::protocol_serde::shape_group::de_group(tokens)?; + if let Some(value) = value { + items.push(value); + } + } + } + } + Ok(Some(items)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start array or null", + )), + } +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_group_summary.rs b/sdk/directoryservicedata/src/protocol_serde/shape_group_summary.rs new file mode 100644 index 000000000000..39835ae3e0cb --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_group_summary.rs @@ -0,0 +1,63 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_group_summary<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = crate::types::builders::GroupSummaryBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "SID" => { + builder = builder.set_sid( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "SAMAccountName" => { + builder = builder.set_sam_account_name( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "GroupType" => { + builder = builder.set_group_type( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::GroupType::from(u.as_ref()))) + .transpose()?, + ); + } + "GroupScope" => { + builder = builder.set_group_scope( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::GroupScope::from(u.as_ref()))) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(crate::serde_util::group_summary_correct_errors(builder).build().map_err(|err| { + ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err) + })?)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_group_summary_list.rs b/sdk/directoryservicedata/src/protocol_serde/shape_group_summary_list.rs new file mode 100644 index 000000000000..67880a1c3344 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_group_summary_list.rs @@ -0,0 +1,32 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_group_summary_list<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { + let mut items = Vec::new(); + loop { + match tokens.peek() { + Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => { + tokens.next().transpose().unwrap(); + break; + } + _ => { + let value = crate::protocol_serde::shape_group_summary::de_group_summary(tokens)?; + if let Some(value) = value { + items.push(value); + } + } + } + } + Ok(Some(items)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start array or null", + )), + } +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_internal_server_exception.rs b/sdk/directoryservicedata/src/protocol_serde/shape_internal_server_exception.rs new file mode 100644 index 000000000000..ccee1272909b --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_internal_server_exception.rs @@ -0,0 +1,36 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_internal_server_exception_json_err( + value: &[u8], + mut builder: crate::types::error::builders::InternalServerExceptionBuilder, +) -> Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "Message" => { + builder = builder.set_message( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_list_group_members.rs b/sdk/directoryservicedata/src/protocol_serde/shape_list_group_members.rs new file mode 100644 index 000000000000..5d1cdbaadf31 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_list_group_members.rs @@ -0,0 +1,205 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_list_group_members_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::list_group_members::ListGroupMembersError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::list_group_members::ListGroupMembersError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "AccessDeniedException" => crate::operation::list_group_members::ListGroupMembersError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::list_group_members::ListGroupMembersError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "DirectoryUnavailableException" => crate::operation::list_group_members::ListGroupMembersError::DirectoryUnavailableException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::DirectoryUnavailableExceptionBuilder::default(); + output = + crate::protocol_serde::shape_directory_unavailable_exception::de_directory_unavailable_exception_json_err(_response_body, output) + .map_err(crate::operation::list_group_members::ListGroupMembersError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "InternalServerException" => crate::operation::list_group_members::ListGroupMembersError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::list_group_members::ListGroupMembersError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ResourceNotFoundException" => crate::operation::list_group_members::ListGroupMembersError::ResourceNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output) + .map_err(crate::operation::list_group_members::ListGroupMembersError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ThrottlingException" => crate::operation::list_group_members::ListGroupMembersError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::list_group_members::ListGroupMembersError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::list_group_members::ListGroupMembersError::unhandled( + "Failed to parse RetryAfterSeconds from header `Retry-After", + ) + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_group_members::ListGroupMembersError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::list_group_members::ListGroupMembersError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::list_group_members::ListGroupMembersError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + _ => crate::operation::list_group_members::ListGroupMembersError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_list_group_members_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::list_group_members::builders::ListGroupMembersOutputBuilder::default(); + output = crate::protocol_serde::shape_list_group_members::de_list_group_members(_response_body, output) + .map_err(crate::operation::list_group_members::ListGroupMembersError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub fn ser_list_group_members_input( + input: &crate::operation::list_group_members::ListGroupMembersInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_list_group_members_input::ser_list_group_members_input_input(&mut object, input)?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} + +pub(crate) fn de_list_group_members( + value: &[u8], + mut builder: crate::operation::list_group_members::builders::ListGroupMembersOutputBuilder, +) -> Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "DirectoryId" => { + builder = builder.set_directory_id( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "MemberRealm" => { + builder = builder.set_member_realm( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Members" => { + builder = builder.set_members(crate::protocol_serde::shape_member_list::de_member_list(tokens)?); + } + "NextToken" => { + builder = builder.set_next_token( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Realm" => { + builder = builder.set_realm( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_list_group_members_input.rs b/sdk/directoryservicedata/src/protocol_serde/shape_list_group_members_input.rs new file mode 100644 index 000000000000..1796b2c664b2 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_list_group_members_input.rs @@ -0,0 +1,25 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_list_group_members_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::list_group_members::ListGroupMembersInput, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.max_results { + object.key("MaxResults").number( + #[allow(clippy::useless_conversion)] + ::aws_smithy_types::Number::NegInt((*var_1).into()), + ); + } + if let Some(var_2) = &input.member_realm { + object.key("MemberRealm").string(var_2.as_str()); + } + if let Some(var_3) = &input.next_token { + object.key("NextToken").string(var_3.as_str()); + } + if let Some(var_4) = &input.realm { + object.key("Realm").string(var_4.as_str()); + } + if let Some(var_5) = &input.sam_account_name { + object.key("SAMAccountName").string(var_5.as_str()); + } + Ok(()) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_list_groups.rs b/sdk/directoryservicedata/src/protocol_serde/shape_list_groups.rs new file mode 100644 index 000000000000..93a47cf5085c --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_list_groups.rs @@ -0,0 +1,181 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_list_groups_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::list_groups::ListGroupsError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::list_groups::ListGroupsError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "AccessDeniedException" => crate::operation::list_groups::ListGroupsError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::list_groups::ListGroupsError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "DirectoryUnavailableException" => crate::operation::list_groups::ListGroupsError::DirectoryUnavailableException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::DirectoryUnavailableExceptionBuilder::default(); + output = + crate::protocol_serde::shape_directory_unavailable_exception::de_directory_unavailable_exception_json_err(_response_body, output) + .map_err(crate::operation::list_groups::ListGroupsError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "InternalServerException" => crate::operation::list_groups::ListGroupsError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::list_groups::ListGroupsError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ThrottlingException" => crate::operation::list_groups::ListGroupsError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::list_groups::ListGroupsError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::list_groups::ListGroupsError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After") + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_groups::ListGroupsError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::list_groups::ListGroupsError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::list_groups::ListGroupsError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + _ => crate::operation::list_groups::ListGroupsError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_list_groups_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::list_groups::builders::ListGroupsOutputBuilder::default(); + output = crate::protocol_serde::shape_list_groups::de_list_groups(_response_body, output) + .map_err(crate::operation::list_groups::ListGroupsError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub fn ser_list_groups_input( + input: &crate::operation::list_groups::ListGroupsInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_list_groups_input::ser_list_groups_input_input(&mut object, input)?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} + +pub(crate) fn de_list_groups( + value: &[u8], + mut builder: crate::operation::list_groups::builders::ListGroupsOutputBuilder, +) -> Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "DirectoryId" => { + builder = builder.set_directory_id( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Groups" => { + builder = builder.set_groups(crate::protocol_serde::shape_group_summary_list::de_group_summary_list(tokens)?); + } + "NextToken" => { + builder = builder.set_next_token( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Realm" => { + builder = builder.set_realm( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_list_groups_for_member.rs b/sdk/directoryservicedata/src/protocol_serde/shape_list_groups_for_member.rs new file mode 100644 index 000000000000..bcfef2060385 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_list_groups_for_member.rs @@ -0,0 +1,214 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_list_groups_for_member_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::list_groups_for_member::ListGroupsForMemberOutput, + crate::operation::list_groups_for_member::ListGroupsForMemberError, +> { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::list_groups_for_member::ListGroupsForMemberError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::list_groups_for_member::ListGroupsForMemberError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "AccessDeniedException" => crate::operation::list_groups_for_member::ListGroupsForMemberError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::list_groups_for_member::ListGroupsForMemberError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "DirectoryUnavailableException" => crate::operation::list_groups_for_member::ListGroupsForMemberError::DirectoryUnavailableException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::DirectoryUnavailableExceptionBuilder::default(); + output = + crate::protocol_serde::shape_directory_unavailable_exception::de_directory_unavailable_exception_json_err(_response_body, output) + .map_err(crate::operation::list_groups_for_member::ListGroupsForMemberError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "InternalServerException" => crate::operation::list_groups_for_member::ListGroupsForMemberError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::list_groups_for_member::ListGroupsForMemberError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ResourceNotFoundException" => crate::operation::list_groups_for_member::ListGroupsForMemberError::ResourceNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output) + .map_err(crate::operation::list_groups_for_member::ListGroupsForMemberError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ThrottlingException" => crate::operation::list_groups_for_member::ListGroupsForMemberError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::list_groups_for_member::ListGroupsForMemberError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::list_groups_for_member::ListGroupsForMemberError::unhandled( + "Failed to parse RetryAfterSeconds from header `Retry-After", + ) + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_groups_for_member::ListGroupsForMemberError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::list_groups_for_member::ListGroupsForMemberError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::list_groups_for_member::ListGroupsForMemberError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + _ => crate::operation::list_groups_for_member::ListGroupsForMemberError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_list_groups_for_member_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result< + crate::operation::list_groups_for_member::ListGroupsForMemberOutput, + crate::operation::list_groups_for_member::ListGroupsForMemberError, +> { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::list_groups_for_member::builders::ListGroupsForMemberOutputBuilder::default(); + output = crate::protocol_serde::shape_list_groups_for_member::de_list_groups_for_member(_response_body, output) + .map_err(crate::operation::list_groups_for_member::ListGroupsForMemberError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub fn ser_list_groups_for_member_input( + input: &crate::operation::list_groups_for_member::ListGroupsForMemberInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_list_groups_for_member_input::ser_list_groups_for_member_input_input(&mut object, input)?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} + +pub(crate) fn de_list_groups_for_member( + value: &[u8], + mut builder: crate::operation::list_groups_for_member::builders::ListGroupsForMemberOutputBuilder, +) -> Result< + crate::operation::list_groups_for_member::builders::ListGroupsForMemberOutputBuilder, + ::aws_smithy_json::deserialize::error::DeserializeError, +> { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "DirectoryId" => { + builder = builder.set_directory_id( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Groups" => { + builder = builder.set_groups(crate::protocol_serde::shape_group_summary_list::de_group_summary_list(tokens)?); + } + "MemberRealm" => { + builder = builder.set_member_realm( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "NextToken" => { + builder = builder.set_next_token( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Realm" => { + builder = builder.set_realm( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_list_groups_for_member_input.rs b/sdk/directoryservicedata/src/protocol_serde/shape_list_groups_for_member_input.rs new file mode 100644 index 000000000000..e891cdd4753b --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_list_groups_for_member_input.rs @@ -0,0 +1,25 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_list_groups_for_member_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::list_groups_for_member::ListGroupsForMemberInput, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.max_results { + object.key("MaxResults").number( + #[allow(clippy::useless_conversion)] + ::aws_smithy_types::Number::NegInt((*var_1).into()), + ); + } + if let Some(var_2) = &input.member_realm { + object.key("MemberRealm").string(var_2.as_str()); + } + if let Some(var_3) = &input.next_token { + object.key("NextToken").string(var_3.as_str()); + } + if let Some(var_4) = &input.realm { + object.key("Realm").string(var_4.as_str()); + } + if let Some(var_5) = &input.sam_account_name { + object.key("SAMAccountName").string(var_5.as_str()); + } + Ok(()) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_list_groups_input.rs b/sdk/directoryservicedata/src/protocol_serde/shape_list_groups_input.rs new file mode 100644 index 000000000000..658d93695dca --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_list_groups_input.rs @@ -0,0 +1,19 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_list_groups_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::list_groups::ListGroupsInput, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.max_results { + object.key("MaxResults").number( + #[allow(clippy::useless_conversion)] + ::aws_smithy_types::Number::NegInt((*var_1).into()), + ); + } + if let Some(var_2) = &input.next_token { + object.key("NextToken").string(var_2.as_str()); + } + if let Some(var_3) = &input.realm { + object.key("Realm").string(var_3.as_str()); + } + Ok(()) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_list_users.rs b/sdk/directoryservicedata/src/protocol_serde/shape_list_users.rs new file mode 100644 index 000000000000..bd24ccdb7950 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_list_users.rs @@ -0,0 +1,181 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_list_users_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::list_users::ListUsersError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::list_users::ListUsersError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "AccessDeniedException" => crate::operation::list_users::ListUsersError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::list_users::ListUsersError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "DirectoryUnavailableException" => crate::operation::list_users::ListUsersError::DirectoryUnavailableException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::DirectoryUnavailableExceptionBuilder::default(); + output = + crate::protocol_serde::shape_directory_unavailable_exception::de_directory_unavailable_exception_json_err(_response_body, output) + .map_err(crate::operation::list_users::ListUsersError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "InternalServerException" => crate::operation::list_users::ListUsersError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::list_users::ListUsersError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ThrottlingException" => crate::operation::list_users::ListUsersError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::list_users::ListUsersError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::list_users::ListUsersError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After") + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::list_users::ListUsersError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::list_users::ListUsersError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::list_users::ListUsersError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + _ => crate::operation::list_users::ListUsersError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_list_users_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::list_users::builders::ListUsersOutputBuilder::default(); + output = crate::protocol_serde::shape_list_users::de_list_users(_response_body, output) + .map_err(crate::operation::list_users::ListUsersError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub fn ser_list_users_input( + input: &crate::operation::list_users::ListUsersInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_list_users_input::ser_list_users_input_input(&mut object, input)?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} + +pub(crate) fn de_list_users( + value: &[u8], + mut builder: crate::operation::list_users::builders::ListUsersOutputBuilder, +) -> Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "DirectoryId" => { + builder = builder.set_directory_id( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "NextToken" => { + builder = builder.set_next_token( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Realm" => { + builder = builder.set_realm( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Users" => { + builder = builder.set_users(crate::protocol_serde::shape_user_summary_list::de_user_summary_list(tokens)?); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_list_users_input.rs b/sdk/directoryservicedata/src/protocol_serde/shape_list_users_input.rs new file mode 100644 index 000000000000..8098f51f7d21 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_list_users_input.rs @@ -0,0 +1,19 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_list_users_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::list_users::ListUsersInput, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.max_results { + object.key("MaxResults").number( + #[allow(clippy::useless_conversion)] + ::aws_smithy_types::Number::NegInt((*var_1).into()), + ); + } + if let Some(var_2) = &input.next_token { + object.key("NextToken").string(var_2.as_str()); + } + if let Some(var_3) = &input.realm { + object.key("Realm").string(var_3.as_str()); + } + Ok(()) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_member.rs b/sdk/directoryservicedata/src/protocol_serde/shape_member.rs new file mode 100644 index 000000000000..5715d370d3bc --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_member.rs @@ -0,0 +1,56 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_member<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = crate::types::builders::MemberBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "SID" => { + builder = builder.set_sid( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "SAMAccountName" => { + builder = builder.set_sam_account_name( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "MemberType" => { + builder = builder.set_member_type( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::MemberType::from(u.as_ref()))) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(crate::serde_util::member_correct_errors(builder).build().map_err(|err| { + ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err) + })?)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_member_list.rs b/sdk/directoryservicedata/src/protocol_serde/shape_member_list.rs new file mode 100644 index 000000000000..3f8d0e7b6b9d --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_member_list.rs @@ -0,0 +1,32 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_member_list<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { + let mut items = Vec::new(); + loop { + match tokens.peek() { + Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => { + tokens.next().transpose().unwrap(); + break; + } + _ => { + let value = crate::protocol_serde::shape_member::de_member(tokens)?; + if let Some(value) = value { + items.push(value); + } + } + } + } + Ok(Some(items)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start array or null", + )), + } +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_remove_group_member.rs b/sdk/directoryservicedata/src/protocol_serde/shape_remove_group_member.rs new file mode 100644 index 000000000000..83821eb6b1b0 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_remove_group_member.rs @@ -0,0 +1,160 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_remove_group_member_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result +{ + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::remove_group_member::RemoveGroupMemberError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::remove_group_member::RemoveGroupMemberError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "AccessDeniedException" => crate::operation::remove_group_member::RemoveGroupMemberError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::remove_group_member::RemoveGroupMemberError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ConflictException" => crate::operation::remove_group_member::RemoveGroupMemberError::ConflictException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ConflictExceptionBuilder::default(); + output = crate::protocol_serde::shape_conflict_exception::de_conflict_exception_json_err(_response_body, output) + .map_err(crate::operation::remove_group_member::RemoveGroupMemberError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "DirectoryUnavailableException" => crate::operation::remove_group_member::RemoveGroupMemberError::DirectoryUnavailableException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::DirectoryUnavailableExceptionBuilder::default(); + output = + crate::protocol_serde::shape_directory_unavailable_exception::de_directory_unavailable_exception_json_err(_response_body, output) + .map_err(crate::operation::remove_group_member::RemoveGroupMemberError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "InternalServerException" => crate::operation::remove_group_member::RemoveGroupMemberError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::remove_group_member::RemoveGroupMemberError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ResourceNotFoundException" => crate::operation::remove_group_member::RemoveGroupMemberError::ResourceNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output) + .map_err(crate::operation::remove_group_member::RemoveGroupMemberError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ThrottlingException" => crate::operation::remove_group_member::RemoveGroupMemberError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::remove_group_member::RemoveGroupMemberError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::remove_group_member::RemoveGroupMemberError::unhandled( + "Failed to parse RetryAfterSeconds from header `Retry-After", + ) + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::remove_group_member::RemoveGroupMemberError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::remove_group_member::RemoveGroupMemberError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::remove_group_member::RemoveGroupMemberError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + _ => crate::operation::remove_group_member::RemoveGroupMemberError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_remove_group_member_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result +{ + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::remove_group_member::builders::RemoveGroupMemberOutputBuilder::default(); + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub fn ser_remove_group_member_input( + input: &crate::operation::remove_group_member::RemoveGroupMemberInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_remove_group_member_input::ser_remove_group_member_input_input(&mut object, input)?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_remove_group_member_input.rs b/sdk/directoryservicedata/src/protocol_serde/shape_remove_group_member_input.rs new file mode 100644 index 000000000000..03c74e5947f8 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_remove_group_member_input.rs @@ -0,0 +1,19 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_remove_group_member_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::remove_group_member::RemoveGroupMemberInput, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.client_token { + object.key("ClientToken").string(var_1.as_str()); + } + if let Some(var_2) = &input.group_name { + object.key("GroupName").string(var_2.as_str()); + } + if let Some(var_3) = &input.member_name { + object.key("MemberName").string(var_3.as_str()); + } + if let Some(var_4) = &input.member_realm { + object.key("MemberRealm").string(var_4.as_str()); + } + Ok(()) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_resource_not_found_exception.rs b/sdk/directoryservicedata/src/protocol_serde/shape_resource_not_found_exception.rs new file mode 100644 index 000000000000..1e2831772a36 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_resource_not_found_exception.rs @@ -0,0 +1,36 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_resource_not_found_exception_json_err( + value: &[u8], + mut builder: crate::types::error::builders::ResourceNotFoundExceptionBuilder, +) -> Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "Message" => { + builder = builder.set_message( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_search_groups.rs b/sdk/directoryservicedata/src/protocol_serde/shape_search_groups.rs new file mode 100644 index 000000000000..8cdac0d213bb --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_search_groups.rs @@ -0,0 +1,181 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_search_groups_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::search_groups::SearchGroupsError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::search_groups::SearchGroupsError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "AccessDeniedException" => crate::operation::search_groups::SearchGroupsError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::search_groups::SearchGroupsError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "DirectoryUnavailableException" => crate::operation::search_groups::SearchGroupsError::DirectoryUnavailableException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::DirectoryUnavailableExceptionBuilder::default(); + output = + crate::protocol_serde::shape_directory_unavailable_exception::de_directory_unavailable_exception_json_err(_response_body, output) + .map_err(crate::operation::search_groups::SearchGroupsError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "InternalServerException" => crate::operation::search_groups::SearchGroupsError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::search_groups::SearchGroupsError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ThrottlingException" => crate::operation::search_groups::SearchGroupsError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::search_groups::SearchGroupsError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::search_groups::SearchGroupsError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After") + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::search_groups::SearchGroupsError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::search_groups::SearchGroupsError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::search_groups::SearchGroupsError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + _ => crate::operation::search_groups::SearchGroupsError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_search_groups_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::search_groups::builders::SearchGroupsOutputBuilder::default(); + output = crate::protocol_serde::shape_search_groups::de_search_groups(_response_body, output) + .map_err(crate::operation::search_groups::SearchGroupsError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub fn ser_search_groups_input( + input: &crate::operation::search_groups::SearchGroupsInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_search_groups_input::ser_search_groups_input_input(&mut object, input)?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} + +pub(crate) fn de_search_groups( + value: &[u8], + mut builder: crate::operation::search_groups::builders::SearchGroupsOutputBuilder, +) -> Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "DirectoryId" => { + builder = builder.set_directory_id( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Groups" => { + builder = builder.set_groups(crate::protocol_serde::shape_group_list::de_group_list(tokens)?); + } + "NextToken" => { + builder = builder.set_next_token( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Realm" => { + builder = builder.set_realm( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_search_groups_input.rs b/sdk/directoryservicedata/src/protocol_serde/shape_search_groups_input.rs new file mode 100644 index 000000000000..cd5d930fb775 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_search_groups_input.rs @@ -0,0 +1,31 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_search_groups_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::search_groups::SearchGroupsInput, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.max_results { + object.key("MaxResults").number( + #[allow(clippy::useless_conversion)] + ::aws_smithy_types::Number::NegInt((*var_1).into()), + ); + } + if let Some(var_2) = &input.next_token { + object.key("NextToken").string(var_2.as_str()); + } + if let Some(var_3) = &input.realm { + object.key("Realm").string(var_3.as_str()); + } + if let Some(var_4) = &input.search_attributes { + let mut array_5 = object.key("SearchAttributes").start_array(); + for item_6 in var_4 { + { + array_5.value().string(item_6.as_str()); + } + } + array_5.finish(); + } + if let Some(var_7) = &input.search_string { + object.key("SearchString").string(var_7.as_str()); + } + Ok(()) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_search_users.rs b/sdk/directoryservicedata/src/protocol_serde/shape_search_users.rs new file mode 100644 index 000000000000..6e1b4420d007 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_search_users.rs @@ -0,0 +1,181 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_search_users_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::search_users::SearchUsersError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::search_users::SearchUsersError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "AccessDeniedException" => crate::operation::search_users::SearchUsersError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::search_users::SearchUsersError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "DirectoryUnavailableException" => crate::operation::search_users::SearchUsersError::DirectoryUnavailableException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::DirectoryUnavailableExceptionBuilder::default(); + output = + crate::protocol_serde::shape_directory_unavailable_exception::de_directory_unavailable_exception_json_err(_response_body, output) + .map_err(crate::operation::search_users::SearchUsersError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "InternalServerException" => crate::operation::search_users::SearchUsersError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::search_users::SearchUsersError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ThrottlingException" => crate::operation::search_users::SearchUsersError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::search_users::SearchUsersError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::search_users::SearchUsersError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After") + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::search_users::SearchUsersError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::search_users::SearchUsersError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::search_users::SearchUsersError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + _ => crate::operation::search_users::SearchUsersError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_search_users_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::search_users::builders::SearchUsersOutputBuilder::default(); + output = crate::protocol_serde::shape_search_users::de_search_users(_response_body, output) + .map_err(crate::operation::search_users::SearchUsersError::unhandled)?; + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub fn ser_search_users_input( + input: &crate::operation::search_users::SearchUsersInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_search_users_input::ser_search_users_input_input(&mut object, input)?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} + +pub(crate) fn de_search_users( + value: &[u8], + mut builder: crate::operation::search_users::builders::SearchUsersOutputBuilder, +) -> Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "DirectoryId" => { + builder = builder.set_directory_id( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "NextToken" => { + builder = builder.set_next_token( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Realm" => { + builder = builder.set_realm( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Users" => { + builder = builder.set_users(crate::protocol_serde::shape_user_list::de_user_list(tokens)?); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_search_users_input.rs b/sdk/directoryservicedata/src/protocol_serde/shape_search_users_input.rs new file mode 100644 index 000000000000..3d4cffecc4c1 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_search_users_input.rs @@ -0,0 +1,31 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_search_users_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::search_users::SearchUsersInput, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.max_results { + object.key("MaxResults").number( + #[allow(clippy::useless_conversion)] + ::aws_smithy_types::Number::NegInt((*var_1).into()), + ); + } + if let Some(var_2) = &input.next_token { + object.key("NextToken").string(var_2.as_str()); + } + if let Some(var_3) = &input.realm { + object.key("Realm").string(var_3.as_str()); + } + if let Some(var_4) = &input.search_attributes { + let mut array_5 = object.key("SearchAttributes").start_array(); + for item_6 in var_4 { + { + array_5.value().string(item_6.as_str()); + } + } + array_5.finish(); + } + if let Some(var_7) = &input.search_string { + object.key("SearchString").string(var_7.as_str()); + } + Ok(()) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_string_set_attribute_value.rs b/sdk/directoryservicedata/src/protocol_serde/shape_string_set_attribute_value.rs new file mode 100644 index 000000000000..cced15f20851 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_string_set_attribute_value.rs @@ -0,0 +1,34 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_string_set_attribute_value<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { + let mut items = Vec::new(); + loop { + match tokens.peek() { + Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => { + tokens.next().transpose().unwrap(); + break; + } + _ => { + let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?; + if let Some(value) = value { + items.push(value); + } + } + } + } + Ok(Some(items)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start array or null", + )), + } +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_throttling_exception.rs b/sdk/directoryservicedata/src/protocol_serde/shape_throttling_exception.rs new file mode 100644 index 000000000000..79df0129aec6 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_throttling_exception.rs @@ -0,0 +1,59 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_throttling_exception_json_err( + value: &[u8], + mut builder: crate::types::error::builders::ThrottlingExceptionBuilder, +) -> Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "Message" => { + builder = builder.set_message( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "RetryAfterSeconds" => { + builder = builder.set_retry_after_seconds( + ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())? + .map(i32::try_from) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} + +pub(crate) fn de_retry_after_seconds_header( + header_map: &::aws_smithy_runtime_api::http::Headers, +) -> ::std::result::Result<::std::option::Option, ::aws_smithy_http::header::ParseError> { + let headers = header_map.get_all("Retry-After"); + let var_1 = ::aws_smithy_http::header::read_many_primitive::(headers)?; + if var_1.len() > 1 { + Err(::aws_smithy_http::header::ParseError::new(format!( + "expected one item but found {}", + var_1.len() + ))) + } else { + let mut var_1 = var_1; + Ok(var_1.pop()) + } +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_update_group.rs b/sdk/directoryservicedata/src/protocol_serde/shape_update_group.rs new file mode 100644 index 000000000000..e863e599b839 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_update_group.rs @@ -0,0 +1,156 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_update_group_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::update_group::UpdateGroupError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::update_group::UpdateGroupError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "AccessDeniedException" => crate::operation::update_group::UpdateGroupError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::update_group::UpdateGroupError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ConflictException" => crate::operation::update_group::UpdateGroupError::ConflictException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ConflictExceptionBuilder::default(); + output = crate::protocol_serde::shape_conflict_exception::de_conflict_exception_json_err(_response_body, output) + .map_err(crate::operation::update_group::UpdateGroupError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "DirectoryUnavailableException" => crate::operation::update_group::UpdateGroupError::DirectoryUnavailableException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::DirectoryUnavailableExceptionBuilder::default(); + output = + crate::protocol_serde::shape_directory_unavailable_exception::de_directory_unavailable_exception_json_err(_response_body, output) + .map_err(crate::operation::update_group::UpdateGroupError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "InternalServerException" => crate::operation::update_group::UpdateGroupError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::update_group::UpdateGroupError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ResourceNotFoundException" => crate::operation::update_group::UpdateGroupError::ResourceNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output) + .map_err(crate::operation::update_group::UpdateGroupError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ThrottlingException" => crate::operation::update_group::UpdateGroupError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::update_group::UpdateGroupError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::update_group::UpdateGroupError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After") + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::update_group::UpdateGroupError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::update_group::UpdateGroupError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::update_group::UpdateGroupError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + _ => crate::operation::update_group::UpdateGroupError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_update_group_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::update_group::builders::UpdateGroupOutputBuilder::default(); + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub fn ser_update_group_input( + input: &crate::operation::update_group::UpdateGroupInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_update_group_input::ser_update_group_input_input(&mut object, input)?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_update_group_input.rs b/sdk/directoryservicedata/src/protocol_serde/shape_update_group_input.rs new file mode 100644 index 000000000000..2b28e637bba7 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_update_group_input.rs @@ -0,0 +1,35 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_update_group_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::update_group::UpdateGroupInput, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.client_token { + object.key("ClientToken").string(var_1.as_str()); + } + if let Some(var_2) = &input.group_scope { + object.key("GroupScope").string(var_2.as_str()); + } + if let Some(var_3) = &input.group_type { + object.key("GroupType").string(var_3.as_str()); + } + if let Some(var_4) = &input.other_attributes { + #[allow(unused_mut)] + let mut object_5 = object.key("OtherAttributes").start_object(); + for (key_6, value_7) in var_4 { + { + #[allow(unused_mut)] + let mut object_8 = object_5.key(key_6.as_str()).start_object(); + crate::protocol_serde::shape_attribute_value::ser_attribute_value(&mut object_8, value_7)?; + object_8.finish(); + } + } + object_5.finish(); + } + if let Some(var_9) = &input.sam_account_name { + object.key("SAMAccountName").string(var_9.as_str()); + } + if let Some(var_10) = &input.update_type { + object.key("UpdateType").string(var_10.as_str()); + } + Ok(()) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_update_user.rs b/sdk/directoryservicedata/src/protocol_serde/shape_update_user.rs new file mode 100644 index 000000000000..15680f3134d7 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_update_user.rs @@ -0,0 +1,156 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#[allow(clippy::unnecessary_wraps)] +pub fn de_update_user_http_error( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + #[allow(unused_mut)] + let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body) + .map_err(crate::operation::update_user::UpdateUserError::unhandled)?; + generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers); + let generic = generic_builder.build(); + let error_code = match generic.code() { + Some(code) => code, + None => return Err(crate::operation::update_user::UpdateUserError::unhandled(generic)), + }; + + let _error_message = generic.message().map(|msg| msg.to_owned()); + Err(match error_code { + "AccessDeniedException" => crate::operation::update_user::UpdateUserError::AccessDeniedException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default(); + output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output) + .map_err(crate::operation::update_user::UpdateUserError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ConflictException" => crate::operation::update_user::UpdateUserError::ConflictException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ConflictExceptionBuilder::default(); + output = crate::protocol_serde::shape_conflict_exception::de_conflict_exception_json_err(_response_body, output) + .map_err(crate::operation::update_user::UpdateUserError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "DirectoryUnavailableException" => crate::operation::update_user::UpdateUserError::DirectoryUnavailableException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::DirectoryUnavailableExceptionBuilder::default(); + output = + crate::protocol_serde::shape_directory_unavailable_exception::de_directory_unavailable_exception_json_err(_response_body, output) + .map_err(crate::operation::update_user::UpdateUserError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "InternalServerException" => crate::operation::update_user::UpdateUserError::InternalServerException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default(); + output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output) + .map_err(crate::operation::update_user::UpdateUserError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ResourceNotFoundException" => crate::operation::update_user::UpdateUserError::ResourceNotFoundException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default(); + output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output) + .map_err(crate::operation::update_user::UpdateUserError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + "ThrottlingException" => crate::operation::update_user::UpdateUserError::ThrottlingException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default(); + output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output) + .map_err(crate::operation::update_user::UpdateUserError::unhandled)?; + output = output.set_retry_after_seconds( + crate::protocol_serde::shape_throttling_exception::de_retry_after_seconds_header(_response_headers).map_err(|_| { + crate::operation::update_user::UpdateUserError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After") + })?, + ); + let output = output.meta(generic); + crate::serde_util::throttling_exception_correct_errors(output) + .build() + .map_err(crate::operation::update_user::UpdateUserError::unhandled)? + }; + tmp + }), + "ValidationException" => crate::operation::update_user::UpdateUserError::ValidationException({ + #[allow(unused_mut)] + let mut tmp = { + #[allow(unused_mut)] + let mut output = crate::types::error::builders::ValidationExceptionBuilder::default(); + output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output) + .map_err(crate::operation::update_user::UpdateUserError::unhandled)?; + let output = output.meta(generic); + output.build() + }; + if tmp.message.is_none() { + tmp.message = _error_message; + } + tmp + }), + _ => crate::operation::update_user::UpdateUserError::generic(generic), + }) +} + +#[allow(clippy::unnecessary_wraps)] +pub fn de_update_user_http_response( + _response_status: u16, + _response_headers: &::aws_smithy_runtime_api::http::Headers, + _response_body: &[u8], +) -> std::result::Result { + Ok({ + #[allow(unused_mut)] + let mut output = crate::operation::update_user::builders::UpdateUserOutputBuilder::default(); + output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); + output.build() + }) +} + +pub fn ser_update_user_input( + input: &crate::operation::update_user::UpdateUserInput, +) -> Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> { + let mut out = String::new(); + let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out); + crate::protocol_serde::shape_update_user_input::ser_update_user_input_input(&mut object, input)?; + object.finish(); + Ok(::aws_smithy_types::body::SdkBody::from(out)) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_update_user_input.rs b/sdk/directoryservicedata/src/protocol_serde/shape_update_user_input.rs new file mode 100644 index 000000000000..2e9e2b03998a --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_update_user_input.rs @@ -0,0 +1,38 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub fn ser_update_user_input_input( + object: &mut ::aws_smithy_json::serialize::JsonObjectWriter, + input: &crate::operation::update_user::UpdateUserInput, +) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> { + if let Some(var_1) = &input.client_token { + object.key("ClientToken").string(var_1.as_str()); + } + if let Some(var_2) = &input.email_address { + object.key("EmailAddress").string(var_2.as_str()); + } + if let Some(var_3) = &input.given_name { + object.key("GivenName").string(var_3.as_str()); + } + if let Some(var_4) = &input.other_attributes { + #[allow(unused_mut)] + let mut object_5 = object.key("OtherAttributes").start_object(); + for (key_6, value_7) in var_4 { + { + #[allow(unused_mut)] + let mut object_8 = object_5.key(key_6.as_str()).start_object(); + crate::protocol_serde::shape_attribute_value::ser_attribute_value(&mut object_8, value_7)?; + object_8.finish(); + } + } + object_5.finish(); + } + if let Some(var_9) = &input.sam_account_name { + object.key("SAMAccountName").string(var_9.as_str()); + } + if let Some(var_10) = &input.surname { + object.key("Surname").string(var_10.as_str()); + } + if let Some(var_11) = &input.update_type { + object.key("UpdateType").string(var_11.as_str()); + } + Ok(()) +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_user.rs b/sdk/directoryservicedata/src/protocol_serde/shape_user.rs new file mode 100644 index 000000000000..da72e610030a --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_user.rs @@ -0,0 +1,90 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_user<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = crate::types::builders::UserBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "SID" => { + builder = builder.set_sid( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "SAMAccountName" => { + builder = builder.set_sam_account_name( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "DistinguishedName" => { + builder = builder.set_distinguished_name( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "UserPrincipalName" => { + builder = builder.set_user_principal_name( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "EmailAddress" => { + builder = builder.set_email_address( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "GivenName" => { + builder = builder.set_given_name( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Surname" => { + builder = builder.set_surname( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Enabled" => { + builder = builder.set_enabled(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?); + } + "OtherAttributes" => { + builder = builder.set_other_attributes(crate::protocol_serde::shape_attributes::de_attributes(tokens)?); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(crate::serde_util::user_correct_errors(builder).build().map_err(|err| { + ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err) + })?)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_user_list.rs b/sdk/directoryservicedata/src/protocol_serde/shape_user_list.rs new file mode 100644 index 000000000000..341c75a503ea --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_user_list.rs @@ -0,0 +1,32 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_user_list<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { + let mut items = Vec::new(); + loop { + match tokens.peek() { + Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => { + tokens.next().transpose().unwrap(); + break; + } + _ => { + let value = crate::protocol_serde::shape_user::de_user(tokens)?; + if let Some(value) = value { + items.push(value); + } + } + } + } + Ok(Some(items)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start array or null", + )), + } +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_user_summary.rs b/sdk/directoryservicedata/src/protocol_serde/shape_user_summary.rs new file mode 100644 index 000000000000..2264bc9b82d4 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_user_summary.rs @@ -0,0 +1,66 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_user_summary<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { + #[allow(unused_mut)] + let mut builder = crate::types::builders::UserSummaryBuilder::default(); + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "SID" => { + builder = builder.set_sid( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "SAMAccountName" => { + builder = builder.set_sam_account_name( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "GivenName" => { + builder = builder.set_given_name( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Surname" => { + builder = builder.set_surname( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Enabled" => { + builder = builder.set_enabled(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + Ok(Some(crate::serde_util::user_summary_correct_errors(builder).build().map_err(|err| { + ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err) + })?)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start object or null", + )), + } +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_user_summary_list.rs b/sdk/directoryservicedata/src/protocol_serde/shape_user_summary_list.rs new file mode 100644 index 000000000000..4cd97b088b32 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_user_summary_list.rs @@ -0,0 +1,32 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_user_summary_list<'a, I>( + tokens: &mut ::std::iter::Peekable, +) -> Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +where + I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>>, +{ + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), + Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { + let mut items = Vec::new(); + loop { + match tokens.peek() { + Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => { + tokens.next().transpose().unwrap(); + break; + } + _ => { + let value = crate::protocol_serde::shape_user_summary::de_user_summary(tokens)?; + if let Some(value) = value { + items.push(value); + } + } + } + } + Ok(Some(items)) + } + _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "expected start array or null", + )), + } +} diff --git a/sdk/directoryservicedata/src/protocol_serde/shape_validation_exception.rs b/sdk/directoryservicedata/src/protocol_serde/shape_validation_exception.rs new file mode 100644 index 000000000000..9765e4360fc9 --- /dev/null +++ b/sdk/directoryservicedata/src/protocol_serde/shape_validation_exception.rs @@ -0,0 +1,43 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_validation_exception_json_err( + value: &[u8], + mut builder: crate::types::error::builders::ValidationExceptionBuilder, +) -> Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); + let tokens = &mut tokens_owned; + ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; + loop { + match tokens.next().transpose()? { + Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break, + Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() { + "Message" => { + builder = builder.set_message( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } + "Reason" => { + builder = builder.set_reason( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| crate::types::ValidationExceptionReason::from(u.as_ref()))) + .transpose()?, + ); + } + _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, + }, + other => { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!( + "expected object key or end object, found: {:?}", + other + ))) + } + } + } + if tokens.next().is_some() { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom( + "found more JSON tokens after completing parsing", + )); + } + Ok(builder) +} diff --git a/sdk/directoryservicedata/src/sdk_feature_tracker.rs b/sdk/directoryservicedata/src/sdk_feature_tracker.rs new file mode 100644 index 000000000000..f052ed5e88a5 --- /dev/null +++ b/sdk/directoryservicedata/src/sdk_feature_tracker.rs @@ -0,0 +1,155 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +#[allow(dead_code)] +pub(crate) mod rpc_v2_cbor { + use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature; + use aws_smithy_runtime_api::box_error::BoxError; + use aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextMut; + use aws_smithy_runtime_api::client::interceptors::Intercept; + use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents; + use aws_smithy_types::config_bag::ConfigBag; + + #[derive(Debug)] + pub(crate) struct RpcV2CborFeatureTrackerInterceptor; + + impl RpcV2CborFeatureTrackerInterceptor { + pub(crate) fn new() -> Self { + Self + } + } + + impl Intercept for RpcV2CborFeatureTrackerInterceptor { + fn name(&self) -> &'static str { + "RpcV2CborFeatureTrackerInterceptor" + } + + fn modify_before_serialization( + &self, + _context: &mut BeforeSerializationInterceptorContextMut<'_>, + _runtime_components: &RuntimeComponents, + cfg: &mut ConfigBag, + ) -> Result<(), BoxError> { + cfg.interceptor_state() + .store_append::(SmithySdkFeature::ProtocolRpcV2Cbor); + Ok(()) + } + } +} + +#[allow(dead_code)] +pub(crate) mod paginator { + use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature; + use aws_smithy_runtime_api::box_error::BoxError; + use aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextMut; + use aws_smithy_runtime_api::client::interceptors::{Intercept, SharedInterceptor}; + use aws_smithy_runtime_api::client::runtime_components::{RuntimeComponents, RuntimeComponentsBuilder}; + use aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin; + use aws_smithy_types::config_bag::ConfigBag; + use std::borrow::Cow; + + #[derive(Debug)] + struct PaginatorFeatureTrackerInterceptor; + + impl PaginatorFeatureTrackerInterceptor { + pub(crate) fn new() -> Self { + Self + } + } + + impl Intercept for PaginatorFeatureTrackerInterceptor { + fn name(&self) -> &'static str { + "PaginatorFeatureTrackerInterceptor" + } + + fn modify_before_serialization( + &self, + _context: &mut BeforeSerializationInterceptorContextMut<'_>, + _runtime_components: &RuntimeComponents, + cfg: &mut ConfigBag, + ) -> Result<(), BoxError> { + cfg.interceptor_state().store_append::(SmithySdkFeature::Paginator); + Ok(()) + } + } + + #[derive(Debug)] + pub(crate) struct PaginatorFeatureTrackerRuntimePlugin { + runtime_components: RuntimeComponentsBuilder, + } + + impl PaginatorFeatureTrackerRuntimePlugin { + pub(crate) fn new() -> Self { + Self { + runtime_components: RuntimeComponentsBuilder::new("PaginatorFeatureTrackerRuntimePlugin") + .with_interceptor(SharedInterceptor::new(PaginatorFeatureTrackerInterceptor::new())), + } + } + } + + impl RuntimePlugin for PaginatorFeatureTrackerRuntimePlugin { + fn runtime_components(&self, _: &RuntimeComponentsBuilder) -> Cow<'_, RuntimeComponentsBuilder> { + Cow::Borrowed(&self.runtime_components) + } + } +} + +#[allow(dead_code)] +pub(crate) mod waiter { + use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature; + use aws_smithy_runtime_api::box_error::BoxError; + use aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextMut; + use aws_smithy_runtime_api::client::interceptors::{Intercept, SharedInterceptor}; + use aws_smithy_runtime_api::client::runtime_components::{RuntimeComponents, RuntimeComponentsBuilder}; + use aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin; + use aws_smithy_types::config_bag::ConfigBag; + use std::borrow::Cow; + + #[derive(Debug)] + struct WaiterFeatureTrackerInterceptor; + + impl WaiterFeatureTrackerInterceptor { + pub(crate) fn new() -> Self { + Self + } + } + + impl Intercept for WaiterFeatureTrackerInterceptor { + fn name(&self) -> &'static str { + "WaiterFeatureTrackerInterceptor" + } + + fn modify_before_serialization( + &self, + _context: &mut BeforeSerializationInterceptorContextMut<'_>, + _runtime_components: &RuntimeComponents, + cfg: &mut ConfigBag, + ) -> Result<(), BoxError> { + cfg.interceptor_state().store_append::(SmithySdkFeature::Waiter); + Ok(()) + } + } + + #[derive(Debug)] + pub(crate) struct WaiterFeatureTrackerRuntimePlugin { + runtime_components: RuntimeComponentsBuilder, + } + + impl WaiterFeatureTrackerRuntimePlugin { + pub(crate) fn new() -> Self { + Self { + runtime_components: RuntimeComponentsBuilder::new("WaiterFeatureTrackerRuntimePlugin") + .with_interceptor(SharedInterceptor::new(WaiterFeatureTrackerInterceptor::new())), + } + } + } + + impl RuntimePlugin for WaiterFeatureTrackerRuntimePlugin { + fn runtime_components(&self, _: &RuntimeComponentsBuilder) -> Cow<'_, RuntimeComponentsBuilder> { + Cow::Borrowed(&self.runtime_components) + } + } +} diff --git a/sdk/directoryservicedata/src/serde_util.rs b/sdk/directoryservicedata/src/serde_util.rs new file mode 100644 index 000000000000..0b67c0578e50 --- /dev/null +++ b/sdk/directoryservicedata/src/serde_util.rs @@ -0,0 +1,65 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn throttling_exception_correct_errors( + mut builder: crate::types::error::builders::ThrottlingExceptionBuilder, +) -> crate::types::error::builders::ThrottlingExceptionBuilder { + if builder.message.is_none() { + builder.message = Some(Default::default()) + } + builder +} + +pub(crate) fn group_correct_errors(mut builder: crate::types::builders::GroupBuilder) -> crate::types::builders::GroupBuilder { + if builder.sam_account_name.is_none() { + builder.sam_account_name = Some(Default::default()) + } + builder +} + +pub(crate) fn group_summary_correct_errors(mut builder: crate::types::builders::GroupSummaryBuilder) -> crate::types::builders::GroupSummaryBuilder { + if builder.sid.is_none() { + builder.sid = Some(Default::default()) + } + if builder.sam_account_name.is_none() { + builder.sam_account_name = Some(Default::default()) + } + if builder.group_type.is_none() { + builder.group_type = "no value was set".parse::().ok() + } + if builder.group_scope.is_none() { + builder.group_scope = "no value was set".parse::().ok() + } + builder +} + +pub(crate) fn member_correct_errors(mut builder: crate::types::builders::MemberBuilder) -> crate::types::builders::MemberBuilder { + if builder.sid.is_none() { + builder.sid = Some(Default::default()) + } + if builder.sam_account_name.is_none() { + builder.sam_account_name = Some(Default::default()) + } + if builder.member_type.is_none() { + builder.member_type = "no value was set".parse::().ok() + } + builder +} + +pub(crate) fn user_correct_errors(mut builder: crate::types::builders::UserBuilder) -> crate::types::builders::UserBuilder { + if builder.sam_account_name.is_none() { + builder.sam_account_name = Some(Default::default()) + } + builder +} + +pub(crate) fn user_summary_correct_errors(mut builder: crate::types::builders::UserSummaryBuilder) -> crate::types::builders::UserSummaryBuilder { + if builder.sid.is_none() { + builder.sid = Some(Default::default()) + } + if builder.sam_account_name.is_none() { + builder.sam_account_name = Some(Default::default()) + } + if builder.enabled.is_none() { + builder.enabled = Some(Default::default()) + } + builder +} diff --git a/sdk/directoryservicedata/src/serialization_settings.rs b/sdk/directoryservicedata/src/serialization_settings.rs new file mode 100644 index 000000000000..b543b8ad0b70 --- /dev/null +++ b/sdk/directoryservicedata/src/serialization_settings.rs @@ -0,0 +1,84 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +#![allow(dead_code)] + +use aws_smithy_http::header::set_request_header_if_absent; +use aws_smithy_types::config_bag::{Storable, StoreReplace}; +use http::header::{HeaderName, CONTENT_LENGTH, CONTENT_TYPE}; + +/// Configuration for how default protocol headers are serialized +#[derive(Clone, Debug, Default)] +pub(crate) struct HeaderSerializationSettings { + omit_default_content_length: bool, + omit_default_content_type: bool, +} + +impl HeaderSerializationSettings { + /// Creates new [`HeaderSerializationSettings`] + pub(crate) fn new() -> Self { + Default::default() + } + + /// Omit the default `Content-Length` header during serialization + pub(crate) fn omit_default_content_length(self) -> Self { + Self { + omit_default_content_length: true, + ..self + } + } + + /// Omit the default `Content-Type` header during serialization + pub(crate) fn omit_default_content_type(self) -> Self { + Self { + omit_default_content_type: true, + ..self + } + } + + /// Returns true if the given default header name should be serialized + fn include_header(&self, header: &HeaderName) -> bool { + (!self.omit_default_content_length || header != CONTENT_LENGTH) && (!self.omit_default_content_type || header != CONTENT_TYPE) + } + + /// Sets a default header on the given request builder if it should be serialized + pub(crate) fn set_default_header(&self, mut request: http::request::Builder, header_name: HeaderName, value: &str) -> http::request::Builder { + if self.include_header(&header_name) { + request = set_request_header_if_absent(request, header_name, value); + } + request + } +} + +impl Storable for HeaderSerializationSettings { + type Storer = StoreReplace; +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_include_header() { + let settings = HeaderSerializationSettings::default(); + assert!(settings.include_header(&CONTENT_LENGTH)); + assert!(settings.include_header(&CONTENT_TYPE)); + + let settings = HeaderSerializationSettings::default().omit_default_content_length(); + assert!(!settings.include_header(&CONTENT_LENGTH)); + assert!(settings.include_header(&CONTENT_TYPE)); + + let settings = HeaderSerializationSettings::default().omit_default_content_type(); + assert!(settings.include_header(&CONTENT_LENGTH)); + assert!(!settings.include_header(&CONTENT_TYPE)); + + let settings = HeaderSerializationSettings::default() + .omit_default_content_type() + .omit_default_content_length(); + assert!(!settings.include_header(&CONTENT_LENGTH)); + assert!(!settings.include_header(&CONTENT_TYPE)); + } +} diff --git a/sdk/directoryservicedata/src/types.rs b/sdk/directoryservicedata/src/types.rs new file mode 100644 index 000000000000..5708dca430b9 --- /dev/null +++ b/sdk/directoryservicedata/src/types.rs @@ -0,0 +1,58 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::types::_validation_exception_reason::ValidationExceptionReason; + +pub use crate::types::_directory_unavailable_reason::DirectoryUnavailableReason; + +pub use crate::types::_access_denied_reason::AccessDeniedReason; + +pub use crate::types::_update_type::UpdateType; + +pub use crate::types::_attribute_value::AttributeValue; + +pub use crate::types::_group_scope::GroupScope; + +pub use crate::types::_group_type::GroupType; + +pub use crate::types::_user::User; + +pub use crate::types::_group::Group; + +pub use crate::types::_user_summary::UserSummary; + +pub use crate::types::_group_summary::GroupSummary; + +pub use crate::types::_member::Member; + +pub use crate::types::_member_type::MemberType; + +mod _access_denied_reason; + +mod _attribute_value; + +mod _directory_unavailable_reason; + +mod _group; + +mod _group_scope; + +mod _group_summary; + +mod _group_type; + +mod _member; + +mod _member_type; + +mod _update_type; + +mod _user; + +mod _user_summary; + +mod _validation_exception_reason; + +/// Builders +pub mod builders; + +/// Error types that AWS Directory Service Data can respond with. +pub mod error; diff --git a/sdk/directoryservicedata/src/types/_access_denied_reason.rs b/sdk/directoryservicedata/src/types/_access_denied_reason.rs new file mode 100644 index 000000000000..537a44faeaa1 --- /dev/null +++ b/sdk/directoryservicedata/src/types/_access_denied_reason.rs @@ -0,0 +1,113 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// When writing a match expression against `AccessDeniedReason`, it is important to ensure +/// your code is forward-compatible. That is, if a match arm handles a case for a +/// feature that is supported by the service but has not been represented as an enum +/// variant in a current version of SDK, your code should continue to work when you +/// upgrade SDK to a future version in which the enum does include a variant for that +/// feature. +/// +/// Here is an example of how you can make a match expression forward-compatible: +/// +/// ```text +/// # let accessdeniedreason = unimplemented!(); +/// match accessdeniedreason { +/// AccessDeniedReason::DataDisabled => { /* ... */ }, +/// AccessDeniedReason::DirectoryAuth => { /* ... */ }, +/// AccessDeniedReason::IamAuth => { /* ... */ }, +/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, +/// _ => { /* ... */ }, +/// } +/// ``` +/// The above code demonstrates that when `accessdeniedreason` represents +/// `NewFeature`, the execution path will lead to the second last match arm, +/// even though the enum does not contain a variant `AccessDeniedReason::NewFeature` +/// in the current version of SDK. The reason is that the variable `other`, +/// created by the `@` operator, is bound to +/// `AccessDeniedReason::Unknown(UnknownVariantValue("NewFeature".to_owned()))` +/// and calling `as_str` on it yields `"NewFeature"`. +/// This match expression is forward-compatible when executed with a newer +/// version of SDK where the variant `AccessDeniedReason::NewFeature` is defined. +/// Specifically, when `accessdeniedreason` represents `NewFeature`, +/// the execution path will hit the second last match arm as before by virtue of +/// calling `as_str` on `AccessDeniedReason::NewFeature` also yielding `"NewFeature"`. +/// +/// Explicitly matching on the `Unknown` variant should +/// be avoided for two reasons: +/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. +/// - It might inadvertently shadow other intended match arms. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive( + ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash, +)] +pub enum AccessDeniedReason { + #[allow(missing_docs)] // documentation missing in model + DataDisabled, + #[allow(missing_docs)] // documentation missing in model + DirectoryAuth, + #[allow(missing_docs)] // documentation missing in model + IamAuth, + /// `Unknown` contains new variants that have been added since this code was generated. + #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")] + Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), +} +impl ::std::convert::From<&str> for AccessDeniedReason { + fn from(s: &str) -> Self { + match s { + "DATA_DISABLED" => AccessDeniedReason::DataDisabled, + "DIRECTORY_AUTH" => AccessDeniedReason::DirectoryAuth, + "IAM_AUTH" => AccessDeniedReason::IamAuth, + other => AccessDeniedReason::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())), + } + } +} +impl ::std::str::FromStr for AccessDeniedReason { + type Err = ::std::convert::Infallible; + + fn from_str(s: &str) -> ::std::result::Result::Err> { + ::std::result::Result::Ok(AccessDeniedReason::from(s)) + } +} +impl AccessDeniedReason { + /// Returns the `&str` value of the enum member. + pub fn as_str(&self) -> &str { + match self { + AccessDeniedReason::DataDisabled => "DATA_DISABLED", + AccessDeniedReason::DirectoryAuth => "DIRECTORY_AUTH", + AccessDeniedReason::IamAuth => "IAM_AUTH", + AccessDeniedReason::Unknown(value) => value.as_str(), + } + } + /// Returns all the `&str` representations of the enum members. + pub const fn values() -> &'static [&'static str] { + &["DATA_DISABLED", "DIRECTORY_AUTH", "IAM_AUTH"] + } +} +impl ::std::convert::AsRef for AccessDeniedReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl AccessDeniedReason { + /// Parses the enum value while disallowing unknown variants. + /// + /// Unknown variants will result in an error. + pub fn try_parse(value: &str) -> ::std::result::Result { + match Self::from(value) { + #[allow(deprecated)] + Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)), + known => Ok(known), + } + } +} +impl ::std::fmt::Display for AccessDeniedReason { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + match self { + AccessDeniedReason::DataDisabled => write!(f, "DATA_DISABLED"), + AccessDeniedReason::DirectoryAuth => write!(f, "DIRECTORY_AUTH"), + AccessDeniedReason::IamAuth => write!(f, "IAM_AUTH"), + AccessDeniedReason::Unknown(value) => write!(f, "{}", value), + } + } +} diff --git a/sdk/directoryservicedata/src/types/_attribute_value.rs b/sdk/directoryservicedata/src/types/_attribute_value.rs new file mode 100644 index 000000000000..4197a48e9d57 --- /dev/null +++ b/sdk/directoryservicedata/src/types/_attribute_value.rs @@ -0,0 +1,97 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

      The data type for an attribute. Each attribute value is described as a name-value pair. The name is the AD schema name, and the value is the data itself. For a list of supported attributes, see Directory Service Data Attributes.

      +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq)] +pub enum AttributeValue { + ///

      Indicates that the attribute type value is a boolean. For example:

      + ///

      "BOOL": true

      + Bool(bool), + ///

      Indicates that the attribute type value is a number. For example:

      + ///

      "N": "16"

      + N(i64), + ///

      Indicates that the attribute type value is a string. For example:

      + ///

      "S": "S Group"

      + S(::std::string::String), + ///

      Indicates that the attribute type value is a string set. For example:

      + ///

      "SS": \["sample_service_class/host.sample.com:1234/sample_service_name_1", "sample_service_class/host.sample.com:1234/sample_service_name_2"\]

      + Ss(::std::vec::Vec<::std::string::String>), + /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version. + /// An unknown enum variant + /// + /// _Note: If you encounter this error, consider upgrading your SDK to the latest version._ + /// The `Unknown` variant represents cases where the server sent a value that wasn't recognized + /// by the client. This can happen when the server adds new functionality, but the client has not been updated. + /// To investigate this, consider turning on debug logging to print the raw HTTP response. + #[non_exhaustive] + Unknown, +} +impl AttributeValue { + /// Tries to convert the enum instance into [`Bool`](crate::types::AttributeValue::Bool), extracting the inner [`bool`](bool). + /// Returns `Err(&Self)` if it can't be converted. + pub fn as_bool(&self) -> ::std::result::Result<&bool, &Self> { + if let AttributeValue::Bool(val) = &self { + ::std::result::Result::Ok(val) + } else { + ::std::result::Result::Err(self) + } + } + /// Returns true if this is a [`Bool`](crate::types::AttributeValue::Bool). + pub fn is_bool(&self) -> bool { + self.as_bool().is_ok() + } + /// Tries to convert the enum instance into [`N`](crate::types::AttributeValue::N), extracting the inner [`i64`](i64). + /// Returns `Err(&Self)` if it can't be converted. + pub fn as_n(&self) -> ::std::result::Result<&i64, &Self> { + if let AttributeValue::N(val) = &self { + ::std::result::Result::Ok(val) + } else { + ::std::result::Result::Err(self) + } + } + /// Returns true if this is a [`N`](crate::types::AttributeValue::N). + pub fn is_n(&self) -> bool { + self.as_n().is_ok() + } + /// Tries to convert the enum instance into [`S`](crate::types::AttributeValue::S), extracting the inner [`String`](::std::string::String). + /// Returns `Err(&Self)` if it can't be converted. + pub fn as_s(&self) -> ::std::result::Result<&::std::string::String, &Self> { + if let AttributeValue::S(val) = &self { + ::std::result::Result::Ok(val) + } else { + ::std::result::Result::Err(self) + } + } + /// Returns true if this is a [`S`](crate::types::AttributeValue::S). + pub fn is_s(&self) -> bool { + self.as_s().is_ok() + } + /// Tries to convert the enum instance into [`Ss`](crate::types::AttributeValue::Ss), extracting the inner [`Vec`](::std::vec::Vec). + /// Returns `Err(&Self)` if it can't be converted. + pub fn as_ss(&self) -> ::std::result::Result<&::std::vec::Vec<::std::string::String>, &Self> { + if let AttributeValue::Ss(val) = &self { + ::std::result::Result::Ok(val) + } else { + ::std::result::Result::Err(self) + } + } + /// Returns true if this is a [`Ss`](crate::types::AttributeValue::Ss). + pub fn is_ss(&self) -> bool { + self.as_ss().is_ok() + } + /// Returns true if the enum instance is the `Unknown` variant. + pub fn is_unknown(&self) -> bool { + matches!(self, Self::Unknown) + } +} +impl ::std::fmt::Debug for AttributeValue { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + match self { + AttributeValue::Bool(_) => f.debug_tuple("*** Sensitive Data Redacted ***").finish(), + AttributeValue::N(_) => f.debug_tuple("*** Sensitive Data Redacted ***").finish(), + AttributeValue::S(_) => f.debug_tuple("*** Sensitive Data Redacted ***").finish(), + AttributeValue::Ss(_) => f.debug_tuple("*** Sensitive Data Redacted ***").finish(), + AttributeValue::Unknown => f.debug_tuple("Unknown").finish(), + } + } +} diff --git a/sdk/directoryservicedata/src/types/_directory_unavailable_reason.rs b/sdk/directoryservicedata/src/types/_directory_unavailable_reason.rs new file mode 100644 index 000000000000..c2b73029a74d --- /dev/null +++ b/sdk/directoryservicedata/src/types/_directory_unavailable_reason.rs @@ -0,0 +1,131 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// When writing a match expression against `DirectoryUnavailableReason`, it is important to ensure +/// your code is forward-compatible. That is, if a match arm handles a case for a +/// feature that is supported by the service but has not been represented as an enum +/// variant in a current version of SDK, your code should continue to work when you +/// upgrade SDK to a future version in which the enum does include a variant for that +/// feature. +/// +/// Here is an example of how you can make a match expression forward-compatible: +/// +/// ```text +/// # let directoryunavailablereason = unimplemented!(); +/// match directoryunavailablereason { +/// DirectoryUnavailableReason::DirectoryResourcesExceeded => { /* ... */ }, +/// DirectoryUnavailableReason::DirectoryTimeout => { /* ... */ }, +/// DirectoryUnavailableReason::InvalidDirectoryState => { /* ... */ }, +/// DirectoryUnavailableReason::NoDiskSpace => { /* ... */ }, +/// DirectoryUnavailableReason::TrustAuthFailure => { /* ... */ }, +/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, +/// _ => { /* ... */ }, +/// } +/// ``` +/// The above code demonstrates that when `directoryunavailablereason` represents +/// `NewFeature`, the execution path will lead to the second last match arm, +/// even though the enum does not contain a variant `DirectoryUnavailableReason::NewFeature` +/// in the current version of SDK. The reason is that the variable `other`, +/// created by the `@` operator, is bound to +/// `DirectoryUnavailableReason::Unknown(UnknownVariantValue("NewFeature".to_owned()))` +/// and calling `as_str` on it yields `"NewFeature"`. +/// This match expression is forward-compatible when executed with a newer +/// version of SDK where the variant `DirectoryUnavailableReason::NewFeature` is defined. +/// Specifically, when `directoryunavailablereason` represents `NewFeature`, +/// the execution path will hit the second last match arm as before by virtue of +/// calling `as_str` on `DirectoryUnavailableReason::NewFeature` also yielding `"NewFeature"`. +/// +/// Explicitly matching on the `Unknown` variant should +/// be avoided for two reasons: +/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. +/// - It might inadvertently shadow other intended match arms. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive( + ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash, +)] +pub enum DirectoryUnavailableReason { + #[allow(missing_docs)] // documentation missing in model + DirectoryResourcesExceeded, + #[allow(missing_docs)] // documentation missing in model + DirectoryTimeout, + #[allow(missing_docs)] // documentation missing in model + InvalidDirectoryState, + #[allow(missing_docs)] // documentation missing in model + NoDiskSpace, + #[allow(missing_docs)] // documentation missing in model + TrustAuthFailure, + /// `Unknown` contains new variants that have been added since this code was generated. + #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")] + Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), +} +impl ::std::convert::From<&str> for DirectoryUnavailableReason { + fn from(s: &str) -> Self { + match s { + "DIRECTORY_RESOURCES_EXCEEDED" => DirectoryUnavailableReason::DirectoryResourcesExceeded, + "DIRECTORY_TIMEOUT" => DirectoryUnavailableReason::DirectoryTimeout, + "INVALID_DIRECTORY_STATE" => DirectoryUnavailableReason::InvalidDirectoryState, + "NO_DISK_SPACE" => DirectoryUnavailableReason::NoDiskSpace, + "TRUST_AUTH_FAILURE" => DirectoryUnavailableReason::TrustAuthFailure, + other => DirectoryUnavailableReason::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())), + } + } +} +impl ::std::str::FromStr for DirectoryUnavailableReason { + type Err = ::std::convert::Infallible; + + fn from_str(s: &str) -> ::std::result::Result::Err> { + ::std::result::Result::Ok(DirectoryUnavailableReason::from(s)) + } +} +impl DirectoryUnavailableReason { + /// Returns the `&str` value of the enum member. + pub fn as_str(&self) -> &str { + match self { + DirectoryUnavailableReason::DirectoryResourcesExceeded => "DIRECTORY_RESOURCES_EXCEEDED", + DirectoryUnavailableReason::DirectoryTimeout => "DIRECTORY_TIMEOUT", + DirectoryUnavailableReason::InvalidDirectoryState => "INVALID_DIRECTORY_STATE", + DirectoryUnavailableReason::NoDiskSpace => "NO_DISK_SPACE", + DirectoryUnavailableReason::TrustAuthFailure => "TRUST_AUTH_FAILURE", + DirectoryUnavailableReason::Unknown(value) => value.as_str(), + } + } + /// Returns all the `&str` representations of the enum members. + pub const fn values() -> &'static [&'static str] { + &[ + "DIRECTORY_RESOURCES_EXCEEDED", + "DIRECTORY_TIMEOUT", + "INVALID_DIRECTORY_STATE", + "NO_DISK_SPACE", + "TRUST_AUTH_FAILURE", + ] + } +} +impl ::std::convert::AsRef for DirectoryUnavailableReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl DirectoryUnavailableReason { + /// Parses the enum value while disallowing unknown variants. + /// + /// Unknown variants will result in an error. + pub fn try_parse(value: &str) -> ::std::result::Result { + match Self::from(value) { + #[allow(deprecated)] + Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)), + known => Ok(known), + } + } +} +impl ::std::fmt::Display for DirectoryUnavailableReason { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + match self { + DirectoryUnavailableReason::DirectoryResourcesExceeded => write!(f, "DIRECTORY_RESOURCES_EXCEEDED"), + DirectoryUnavailableReason::DirectoryTimeout => write!(f, "DIRECTORY_TIMEOUT"), + DirectoryUnavailableReason::InvalidDirectoryState => write!(f, "INVALID_DIRECTORY_STATE"), + DirectoryUnavailableReason::NoDiskSpace => write!(f, "NO_DISK_SPACE"), + DirectoryUnavailableReason::TrustAuthFailure => write!(f, "TRUST_AUTH_FAILURE"), + DirectoryUnavailableReason::Unknown(value) => write!(f, "{}", value), + } + } +} diff --git a/sdk/directoryservicedata/src/types/_group.rs b/sdk/directoryservicedata/src/types/_group.rs new file mode 100644 index 000000000000..b2a9638d292a --- /dev/null +++ b/sdk/directoryservicedata/src/types/_group.rs @@ -0,0 +1,202 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

      A group object that contains identifying information and attributes for a specified group.

      +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq)] +pub struct Group { + ///

      The unique security identifier (SID) of the group.

      + pub sid: ::std::option::Option<::std::string::String>, + ///

      The name of the group.

      + pub sam_account_name: ::std::string::String, + ///

      The distinguished name of the object.

      + pub distinguished_name: ::std::option::Option<::std::string::String>, + ///

      The AD group type. For details, see Active Directory security group type.

      + pub group_type: ::std::option::Option, + ///

      The scope of the AD group. For details, see Active Directory security groups

      + pub group_scope: ::std::option::Option, + ///

      An expression of one or more attributes, data types, and the values of a group.

      + pub other_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, +} +impl Group { + ///

      The unique security identifier (SID) of the group.

      + pub fn sid(&self) -> ::std::option::Option<&str> { + self.sid.as_deref() + } + ///

      The name of the group.

      + pub fn sam_account_name(&self) -> &str { + use std::ops::Deref; + self.sam_account_name.deref() + } + ///

      The distinguished name of the object.

      + pub fn distinguished_name(&self) -> ::std::option::Option<&str> { + self.distinguished_name.as_deref() + } + ///

      The AD group type. For details, see Active Directory security group type.

      + pub fn group_type(&self) -> ::std::option::Option<&crate::types::GroupType> { + self.group_type.as_ref() + } + ///

      The scope of the AD group. For details, see Active Directory security groups

      + pub fn group_scope(&self) -> ::std::option::Option<&crate::types::GroupScope> { + self.group_scope.as_ref() + } + ///

      An expression of one or more attributes, data types, and the values of a group.

      + pub fn other_attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> { + self.other_attributes.as_ref() + } +} +impl ::std::fmt::Debug for Group { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("Group"); + formatter.field("sid", &self.sid); + formatter.field("sam_account_name", &self.sam_account_name); + formatter.field("distinguished_name", &"*** Sensitive Data Redacted ***"); + formatter.field("group_type", &self.group_type); + formatter.field("group_scope", &self.group_scope); + formatter.field("other_attributes", &self.other_attributes); + formatter.finish() + } +} +impl Group { + /// Creates a new builder-style object to manufacture [`Group`](crate::types::Group). + pub fn builder() -> crate::types::builders::GroupBuilder { + crate::types::builders::GroupBuilder::default() + } +} + +/// A builder for [`Group`](crate::types::Group). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)] +#[non_exhaustive] +pub struct GroupBuilder { + pub(crate) sid: ::std::option::Option<::std::string::String>, + pub(crate) sam_account_name: ::std::option::Option<::std::string::String>, + pub(crate) distinguished_name: ::std::option::Option<::std::string::String>, + pub(crate) group_type: ::std::option::Option, + pub(crate) group_scope: ::std::option::Option, + pub(crate) other_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, +} +impl GroupBuilder { + ///

      The unique security identifier (SID) of the group.

      + pub fn sid(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sid = ::std::option::Option::Some(input.into()); + self + } + ///

      The unique security identifier (SID) of the group.

      + pub fn set_sid(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sid = input; + self + } + ///

      The unique security identifier (SID) of the group.

      + pub fn get_sid(&self) -> &::std::option::Option<::std::string::String> { + &self.sid + } + ///

      The name of the group.

      + /// This field is required. + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sam_account_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The name of the group.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sam_account_name = input; + self + } + ///

      The name of the group.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + &self.sam_account_name + } + ///

      The distinguished name of the object.

      + pub fn distinguished_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.distinguished_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The distinguished name of the object.

      + pub fn set_distinguished_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.distinguished_name = input; + self + } + ///

      The distinguished name of the object.

      + pub fn get_distinguished_name(&self) -> &::std::option::Option<::std::string::String> { + &self.distinguished_name + } + ///

      The AD group type. For details, see Active Directory security group type.

      + pub fn group_type(mut self, input: crate::types::GroupType) -> Self { + self.group_type = ::std::option::Option::Some(input); + self + } + ///

      The AD group type. For details, see Active Directory security group type.

      + pub fn set_group_type(mut self, input: ::std::option::Option) -> Self { + self.group_type = input; + self + } + ///

      The AD group type. For details, see Active Directory security group type.

      + pub fn get_group_type(&self) -> &::std::option::Option { + &self.group_type + } + ///

      The scope of the AD group. For details, see Active Directory security groups

      + pub fn group_scope(mut self, input: crate::types::GroupScope) -> Self { + self.group_scope = ::std::option::Option::Some(input); + self + } + ///

      The scope of the AD group. For details, see Active Directory security groups

      + pub fn set_group_scope(mut self, input: ::std::option::Option) -> Self { + self.group_scope = input; + self + } + ///

      The scope of the AD group. For details, see Active Directory security groups

      + pub fn get_group_scope(&self) -> &::std::option::Option { + &self.group_scope + } + /// Adds a key-value pair to `other_attributes`. + /// + /// To override the contents of this collection use [`set_other_attributes`](Self::set_other_attributes). + /// + ///

      An expression of one or more attributes, data types, and the values of a group.

      + pub fn other_attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self { + let mut hash_map = self.other_attributes.unwrap_or_default(); + hash_map.insert(k.into(), v); + self.other_attributes = ::std::option::Option::Some(hash_map); + self + } + ///

      An expression of one or more attributes, data types, and the values of a group.

      + pub fn set_other_attributes( + mut self, + input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, + ) -> Self { + self.other_attributes = input; + self + } + ///

      An expression of one or more attributes, data types, and the values of a group.

      + pub fn get_other_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> { + &self.other_attributes + } + /// Consumes the builder and constructs a [`Group`](crate::types::Group). + /// This method will fail if any of the following fields are not set: + /// - [`sam_account_name`](crate::types::builders::GroupBuilder::sam_account_name) + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::types::Group { + sid: self.sid, + sam_account_name: self.sam_account_name.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "sam_account_name", + "sam_account_name was not specified but it is required when building Group", + ) + })?, + distinguished_name: self.distinguished_name, + group_type: self.group_type, + group_scope: self.group_scope, + other_attributes: self.other_attributes, + }) + } +} +impl ::std::fmt::Debug for GroupBuilder { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("GroupBuilder"); + formatter.field("sid", &self.sid); + formatter.field("sam_account_name", &self.sam_account_name); + formatter.field("distinguished_name", &"*** Sensitive Data Redacted ***"); + formatter.field("group_type", &self.group_type); + formatter.field("group_scope", &self.group_scope); + formatter.field("other_attributes", &self.other_attributes); + formatter.finish() + } +} diff --git a/sdk/directoryservicedata/src/types/_group_scope.rs b/sdk/directoryservicedata/src/types/_group_scope.rs new file mode 100644 index 000000000000..e219b7029c68 --- /dev/null +++ b/sdk/directoryservicedata/src/types/_group_scope.rs @@ -0,0 +1,119 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// When writing a match expression against `GroupScope`, it is important to ensure +/// your code is forward-compatible. That is, if a match arm handles a case for a +/// feature that is supported by the service but has not been represented as an enum +/// variant in a current version of SDK, your code should continue to work when you +/// upgrade SDK to a future version in which the enum does include a variant for that +/// feature. +/// +/// Here is an example of how you can make a match expression forward-compatible: +/// +/// ```text +/// # let groupscope = unimplemented!(); +/// match groupscope { +/// GroupScope::BuiltinLocal => { /* ... */ }, +/// GroupScope::DomainLocal => { /* ... */ }, +/// GroupScope::Global => { /* ... */ }, +/// GroupScope::Universal => { /* ... */ }, +/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, +/// _ => { /* ... */ }, +/// } +/// ``` +/// The above code demonstrates that when `groupscope` represents +/// `NewFeature`, the execution path will lead to the second last match arm, +/// even though the enum does not contain a variant `GroupScope::NewFeature` +/// in the current version of SDK. The reason is that the variable `other`, +/// created by the `@` operator, is bound to +/// `GroupScope::Unknown(UnknownVariantValue("NewFeature".to_owned()))` +/// and calling `as_str` on it yields `"NewFeature"`. +/// This match expression is forward-compatible when executed with a newer +/// version of SDK where the variant `GroupScope::NewFeature` is defined. +/// Specifically, when `groupscope` represents `NewFeature`, +/// the execution path will hit the second last match arm as before by virtue of +/// calling `as_str` on `GroupScope::NewFeature` also yielding `"NewFeature"`. +/// +/// Explicitly matching on the `Unknown` variant should +/// be avoided for two reasons: +/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. +/// - It might inadvertently shadow other intended match arms. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive( + ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash, +)] +pub enum GroupScope { + #[allow(missing_docs)] // documentation missing in model + BuiltinLocal, + #[allow(missing_docs)] // documentation missing in model + DomainLocal, + #[allow(missing_docs)] // documentation missing in model + Global, + #[allow(missing_docs)] // documentation missing in model + Universal, + /// `Unknown` contains new variants that have been added since this code was generated. + #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")] + Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), +} +impl ::std::convert::From<&str> for GroupScope { + fn from(s: &str) -> Self { + match s { + "BuiltinLocal" => GroupScope::BuiltinLocal, + "DomainLocal" => GroupScope::DomainLocal, + "Global" => GroupScope::Global, + "Universal" => GroupScope::Universal, + other => GroupScope::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())), + } + } +} +impl ::std::str::FromStr for GroupScope { + type Err = ::std::convert::Infallible; + + fn from_str(s: &str) -> ::std::result::Result::Err> { + ::std::result::Result::Ok(GroupScope::from(s)) + } +} +impl GroupScope { + /// Returns the `&str` value of the enum member. + pub fn as_str(&self) -> &str { + match self { + GroupScope::BuiltinLocal => "BuiltinLocal", + GroupScope::DomainLocal => "DomainLocal", + GroupScope::Global => "Global", + GroupScope::Universal => "Universal", + GroupScope::Unknown(value) => value.as_str(), + } + } + /// Returns all the `&str` representations of the enum members. + pub const fn values() -> &'static [&'static str] { + &["BuiltinLocal", "DomainLocal", "Global", "Universal"] + } +} +impl ::std::convert::AsRef for GroupScope { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl GroupScope { + /// Parses the enum value while disallowing unknown variants. + /// + /// Unknown variants will result in an error. + pub fn try_parse(value: &str) -> ::std::result::Result { + match Self::from(value) { + #[allow(deprecated)] + Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)), + known => Ok(known), + } + } +} +impl ::std::fmt::Display for GroupScope { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + match self { + GroupScope::BuiltinLocal => write!(f, "BuiltinLocal"), + GroupScope::DomainLocal => write!(f, "DomainLocal"), + GroupScope::Global => write!(f, "Global"), + GroupScope::Universal => write!(f, "Universal"), + GroupScope::Unknown(value) => write!(f, "{}", value), + } + } +} diff --git a/sdk/directoryservicedata/src/types/_group_summary.rs b/sdk/directoryservicedata/src/types/_group_summary.rs new file mode 100644 index 000000000000..93db2b61e65f --- /dev/null +++ b/sdk/directoryservicedata/src/types/_group_summary.rs @@ -0,0 +1,147 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

      A structure containing a subset of fields of a group object from a directory.

      +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct GroupSummary { + ///

      The unique security identifier (SID) of the group.

      + pub sid: ::std::string::String, + ///

      The name of the group.

      + pub sam_account_name: ::std::string::String, + ///

      The AD group type. For details, see Active Directory security group type.

      + pub group_type: crate::types::GroupType, + ///

      The scope of the AD group. For details, see Active Directory security groups.

      + pub group_scope: crate::types::GroupScope, +} +impl GroupSummary { + ///

      The unique security identifier (SID) of the group.

      + pub fn sid(&self) -> &str { + use std::ops::Deref; + self.sid.deref() + } + ///

      The name of the group.

      + pub fn sam_account_name(&self) -> &str { + use std::ops::Deref; + self.sam_account_name.deref() + } + ///

      The AD group type. For details, see Active Directory security group type.

      + pub fn group_type(&self) -> &crate::types::GroupType { + &self.group_type + } + ///

      The scope of the AD group. For details, see Active Directory security groups.

      + pub fn group_scope(&self) -> &crate::types::GroupScope { + &self.group_scope + } +} +impl GroupSummary { + /// Creates a new builder-style object to manufacture [`GroupSummary`](crate::types::GroupSummary). + pub fn builder() -> crate::types::builders::GroupSummaryBuilder { + crate::types::builders::GroupSummaryBuilder::default() + } +} + +/// A builder for [`GroupSummary`](crate::types::GroupSummary). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct GroupSummaryBuilder { + pub(crate) sid: ::std::option::Option<::std::string::String>, + pub(crate) sam_account_name: ::std::option::Option<::std::string::String>, + pub(crate) group_type: ::std::option::Option, + pub(crate) group_scope: ::std::option::Option, +} +impl GroupSummaryBuilder { + ///

      The unique security identifier (SID) of the group.

      + /// This field is required. + pub fn sid(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sid = ::std::option::Option::Some(input.into()); + self + } + ///

      The unique security identifier (SID) of the group.

      + pub fn set_sid(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sid = input; + self + } + ///

      The unique security identifier (SID) of the group.

      + pub fn get_sid(&self) -> &::std::option::Option<::std::string::String> { + &self.sid + } + ///

      The name of the group.

      + /// This field is required. + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sam_account_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The name of the group.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sam_account_name = input; + self + } + ///

      The name of the group.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + &self.sam_account_name + } + ///

      The AD group type. For details, see Active Directory security group type.

      + /// This field is required. + pub fn group_type(mut self, input: crate::types::GroupType) -> Self { + self.group_type = ::std::option::Option::Some(input); + self + } + ///

      The AD group type. For details, see Active Directory security group type.

      + pub fn set_group_type(mut self, input: ::std::option::Option) -> Self { + self.group_type = input; + self + } + ///

      The AD group type. For details, see Active Directory security group type.

      + pub fn get_group_type(&self) -> &::std::option::Option { + &self.group_type + } + ///

      The scope of the AD group. For details, see Active Directory security groups.

      + /// This field is required. + pub fn group_scope(mut self, input: crate::types::GroupScope) -> Self { + self.group_scope = ::std::option::Option::Some(input); + self + } + ///

      The scope of the AD group. For details, see Active Directory security groups.

      + pub fn set_group_scope(mut self, input: ::std::option::Option) -> Self { + self.group_scope = input; + self + } + ///

      The scope of the AD group. For details, see Active Directory security groups.

      + pub fn get_group_scope(&self) -> &::std::option::Option { + &self.group_scope + } + /// Consumes the builder and constructs a [`GroupSummary`](crate::types::GroupSummary). + /// This method will fail if any of the following fields are not set: + /// - [`sid`](crate::types::builders::GroupSummaryBuilder::sid) + /// - [`sam_account_name`](crate::types::builders::GroupSummaryBuilder::sam_account_name) + /// - [`group_type`](crate::types::builders::GroupSummaryBuilder::group_type) + /// - [`group_scope`](crate::types::builders::GroupSummaryBuilder::group_scope) + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::types::GroupSummary { + sid: self.sid.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "sid", + "sid was not specified but it is required when building GroupSummary", + ) + })?, + sam_account_name: self.sam_account_name.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "sam_account_name", + "sam_account_name was not specified but it is required when building GroupSummary", + ) + })?, + group_type: self.group_type.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "group_type", + "group_type was not specified but it is required when building GroupSummary", + ) + })?, + group_scope: self.group_scope.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "group_scope", + "group_scope was not specified but it is required when building GroupSummary", + ) + })?, + }) + } +} diff --git a/sdk/directoryservicedata/src/types/_group_type.rs b/sdk/directoryservicedata/src/types/_group_type.rs new file mode 100644 index 000000000000..1dcdbccccfea --- /dev/null +++ b/sdk/directoryservicedata/src/types/_group_type.rs @@ -0,0 +1,107 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// When writing a match expression against `GroupType`, it is important to ensure +/// your code is forward-compatible. That is, if a match arm handles a case for a +/// feature that is supported by the service but has not been represented as an enum +/// variant in a current version of SDK, your code should continue to work when you +/// upgrade SDK to a future version in which the enum does include a variant for that +/// feature. +/// +/// Here is an example of how you can make a match expression forward-compatible: +/// +/// ```text +/// # let grouptype = unimplemented!(); +/// match grouptype { +/// GroupType::Distribution => { /* ... */ }, +/// GroupType::Security => { /* ... */ }, +/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, +/// _ => { /* ... */ }, +/// } +/// ``` +/// The above code demonstrates that when `grouptype` represents +/// `NewFeature`, the execution path will lead to the second last match arm, +/// even though the enum does not contain a variant `GroupType::NewFeature` +/// in the current version of SDK. The reason is that the variable `other`, +/// created by the `@` operator, is bound to +/// `GroupType::Unknown(UnknownVariantValue("NewFeature".to_owned()))` +/// and calling `as_str` on it yields `"NewFeature"`. +/// This match expression is forward-compatible when executed with a newer +/// version of SDK where the variant `GroupType::NewFeature` is defined. +/// Specifically, when `grouptype` represents `NewFeature`, +/// the execution path will hit the second last match arm as before by virtue of +/// calling `as_str` on `GroupType::NewFeature` also yielding `"NewFeature"`. +/// +/// Explicitly matching on the `Unknown` variant should +/// be avoided for two reasons: +/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. +/// - It might inadvertently shadow other intended match arms. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive( + ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash, +)] +pub enum GroupType { + #[allow(missing_docs)] // documentation missing in model + Distribution, + #[allow(missing_docs)] // documentation missing in model + Security, + /// `Unknown` contains new variants that have been added since this code was generated. + #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")] + Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), +} +impl ::std::convert::From<&str> for GroupType { + fn from(s: &str) -> Self { + match s { + "Distribution" => GroupType::Distribution, + "Security" => GroupType::Security, + other => GroupType::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())), + } + } +} +impl ::std::str::FromStr for GroupType { + type Err = ::std::convert::Infallible; + + fn from_str(s: &str) -> ::std::result::Result::Err> { + ::std::result::Result::Ok(GroupType::from(s)) + } +} +impl GroupType { + /// Returns the `&str` value of the enum member. + pub fn as_str(&self) -> &str { + match self { + GroupType::Distribution => "Distribution", + GroupType::Security => "Security", + GroupType::Unknown(value) => value.as_str(), + } + } + /// Returns all the `&str` representations of the enum members. + pub const fn values() -> &'static [&'static str] { + &["Distribution", "Security"] + } +} +impl ::std::convert::AsRef for GroupType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl GroupType { + /// Parses the enum value while disallowing unknown variants. + /// + /// Unknown variants will result in an error. + pub fn try_parse(value: &str) -> ::std::result::Result { + match Self::from(value) { + #[allow(deprecated)] + Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)), + known => Ok(known), + } + } +} +impl ::std::fmt::Display for GroupType { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + match self { + GroupType::Distribution => write!(f, "Distribution"), + GroupType::Security => write!(f, "Security"), + GroupType::Unknown(value) => write!(f, "{}", value), + } + } +} diff --git a/sdk/directoryservicedata/src/types/_member.rs b/sdk/directoryservicedata/src/types/_member.rs new file mode 100644 index 000000000000..021ae9d617e9 --- /dev/null +++ b/sdk/directoryservicedata/src/types/_member.rs @@ -0,0 +1,118 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

      A member object that contains identifying information for a specified member.

      +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct Member { + ///

      The unique security identifier (SID) of the group member.

      + pub sid: ::std::string::String, + ///

      The name of the group member.

      + pub sam_account_name: ::std::string::String, + ///

      The AD type of the member object.

      + pub member_type: crate::types::MemberType, +} +impl Member { + ///

      The unique security identifier (SID) of the group member.

      + pub fn sid(&self) -> &str { + use std::ops::Deref; + self.sid.deref() + } + ///

      The name of the group member.

      + pub fn sam_account_name(&self) -> &str { + use std::ops::Deref; + self.sam_account_name.deref() + } + ///

      The AD type of the member object.

      + pub fn member_type(&self) -> &crate::types::MemberType { + &self.member_type + } +} +impl Member { + /// Creates a new builder-style object to manufacture [`Member`](crate::types::Member). + pub fn builder() -> crate::types::builders::MemberBuilder { + crate::types::builders::MemberBuilder::default() + } +} + +/// A builder for [`Member`](crate::types::Member). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct MemberBuilder { + pub(crate) sid: ::std::option::Option<::std::string::String>, + pub(crate) sam_account_name: ::std::option::Option<::std::string::String>, + pub(crate) member_type: ::std::option::Option, +} +impl MemberBuilder { + ///

      The unique security identifier (SID) of the group member.

      + /// This field is required. + pub fn sid(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sid = ::std::option::Option::Some(input.into()); + self + } + ///

      The unique security identifier (SID) of the group member.

      + pub fn set_sid(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sid = input; + self + } + ///

      The unique security identifier (SID) of the group member.

      + pub fn get_sid(&self) -> &::std::option::Option<::std::string::String> { + &self.sid + } + ///

      The name of the group member.

      + /// This field is required. + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sam_account_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The name of the group member.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sam_account_name = input; + self + } + ///

      The name of the group member.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + &self.sam_account_name + } + ///

      The AD type of the member object.

      + /// This field is required. + pub fn member_type(mut self, input: crate::types::MemberType) -> Self { + self.member_type = ::std::option::Option::Some(input); + self + } + ///

      The AD type of the member object.

      + pub fn set_member_type(mut self, input: ::std::option::Option) -> Self { + self.member_type = input; + self + } + ///

      The AD type of the member object.

      + pub fn get_member_type(&self) -> &::std::option::Option { + &self.member_type + } + /// Consumes the builder and constructs a [`Member`](crate::types::Member). + /// This method will fail if any of the following fields are not set: + /// - [`sid`](crate::types::builders::MemberBuilder::sid) + /// - [`sam_account_name`](crate::types::builders::MemberBuilder::sam_account_name) + /// - [`member_type`](crate::types::builders::MemberBuilder::member_type) + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::types::Member { + sid: self.sid.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "sid", + "sid was not specified but it is required when building Member", + ) + })?, + sam_account_name: self.sam_account_name.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "sam_account_name", + "sam_account_name was not specified but it is required when building Member", + ) + })?, + member_type: self.member_type.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "member_type", + "member_type was not specified but it is required when building Member", + ) + })?, + }) + } +} diff --git a/sdk/directoryservicedata/src/types/_member_type.rs b/sdk/directoryservicedata/src/types/_member_type.rs new file mode 100644 index 000000000000..d8e4bd9d75e9 --- /dev/null +++ b/sdk/directoryservicedata/src/types/_member_type.rs @@ -0,0 +1,113 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// When writing a match expression against `MemberType`, it is important to ensure +/// your code is forward-compatible. That is, if a match arm handles a case for a +/// feature that is supported by the service but has not been represented as an enum +/// variant in a current version of SDK, your code should continue to work when you +/// upgrade SDK to a future version in which the enum does include a variant for that +/// feature. +/// +/// Here is an example of how you can make a match expression forward-compatible: +/// +/// ```text +/// # let membertype = unimplemented!(); +/// match membertype { +/// MemberType::Computer => { /* ... */ }, +/// MemberType::Group => { /* ... */ }, +/// MemberType::User => { /* ... */ }, +/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, +/// _ => { /* ... */ }, +/// } +/// ``` +/// The above code demonstrates that when `membertype` represents +/// `NewFeature`, the execution path will lead to the second last match arm, +/// even though the enum does not contain a variant `MemberType::NewFeature` +/// in the current version of SDK. The reason is that the variable `other`, +/// created by the `@` operator, is bound to +/// `MemberType::Unknown(UnknownVariantValue("NewFeature".to_owned()))` +/// and calling `as_str` on it yields `"NewFeature"`. +/// This match expression is forward-compatible when executed with a newer +/// version of SDK where the variant `MemberType::NewFeature` is defined. +/// Specifically, when `membertype` represents `NewFeature`, +/// the execution path will hit the second last match arm as before by virtue of +/// calling `as_str` on `MemberType::NewFeature` also yielding `"NewFeature"`. +/// +/// Explicitly matching on the `Unknown` variant should +/// be avoided for two reasons: +/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. +/// - It might inadvertently shadow other intended match arms. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive( + ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash, +)] +pub enum MemberType { + #[allow(missing_docs)] // documentation missing in model + Computer, + #[allow(missing_docs)] // documentation missing in model + Group, + #[allow(missing_docs)] // documentation missing in model + User, + /// `Unknown` contains new variants that have been added since this code was generated. + #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")] + Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), +} +impl ::std::convert::From<&str> for MemberType { + fn from(s: &str) -> Self { + match s { + "COMPUTER" => MemberType::Computer, + "GROUP" => MemberType::Group, + "USER" => MemberType::User, + other => MemberType::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())), + } + } +} +impl ::std::str::FromStr for MemberType { + type Err = ::std::convert::Infallible; + + fn from_str(s: &str) -> ::std::result::Result::Err> { + ::std::result::Result::Ok(MemberType::from(s)) + } +} +impl MemberType { + /// Returns the `&str` value of the enum member. + pub fn as_str(&self) -> &str { + match self { + MemberType::Computer => "COMPUTER", + MemberType::Group => "GROUP", + MemberType::User => "USER", + MemberType::Unknown(value) => value.as_str(), + } + } + /// Returns all the `&str` representations of the enum members. + pub const fn values() -> &'static [&'static str] { + &["COMPUTER", "GROUP", "USER"] + } +} +impl ::std::convert::AsRef for MemberType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl MemberType { + /// Parses the enum value while disallowing unknown variants. + /// + /// Unknown variants will result in an error. + pub fn try_parse(value: &str) -> ::std::result::Result { + match Self::from(value) { + #[allow(deprecated)] + Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)), + known => Ok(known), + } + } +} +impl ::std::fmt::Display for MemberType { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + match self { + MemberType::Computer => write!(f, "COMPUTER"), + MemberType::Group => write!(f, "GROUP"), + MemberType::User => write!(f, "USER"), + MemberType::Unknown(value) => write!(f, "{}", value), + } + } +} diff --git a/sdk/directoryservicedata/src/types/_update_type.rs b/sdk/directoryservicedata/src/types/_update_type.rs new file mode 100644 index 000000000000..80e9daaa0ca6 --- /dev/null +++ b/sdk/directoryservicedata/src/types/_update_type.rs @@ -0,0 +1,113 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// When writing a match expression against `UpdateType`, it is important to ensure +/// your code is forward-compatible. That is, if a match arm handles a case for a +/// feature that is supported by the service but has not been represented as an enum +/// variant in a current version of SDK, your code should continue to work when you +/// upgrade SDK to a future version in which the enum does include a variant for that +/// feature. +/// +/// Here is an example of how you can make a match expression forward-compatible: +/// +/// ```text +/// # let updatetype = unimplemented!(); +/// match updatetype { +/// UpdateType::Add => { /* ... */ }, +/// UpdateType::Remove => { /* ... */ }, +/// UpdateType::Replace => { /* ... */ }, +/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, +/// _ => { /* ... */ }, +/// } +/// ``` +/// The above code demonstrates that when `updatetype` represents +/// `NewFeature`, the execution path will lead to the second last match arm, +/// even though the enum does not contain a variant `UpdateType::NewFeature` +/// in the current version of SDK. The reason is that the variable `other`, +/// created by the `@` operator, is bound to +/// `UpdateType::Unknown(UnknownVariantValue("NewFeature".to_owned()))` +/// and calling `as_str` on it yields `"NewFeature"`. +/// This match expression is forward-compatible when executed with a newer +/// version of SDK where the variant `UpdateType::NewFeature` is defined. +/// Specifically, when `updatetype` represents `NewFeature`, +/// the execution path will hit the second last match arm as before by virtue of +/// calling `as_str` on `UpdateType::NewFeature` also yielding `"NewFeature"`. +/// +/// Explicitly matching on the `Unknown` variant should +/// be avoided for two reasons: +/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. +/// - It might inadvertently shadow other intended match arms. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive( + ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash, +)] +pub enum UpdateType { + #[allow(missing_docs)] // documentation missing in model + Add, + #[allow(missing_docs)] // documentation missing in model + Remove, + #[allow(missing_docs)] // documentation missing in model + Replace, + /// `Unknown` contains new variants that have been added since this code was generated. + #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")] + Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), +} +impl ::std::convert::From<&str> for UpdateType { + fn from(s: &str) -> Self { + match s { + "ADD" => UpdateType::Add, + "REMOVE" => UpdateType::Remove, + "REPLACE" => UpdateType::Replace, + other => UpdateType::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())), + } + } +} +impl ::std::str::FromStr for UpdateType { + type Err = ::std::convert::Infallible; + + fn from_str(s: &str) -> ::std::result::Result::Err> { + ::std::result::Result::Ok(UpdateType::from(s)) + } +} +impl UpdateType { + /// Returns the `&str` value of the enum member. + pub fn as_str(&self) -> &str { + match self { + UpdateType::Add => "ADD", + UpdateType::Remove => "REMOVE", + UpdateType::Replace => "REPLACE", + UpdateType::Unknown(value) => value.as_str(), + } + } + /// Returns all the `&str` representations of the enum members. + pub const fn values() -> &'static [&'static str] { + &["ADD", "REMOVE", "REPLACE"] + } +} +impl ::std::convert::AsRef for UpdateType { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl UpdateType { + /// Parses the enum value while disallowing unknown variants. + /// + /// Unknown variants will result in an error. + pub fn try_parse(value: &str) -> ::std::result::Result { + match Self::from(value) { + #[allow(deprecated)] + Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)), + known => Ok(known), + } + } +} +impl ::std::fmt::Display for UpdateType { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + match self { + UpdateType::Add => write!(f, "ADD"), + UpdateType::Remove => write!(f, "REMOVE"), + UpdateType::Replace => write!(f, "REPLACE"), + UpdateType::Unknown(value) => write!(f, "{}", value), + } + } +} diff --git a/sdk/directoryservicedata/src/types/_user.rs b/sdk/directoryservicedata/src/types/_user.rs new file mode 100644 index 000000000000..0e5bc92d9773 --- /dev/null +++ b/sdk/directoryservicedata/src/types/_user.rs @@ -0,0 +1,274 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

      A user object that contains identifying information and attributes for a specified user.

      +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq)] +pub struct User { + ///

      The unique security identifier (SID) of the user.

      + pub sid: ::std::option::Option<::std::string::String>, + ///

      The name of the user.

      + pub sam_account_name: ::std::string::String, + ///

      The distinguished name of the object.

      + pub distinguished_name: ::std::option::Option<::std::string::String>, + ///

      The UPN that is an internet-style login name for a user and based on the internet standard RFC 822. The UPN is shorter than the distinguished name and easier to remember.

      + pub user_principal_name: ::std::option::Option<::std::string::String>, + ///

      The email address of the user.

      + pub email_address: ::std::option::Option<::std::string::String>, + ///

      The first name of the user.

      + pub given_name: ::std::option::Option<::std::string::String>, + ///

      The last name of the user.

      + pub surname: ::std::option::Option<::std::string::String>, + ///

      Indicates whether the user account is active.

      + pub enabled: ::std::option::Option, + ///

      An expression that includes one or more attributes, data types, and values of a user.

      + pub other_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, +} +impl User { + ///

      The unique security identifier (SID) of the user.

      + pub fn sid(&self) -> ::std::option::Option<&str> { + self.sid.as_deref() + } + ///

      The name of the user.

      + pub fn sam_account_name(&self) -> &str { + use std::ops::Deref; + self.sam_account_name.deref() + } + ///

      The distinguished name of the object.

      + pub fn distinguished_name(&self) -> ::std::option::Option<&str> { + self.distinguished_name.as_deref() + } + ///

      The UPN that is an internet-style login name for a user and based on the internet standard RFC 822. The UPN is shorter than the distinguished name and easier to remember.

      + pub fn user_principal_name(&self) -> ::std::option::Option<&str> { + self.user_principal_name.as_deref() + } + ///

      The email address of the user.

      + pub fn email_address(&self) -> ::std::option::Option<&str> { + self.email_address.as_deref() + } + ///

      The first name of the user.

      + pub fn given_name(&self) -> ::std::option::Option<&str> { + self.given_name.as_deref() + } + ///

      The last name of the user.

      + pub fn surname(&self) -> ::std::option::Option<&str> { + self.surname.as_deref() + } + ///

      Indicates whether the user account is active.

      + pub fn enabled(&self) -> ::std::option::Option { + self.enabled + } + ///

      An expression that includes one or more attributes, data types, and values of a user.

      + pub fn other_attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> { + self.other_attributes.as_ref() + } +} +impl ::std::fmt::Debug for User { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("User"); + formatter.field("sid", &self.sid); + formatter.field("sam_account_name", &self.sam_account_name); + formatter.field("distinguished_name", &"*** Sensitive Data Redacted ***"); + formatter.field("user_principal_name", &"*** Sensitive Data Redacted ***"); + formatter.field("email_address", &"*** Sensitive Data Redacted ***"); + formatter.field("given_name", &"*** Sensitive Data Redacted ***"); + formatter.field("surname", &"*** Sensitive Data Redacted ***"); + formatter.field("enabled", &self.enabled); + formatter.field("other_attributes", &self.other_attributes); + formatter.finish() + } +} +impl User { + /// Creates a new builder-style object to manufacture [`User`](crate::types::User). + pub fn builder() -> crate::types::builders::UserBuilder { + crate::types::builders::UserBuilder::default() + } +} + +/// A builder for [`User`](crate::types::User). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)] +#[non_exhaustive] +pub struct UserBuilder { + pub(crate) sid: ::std::option::Option<::std::string::String>, + pub(crate) sam_account_name: ::std::option::Option<::std::string::String>, + pub(crate) distinguished_name: ::std::option::Option<::std::string::String>, + pub(crate) user_principal_name: ::std::option::Option<::std::string::String>, + pub(crate) email_address: ::std::option::Option<::std::string::String>, + pub(crate) given_name: ::std::option::Option<::std::string::String>, + pub(crate) surname: ::std::option::Option<::std::string::String>, + pub(crate) enabled: ::std::option::Option, + pub(crate) other_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, +} +impl UserBuilder { + ///

      The unique security identifier (SID) of the user.

      + pub fn sid(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sid = ::std::option::Option::Some(input.into()); + self + } + ///

      The unique security identifier (SID) of the user.

      + pub fn set_sid(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sid = input; + self + } + ///

      The unique security identifier (SID) of the user.

      + pub fn get_sid(&self) -> &::std::option::Option<::std::string::String> { + &self.sid + } + ///

      The name of the user.

      + /// This field is required. + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sam_account_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The name of the user.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sam_account_name = input; + self + } + ///

      The name of the user.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + &self.sam_account_name + } + ///

      The distinguished name of the object.

      + pub fn distinguished_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.distinguished_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The distinguished name of the object.

      + pub fn set_distinguished_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.distinguished_name = input; + self + } + ///

      The distinguished name of the object.

      + pub fn get_distinguished_name(&self) -> &::std::option::Option<::std::string::String> { + &self.distinguished_name + } + ///

      The UPN that is an internet-style login name for a user and based on the internet standard RFC 822. The UPN is shorter than the distinguished name and easier to remember.

      + pub fn user_principal_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.user_principal_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The UPN that is an internet-style login name for a user and based on the internet standard RFC 822. The UPN is shorter than the distinguished name and easier to remember.

      + pub fn set_user_principal_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.user_principal_name = input; + self + } + ///

      The UPN that is an internet-style login name for a user and based on the internet standard RFC 822. The UPN is shorter than the distinguished name and easier to remember.

      + pub fn get_user_principal_name(&self) -> &::std::option::Option<::std::string::String> { + &self.user_principal_name + } + ///

      The email address of the user.

      + pub fn email_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.email_address = ::std::option::Option::Some(input.into()); + self + } + ///

      The email address of the user.

      + pub fn set_email_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.email_address = input; + self + } + ///

      The email address of the user.

      + pub fn get_email_address(&self) -> &::std::option::Option<::std::string::String> { + &self.email_address + } + ///

      The first name of the user.

      + pub fn given_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.given_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The first name of the user.

      + pub fn set_given_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.given_name = input; + self + } + ///

      The first name of the user.

      + pub fn get_given_name(&self) -> &::std::option::Option<::std::string::String> { + &self.given_name + } + ///

      The last name of the user.

      + pub fn surname(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.surname = ::std::option::Option::Some(input.into()); + self + } + ///

      The last name of the user.

      + pub fn set_surname(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.surname = input; + self + } + ///

      The last name of the user.

      + pub fn get_surname(&self) -> &::std::option::Option<::std::string::String> { + &self.surname + } + ///

      Indicates whether the user account is active.

      + pub fn enabled(mut self, input: bool) -> Self { + self.enabled = ::std::option::Option::Some(input); + self + } + ///

      Indicates whether the user account is active.

      + pub fn set_enabled(mut self, input: ::std::option::Option) -> Self { + self.enabled = input; + self + } + ///

      Indicates whether the user account is active.

      + pub fn get_enabled(&self) -> &::std::option::Option { + &self.enabled + } + /// Adds a key-value pair to `other_attributes`. + /// + /// To override the contents of this collection use [`set_other_attributes`](Self::set_other_attributes). + /// + ///

      An expression that includes one or more attributes, data types, and values of a user.

      + pub fn other_attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self { + let mut hash_map = self.other_attributes.unwrap_or_default(); + hash_map.insert(k.into(), v); + self.other_attributes = ::std::option::Option::Some(hash_map); + self + } + ///

      An expression that includes one or more attributes, data types, and values of a user.

      + pub fn set_other_attributes( + mut self, + input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>, + ) -> Self { + self.other_attributes = input; + self + } + ///

      An expression that includes one or more attributes, data types, and values of a user.

      + pub fn get_other_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> { + &self.other_attributes + } + /// Consumes the builder and constructs a [`User`](crate::types::User). + /// This method will fail if any of the following fields are not set: + /// - [`sam_account_name`](crate::types::builders::UserBuilder::sam_account_name) + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::types::User { + sid: self.sid, + sam_account_name: self.sam_account_name.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "sam_account_name", + "sam_account_name was not specified but it is required when building User", + ) + })?, + distinguished_name: self.distinguished_name, + user_principal_name: self.user_principal_name, + email_address: self.email_address, + given_name: self.given_name, + surname: self.surname, + enabled: self.enabled, + other_attributes: self.other_attributes, + }) + } +} +impl ::std::fmt::Debug for UserBuilder { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("UserBuilder"); + formatter.field("sid", &self.sid); + formatter.field("sam_account_name", &self.sam_account_name); + formatter.field("distinguished_name", &"*** Sensitive Data Redacted ***"); + formatter.field("user_principal_name", &"*** Sensitive Data Redacted ***"); + formatter.field("email_address", &"*** Sensitive Data Redacted ***"); + formatter.field("given_name", &"*** Sensitive Data Redacted ***"); + formatter.field("surname", &"*** Sensitive Data Redacted ***"); + formatter.field("enabled", &self.enabled); + formatter.field("other_attributes", &self.other_attributes); + formatter.finish() + } +} diff --git a/sdk/directoryservicedata/src/types/_user_summary.rs b/sdk/directoryservicedata/src/types/_user_summary.rs new file mode 100644 index 000000000000..cdb9c296ff8f --- /dev/null +++ b/sdk/directoryservicedata/src/types/_user_summary.rs @@ -0,0 +1,184 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

      A structure containing a subset of the fields of a user object from a directory.

      +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq)] +pub struct UserSummary { + ///

      The unique security identifier (SID) of the user.

      + pub sid: ::std::string::String, + ///

      The name of the user.

      + pub sam_account_name: ::std::string::String, + ///

      The first name of the user.

      + pub given_name: ::std::option::Option<::std::string::String>, + ///

      The last name of the user.

      + pub surname: ::std::option::Option<::std::string::String>, + ///

      Indicates whether the user account is active.

      + pub enabled: bool, +} +impl UserSummary { + ///

      The unique security identifier (SID) of the user.

      + pub fn sid(&self) -> &str { + use std::ops::Deref; + self.sid.deref() + } + ///

      The name of the user.

      + pub fn sam_account_name(&self) -> &str { + use std::ops::Deref; + self.sam_account_name.deref() + } + ///

      The first name of the user.

      + pub fn given_name(&self) -> ::std::option::Option<&str> { + self.given_name.as_deref() + } + ///

      The last name of the user.

      + pub fn surname(&self) -> ::std::option::Option<&str> { + self.surname.as_deref() + } + ///

      Indicates whether the user account is active.

      + pub fn enabled(&self) -> bool { + self.enabled + } +} +impl ::std::fmt::Debug for UserSummary { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("UserSummary"); + formatter.field("sid", &self.sid); + formatter.field("sam_account_name", &self.sam_account_name); + formatter.field("given_name", &"*** Sensitive Data Redacted ***"); + formatter.field("surname", &"*** Sensitive Data Redacted ***"); + formatter.field("enabled", &self.enabled); + formatter.finish() + } +} +impl UserSummary { + /// Creates a new builder-style object to manufacture [`UserSummary`](crate::types::UserSummary). + pub fn builder() -> crate::types::builders::UserSummaryBuilder { + crate::types::builders::UserSummaryBuilder::default() + } +} + +/// A builder for [`UserSummary`](crate::types::UserSummary). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)] +#[non_exhaustive] +pub struct UserSummaryBuilder { + pub(crate) sid: ::std::option::Option<::std::string::String>, + pub(crate) sam_account_name: ::std::option::Option<::std::string::String>, + pub(crate) given_name: ::std::option::Option<::std::string::String>, + pub(crate) surname: ::std::option::Option<::std::string::String>, + pub(crate) enabled: ::std::option::Option, +} +impl UserSummaryBuilder { + ///

      The unique security identifier (SID) of the user.

      + /// This field is required. + pub fn sid(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sid = ::std::option::Option::Some(input.into()); + self + } + ///

      The unique security identifier (SID) of the user.

      + pub fn set_sid(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sid = input; + self + } + ///

      The unique security identifier (SID) of the user.

      + pub fn get_sid(&self) -> &::std::option::Option<::std::string::String> { + &self.sid + } + ///

      The name of the user.

      + /// This field is required. + pub fn sam_account_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.sam_account_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The name of the user.

      + pub fn set_sam_account_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.sam_account_name = input; + self + } + ///

      The name of the user.

      + pub fn get_sam_account_name(&self) -> &::std::option::Option<::std::string::String> { + &self.sam_account_name + } + ///

      The first name of the user.

      + pub fn given_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.given_name = ::std::option::Option::Some(input.into()); + self + } + ///

      The first name of the user.

      + pub fn set_given_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.given_name = input; + self + } + ///

      The first name of the user.

      + pub fn get_given_name(&self) -> &::std::option::Option<::std::string::String> { + &self.given_name + } + ///

      The last name of the user.

      + pub fn surname(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.surname = ::std::option::Option::Some(input.into()); + self + } + ///

      The last name of the user.

      + pub fn set_surname(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.surname = input; + self + } + ///

      The last name of the user.

      + pub fn get_surname(&self) -> &::std::option::Option<::std::string::String> { + &self.surname + } + ///

      Indicates whether the user account is active.

      + /// This field is required. + pub fn enabled(mut self, input: bool) -> Self { + self.enabled = ::std::option::Option::Some(input); + self + } + ///

      Indicates whether the user account is active.

      + pub fn set_enabled(mut self, input: ::std::option::Option) -> Self { + self.enabled = input; + self + } + ///

      Indicates whether the user account is active.

      + pub fn get_enabled(&self) -> &::std::option::Option { + &self.enabled + } + /// Consumes the builder and constructs a [`UserSummary`](crate::types::UserSummary). + /// This method will fail if any of the following fields are not set: + /// - [`sid`](crate::types::builders::UserSummaryBuilder::sid) + /// - [`sam_account_name`](crate::types::builders::UserSummaryBuilder::sam_account_name) + /// - [`enabled`](crate::types::builders::UserSummaryBuilder::enabled) + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::types::UserSummary { + sid: self.sid.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "sid", + "sid was not specified but it is required when building UserSummary", + ) + })?, + sam_account_name: self.sam_account_name.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "sam_account_name", + "sam_account_name was not specified but it is required when building UserSummary", + ) + })?, + given_name: self.given_name, + surname: self.surname, + enabled: self.enabled.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "enabled", + "enabled was not specified but it is required when building UserSummary", + ) + })?, + }) + } +} +impl ::std::fmt::Debug for UserSummaryBuilder { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("UserSummaryBuilder"); + formatter.field("sid", &self.sid); + formatter.field("sam_account_name", &self.sam_account_name); + formatter.field("given_name", &"*** Sensitive Data Redacted ***"); + formatter.field("surname", &"*** Sensitive Data Redacted ***"); + formatter.field("enabled", &self.enabled); + formatter.finish() + } +} diff --git a/sdk/directoryservicedata/src/types/_validation_exception_reason.rs b/sdk/directoryservicedata/src/types/_validation_exception_reason.rs new file mode 100644 index 000000000000..70874d9b83b4 --- /dev/null +++ b/sdk/directoryservicedata/src/types/_validation_exception_reason.rs @@ -0,0 +1,201 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +/// When writing a match expression against `ValidationExceptionReason`, it is important to ensure +/// your code is forward-compatible. That is, if a match arm handles a case for a +/// feature that is supported by the service but has not been represented as an enum +/// variant in a current version of SDK, your code should continue to work when you +/// upgrade SDK to a future version in which the enum does include a variant for that +/// feature. +/// +/// Here is an example of how you can make a match expression forward-compatible: +/// +/// ```text +/// # let validationexceptionreason = unimplemented!(); +/// match validationexceptionreason { +/// ValidationExceptionReason::AttributeExists => { /* ... */ }, +/// ValidationExceptionReason::DuplicateAttribute => { /* ... */ }, +/// ValidationExceptionReason::InvalidAttributeForGroup => { /* ... */ }, +/// ValidationExceptionReason::InvalidAttributeForModify => { /* ... */ }, +/// ValidationExceptionReason::InvalidAttributeForSearch => { /* ... */ }, +/// ValidationExceptionReason::InvalidAttributeForUser => { /* ... */ }, +/// ValidationExceptionReason::InvalidAttributeName => { /* ... */ }, +/// ValidationExceptionReason::InvalidAttributeValue => { /* ... */ }, +/// ValidationExceptionReason::InvalidDirectoryType => { /* ... */ }, +/// ValidationExceptionReason::InvalidNextToken => { /* ... */ }, +/// ValidationExceptionReason::InvalidRealm => { /* ... */ }, +/// ValidationExceptionReason::InvalidSecondaryRegion => { /* ... */ }, +/// ValidationExceptionReason::LdapSizeLimitExceeded => { /* ... */ }, +/// ValidationExceptionReason::LdapUnsupportedOperation => { /* ... */ }, +/// ValidationExceptionReason::MissingAttribute => { /* ... */ }, +/// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ }, +/// _ => { /* ... */ }, +/// } +/// ``` +/// The above code demonstrates that when `validationexceptionreason` represents +/// `NewFeature`, the execution path will lead to the second last match arm, +/// even though the enum does not contain a variant `ValidationExceptionReason::NewFeature` +/// in the current version of SDK. The reason is that the variable `other`, +/// created by the `@` operator, is bound to +/// `ValidationExceptionReason::Unknown(UnknownVariantValue("NewFeature".to_owned()))` +/// and calling `as_str` on it yields `"NewFeature"`. +/// This match expression is forward-compatible when executed with a newer +/// version of SDK where the variant `ValidationExceptionReason::NewFeature` is defined. +/// Specifically, when `validationexceptionreason` represents `NewFeature`, +/// the execution path will hit the second last match arm as before by virtue of +/// calling `as_str` on `ValidationExceptionReason::NewFeature` also yielding `"NewFeature"`. +/// +/// Explicitly matching on the `Unknown` variant should +/// be avoided for two reasons: +/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. +/// - It might inadvertently shadow other intended match arms. +#[allow(missing_docs)] // documentation missing in model +#[non_exhaustive] +#[derive( + ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash, +)] +pub enum ValidationExceptionReason { + #[allow(missing_docs)] // documentation missing in model + AttributeExists, + #[allow(missing_docs)] // documentation missing in model + DuplicateAttribute, + #[allow(missing_docs)] // documentation missing in model + InvalidAttributeForGroup, + #[allow(missing_docs)] // documentation missing in model + InvalidAttributeForModify, + #[allow(missing_docs)] // documentation missing in model + InvalidAttributeForSearch, + #[allow(missing_docs)] // documentation missing in model + InvalidAttributeForUser, + #[allow(missing_docs)] // documentation missing in model + InvalidAttributeName, + #[allow(missing_docs)] // documentation missing in model + InvalidAttributeValue, + #[allow(missing_docs)] // documentation missing in model + InvalidDirectoryType, + #[allow(missing_docs)] // documentation missing in model + InvalidNextToken, + #[allow(missing_docs)] // documentation missing in model + InvalidRealm, + #[allow(missing_docs)] // documentation missing in model + InvalidSecondaryRegion, + #[allow(missing_docs)] // documentation missing in model + LdapSizeLimitExceeded, + #[allow(missing_docs)] // documentation missing in model + LdapUnsupportedOperation, + #[allow(missing_docs)] // documentation missing in model + MissingAttribute, + /// `Unknown` contains new variants that have been added since this code was generated. + #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")] + Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue), +} +impl ::std::convert::From<&str> for ValidationExceptionReason { + fn from(s: &str) -> Self { + match s { + "ATTRIBUTE_EXISTS" => ValidationExceptionReason::AttributeExists, + "DUPLICATE_ATTRIBUTE" => ValidationExceptionReason::DuplicateAttribute, + "INVALID_ATTRIBUTE_FOR_GROUP" => ValidationExceptionReason::InvalidAttributeForGroup, + "INVALID_ATTRIBUTE_FOR_MODIFY" => ValidationExceptionReason::InvalidAttributeForModify, + "INVALID_ATTRIBUTE_FOR_SEARCH" => ValidationExceptionReason::InvalidAttributeForSearch, + "INVALID_ATTRIBUTE_FOR_USER" => ValidationExceptionReason::InvalidAttributeForUser, + "INVALID_ATTRIBUTE_NAME" => ValidationExceptionReason::InvalidAttributeName, + "INVALID_ATTRIBUTE_VALUE" => ValidationExceptionReason::InvalidAttributeValue, + "INVALID_DIRECTORY_TYPE" => ValidationExceptionReason::InvalidDirectoryType, + "INVALID_NEXT_TOKEN" => ValidationExceptionReason::InvalidNextToken, + "INVALID_REALM" => ValidationExceptionReason::InvalidRealm, + "INVALID_SECONDARY_REGION" => ValidationExceptionReason::InvalidSecondaryRegion, + "LDAP_SIZE_LIMIT_EXCEEDED" => ValidationExceptionReason::LdapSizeLimitExceeded, + "LDAP_UNSUPPORTED_OPERATION" => ValidationExceptionReason::LdapUnsupportedOperation, + "MISSING_ATTRIBUTE" => ValidationExceptionReason::MissingAttribute, + other => ValidationExceptionReason::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())), + } + } +} +impl ::std::str::FromStr for ValidationExceptionReason { + type Err = ::std::convert::Infallible; + + fn from_str(s: &str) -> ::std::result::Result::Err> { + ::std::result::Result::Ok(ValidationExceptionReason::from(s)) + } +} +impl ValidationExceptionReason { + /// Returns the `&str` value of the enum member. + pub fn as_str(&self) -> &str { + match self { + ValidationExceptionReason::AttributeExists => "ATTRIBUTE_EXISTS", + ValidationExceptionReason::DuplicateAttribute => "DUPLICATE_ATTRIBUTE", + ValidationExceptionReason::InvalidAttributeForGroup => "INVALID_ATTRIBUTE_FOR_GROUP", + ValidationExceptionReason::InvalidAttributeForModify => "INVALID_ATTRIBUTE_FOR_MODIFY", + ValidationExceptionReason::InvalidAttributeForSearch => "INVALID_ATTRIBUTE_FOR_SEARCH", + ValidationExceptionReason::InvalidAttributeForUser => "INVALID_ATTRIBUTE_FOR_USER", + ValidationExceptionReason::InvalidAttributeName => "INVALID_ATTRIBUTE_NAME", + ValidationExceptionReason::InvalidAttributeValue => "INVALID_ATTRIBUTE_VALUE", + ValidationExceptionReason::InvalidDirectoryType => "INVALID_DIRECTORY_TYPE", + ValidationExceptionReason::InvalidNextToken => "INVALID_NEXT_TOKEN", + ValidationExceptionReason::InvalidRealm => "INVALID_REALM", + ValidationExceptionReason::InvalidSecondaryRegion => "INVALID_SECONDARY_REGION", + ValidationExceptionReason::LdapSizeLimitExceeded => "LDAP_SIZE_LIMIT_EXCEEDED", + ValidationExceptionReason::LdapUnsupportedOperation => "LDAP_UNSUPPORTED_OPERATION", + ValidationExceptionReason::MissingAttribute => "MISSING_ATTRIBUTE", + ValidationExceptionReason::Unknown(value) => value.as_str(), + } + } + /// Returns all the `&str` representations of the enum members. + pub const fn values() -> &'static [&'static str] { + &[ + "ATTRIBUTE_EXISTS", + "DUPLICATE_ATTRIBUTE", + "INVALID_ATTRIBUTE_FOR_GROUP", + "INVALID_ATTRIBUTE_FOR_MODIFY", + "INVALID_ATTRIBUTE_FOR_SEARCH", + "INVALID_ATTRIBUTE_FOR_USER", + "INVALID_ATTRIBUTE_NAME", + "INVALID_ATTRIBUTE_VALUE", + "INVALID_DIRECTORY_TYPE", + "INVALID_NEXT_TOKEN", + "INVALID_REALM", + "INVALID_SECONDARY_REGION", + "LDAP_SIZE_LIMIT_EXCEEDED", + "LDAP_UNSUPPORTED_OPERATION", + "MISSING_ATTRIBUTE", + ] + } +} +impl ::std::convert::AsRef for ValidationExceptionReason { + fn as_ref(&self) -> &str { + self.as_str() + } +} +impl ValidationExceptionReason { + /// Parses the enum value while disallowing unknown variants. + /// + /// Unknown variants will result in an error. + pub fn try_parse(value: &str) -> ::std::result::Result { + match Self::from(value) { + #[allow(deprecated)] + Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)), + known => Ok(known), + } + } +} +impl ::std::fmt::Display for ValidationExceptionReason { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + match self { + ValidationExceptionReason::AttributeExists => write!(f, "ATTRIBUTE_EXISTS"), + ValidationExceptionReason::DuplicateAttribute => write!(f, "DUPLICATE_ATTRIBUTE"), + ValidationExceptionReason::InvalidAttributeForGroup => write!(f, "INVALID_ATTRIBUTE_FOR_GROUP"), + ValidationExceptionReason::InvalidAttributeForModify => write!(f, "INVALID_ATTRIBUTE_FOR_MODIFY"), + ValidationExceptionReason::InvalidAttributeForSearch => write!(f, "INVALID_ATTRIBUTE_FOR_SEARCH"), + ValidationExceptionReason::InvalidAttributeForUser => write!(f, "INVALID_ATTRIBUTE_FOR_USER"), + ValidationExceptionReason::InvalidAttributeName => write!(f, "INVALID_ATTRIBUTE_NAME"), + ValidationExceptionReason::InvalidAttributeValue => write!(f, "INVALID_ATTRIBUTE_VALUE"), + ValidationExceptionReason::InvalidDirectoryType => write!(f, "INVALID_DIRECTORY_TYPE"), + ValidationExceptionReason::InvalidNextToken => write!(f, "INVALID_NEXT_TOKEN"), + ValidationExceptionReason::InvalidRealm => write!(f, "INVALID_REALM"), + ValidationExceptionReason::InvalidSecondaryRegion => write!(f, "INVALID_SECONDARY_REGION"), + ValidationExceptionReason::LdapSizeLimitExceeded => write!(f, "LDAP_SIZE_LIMIT_EXCEEDED"), + ValidationExceptionReason::LdapUnsupportedOperation => write!(f, "LDAP_UNSUPPORTED_OPERATION"), + ValidationExceptionReason::MissingAttribute => write!(f, "MISSING_ATTRIBUTE"), + ValidationExceptionReason::Unknown(value) => write!(f, "{}", value), + } + } +} diff --git a/sdk/directoryservicedata/src/types/builders.rs b/sdk/directoryservicedata/src/types/builders.rs new file mode 100644 index 000000000000..a4c2b9a2c3ca --- /dev/null +++ b/sdk/directoryservicedata/src/types/builders.rs @@ -0,0 +1,10 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::types::_user::UserBuilder; + +pub use crate::types::_group::GroupBuilder; + +pub use crate::types::_user_summary::UserSummaryBuilder; + +pub use crate::types::_group_summary::GroupSummaryBuilder; + +pub use crate::types::_member::MemberBuilder; diff --git a/sdk/directoryservicedata/src/types/error.rs b/sdk/directoryservicedata/src/types/error.rs new file mode 100644 index 000000000000..e7daad937b6e --- /dev/null +++ b/sdk/directoryservicedata/src/types/error.rs @@ -0,0 +1,31 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::types::error::_validation_exception::ValidationException; + +pub use crate::types::error::_throttling_exception::ThrottlingException; + +pub use crate::types::error::_resource_not_found_exception::ResourceNotFoundException; + +pub use crate::types::error::_internal_server_exception::InternalServerException; + +pub use crate::types::error::_directory_unavailable_exception::DirectoryUnavailableException; + +pub use crate::types::error::_conflict_exception::ConflictException; + +pub use crate::types::error::_access_denied_exception::AccessDeniedException; + +mod _access_denied_exception; + +mod _conflict_exception; + +mod _directory_unavailable_exception; + +mod _internal_server_exception; + +mod _resource_not_found_exception; + +mod _throttling_exception; + +mod _validation_exception; + +/// Builders +pub mod builders; diff --git a/sdk/directoryservicedata/src/types/error/_access_denied_exception.rs b/sdk/directoryservicedata/src/types/error/_access_denied_exception.rs new file mode 100644 index 000000000000..d5ddda47e968 --- /dev/null +++ b/sdk/directoryservicedata/src/types/error/_access_denied_exception.rs @@ -0,0 +1,112 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

      You don't have permission to perform the request or access the directory. It can also occur when the DirectoryId doesn't exist or the user, member, or group might be outside of your organizational unit (OU).

      +///

      Make sure that you have the authentication and authorization to perform the action. Review the directory information in the request, and make sure that the object isn't outside of your OU.

      +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct AccessDeniedException { + #[allow(missing_docs)] // documentation missing in model + pub message: ::std::option::Option<::std::string::String>, + ///

      Reason the request was unauthorized.

      + pub reason: ::std::option::Option, + pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata, +} +impl AccessDeniedException { + ///

      Reason the request was unauthorized.

      + pub fn reason(&self) -> ::std::option::Option<&crate::types::AccessDeniedReason> { + self.reason.as_ref() + } +} +impl AccessDeniedException { + /// Returns the error message. + pub fn message(&self) -> ::std::option::Option<&str> { + self.message.as_deref() + } +} +impl ::std::fmt::Display for AccessDeniedException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + ::std::write!(f, "AccessDeniedException")?; + if let ::std::option::Option::Some(inner_1) = &self.message { + { + ::std::write!(f, ": {}", inner_1)?; + } + } + Ok(()) + } +} +impl ::std::error::Error for AccessDeniedException {} +impl ::aws_types::request_id::RequestId for crate::types::error::AccessDeniedException { + fn request_id(&self) -> Option<&str> { + use ::aws_smithy_types::error::metadata::ProvideErrorMetadata; + self.meta().request_id() + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for AccessDeniedException { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + &self.meta + } +} +impl AccessDeniedException { + /// Creates a new builder-style object to manufacture [`AccessDeniedException`](crate::types::error::AccessDeniedException). + pub fn builder() -> crate::types::error::builders::AccessDeniedExceptionBuilder { + crate::types::error::builders::AccessDeniedExceptionBuilder::default() + } +} + +/// A builder for [`AccessDeniedException`](crate::types::error::AccessDeniedException). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct AccessDeniedExceptionBuilder { + pub(crate) message: ::std::option::Option<::std::string::String>, + pub(crate) reason: ::std::option::Option, + meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>, +} +impl AccessDeniedExceptionBuilder { + #[allow(missing_docs)] // documentation missing in model + pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.message = ::std::option::Option::Some(input.into()); + self + } + #[allow(missing_docs)] // documentation missing in model + pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.message = input; + self + } + #[allow(missing_docs)] // documentation missing in model + pub fn get_message(&self) -> &::std::option::Option<::std::string::String> { + &self.message + } + ///

      Reason the request was unauthorized.

      + pub fn reason(mut self, input: crate::types::AccessDeniedReason) -> Self { + self.reason = ::std::option::Option::Some(input); + self + } + ///

      Reason the request was unauthorized.

      + pub fn set_reason(mut self, input: ::std::option::Option) -> Self { + self.reason = input; + self + } + ///

      Reason the request was unauthorized.

      + pub fn get_reason(&self) -> &::std::option::Option { + &self.reason + } + /// Sets error metadata + pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self { + self.meta = Some(meta); + self + } + + /// Sets error metadata + pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self { + self.meta = meta; + self + } + /// Consumes the builder and constructs a [`AccessDeniedException`](crate::types::error::AccessDeniedException). + pub fn build(self) -> crate::types::error::AccessDeniedException { + crate::types::error::AccessDeniedException { + message: self.message, + reason: self.reason, + meta: self.meta.unwrap_or_default(), + } + } +} diff --git a/sdk/directoryservicedata/src/types/error/_conflict_exception.rs b/sdk/directoryservicedata/src/types/error/_conflict_exception.rs new file mode 100644 index 000000000000..20dad3744a63 --- /dev/null +++ b/sdk/directoryservicedata/src/types/error/_conflict_exception.rs @@ -0,0 +1,88 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

      This error will occur when you try to create a resource that conflicts with an existing object. It can also occur when adding a member to a group that the member is already in.

      +///

      This error can be caused by a request sent within the 8-hour idempotency window with the same client token but different input parameters. Client tokens should not be re-used across different requests. After 8 hours, any request with the same client token is treated as a new request.

      +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ConflictException { + #[allow(missing_docs)] // documentation missing in model + pub message: ::std::option::Option<::std::string::String>, + pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata, +} +impl ConflictException { + /// Returns the error message. + pub fn message(&self) -> ::std::option::Option<&str> { + self.message.as_deref() + } +} +impl ::std::fmt::Display for ConflictException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + ::std::write!(f, "ConflictException")?; + if let ::std::option::Option::Some(inner_1) = &self.message { + { + ::std::write!(f, ": {}", inner_1)?; + } + } + Ok(()) + } +} +impl ::std::error::Error for ConflictException {} +impl ::aws_types::request_id::RequestId for crate::types::error::ConflictException { + fn request_id(&self) -> Option<&str> { + use ::aws_smithy_types::error::metadata::ProvideErrorMetadata; + self.meta().request_id() + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ConflictException { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + &self.meta + } +} +impl ConflictException { + /// Creates a new builder-style object to manufacture [`ConflictException`](crate::types::error::ConflictException). + pub fn builder() -> crate::types::error::builders::ConflictExceptionBuilder { + crate::types::error::builders::ConflictExceptionBuilder::default() + } +} + +/// A builder for [`ConflictException`](crate::types::error::ConflictException). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ConflictExceptionBuilder { + pub(crate) message: ::std::option::Option<::std::string::String>, + meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>, +} +impl ConflictExceptionBuilder { + #[allow(missing_docs)] // documentation missing in model + pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.message = ::std::option::Option::Some(input.into()); + self + } + #[allow(missing_docs)] // documentation missing in model + pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.message = input; + self + } + #[allow(missing_docs)] // documentation missing in model + pub fn get_message(&self) -> &::std::option::Option<::std::string::String> { + &self.message + } + /// Sets error metadata + pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self { + self.meta = Some(meta); + self + } + + /// Sets error metadata + pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self { + self.meta = meta; + self + } + /// Consumes the builder and constructs a [`ConflictException`](crate::types::error::ConflictException). + pub fn build(self) -> crate::types::error::ConflictException { + crate::types::error::ConflictException { + message: self.message, + meta: self.meta.unwrap_or_default(), + } + } +} diff --git a/sdk/directoryservicedata/src/types/error/_directory_unavailable_exception.rs b/sdk/directoryservicedata/src/types/error/_directory_unavailable_exception.rs new file mode 100644 index 000000000000..a900be30bdbc --- /dev/null +++ b/sdk/directoryservicedata/src/types/error/_directory_unavailable_exception.rs @@ -0,0 +1,115 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

      The request could not be completed due to a problem in the configuration or current state of the specified directory.

      +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct DirectoryUnavailableException { + #[allow(missing_docs)] // documentation missing in model + pub message: ::std::option::Option<::std::string::String>, + ///

      Reason the request failed for the specified directory.

      + pub reason: ::std::option::Option, + pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata, +} +impl DirectoryUnavailableException { + ///

      Reason the request failed for the specified directory.

      + pub fn reason(&self) -> ::std::option::Option<&crate::types::DirectoryUnavailableReason> { + self.reason.as_ref() + } +} +impl DirectoryUnavailableException { + /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. + pub fn retryable_error_kind(&self) -> ::aws_smithy_types::retry::ErrorKind { + ::aws_smithy_types::retry::ErrorKind::ClientError + } + /// Returns the error message. + pub fn message(&self) -> ::std::option::Option<&str> { + self.message.as_deref() + } +} +impl ::std::fmt::Display for DirectoryUnavailableException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + ::std::write!(f, "DirectoryUnavailableException")?; + if let ::std::option::Option::Some(inner_1) = &self.message { + { + ::std::write!(f, ": {}", inner_1)?; + } + } + Ok(()) + } +} +impl ::std::error::Error for DirectoryUnavailableException {} +impl ::aws_types::request_id::RequestId for crate::types::error::DirectoryUnavailableException { + fn request_id(&self) -> Option<&str> { + use ::aws_smithy_types::error::metadata::ProvideErrorMetadata; + self.meta().request_id() + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for DirectoryUnavailableException { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + &self.meta + } +} +impl DirectoryUnavailableException { + /// Creates a new builder-style object to manufacture [`DirectoryUnavailableException`](crate::types::error::DirectoryUnavailableException). + pub fn builder() -> crate::types::error::builders::DirectoryUnavailableExceptionBuilder { + crate::types::error::builders::DirectoryUnavailableExceptionBuilder::default() + } +} + +/// A builder for [`DirectoryUnavailableException`](crate::types::error::DirectoryUnavailableException). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct DirectoryUnavailableExceptionBuilder { + pub(crate) message: ::std::option::Option<::std::string::String>, + pub(crate) reason: ::std::option::Option, + meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>, +} +impl DirectoryUnavailableExceptionBuilder { + #[allow(missing_docs)] // documentation missing in model + pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.message = ::std::option::Option::Some(input.into()); + self + } + #[allow(missing_docs)] // documentation missing in model + pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.message = input; + self + } + #[allow(missing_docs)] // documentation missing in model + pub fn get_message(&self) -> &::std::option::Option<::std::string::String> { + &self.message + } + ///

      Reason the request failed for the specified directory.

      + pub fn reason(mut self, input: crate::types::DirectoryUnavailableReason) -> Self { + self.reason = ::std::option::Option::Some(input); + self + } + ///

      Reason the request failed for the specified directory.

      + pub fn set_reason(mut self, input: ::std::option::Option) -> Self { + self.reason = input; + self + } + ///

      Reason the request failed for the specified directory.

      + pub fn get_reason(&self) -> &::std::option::Option { + &self.reason + } + /// Sets error metadata + pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self { + self.meta = Some(meta); + self + } + + /// Sets error metadata + pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self { + self.meta = meta; + self + } + /// Consumes the builder and constructs a [`DirectoryUnavailableException`](crate::types::error::DirectoryUnavailableException). + pub fn build(self) -> crate::types::error::DirectoryUnavailableException { + crate::types::error::DirectoryUnavailableException { + message: self.message, + reason: self.reason, + meta: self.meta.unwrap_or_default(), + } + } +} diff --git a/sdk/directoryservicedata/src/types/error/_internal_server_exception.rs b/sdk/directoryservicedata/src/types/error/_internal_server_exception.rs new file mode 100644 index 000000000000..a5efb9a59098 --- /dev/null +++ b/sdk/directoryservicedata/src/types/error/_internal_server_exception.rs @@ -0,0 +1,91 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

      The operation didn't succeed because an internal error occurred. Try again later.

      +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct InternalServerException { + #[allow(missing_docs)] // documentation missing in model + pub message: ::std::option::Option<::std::string::String>, + pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata, +} +impl InternalServerException { + /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. + pub fn retryable_error_kind(&self) -> ::aws_smithy_types::retry::ErrorKind { + ::aws_smithy_types::retry::ErrorKind::ServerError + } + /// Returns the error message. + pub fn message(&self) -> ::std::option::Option<&str> { + self.message.as_deref() + } +} +impl ::std::fmt::Display for InternalServerException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + ::std::write!(f, "InternalServerException")?; + if let ::std::option::Option::Some(inner_1) = &self.message { + { + ::std::write!(f, ": {}", inner_1)?; + } + } + Ok(()) + } +} +impl ::std::error::Error for InternalServerException {} +impl ::aws_types::request_id::RequestId for crate::types::error::InternalServerException { + fn request_id(&self) -> Option<&str> { + use ::aws_smithy_types::error::metadata::ProvideErrorMetadata; + self.meta().request_id() + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for InternalServerException { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + &self.meta + } +} +impl InternalServerException { + /// Creates a new builder-style object to manufacture [`InternalServerException`](crate::types::error::InternalServerException). + pub fn builder() -> crate::types::error::builders::InternalServerExceptionBuilder { + crate::types::error::builders::InternalServerExceptionBuilder::default() + } +} + +/// A builder for [`InternalServerException`](crate::types::error::InternalServerException). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct InternalServerExceptionBuilder { + pub(crate) message: ::std::option::Option<::std::string::String>, + meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>, +} +impl InternalServerExceptionBuilder { + #[allow(missing_docs)] // documentation missing in model + pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.message = ::std::option::Option::Some(input.into()); + self + } + #[allow(missing_docs)] // documentation missing in model + pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.message = input; + self + } + #[allow(missing_docs)] // documentation missing in model + pub fn get_message(&self) -> &::std::option::Option<::std::string::String> { + &self.message + } + /// Sets error metadata + pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self { + self.meta = Some(meta); + self + } + + /// Sets error metadata + pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self { + self.meta = meta; + self + } + /// Consumes the builder and constructs a [`InternalServerException`](crate::types::error::InternalServerException). + pub fn build(self) -> crate::types::error::InternalServerException { + crate::types::error::InternalServerException { + message: self.message, + meta: self.meta.unwrap_or_default(), + } + } +} diff --git a/sdk/directoryservicedata/src/types/error/_resource_not_found_exception.rs b/sdk/directoryservicedata/src/types/error/_resource_not_found_exception.rs new file mode 100644 index 000000000000..ff8dee5dbb6a --- /dev/null +++ b/sdk/directoryservicedata/src/types/error/_resource_not_found_exception.rs @@ -0,0 +1,87 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

      The resource couldn't be found.

      +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ResourceNotFoundException { + #[allow(missing_docs)] // documentation missing in model + pub message: ::std::option::Option<::std::string::String>, + pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata, +} +impl ResourceNotFoundException { + /// Returns the error message. + pub fn message(&self) -> ::std::option::Option<&str> { + self.message.as_deref() + } +} +impl ::std::fmt::Display for ResourceNotFoundException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + ::std::write!(f, "ResourceNotFoundException")?; + if let ::std::option::Option::Some(inner_1) = &self.message { + { + ::std::write!(f, ": {}", inner_1)?; + } + } + Ok(()) + } +} +impl ::std::error::Error for ResourceNotFoundException {} +impl ::aws_types::request_id::RequestId for crate::types::error::ResourceNotFoundException { + fn request_id(&self) -> Option<&str> { + use ::aws_smithy_types::error::metadata::ProvideErrorMetadata; + self.meta().request_id() + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ResourceNotFoundException { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + &self.meta + } +} +impl ResourceNotFoundException { + /// Creates a new builder-style object to manufacture [`ResourceNotFoundException`](crate::types::error::ResourceNotFoundException). + pub fn builder() -> crate::types::error::builders::ResourceNotFoundExceptionBuilder { + crate::types::error::builders::ResourceNotFoundExceptionBuilder::default() + } +} + +/// A builder for [`ResourceNotFoundException`](crate::types::error::ResourceNotFoundException). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ResourceNotFoundExceptionBuilder { + pub(crate) message: ::std::option::Option<::std::string::String>, + meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>, +} +impl ResourceNotFoundExceptionBuilder { + #[allow(missing_docs)] // documentation missing in model + pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.message = ::std::option::Option::Some(input.into()); + self + } + #[allow(missing_docs)] // documentation missing in model + pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.message = input; + self + } + #[allow(missing_docs)] // documentation missing in model + pub fn get_message(&self) -> &::std::option::Option<::std::string::String> { + &self.message + } + /// Sets error metadata + pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self { + self.meta = Some(meta); + self + } + + /// Sets error metadata + pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self { + self.meta = meta; + self + } + /// Consumes the builder and constructs a [`ResourceNotFoundException`](crate::types::error::ResourceNotFoundException). + pub fn build(self) -> crate::types::error::ResourceNotFoundException { + crate::types::error::ResourceNotFoundException { + message: self.message, + meta: self.meta.unwrap_or_default(), + } + } +} diff --git a/sdk/directoryservicedata/src/types/error/_throttling_exception.rs b/sdk/directoryservicedata/src/types/error/_throttling_exception.rs new file mode 100644 index 000000000000..1e02f9a6714a --- /dev/null +++ b/sdk/directoryservicedata/src/types/error/_throttling_exception.rs @@ -0,0 +1,121 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

      The limit on the number of requests per second has been exceeded.

      +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ThrottlingException { + #[allow(missing_docs)] // documentation missing in model + pub message: ::std::string::String, + ///

      The recommended amount of seconds to retry after a throttling exception.

      + pub retry_after_seconds: ::std::option::Option, + pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata, +} +impl ThrottlingException { + ///

      The recommended amount of seconds to retry after a throttling exception.

      + pub fn retry_after_seconds(&self) -> ::std::option::Option { + self.retry_after_seconds + } +} +impl ThrottlingException { + /// Returns `Some(ErrorKind)` if the error is retryable. Otherwise, returns `None`. + pub fn retryable_error_kind(&self) -> ::aws_smithy_types::retry::ErrorKind { + ::aws_smithy_types::retry::ErrorKind::ThrottlingError + } + /// Returns the error message. + pub fn message(&self) -> &str { + &self.message + } +} +impl ::std::fmt::Display for ThrottlingException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + ::std::write!(f, "ThrottlingException")?; + { + ::std::write!(f, ": {}", &self.message)?; + } + Ok(()) + } +} +impl ::std::error::Error for ThrottlingException {} +impl ::aws_types::request_id::RequestId for crate::types::error::ThrottlingException { + fn request_id(&self) -> Option<&str> { + use ::aws_smithy_types::error::metadata::ProvideErrorMetadata; + self.meta().request_id() + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ThrottlingException { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + &self.meta + } +} +impl ThrottlingException { + /// Creates a new builder-style object to manufacture [`ThrottlingException`](crate::types::error::ThrottlingException). + pub fn builder() -> crate::types::error::builders::ThrottlingExceptionBuilder { + crate::types::error::builders::ThrottlingExceptionBuilder::default() + } +} + +/// A builder for [`ThrottlingException`](crate::types::error::ThrottlingException). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ThrottlingExceptionBuilder { + pub(crate) message: ::std::option::Option<::std::string::String>, + pub(crate) retry_after_seconds: ::std::option::Option, + meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>, +} +impl ThrottlingExceptionBuilder { + #[allow(missing_docs)] // documentation missing in model + /// This field is required. + pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.message = ::std::option::Option::Some(input.into()); + self + } + #[allow(missing_docs)] // documentation missing in model + pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.message = input; + self + } + #[allow(missing_docs)] // documentation missing in model + pub fn get_message(&self) -> &::std::option::Option<::std::string::String> { + &self.message + } + ///

      The recommended amount of seconds to retry after a throttling exception.

      + pub fn retry_after_seconds(mut self, input: i32) -> Self { + self.retry_after_seconds = ::std::option::Option::Some(input); + self + } + ///

      The recommended amount of seconds to retry after a throttling exception.

      + pub fn set_retry_after_seconds(mut self, input: ::std::option::Option) -> Self { + self.retry_after_seconds = input; + self + } + ///

      The recommended amount of seconds to retry after a throttling exception.

      + pub fn get_retry_after_seconds(&self) -> &::std::option::Option { + &self.retry_after_seconds + } + /// Sets error metadata + pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self { + self.meta = Some(meta); + self + } + + /// Sets error metadata + pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self { + self.meta = meta; + self + } + /// Consumes the builder and constructs a [`ThrottlingException`](crate::types::error::ThrottlingException). + /// This method will fail if any of the following fields are not set: + /// - [`message`](crate::types::error::builders::ThrottlingExceptionBuilder::message) + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::types::error::ThrottlingException { + message: self.message.ok_or_else(|| { + ::aws_smithy_types::error::operation::BuildError::missing_field( + "message", + "message was not specified but it is required when building ThrottlingException", + ) + })?, + retry_after_seconds: self.retry_after_seconds, + meta: self.meta.unwrap_or_default(), + }) + } +} diff --git a/sdk/directoryservicedata/src/types/error/_validation_exception.rs b/sdk/directoryservicedata/src/types/error/_validation_exception.rs new file mode 100644 index 000000000000..b83fdd6b1b4a --- /dev/null +++ b/sdk/directoryservicedata/src/types/error/_validation_exception.rs @@ -0,0 +1,111 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. + +///

      The request isn't valid. Review the details in the error message to update the invalid parameters or values in your request.

      +#[non_exhaustive] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct ValidationException { + #[allow(missing_docs)] // documentation missing in model + pub message: ::std::option::Option<::std::string::String>, + ///

      Reason the request failed validation.

      + pub reason: ::std::option::Option, + pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata, +} +impl ValidationException { + ///

      Reason the request failed validation.

      + pub fn reason(&self) -> ::std::option::Option<&crate::types::ValidationExceptionReason> { + self.reason.as_ref() + } +} +impl ValidationException { + /// Returns the error message. + pub fn message(&self) -> ::std::option::Option<&str> { + self.message.as_deref() + } +} +impl ::std::fmt::Display for ValidationException { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + ::std::write!(f, "ValidationException")?; + if let ::std::option::Option::Some(inner_1) = &self.message { + { + ::std::write!(f, ": {}", inner_1)?; + } + } + Ok(()) + } +} +impl ::std::error::Error for ValidationException {} +impl ::aws_types::request_id::RequestId for crate::types::error::ValidationException { + fn request_id(&self) -> Option<&str> { + use ::aws_smithy_types::error::metadata::ProvideErrorMetadata; + self.meta().request_id() + } +} +impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ValidationException { + fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { + &self.meta + } +} +impl ValidationException { + /// Creates a new builder-style object to manufacture [`ValidationException`](crate::types::error::ValidationException). + pub fn builder() -> crate::types::error::builders::ValidationExceptionBuilder { + crate::types::error::builders::ValidationExceptionBuilder::default() + } +} + +/// A builder for [`ValidationException`](crate::types::error::ValidationException). +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[non_exhaustive] +pub struct ValidationExceptionBuilder { + pub(crate) message: ::std::option::Option<::std::string::String>, + pub(crate) reason: ::std::option::Option, + meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>, +} +impl ValidationExceptionBuilder { + #[allow(missing_docs)] // documentation missing in model + pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.message = ::std::option::Option::Some(input.into()); + self + } + #[allow(missing_docs)] // documentation missing in model + pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.message = input; + self + } + #[allow(missing_docs)] // documentation missing in model + pub fn get_message(&self) -> &::std::option::Option<::std::string::String> { + &self.message + } + ///

      Reason the request failed validation.

      + pub fn reason(mut self, input: crate::types::ValidationExceptionReason) -> Self { + self.reason = ::std::option::Option::Some(input); + self + } + ///

      Reason the request failed validation.

      + pub fn set_reason(mut self, input: ::std::option::Option) -> Self { + self.reason = input; + self + } + ///

      Reason the request failed validation.

      + pub fn get_reason(&self) -> &::std::option::Option { + &self.reason + } + /// Sets error metadata + pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self { + self.meta = Some(meta); + self + } + + /// Sets error metadata + pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self { + self.meta = meta; + self + } + /// Consumes the builder and constructs a [`ValidationException`](crate::types::error::ValidationException). + pub fn build(self) -> crate::types::error::ValidationException { + crate::types::error::ValidationException { + message: self.message, + reason: self.reason, + meta: self.meta.unwrap_or_default(), + } + } +} diff --git a/sdk/directoryservicedata/src/types/error/builders.rs b/sdk/directoryservicedata/src/types/error/builders.rs new file mode 100644 index 000000000000..720906b2b570 --- /dev/null +++ b/sdk/directoryservicedata/src/types/error/builders.rs @@ -0,0 +1,14 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub use crate::types::error::_validation_exception::ValidationExceptionBuilder; + +pub use crate::types::error::_throttling_exception::ThrottlingExceptionBuilder; + +pub use crate::types::error::_resource_not_found_exception::ResourceNotFoundExceptionBuilder; + +pub use crate::types::error::_internal_server_exception::InternalServerExceptionBuilder; + +pub use crate::types::error::_directory_unavailable_exception::DirectoryUnavailableExceptionBuilder; + +pub use crate::types::error::_conflict_exception::ConflictExceptionBuilder; + +pub use crate::types::error::_access_denied_exception::AccessDeniedExceptionBuilder; diff --git a/sdk/directoryservicedata/tests/endpoint_tests.rs b/sdk/directoryservicedata/tests/endpoint_tests.rs new file mode 100644 index 000000000000..e0cddc84a781 --- /dev/null +++ b/sdk/directoryservicedata/tests/endpoint_tests.rs @@ -0,0 +1,2 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#![cfg(feature = "test-util")] diff --git a/sdk/directoryservicedata/tests/smoketests.rs b/sdk/directoryservicedata/tests/smoketests.rs new file mode 100644 index 000000000000..3cdfee603bb6 --- /dev/null +++ b/sdk/directoryservicedata/tests/smoketests.rs @@ -0,0 +1,53 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +#![cfg(smoketests)] +//! +//! The tests in this module run against live AWS services. As such, +//! they are disabled by default. To enable them, run the tests with +//! +//! ```sh +//! RUSTFLAGS="--cfg smoketests" cargo test +//! ``` +//! +use aws_sdk_directoryservicedata::{config, Client}; +/// Smoke tests for the `describe_group` operation +#[::tokio::test] +async fn test_describe_group_failure() { + let config = ::aws_config::load_defaults(config::BehaviorVersion::latest()).await; + let conf = config::Config::from(&config) + .to_builder() + .region(::aws_types::region::Region::new("us-west-2")) + .use_dual_stack(false) + .use_fips(false) + .build(); + let client = Client::from_conf(conf); + let res = client + .describe_group() + .set_directory_id(::std::option::Option::Some("d-1111111111".to_owned())) + .set_sam_account_name(::std::option::Option::Some("test-group".to_owned())) + .send() + .await; + let err = res.expect_err("request should fail"); + let err = err.into_service_error(); + assert!(err.is_access_denied_exception()) +} +/// Smoke tests for the `describe_user` operation +#[::tokio::test] +async fn test_describe_user_failure() { + let config = ::aws_config::load_defaults(config::BehaviorVersion::latest()).await; + let conf = config::Config::from(&config) + .to_builder() + .region(::aws_types::region::Region::new("us-west-2")) + .use_dual_stack(false) + .use_fips(false) + .build(); + let client = Client::from_conf(conf); + let res = client + .describe_user() + .set_directory_id(::std::option::Option::Some("d-1111111111".to_owned())) + .set_sam_account_name(::std::option::Option::Some("test-user".to_owned())) + .send() + .await; + let err = res.expect_err("request should fail"); + let err = err.into_service_error(); + assert!(err.is_access_denied_exception()) +} diff --git a/sdk/guardduty/Cargo.toml b/sdk/guardduty/Cargo.toml index ce5607a1038c..667e96a6dd25 100644 --- a/sdk/guardduty/Cargo.toml +++ b/sdk/guardduty/Cargo.toml @@ -1,7 +1,7 @@ # Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. [package] name = "aws-sdk-guardduty" -version = "1.49.0" +version = "1.50.0" authors = ["AWS Rust SDK Team ", "Russell Cohen "] description = "AWS SDK for Amazon GuardDuty" edition = "2021" diff --git a/sdk/guardduty/README.md b/sdk/guardduty/README.md index 385de2ea5469..46c914bfeeb5 100644 --- a/sdk/guardduty/README.md +++ b/sdk/guardduty/README.md @@ -18,7 +18,7 @@ your project, add the following to your **Cargo.toml** file: ```toml [dependencies] aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -aws-sdk-guardduty = "1.49.0" +aws-sdk-guardduty = "1.50.0" tokio = { version = "1", features = ["full"] } ``` diff --git a/sdk/guardduty/src/lib.rs b/sdk/guardduty/src/lib.rs index ede98acb2166..b132653910d8 100644 --- a/sdk/guardduty/src/lib.rs +++ b/sdk/guardduty/src/lib.rs @@ -35,7 +35,7 @@ //! ```toml //! [dependencies] //! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -//! aws-sdk-guardduty = "1.49.0" +//! aws-sdk-guardduty = "1.50.0" //! tokio = { version = "1", features = ["full"] } //! ``` //! diff --git a/sdk/guardduty/src/protocol_serde/shape_ecs_task_details.rs b/sdk/guardduty/src/protocol_serde/shape_ecs_task_details.rs index f03615b38ed4..56bf98677151 100644 --- a/sdk/guardduty/src/protocol_serde/shape_ecs_task_details.rs +++ b/sdk/guardduty/src/protocol_serde/shape_ecs_task_details.rs @@ -70,6 +70,13 @@ where .transpose()?, ); } + "launchType" => { + builder = builder.set_launch_type( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()?, + ); + } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, }, other => { diff --git a/sdk/guardduty/src/protocol_serde/shape_kubernetes_api_call_action.rs b/sdk/guardduty/src/protocol_serde/shape_kubernetes_api_call_action.rs index c7a5e6a97cb2..fa5e424e990c 100644 --- a/sdk/guardduty/src/protocol_serde/shape_kubernetes_api_call_action.rs +++ b/sdk/guardduty/src/protocol_serde/shape_kubernetes_api_call_action.rs @@ -28,7 +28,7 @@ where .transpose()?, ); } - "sourceIps" => { + "sourceIPs" => { builder = builder.set_source_ips(crate::protocol_serde::shape_source_ips::de_source_ips(tokens)?); } "userAgent" => { diff --git a/sdk/guardduty/src/types/_ecs_task_details.rs b/sdk/guardduty/src/types/_ecs_task_details.rs index a2f1f4105c98..a56182fd0e7e 100644 --- a/sdk/guardduty/src/types/_ecs_task_details.rs +++ b/sdk/guardduty/src/types/_ecs_task_details.rs @@ -24,6 +24,8 @@ pub struct EcsTaskDetails { pub containers: ::std::option::Option<::std::vec::Vec>, ///

      The name of the task group that's associated with the task.

      pub group: ::std::option::Option<::std::string::String>, + ///

      A capacity on which the task is running. For example, Fargate and EC2.

      + pub launch_type: ::std::option::Option<::std::string::String>, } impl EcsTaskDetails { ///

      The Amazon Resource Name (ARN) of the task.

      @@ -72,6 +74,10 @@ impl EcsTaskDetails { pub fn group(&self) -> ::std::option::Option<&str> { self.group.as_deref() } + ///

      A capacity on which the task is running. For example, Fargate and EC2.

      + pub fn launch_type(&self) -> ::std::option::Option<&str> { + self.launch_type.as_deref() + } } impl EcsTaskDetails { /// Creates a new builder-style object to manufacture [`EcsTaskDetails`](crate::types::EcsTaskDetails). @@ -94,6 +100,7 @@ pub struct EcsTaskDetailsBuilder { pub(crate) volumes: ::std::option::Option<::std::vec::Vec>, pub(crate) containers: ::std::option::Option<::std::vec::Vec>, pub(crate) group: ::std::option::Option<::std::string::String>, + pub(crate) launch_type: ::std::option::Option<::std::string::String>, } impl EcsTaskDetailsBuilder { ///

      The Amazon Resource Name (ARN) of the task.

      @@ -254,6 +261,20 @@ impl EcsTaskDetailsBuilder { pub fn get_group(&self) -> &::std::option::Option<::std::string::String> { &self.group } + ///

      A capacity on which the task is running. For example, Fargate and EC2.

      + pub fn launch_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.launch_type = ::std::option::Option::Some(input.into()); + self + } + ///

      A capacity on which the task is running. For example, Fargate and EC2.

      + pub fn set_launch_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.launch_type = input; + self + } + ///

      A capacity on which the task is running. For example, Fargate and EC2.

      + pub fn get_launch_type(&self) -> &::std::option::Option<::std::string::String> { + &self.launch_type + } /// Consumes the builder and constructs a [`EcsTaskDetails`](crate::types::EcsTaskDetails). pub fn build(self) -> crate::types::EcsTaskDetails { crate::types::EcsTaskDetails { @@ -267,6 +288,7 @@ impl EcsTaskDetailsBuilder { volumes: self.volumes, containers: self.containers, group: self.group, + launch_type: self.launch_type, } } } diff --git a/sdk/mailmanager/Cargo.toml b/sdk/mailmanager/Cargo.toml index fec7681d8962..6a49826a5aef 100644 --- a/sdk/mailmanager/Cargo.toml +++ b/sdk/mailmanager/Cargo.toml @@ -1,7 +1,7 @@ # Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. [package] name = "aws-sdk-mailmanager" -version = "1.18.0" +version = "1.19.0" authors = ["AWS Rust SDK Team ", "Russell Cohen "] description = "AWS SDK for MailManager" edition = "2021" diff --git a/sdk/mailmanager/README.md b/sdk/mailmanager/README.md index a8d419b48e71..644b4ac01346 100644 --- a/sdk/mailmanager/README.md +++ b/sdk/mailmanager/README.md @@ -1,8 +1,8 @@ # aws-sdk-mailmanager -[AWS SES Mail Manager API](http://aws.amazon.com/ses) contains operations and data types that comprise the Mail Manager feature of Amazon Simple Email Service. +The Amazon SES Mail Manager API contains operations and data types that comprise the Mail Manager feature of [Amazon Simple Email Service (SES)](http://aws.amazon.com/ses). -Mail Manager is a set of Amazon SES email gateway features designed to help you strengthen your organization's email infrastructure, simplify email workflow management, and streamline email compliance control. To learn more, see the [Mail Manager chapter](https://docs.aws.amazon.com/ses/latest/dg/eb.html) in the Amazon SES Developer Guide. +Mail Manager is a set of Amazon SES email gateway features designed to help you strengthen your organization's email infrastructure, simplify email workflow management, and streamline email compliance control. To learn more, see the [Mail Manager chapter](https://docs.aws.amazon.com/ses/latest/dg/eb.html) in the _Amazon SES Developer Guide_. ## Getting Started @@ -16,7 +16,7 @@ your project, add the following to your **Cargo.toml** file: ```toml [dependencies] aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -aws-sdk-mailmanager = "1.18.0" +aws-sdk-mailmanager = "1.19.0" tokio = { version = "1", features = ["full"] } ``` diff --git a/sdk/mailmanager/src/lib.rs b/sdk/mailmanager/src/lib.rs index 63a34a4b9d5d..a42ecd1ad430 100644 --- a/sdk/mailmanager/src/lib.rs +++ b/sdk/mailmanager/src/lib.rs @@ -17,9 +17,9 @@ #![forbid(unsafe_code)] #![warn(missing_docs)] #![cfg_attr(docsrs, feature(doc_auto_cfg))] -//! [AWS SES Mail Manager API](http://aws.amazon.com/ses) contains operations and data types that comprise the Mail Manager feature of Amazon Simple Email Service. +//! The Amazon SES Mail Manager API contains operations and data types that comprise the Mail Manager feature of [Amazon Simple Email Service (SES)](http://aws.amazon.com/ses). //! -//! Mail Manager is a set of Amazon SES email gateway features designed to help you strengthen your organization's email infrastructure, simplify email workflow management, and streamline email compliance control. To learn more, see the [Mail Manager chapter](https://docs.aws.amazon.com/ses/latest/dg/eb.html) in the Amazon SES Developer Guide. +//! Mail Manager is a set of Amazon SES email gateway features designed to help you strengthen your organization's email infrastructure, simplify email workflow management, and streamline email compliance control. To learn more, see the [Mail Manager chapter](https://docs.aws.amazon.com/ses/latest/dg/eb.html) in the _Amazon SES Developer Guide_. //! //! ## Getting Started //! @@ -33,7 +33,7 @@ //! ```toml //! [dependencies] //! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -//! aws-sdk-mailmanager = "1.18.0" +//! aws-sdk-mailmanager = "1.19.0" //! tokio = { version = "1", features = ["full"] } //! ``` //! diff --git a/sdk/mailmanager/src/operation/update_rule_set/builders.rs b/sdk/mailmanager/src/operation/update_rule_set/builders.rs index 4454aed940a8..7219d5484ede 100644 --- a/sdk/mailmanager/src/operation/update_rule_set/builders.rs +++ b/sdk/mailmanager/src/operation/update_rule_set/builders.rs @@ -22,7 +22,7 @@ impl crate::operation::update_rule_set::builders::UpdateRuleSetInputBuilder { } /// Fluent builder constructing a request to `UpdateRuleSet`. /// -///

      >Update attributes of an already provisioned rule set.

      +///

      Update attributes of an already provisioned rule set.

      #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct UpdateRuleSetFluentBuilder { handle: ::std::sync::Arc, diff --git a/sdk/mailmanager/src/protocol_serde/shape_rule_string_to_evaluate.rs b/sdk/mailmanager/src/protocol_serde/shape_rule_string_to_evaluate.rs index 335566616801..7cc468d8ff3a 100644 --- a/sdk/mailmanager/src/protocol_serde/shape_rule_string_to_evaluate.rs +++ b/sdk/mailmanager/src/protocol_serde/shape_rule_string_to_evaluate.rs @@ -7,6 +7,9 @@ pub fn ser_rule_string_to_evaluate( crate::types::RuleStringToEvaluate::Attribute(inner) => { object_2.key("Attribute").string(inner.as_str()); } + crate::types::RuleStringToEvaluate::MimeHeaderAttribute(inner) => { + object_2.key("MimeHeaderAttribute").string(inner.as_str()); + } crate::types::RuleStringToEvaluate::Unknown => { return Err(::aws_smithy_types::error::operation::SerializationError::unknown_variant( "RuleStringToEvaluate", @@ -54,6 +57,14 @@ where ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'Attribute' cannot be null") })?, )), + "MimeHeaderAttribute" => Some(crate::types::RuleStringToEvaluate::MimeHeaderAttribute( + ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())? + .map(|s| s.to_unescaped().map(|u| u.into_owned())) + .transpose()? + .ok_or_else(|| { + ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'MimeHeaderAttribute' cannot be null") + })?, + )), _ => { ::aws_smithy_json::deserialize::token::skip_value(tokens)?; Some(crate::types::RuleStringToEvaluate::Unknown) diff --git a/sdk/mailmanager/src/types/_rule_string_to_evaluate.rs b/sdk/mailmanager/src/types/_rule_string_to_evaluate.rs index bcfb0de23618..868e1b3385c8 100644 --- a/sdk/mailmanager/src/types/_rule_string_to_evaluate.rs +++ b/sdk/mailmanager/src/types/_rule_string_to_evaluate.rs @@ -6,6 +6,8 @@ pub enum RuleStringToEvaluate { ///

      The email attribute to evaluate in a string condition expression.

      Attribute(crate::types::RuleStringEmailAttribute), + ///

      The email MIME X-Header attribute to evaluate in a string condition expression.

      + MimeHeaderAttribute(::std::string::String), /// The `Unknown` variant represents cases where new union variant was received. Consider upgrading the SDK to the latest available version. /// An unknown enum variant /// @@ -17,7 +19,6 @@ pub enum RuleStringToEvaluate { Unknown, } impl RuleStringToEvaluate { - #[allow(irrefutable_let_patterns)] /// Tries to convert the enum instance into [`Attribute`](crate::types::RuleStringToEvaluate::Attribute), extracting the inner [`RuleStringEmailAttribute`](crate::types::RuleStringEmailAttribute). /// Returns `Err(&Self)` if it can't be converted. pub fn as_attribute(&self) -> ::std::result::Result<&crate::types::RuleStringEmailAttribute, &Self> { @@ -31,6 +32,19 @@ impl RuleStringToEvaluate { pub fn is_attribute(&self) -> bool { self.as_attribute().is_ok() } + /// Tries to convert the enum instance into [`MimeHeaderAttribute`](crate::types::RuleStringToEvaluate::MimeHeaderAttribute), extracting the inner [`String`](::std::string::String). + /// Returns `Err(&Self)` if it can't be converted. + pub fn as_mime_header_attribute(&self) -> ::std::result::Result<&::std::string::String, &Self> { + if let RuleStringToEvaluate::MimeHeaderAttribute(val) = &self { + ::std::result::Result::Ok(val) + } else { + ::std::result::Result::Err(self) + } + } + /// Returns true if this is a [`MimeHeaderAttribute`](crate::types::RuleStringToEvaluate::MimeHeaderAttribute). + pub fn is_mime_header_attribute(&self) -> bool { + self.as_mime_header_attribute().is_ok() + } /// Returns true if the enum instance is the `Unknown` variant. pub fn is_unknown(&self) -> bool { matches!(self, Self::Unknown) diff --git a/sdk/rds/Cargo.toml b/sdk/rds/Cargo.toml index c416f94d6118..80c1c41e1fa8 100644 --- a/sdk/rds/Cargo.toml +++ b/sdk/rds/Cargo.toml @@ -1,7 +1,7 @@ # Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. [package] name = "aws-sdk-rds" -version = "1.55.0" +version = "1.55.1" authors = ["AWS Rust SDK Team ", "Russell Cohen "] description = "AWS SDK for Amazon Relational Database Service" edition = "2021" diff --git a/sdk/rds/README.md b/sdk/rds/README.md index a6eb3f089032..c93c131ec8b7 100644 --- a/sdk/rds/README.md +++ b/sdk/rds/README.md @@ -28,7 +28,7 @@ your project, add the following to your **Cargo.toml** file: ```toml [dependencies] aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -aws-sdk-rds = "1.55.0" +aws-sdk-rds = "1.55.1" tokio = { version = "1", features = ["full"] } ``` diff --git a/sdk/rds/src/lib.rs b/sdk/rds/src/lib.rs index 82caa02c7a67..ba3bf54a2086 100644 --- a/sdk/rds/src/lib.rs +++ b/sdk/rds/src/lib.rs @@ -45,7 +45,7 @@ //! ```toml //! [dependencies] //! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -//! aws-sdk-rds = "1.55.0" +//! aws-sdk-rds = "1.55.1" //! tokio = { version = "1", features = ["full"] } //! ``` //! diff --git a/sdk/rds/src/operation/restore_db_instance_from_db_snapshot/builders.rs b/sdk/rds/src/operation/restore_db_instance_from_db_snapshot/builders.rs index 3c43980c3962..287270520951 100644 --- a/sdk/rds/src/operation/restore_db_instance_from_db_snapshot/builders.rs +++ b/sdk/rds/src/operation/restore_db_instance_from_db_snapshot/builders.rs @@ -24,7 +24,8 @@ impl crate::operation::restore_db_instance_from_db_snapshot::builders::RestoreDb /// ///

      Creates a new DB instance from a DB snapshot. The target database is created from the source database restore point with most of the source's original configuration, including the default security group and DB parameter group. By default, the new DB instance is created as a Single-AZ deployment, except when the instance is a SQL Server instance that has an option group associated with mirroring. In this case, the instance becomes a Multi-AZ deployment, not a Single-AZ deployment.

      ///

      If you want to replace your original DB instance with the new, restored DB instance, then rename your original DB instance before you call the RestoreDBInstanceFromDBSnapshot operation. RDS doesn't allow two DB instances with the same name. After you have renamed your original DB instance with a different identifier, then you can pass the original name of the DB instance as the DBInstanceIdentifier in the call to the RestoreDBInstanceFromDBSnapshot operation. The result is that you replace the original DB instance with the DB instance created from the snapshot.

      -///

      If you are restoring from a shared manual DB snapshot, the DBSnapshotIdentifier must be the ARN of the shared DB snapshot.

      +///

      If you are restoring from a shared manual DB snapshot, the DBSnapshotIdentifier must be the ARN of the shared DB snapshot.

      +///

      To restore from a DB snapshot with an unsupported engine version, you must first upgrade the engine version of the snapshot. For more information about upgrading a RDS for MySQL DB snapshot engine version, see Upgrading a MySQL DB snapshot engine version. For more information about upgrading a RDS for PostgreSQL DB snapshot engine version, Upgrading a PostgreSQL DB snapshot engine version.

      ///

      This command doesn't apply to Aurora MySQL and Aurora PostgreSQL. For Aurora, use RestoreDBClusterFromSnapshot.

      ///
      #[derive(::std::clone::Clone, ::std::fmt::Debug)] diff --git a/sdk/s3/Cargo.toml b/sdk/s3/Cargo.toml index d1e3e04c8c23..0990621508d4 100644 --- a/sdk/s3/Cargo.toml +++ b/sdk/s3/Cargo.toml @@ -1,7 +1,7 @@ # Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. [package] name = "aws-sdk-s3" -version = "1.50.0" +version = "1.51.0" authors = ["AWS Rust SDK Team ", "Russell Cohen "] description = "AWS SDK for Amazon Simple Storage Service" edition = "2021" diff --git a/sdk/s3/README.md b/sdk/s3/README.md index b33c7f6410aa..9ae770d0e1b7 100644 --- a/sdk/s3/README.md +++ b/sdk/s3/README.md @@ -12,7 +12,7 @@ your project, add the following to your **Cargo.toml** file: ```toml [dependencies] aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -aws-sdk-s3 = "1.50.0" +aws-sdk-s3 = "1.51.0" tokio = { version = "1", features = ["full"] } ``` diff --git a/sdk/s3/src/client/complete_multipart_upload.rs b/sdk/s3/src/client/complete_multipart_upload.rs index 4a893f2dbba6..2b405bdc208c 100644 --- a/sdk/s3/src/client/complete_multipart_upload.rs +++ b/sdk/s3/src/client/complete_multipart_upload.rs @@ -27,10 +27,10 @@ impl super::Client { /// - [`checksum_crc32_c(Option)`](crate::operation::complete_multipart_upload::CompleteMultipartUploadOutput::checksum_crc32_c):

      The base64-encoded, 32-bit CRC32C checksum of the object. This will only be present if it was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the Amazon S3 User Guide.

      /// - [`checksum_sha1(Option)`](crate::operation::complete_multipart_upload::CompleteMultipartUploadOutput::checksum_sha1):

      The base64-encoded, 160-bit SHA-1 digest of the object. This will only be present if it was uploaded with the object. When you use the API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the Amazon S3 User Guide.

      /// - [`checksum_sha256(Option)`](crate::operation::complete_multipart_upload::CompleteMultipartUploadOutput::checksum_sha256):

      The base64-encoded, 256-bit SHA-256 digest of the object. This will only be present if it was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the Amazon S3 User Guide.

      - /// - [`server_side_encryption(Option)`](crate::operation::complete_multipart_upload::CompleteMultipartUploadOutput::server_side_encryption):

      The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms).

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      + /// - [`server_side_encryption(Option)`](crate::operation::complete_multipart_upload::CompleteMultipartUploadOutput::server_side_encryption):

      The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms).

      /// - [`version_id(Option)`](crate::operation::complete_multipart_upload::CompleteMultipartUploadOutput::version_id):

      Version ID of the newly created object, in case the bucket has versioning turned on.

      This functionality is not supported for directory buckets.

      - /// - [`ssekms_key_id(Option)`](crate::operation::complete_multipart_upload::CompleteMultipartUploadOutput::ssekms_key_id):

      If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

      This functionality is not supported for directory buckets.

      - /// - [`bucket_key_enabled(Option)`](crate::operation::complete_multipart_upload::CompleteMultipartUploadOutput::bucket_key_enabled):

      Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      This functionality is not supported for directory buckets.

      + /// - [`ssekms_key_id(Option)`](crate::operation::complete_multipart_upload::CompleteMultipartUploadOutput::ssekms_key_id):

      If present, indicates the ID of the KMS key that was used for object encryption.

      + /// - [`bucket_key_enabled(Option)`](crate::operation::complete_multipart_upload::CompleteMultipartUploadOutput::bucket_key_enabled):

      Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      /// - [`request_charged(Option)`](crate::operation::complete_multipart_upload::CompleteMultipartUploadOutput::request_charged):

      If present, indicates that the requester was successfully charged for the request.

      This functionality is not supported for directory buckets.

      /// - On failure, responds with [`SdkError`](crate::operation::complete_multipart_upload::CompleteMultipartUploadError) pub fn complete_multipart_upload(&self) -> crate::operation::complete_multipart_upload::builders::CompleteMultipartUploadFluentBuilder { diff --git a/sdk/s3/src/client/copy_object.rs b/sdk/s3/src/client/copy_object.rs index aa307d9cc203..7aa3787a8819 100644 --- a/sdk/s3/src/client/copy_object.rs +++ b/sdk/s3/src/client/copy_object.rs @@ -25,15 +25,15 @@ impl super::Client { /// - [`metadata(impl Into, impl Into)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::metadata) / [`set_metadata(Option>)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::set_metadata):
      required: **false**

      A map of metadata to store with the object in S3.


      /// - [`metadata_directive(MetadataDirective)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::metadata_directive) / [`set_metadata_directive(Option)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::set_metadata_directive):
      required: **false**

      Specifies whether the metadata is copied from the source object or replaced with metadata that's provided in the request. When copying an object, you can preserve all metadata (the default) or specify new metadata. If this header isn’t specified, COPY is the default behavior.

      General purpose bucket - For general purpose buckets, when you grant permissions, you can use the s3:x-amz-metadata-directive condition key to enforce certain metadata behavior when objects are uploaded. For more information, see Amazon S3 condition key examples in the Amazon S3 User Guide.

      x-amz-website-redirect-location is unique to each object and is not copied when using the x-amz-metadata-directive header. To copy the value, you must specify x-amz-website-redirect-location in the request header.


      /// - [`tagging_directive(TaggingDirective)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::tagging_directive) / [`set_tagging_directive(Option)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::set_tagging_directive):
      required: **false**

      Specifies whether the object tag-set is copied from the source object or replaced with the tag-set that's provided in the request.

      The default value is COPY.

      Directory buckets - For directory buckets in a CopyObject operation, only the empty tag-set is supported. Any requests that attempt to write non-empty tags into directory buckets will receive a 501 Not Implemented status code. When the destination bucket is a directory bucket, you will receive a 501 Not Implemented response in any of the following situations:

      • When you attempt to COPY the tag-set from an S3 source object that has non-empty tags.

      • When you attempt to REPLACE the tag-set of a source object and set a non-empty value to x-amz-tagging.

      • When you don't set the x-amz-tagging-directive header and the source object has non-empty tags. This is because the default value of x-amz-tagging-directive is COPY.

      Because only the empty tag-set is supported for directory buckets in a CopyObject operation, the following situations are allowed:

      • When you attempt to COPY the tag-set from a directory bucket source object that has no tags to a general purpose bucket. It copies an empty tag-set to the destination object.

      • When you attempt to REPLACE the tag-set of a directory bucket source object and set the x-amz-tagging value of the directory bucket destination object to empty.

      • When you attempt to REPLACE the tag-set of a general purpose bucket source object that has non-empty tags and set the x-amz-tagging value of the directory bucket destination object to empty.

      • When you attempt to REPLACE the tag-set of a directory bucket source object and don't set the x-amz-tagging value of the directory bucket destination object. This is because the default value of x-amz-tagging is the empty value.


      - /// - [`server_side_encryption(ServerSideEncryption)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::server_side_encryption) / [`set_server_side_encryption(Option)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::set_server_side_encryption):
      required: **false**

      The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse). Unrecognized or unsupported values won’t write a destination object and will receive a 400 Bad Request response.

      Amazon S3 automatically encrypts all new objects that are copied to an S3 bucket. When copying an object, if you don't specify encryption information in your copy request, the encryption setting of the target object is set to the default encryption configuration of the destination bucket. By default, all buckets have a base level of encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). If the destination bucket has a default encryption configuration that uses server-side encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), or server-side encryption with customer-provided encryption keys (SSE-C), Amazon S3 uses the corresponding KMS key, or a customer-provided key to encrypt the target object copy.

      When you perform a CopyObject operation, if you want to use a different type of encryption setting for the target object, you can specify appropriate encryption-related headers to encrypt the target object with an Amazon S3 managed key, a KMS key, or a customer-provided key. If the encryption setting in your request is different from the default encryption configuration of the destination bucket, the encryption setting in your request takes precedence.

      With server-side encryption, Amazon S3 encrypts your data as it writes your data to disks in its data centers and decrypts the data when you access it. For more information about server-side encryption, see Using Server-Side Encryption in the Amazon S3 User Guide.

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.


      + /// - [`server_side_encryption(ServerSideEncryption)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::server_side_encryption) / [`set_server_side_encryption(Option)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::set_server_side_encryption):
      required: **false**

      The server-side encryption algorithm used when storing this object in Amazon S3. Unrecognized or unsupported values won’t write a destination object and will receive a 400 Bad Request response.

      Amazon S3 automatically encrypts all new objects that are copied to an S3 bucket. When copying an object, if you don't specify encryption information in your copy request, the encryption setting of the target object is set to the default encryption configuration of the destination bucket. By default, all buckets have a base level of encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). If the destination bucket has a different default encryption configuration, Amazon S3 uses the corresponding encryption key to encrypt the target object copy.

      With server-side encryption, Amazon S3 encrypts your data as it writes your data to disks in its data centers and decrypts the data when you access it. For more information about server-side encryption, see Using Server-Side Encryption in the Amazon S3 User Guide.

      General purpose buckets

      • For general purpose buckets, there are the following supported options for server-side encryption: server-side encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), and server-side encryption with customer-provided encryption keys (SSE-C). Amazon S3 uses the corresponding KMS key, or a customer-provided key to encrypt the target object copy.

      • When you perform a CopyObject operation, if you want to use a different type of encryption setting for the target object, you can specify appropriate encryption-related headers to encrypt the target object with an Amazon S3 managed key, a KMS key, or a customer-provided key. If the encryption setting in your request is different from the default encryption configuration of the destination bucket, the encryption setting in your request takes precedence.

      Directory buckets

      • For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

      • To encrypt new object copies to a directory bucket with SSE-KMS, we recommend you specify SSE-KMS as the directory bucket's default encryption configuration with a KMS key (specifically, a customer managed key). Amazon Web Services managed key (aws/s3) isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. After you specify a customer managed key for SSE-KMS, you can't override the customer managed key for the bucket's SSE-KMS configuration. Then, when you perform a CopyObject operation and want to specify server-side encryption settings for new object copies with SSE-KMS in the encryption-related request headers, you must ensure the encryption key is the same customer managed key that you specified for the directory bucket's default encryption configuration.


      /// - [`storage_class(StorageClass)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::storage_class) / [`set_storage_class(Option)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::set_storage_class):
      required: **false**

      If the x-amz-storage-class header is not used, the copied object will be stored in the STANDARD Storage Class by default. The STANDARD storage class provides high durability and high availability. Depending on performance needs, you can specify a different Storage Class.

      • Directory buckets - For directory buckets, only the S3 Express One Zone storage class is supported to store newly created objects. Unsupported storage class values won't write a destination object and will respond with the HTTP status code 400 Bad Request.

      • Amazon S3 on Outposts - S3 on Outposts only uses the OUTPOSTS Storage Class.

      You can use the CopyObject action to change the storage class of an object that is already stored in Amazon S3 by using the x-amz-storage-class header. For more information, see Storage Classes in the Amazon S3 User Guide.

      Before using an object as a source object for the copy operation, you must restore a copy of it if it meets any of the following conditions:

      • The storage class of the source object is GLACIER or DEEP_ARCHIVE.

      • The storage class of the source object is INTELLIGENT_TIERING and it's S3 Intelligent-Tiering access tier is Archive Access or Deep Archive Access.

      For more information, see RestoreObject and Copying Objects in the Amazon S3 User Guide.


      /// - [`website_redirect_location(impl Into)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::website_redirect_location) / [`set_website_redirect_location(Option)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::set_website_redirect_location):
      required: **false**

      If the destination bucket is configured as a website, redirects requests for this object copy to another object in the same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata. This value is unique to each object and is not copied when using the x-amz-metadata-directive header. Instead, you may opt to provide this header in combination with the x-amz-metadata-directive header.

      This functionality is not supported for directory buckets.


      /// - [`sse_customer_algorithm(impl Into)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::sse_customer_algorithm) / [`set_sse_customer_algorithm(Option)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::set_sse_customer_algorithm):
      required: **false**

      Specifies the algorithm to use when encrypting the object (for example, AES256).

      When you perform a CopyObject operation, if you want to use a different type of encryption setting for the target object, you can specify appropriate encryption-related headers to encrypt the target object with an Amazon S3 managed key, a KMS key, or a customer-provided key. If the encryption setting in your request is different from the default encryption configuration of the destination bucket, the encryption setting in your request takes precedence.

      This functionality is not supported when the destination bucket is a directory bucket.


      /// - [`sse_customer_key(impl Into)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::sse_customer_key) / [`set_sse_customer_key(Option)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::set_sse_customer_key):
      required: **false**

      Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded. Amazon S3 does not store the encryption key. The key must be appropriate for use with the algorithm specified in the x-amz-server-side-encryption-customer-algorithm header.

      This functionality is not supported when the destination bucket is a directory bucket.


      /// - [`sse_customer_key_md5(impl Into)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::sse_customer_key_md5) / [`set_sse_customer_key_md5(Option)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::set_sse_customer_key_md5):
      required: **false**

      Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error.

      This functionality is not supported when the destination bucket is a directory bucket.


      - /// - [`ssekms_key_id(impl Into)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::ssekms_key_id) / [`set_ssekms_key_id(Option)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::set_ssekms_key_id):
      required: **false**

      Specifies the KMS ID (Key ID, Key ARN, or Key Alias) to use for object encryption. All GET and PUT requests for an object protected by KMS will fail if they're not made via SSL or using SigV4. For information about configuring any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature Version in Request Authentication in the Amazon S3 User Guide.

      This functionality is not supported when the destination bucket is a directory bucket.


      - /// - [`ssekms_encryption_context(impl Into)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::ssekms_encryption_context) / [`set_ssekms_encryption_context(Option)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::set_ssekms_encryption_context):
      required: **false**

      Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. This value must be explicitly added to specify encryption context for CopyObject requests.

      This functionality is not supported when the destination bucket is a directory bucket.


      - /// - [`bucket_key_enabled(bool)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::bucket_key_enabled) / [`set_bucket_key_enabled(Option)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::set_bucket_key_enabled):
      required: **false**

      Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). If a target object uses SSE-KMS, you can enable an S3 Bucket Key for the object.

      Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Specifying this header with a COPY action doesn’t affect bucket-level settings for S3 Bucket Key.

      For more information, see Amazon S3 Bucket Keys in the Amazon S3 User Guide.

      This functionality is not supported when the destination bucket is a directory bucket.


      + /// - [`ssekms_key_id(impl Into)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::ssekms_key_id) / [`set_ssekms_key_id(Option)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::set_ssekms_key_id):
      required: **false**

      Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. All GET and PUT requests for an object protected by KMS will fail if they're not made via SSL or using SigV4. For information about configuring any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature Version in Request Authentication in the Amazon S3 User Guide.

      Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.


      + /// - [`ssekms_encryption_context(impl Into)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::ssekms_encryption_context) / [`set_ssekms_encryption_context(Option)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::set_ssekms_encryption_context):
      required: **false**

      Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for the destination object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      General purpose buckets - This value must be explicitly added to specify encryption context for CopyObject requests if you want an additional encryption context for your destination object. The additional encryption context of the source object won't be copied to the destination object. For more information, see Encryption context in the Amazon S3 User Guide.

      Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.


      + /// - [`bucket_key_enabled(bool)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::bucket_key_enabled) / [`set_bucket_key_enabled(Option)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::set_bucket_key_enabled):
      required: **false**

      Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). If a target object uses SSE-KMS, you can enable an S3 Bucket Key for the object.

      Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Specifying this header with a COPY action doesn’t affect bucket-level settings for S3 Bucket Key.

      For more information, see Amazon S3 Bucket Keys in the Amazon S3 User Guide.

      Directory buckets - S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.


      /// - [`copy_source_sse_customer_algorithm(impl Into)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::copy_source_sse_customer_algorithm) / [`set_copy_source_sse_customer_algorithm(Option)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::set_copy_source_sse_customer_algorithm):
      required: **false**

      Specifies the algorithm to use when decrypting the source object (for example, AES256).

      If the source object for the copy is stored in Amazon S3 using SSE-C, you must provide the necessary encryption information in your request so that Amazon S3 can decrypt the object for copying.

      This functionality is not supported when the source object is in a directory bucket.


      /// - [`copy_source_sse_customer_key(impl Into)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::copy_source_sse_customer_key) / [`set_copy_source_sse_customer_key(Option)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::set_copy_source_sse_customer_key):
      required: **false**

      Specifies the customer-provided encryption key for Amazon S3 to use to decrypt the source object. The encryption key provided in this header must be the same one that was used when the source object was created.

      If the source object for the copy is stored in Amazon S3 using SSE-C, you must provide the necessary encryption information in your request so that Amazon S3 can decrypt the object for copying.

      This functionality is not supported when the source object is in a directory bucket.


      /// - [`copy_source_sse_customer_key_md5(impl Into)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::copy_source_sse_customer_key_md5) / [`set_copy_source_sse_customer_key_md5(Option)`](crate::operation::copy_object::builders::CopyObjectFluentBuilder::set_copy_source_sse_customer_key_md5):
      required: **false**

      Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error.

      If the source object for the copy is stored in Amazon S3 using SSE-C, you must provide the necessary encryption information in your request so that Amazon S3 can decrypt the object for copying.

      This functionality is not supported when the source object is in a directory bucket.


      @@ -49,12 +49,12 @@ impl super::Client { /// - [`expiration(Option)`](crate::operation::copy_object::CopyObjectOutput::expiration):

      If the object expiration is configured, the response includes this header.

      This functionality is not supported for directory buckets.

      /// - [`copy_source_version_id(Option)`](crate::operation::copy_object::CopyObjectOutput::copy_source_version_id):

      Version ID of the source object that was copied.

      This functionality is not supported when the source object is in a directory bucket.

      /// - [`version_id(Option)`](crate::operation::copy_object::CopyObjectOutput::version_id):

      Version ID of the newly created copy.

      This functionality is not supported for directory buckets.

      - /// - [`server_side_encryption(Option)`](crate::operation::copy_object::CopyObjectOutput::server_side_encryption):

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      + /// - [`server_side_encryption(Option)`](crate::operation::copy_object::CopyObjectOutput::server_side_encryption):

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

      /// - [`sse_customer_algorithm(Option)`](crate::operation::copy_object::CopyObjectOutput::sse_customer_algorithm):

      If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used.

      This functionality is not supported for directory buckets.

      /// - [`sse_customer_key_md5(Option)`](crate::operation::copy_object::CopyObjectOutput::sse_customer_key_md5):

      If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key.

      This functionality is not supported for directory buckets.

      - /// - [`ssekms_key_id(Option)`](crate::operation::copy_object::CopyObjectOutput::ssekms_key_id):

      If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

      This functionality is not supported for directory buckets.

      - /// - [`ssekms_encryption_context(Option)`](crate::operation::copy_object::CopyObjectOutput::ssekms_encryption_context):

      If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      This functionality is not supported for directory buckets.

      - /// - [`bucket_key_enabled(Option)`](crate::operation::copy_object::CopyObjectOutput::bucket_key_enabled):

      Indicates whether the copied object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      This functionality is not supported for directory buckets.

      + /// - [`ssekms_key_id(Option)`](crate::operation::copy_object::CopyObjectOutput::ssekms_key_id):

      If present, indicates the ID of the KMS key that was used for object encryption.

      + /// - [`ssekms_encryption_context(Option)`](crate::operation::copy_object::CopyObjectOutput::ssekms_encryption_context):

      If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      + /// - [`bucket_key_enabled(Option)`](crate::operation::copy_object::CopyObjectOutput::bucket_key_enabled):

      Indicates whether the copied object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      /// - [`request_charged(Option)`](crate::operation::copy_object::CopyObjectOutput::request_charged):

      If present, indicates that the requester was successfully charged for the request.

      This functionality is not supported for directory buckets.

      /// - On failure, responds with [`SdkError`](crate::operation::copy_object::CopyObjectError) pub fn copy_object(&self) -> crate::operation::copy_object::builders::CopyObjectFluentBuilder { diff --git a/sdk/s3/src/client/create_multipart_upload.rs b/sdk/s3/src/client/create_multipart_upload.rs index 4f48507460b9..499dadf1a15b 100644 --- a/sdk/s3/src/client/create_multipart_upload.rs +++ b/sdk/s3/src/client/create_multipart_upload.rs @@ -17,15 +17,15 @@ impl super::Client { /// - [`grant_write_acp(impl Into)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::grant_write_acp) / [`set_grant_write_acp(Option)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::set_grant_write_acp):
      required: **false**

      Specify access permissions explicitly to allows grantee to allow grantee to write the ACL for the applicable object.

      By default, all objects are private. Only the owner has full access control. When uploading an object, you can use this header to explicitly grant access permissions to specific Amazon Web Services accounts or groups. This header maps to specific permissions that Amazon S3 supports in an ACL. For more information, see Access Control List (ACL) Overview in the Amazon S3 User Guide.

      You specify each grantee as a type=value pair, where the type is one of the following:

      • id – if the value specified is the canonical user ID of an Amazon Web Services account

      • uri – if you are granting permissions to a predefined group

      • emailAddress – if the value specified is the email address of an Amazon Web Services account

        Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions:

        • US East (N. Virginia)

        • US West (N. California)

        • US West (Oregon)

        • Asia Pacific (Singapore)

        • Asia Pacific (Sydney)

        • Asia Pacific (Tokyo)

        • Europe (Ireland)

        • South America (São Paulo)

        For a list of all the Amazon S3 supported Regions and endpoints, see Regions and Endpoints in the Amazon Web Services General Reference.

      For example, the following x-amz-grant-read header grants the Amazon Web Services accounts identified by account IDs permissions to read object data and its metadata:

      x-amz-grant-read: id="11112222333", id="444455556666"

      • This functionality is not supported for directory buckets.

      • This functionality is not supported for Amazon S3 on Outposts.


      /// - [`key(impl Into)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::key) / [`set_key(Option)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::set_key):
      required: **true**

      Object key for which the multipart upload is to be initiated.


      /// - [`metadata(impl Into, impl Into)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::metadata) / [`set_metadata(Option>)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::set_metadata):
      required: **false**

      A map of metadata to store with the object in S3.


      - /// - [`server_side_encryption(ServerSideEncryption)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::server_side_encryption) / [`set_server_side_encryption(Option)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::set_server_side_encryption):
      required: **false**

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.


      + /// - [`server_side_encryption(ServerSideEncryption)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::server_side_encryption) / [`set_server_side_encryption(Option)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::set_server_side_encryption):
      required: **false**

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

      • Directory buckets - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

        In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the CreateSession request. You can't override the values of the encryption settings (x-amz-server-side-encryption, x-amz-server-side-encryption-aws-kms-key-id, x-amz-server-side-encryption-context, and x-amz-server-side-encryption-bucket-key-enabled) that are specified in the CreateSession request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the CreateSession request to protect new objects in the directory bucket.

        When you use the CLI or the Amazon Web Services SDKs, for CreateSession, the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the CreateSession request. It's not supported to override the encryption settings values in the CreateSession request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket.


      /// - [`storage_class(StorageClass)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::storage_class) / [`set_storage_class(Option)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::set_storage_class):
      required: **false**

      By default, Amazon S3 uses the STANDARD Storage Class to store newly created objects. The STANDARD storage class provides high durability and high availability. Depending on performance needs, you can specify a different Storage Class. For more information, see Storage Classes in the Amazon S3 User Guide.

      • For directory buckets, only the S3 Express One Zone storage class is supported to store newly created objects.

      • Amazon S3 on Outposts only uses the OUTPOSTS Storage Class.


      /// - [`website_redirect_location(impl Into)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::website_redirect_location) / [`set_website_redirect_location(Option)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::set_website_redirect_location):
      required: **false**

      If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata.

      This functionality is not supported for directory buckets.


      /// - [`sse_customer_algorithm(impl Into)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::sse_customer_algorithm) / [`set_sse_customer_algorithm(Option)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::set_sse_customer_algorithm):
      required: **false**

      Specifies the algorithm to use when encrypting the object (for example, AES256).

      This functionality is not supported for directory buckets.


      /// - [`sse_customer_key(impl Into)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::sse_customer_key) / [`set_sse_customer_key(Option)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::set_sse_customer_key):
      required: **false**

      Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon S3 does not store the encryption key. The key must be appropriate for use with the algorithm specified in the x-amz-server-side-encryption-customer-algorithm header.

      This functionality is not supported for directory buckets.


      /// - [`sse_customer_key_md5(impl Into)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::sse_customer_key_md5) / [`set_sse_customer_key_md5(Option)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::set_sse_customer_key_md5):
      required: **false**

      Specifies the 128-bit MD5 digest of the customer-provided encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error.

      This functionality is not supported for directory buckets.


      - /// - [`ssekms_key_id(impl Into)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::ssekms_key_id) / [`set_ssekms_key_id(Option)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::set_ssekms_key_id):
      required: **false**

      Specifies the ID (Key ID, Key ARN, or Key Alias) of the symmetric encryption customer managed key to use for object encryption.

      This functionality is not supported for directory buckets.


      - /// - [`ssekms_encryption_context(impl Into)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::ssekms_encryption_context) / [`set_ssekms_encryption_context(Option)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::set_ssekms_encryption_context):
      required: **false**

      Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      This functionality is not supported for directory buckets.


      - /// - [`bucket_key_enabled(bool)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::bucket_key_enabled) / [`set_bucket_key_enabled(Option)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::set_bucket_key_enabled):
      required: **false**

      Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.

      Specifying this header with an object action doesn’t affect bucket-level settings for S3 Bucket Key.

      This functionality is not supported for directory buckets.


      + /// - [`ssekms_key_id(impl Into)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::ssekms_key_id) / [`set_ssekms_key_id(Option)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::set_ssekms_key_id):
      required: **false**

      Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID.

      General purpose buckets - If you specify x-amz-server-side-encryption with aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key to use. If you specify x-amz-server-side-encryption:aws:kms or x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key (aws/s3) to protect the data.

      Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.


      + /// - [`ssekms_encryption_context(impl Into)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::ssekms_encryption_context) / [`set_ssekms_encryption_context(Option)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::set_ssekms_encryption_context):
      required: **false**

      Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs.

      Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.


      + /// - [`bucket_key_enabled(bool)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::bucket_key_enabled) / [`set_bucket_key_enabled(Option)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::set_bucket_key_enabled):
      required: **false**

      Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS).

      General purpose buckets - Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key.

      Directory buckets - S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.


      /// - [`request_payer(RequestPayer)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::request_payer) / [`set_request_payer(Option)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::set_request_payer):
      required: **false**

      Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.

      This functionality is not supported for directory buckets.


      /// - [`tagging(impl Into)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::tagging) / [`set_tagging(Option)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::set_tagging):
      required: **false**

      The tag-set for the object. The tag-set must be encoded as URL Query parameters.

      This functionality is not supported for directory buckets.


      /// - [`object_lock_mode(ObjectLockMode)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::object_lock_mode) / [`set_object_lock_mode(Option)`](crate::operation::create_multipart_upload::builders::CreateMultipartUploadFluentBuilder::set_object_lock_mode):
      required: **false**

      Specifies the Object Lock mode that you want to apply to the uploaded object.

      This functionality is not supported for directory buckets.


      @@ -39,12 +39,12 @@ impl super::Client { /// - [`bucket(Option)`](crate::operation::create_multipart_upload::CreateMultipartUploadOutput::bucket):

      The name of the bucket to which the multipart upload was initiated. Does not return the access point ARN or access point alias if used.

      Access points are not supported by directory buckets.

      /// - [`key(Option)`](crate::operation::create_multipart_upload::CreateMultipartUploadOutput::key):

      Object key for which the multipart upload was initiated.

      /// - [`upload_id(Option)`](crate::operation::create_multipart_upload::CreateMultipartUploadOutput::upload_id):

      ID for the initiated multipart upload.

      - /// - [`server_side_encryption(Option)`](crate::operation::create_multipart_upload::CreateMultipartUploadOutput::server_side_encryption):

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      + /// - [`server_side_encryption(Option)`](crate::operation::create_multipart_upload::CreateMultipartUploadOutput::server_side_encryption):

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

      /// - [`sse_customer_algorithm(Option)`](crate::operation::create_multipart_upload::CreateMultipartUploadOutput::sse_customer_algorithm):

      If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used.

      This functionality is not supported for directory buckets.

      /// - [`sse_customer_key_md5(Option)`](crate::operation::create_multipart_upload::CreateMultipartUploadOutput::sse_customer_key_md5):

      If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key.

      This functionality is not supported for directory buckets.

      - /// - [`ssekms_key_id(Option)`](crate::operation::create_multipart_upload::CreateMultipartUploadOutput::ssekms_key_id):

      If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

      This functionality is not supported for directory buckets.

      - /// - [`ssekms_encryption_context(Option)`](crate::operation::create_multipart_upload::CreateMultipartUploadOutput::ssekms_encryption_context):

      If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      This functionality is not supported for directory buckets.

      - /// - [`bucket_key_enabled(Option)`](crate::operation::create_multipart_upload::CreateMultipartUploadOutput::bucket_key_enabled):

      Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      This functionality is not supported for directory buckets.

      + /// - [`ssekms_key_id(Option)`](crate::operation::create_multipart_upload::CreateMultipartUploadOutput::ssekms_key_id):

      If present, indicates the ID of the KMS key that was used for object encryption.

      + /// - [`ssekms_encryption_context(Option)`](crate::operation::create_multipart_upload::CreateMultipartUploadOutput::ssekms_encryption_context):

      If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs.

      + /// - [`bucket_key_enabled(Option)`](crate::operation::create_multipart_upload::CreateMultipartUploadOutput::bucket_key_enabled):

      Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      /// - [`request_charged(Option)`](crate::operation::create_multipart_upload::CreateMultipartUploadOutput::request_charged):

      If present, indicates that the requester was successfully charged for the request.

      This functionality is not supported for directory buckets.

      /// - [`checksum_algorithm(Option)`](crate::operation::create_multipart_upload::CreateMultipartUploadOutput::checksum_algorithm):

      The algorithm that was used to create a checksum of the object.

      /// - On failure, responds with [`SdkError`](crate::operation::create_multipart_upload::CreateMultipartUploadError) diff --git a/sdk/s3/src/client/create_session.rs b/sdk/s3/src/client/create_session.rs index 080a762d03c2..4981312ab455 100644 --- a/sdk/s3/src/client/create_session.rs +++ b/sdk/s3/src/client/create_session.rs @@ -3,9 +3,17 @@ impl super::Client { /// Constructs a fluent builder for the [`CreateSession`](crate::operation::create_session::builders::CreateSessionFluentBuilder) operation. /// /// - The fluent builder is configurable: - /// - [`session_mode(SessionMode)`](crate::operation::create_session::builders::CreateSessionFluentBuilder::session_mode) / [`set_session_mode(Option)`](crate::operation::create_session::builders::CreateSessionFluentBuilder::set_session_mode):
      required: **false**

      Specifies the mode of the session that will be created, either ReadWrite or ReadOnly. By default, a ReadWrite session is created. A ReadWrite session is capable of executing all the Zonal endpoint APIs on a directory bucket. A ReadOnly session is constrained to execute the following Zonal endpoint APIs: GetObject, HeadObject, ListObjectsV2, GetObjectAttributes, ListParts, and ListMultipartUploads.


      + /// - [`session_mode(SessionMode)`](crate::operation::create_session::builders::CreateSessionFluentBuilder::session_mode) / [`set_session_mode(Option)`](crate::operation::create_session::builders::CreateSessionFluentBuilder::set_session_mode):
      required: **false**

      Specifies the mode of the session that will be created, either ReadWrite or ReadOnly. By default, a ReadWrite session is created. A ReadWrite session is capable of executing all the Zonal endpoint API operations on a directory bucket. A ReadOnly session is constrained to execute the following Zonal endpoint API operations: GetObject, HeadObject, ListObjectsV2, GetObjectAttributes, ListParts, and ListMultipartUploads.


      /// - [`bucket(impl Into)`](crate::operation::create_session::builders::CreateSessionFluentBuilder::bucket) / [`set_bucket(Option)`](crate::operation::create_session::builders::CreateSessionFluentBuilder::set_bucket):
      required: **true**

      The name of the bucket that you create a session for.


      + /// - [`server_side_encryption(ServerSideEncryption)`](crate::operation::create_session::builders::CreateSessionFluentBuilder::server_side_encryption) / [`set_server_side_encryption(Option)`](crate::operation::create_session::builders::CreateSessionFluentBuilder::set_server_side_encryption):
      required: **false**

      The server-side encryption algorithm to use when you store objects in the directory bucket.

      For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). By default, Amazon S3 encrypts data with SSE-S3. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide.


      + /// - [`ssekms_key_id(impl Into)`](crate::operation::create_session::builders::CreateSessionFluentBuilder::ssekms_key_id) / [`set_ssekms_key_id(Option)`](crate::operation::create_session::builders::CreateSessionFluentBuilder::set_ssekms_key_id):
      required: **false**

      If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Also, if the KMS key doesn't exist in the same account that't issuing the command, you must use the full Key ARN not the Key ID.

      Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.


      + /// - [`ssekms_encryption_context(impl Into)`](crate::operation::create_session::builders::CreateSessionFluentBuilder::ssekms_encryption_context) / [`set_ssekms_encryption_context(Option)`](crate::operation::create_session::builders::CreateSessionFluentBuilder::set_ssekms_encryption_context):
      required: **false**

      Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

      General purpose buckets - This value must be explicitly added during CopyObject operations if you want an additional encryption context for your object. For more information, see Encryption context in the Amazon S3 User Guide.

      Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.


      + /// - [`bucket_key_enabled(bool)`](crate::operation::create_session::builders::CreateSessionFluentBuilder::bucket_key_enabled) / [`set_bucket_key_enabled(Option)`](crate::operation::create_session::builders::CreateSessionFluentBuilder::set_bucket_key_enabled):
      required: **false**

      Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using KMS keys (SSE-KMS).

      S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.


      /// - On success, responds with [`CreateSessionOutput`](crate::operation::create_session::CreateSessionOutput) with field(s): + /// - [`server_side_encryption(Option)`](crate::operation::create_session::CreateSessionOutput::server_side_encryption):

      The server-side encryption algorithm used when you store objects in the directory bucket.

      + /// - [`ssekms_key_id(Option)`](crate::operation::create_session::CreateSessionOutput::ssekms_key_id):

      If you specify x-amz-server-side-encryption with aws:kms, this header indicates the ID of the KMS symmetric encryption customer managed key that was used for object encryption.

      + /// - [`ssekms_encryption_context(Option)`](crate::operation::create_session::CreateSessionOutput::ssekms_encryption_context):

      If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

      + /// - [`bucket_key_enabled(Option)`](crate::operation::create_session::CreateSessionOutput::bucket_key_enabled):

      Indicates whether to use an S3 Bucket Key for server-side encryption with KMS keys (SSE-KMS).

      /// - [`credentials(Option)`](crate::operation::create_session::CreateSessionOutput::credentials):

      The established temporary security credentials for the created session.

      /// - On failure, responds with [`SdkError`](crate::operation::create_session::CreateSessionError) pub fn create_session(&self) -> crate::operation::create_session::builders::CreateSessionFluentBuilder { diff --git a/sdk/s3/src/client/delete_bucket_encryption.rs b/sdk/s3/src/client/delete_bucket_encryption.rs index 91da9bc83acd..e40e915cc36c 100644 --- a/sdk/s3/src/client/delete_bucket_encryption.rs +++ b/sdk/s3/src/client/delete_bucket_encryption.rs @@ -3,8 +3,8 @@ impl super::Client { /// Constructs a fluent builder for the [`DeleteBucketEncryption`](crate::operation::delete_bucket_encryption::builders::DeleteBucketEncryptionFluentBuilder) operation. /// /// - The fluent builder is configurable: - /// - [`bucket(impl Into)`](crate::operation::delete_bucket_encryption::builders::DeleteBucketEncryptionFluentBuilder::bucket) / [`set_bucket(Option)`](crate::operation::delete_bucket_encryption::builders::DeleteBucketEncryptionFluentBuilder::set_bucket):
      required: **true**

      The name of the bucket containing the server-side encryption configuration to delete.


      - /// - [`expected_bucket_owner(impl Into)`](crate::operation::delete_bucket_encryption::builders::DeleteBucketEncryptionFluentBuilder::expected_bucket_owner) / [`set_expected_bucket_owner(Option)`](crate::operation::delete_bucket_encryption::builders::DeleteBucketEncryptionFluentBuilder::set_expected_bucket_owner):
      required: **false**

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).


      + /// - [`bucket(impl Into)`](crate::operation::delete_bucket_encryption::builders::DeleteBucketEncryptionFluentBuilder::bucket) / [`set_bucket(Option)`](crate::operation::delete_bucket_encryption::builders::DeleteBucketEncryptionFluentBuilder::set_bucket):
      required: **true**

      The name of the bucket containing the server-side encryption configuration to delete.

      Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide


      + /// - [`expected_bucket_owner(impl Into)`](crate::operation::delete_bucket_encryption::builders::DeleteBucketEncryptionFluentBuilder::expected_bucket_owner) / [`set_expected_bucket_owner(Option)`](crate::operation::delete_bucket_encryption::builders::DeleteBucketEncryptionFluentBuilder::set_expected_bucket_owner):
      required: **false**

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

      For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code 501 Not Implemented.


      /// - On success, responds with [`DeleteBucketEncryptionOutput`](crate::operation::delete_bucket_encryption::DeleteBucketEncryptionOutput) /// - On failure, responds with [`SdkError`](crate::operation::delete_bucket_encryption::DeleteBucketEncryptionError) pub fn delete_bucket_encryption(&self) -> crate::operation::delete_bucket_encryption::builders::DeleteBucketEncryptionFluentBuilder { diff --git a/sdk/s3/src/client/get_bucket_encryption.rs b/sdk/s3/src/client/get_bucket_encryption.rs index f526d99daeeb..a0e27a435375 100644 --- a/sdk/s3/src/client/get_bucket_encryption.rs +++ b/sdk/s3/src/client/get_bucket_encryption.rs @@ -3,8 +3,8 @@ impl super::Client { /// Constructs a fluent builder for the [`GetBucketEncryption`](crate::operation::get_bucket_encryption::builders::GetBucketEncryptionFluentBuilder) operation. /// /// - The fluent builder is configurable: - /// - [`bucket(impl Into)`](crate::operation::get_bucket_encryption::builders::GetBucketEncryptionFluentBuilder::bucket) / [`set_bucket(Option)`](crate::operation::get_bucket_encryption::builders::GetBucketEncryptionFluentBuilder::set_bucket):
      required: **true**

      The name of the bucket from which the server-side encryption configuration is retrieved.


      - /// - [`expected_bucket_owner(impl Into)`](crate::operation::get_bucket_encryption::builders::GetBucketEncryptionFluentBuilder::expected_bucket_owner) / [`set_expected_bucket_owner(Option)`](crate::operation::get_bucket_encryption::builders::GetBucketEncryptionFluentBuilder::set_expected_bucket_owner):
      required: **false**

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).


      + /// - [`bucket(impl Into)`](crate::operation::get_bucket_encryption::builders::GetBucketEncryptionFluentBuilder::bucket) / [`set_bucket(Option)`](crate::operation::get_bucket_encryption::builders::GetBucketEncryptionFluentBuilder::set_bucket):
      required: **true**

      The name of the bucket from which the server-side encryption configuration is retrieved.

      Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide


      + /// - [`expected_bucket_owner(impl Into)`](crate::operation::get_bucket_encryption::builders::GetBucketEncryptionFluentBuilder::expected_bucket_owner) / [`set_expected_bucket_owner(Option)`](crate::operation::get_bucket_encryption::builders::GetBucketEncryptionFluentBuilder::set_expected_bucket_owner):
      required: **false**

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

      For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code 501 Not Implemented.


      /// - On success, responds with [`GetBucketEncryptionOutput`](crate::operation::get_bucket_encryption::GetBucketEncryptionOutput) with field(s): /// - [`server_side_encryption_configuration(Option)`](crate::operation::get_bucket_encryption::GetBucketEncryptionOutput::server_side_encryption_configuration):

      Specifies the default server-side-encryption configuration.

      /// - On failure, responds with [`SdkError`](crate::operation::get_bucket_encryption::GetBucketEncryptionError) diff --git a/sdk/s3/src/client/get_object.rs b/sdk/s3/src/client/get_object.rs index 5e61ef44cb75..eabeb8ee0a98 100644 --- a/sdk/s3/src/client/get_object.rs +++ b/sdk/s3/src/client/get_object.rs @@ -23,7 +23,7 @@ impl super::Client { /// - [`request_payer(RequestPayer)`](crate::operation::get_object::builders::GetObjectFluentBuilder::request_payer) / [`set_request_payer(Option)`](crate::operation::get_object::builders::GetObjectFluentBuilder::set_request_payer):
      required: **false**

      Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.

      This functionality is not supported for directory buckets.


      /// - [`part_number(i32)`](crate::operation::get_object::builders::GetObjectFluentBuilder::part_number) / [`set_part_number(Option)`](crate::operation::get_object::builders::GetObjectFluentBuilder::set_part_number):
      required: **false**

      Part number of the object being read. This is a positive integer between 1 and 10,000. Effectively performs a 'ranged' GET request for the part specified. Useful for downloading just a part of an object.


      /// - [`expected_bucket_owner(impl Into)`](crate::operation::get_object::builders::GetObjectFluentBuilder::expected_bucket_owner) / [`set_expected_bucket_owner(Option)`](crate::operation::get_object::builders::GetObjectFluentBuilder::set_expected_bucket_owner):
      required: **false**

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).


      - /// - [`checksum_mode(ChecksumMode)`](crate::operation::get_object::builders::GetObjectFluentBuilder::checksum_mode) / [`set_checksum_mode(Option)`](crate::operation::get_object::builders::GetObjectFluentBuilder::set_checksum_mode):
      required: **false**

      To retrieve the checksum, this mode must be enabled.

      In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.


      + /// - [`checksum_mode(ChecksumMode)`](crate::operation::get_object::builders::GetObjectFluentBuilder::checksum_mode) / [`set_checksum_mode(Option)`](crate::operation::get_object::builders::GetObjectFluentBuilder::set_checksum_mode):
      required: **false**

      To retrieve the checksum, this mode must be enabled.

      General purpose buckets - In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.


      /// - On success, responds with [`GetObjectOutput`](crate::operation::get_object::GetObjectOutput) with field(s): /// - [`body(ByteStream)`](crate::operation::get_object::GetObjectOutput::body):

      Object data.

      /// - [`delete_marker(Option)`](crate::operation::get_object::GetObjectOutput::delete_marker):

      Indicates whether the object retrieved was (true) or was not (false) a Delete Marker. If false, this response header does not appear in the response.

      • If the current version of the object is a delete marker, Amazon S3 behaves as if the object was deleted and includes x-amz-delete-marker: true in the response.

      • If the specified version in the request is a delete marker, the response returns a 405 Method Not Allowed error and the Last-Modified: timestamp response header.

      @@ -46,12 +46,12 @@ impl super::Client { /// - [`content_range(Option)`](crate::operation::get_object::GetObjectOutput::content_range):

      The portion of the object returned in the response.

      /// - [`content_type(Option)`](crate::operation::get_object::GetObjectOutput::content_type):

      A standard MIME type describing the format of the object data.

      /// - [`website_redirect_location(Option)`](crate::operation::get_object::GetObjectOutput::website_redirect_location):

      If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata.

      This functionality is not supported for directory buckets.

      - /// - [`server_side_encryption(Option)`](crate::operation::get_object::GetObjectOutput::server_side_encryption):

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      + /// - [`server_side_encryption(Option)`](crate::operation::get_object::GetObjectOutput::server_side_encryption):

      The server-side encryption algorithm used when you store this object in Amazon S3.

      /// - [`metadata(Option>)`](crate::operation::get_object::GetObjectOutput::metadata):

      A map of metadata to store with the object in S3.

      /// - [`sse_customer_algorithm(Option)`](crate::operation::get_object::GetObjectOutput::sse_customer_algorithm):

      If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used.

      This functionality is not supported for directory buckets.

      /// - [`sse_customer_key_md5(Option)`](crate::operation::get_object::GetObjectOutput::sse_customer_key_md5):

      If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key.

      This functionality is not supported for directory buckets.

      - /// - [`ssekms_key_id(Option)`](crate::operation::get_object::GetObjectOutput::ssekms_key_id):

      If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

      This functionality is not supported for directory buckets.

      - /// - [`bucket_key_enabled(Option)`](crate::operation::get_object::GetObjectOutput::bucket_key_enabled):

      Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      This functionality is not supported for directory buckets.

      + /// - [`ssekms_key_id(Option)`](crate::operation::get_object::GetObjectOutput::ssekms_key_id):

      If present, indicates the ID of the KMS key that was used for object encryption.

      + /// - [`bucket_key_enabled(Option)`](crate::operation::get_object::GetObjectOutput::bucket_key_enabled):

      Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      /// - [`storage_class(Option)`](crate::operation::get_object::GetObjectOutput::storage_class):

      Provides storage class information of the object. Amazon S3 returns this header for all objects except for S3 Standard storage class objects.

      Directory buckets - Only the S3 Express One Zone storage class is supported by directory buckets to store objects.

      /// - [`request_charged(Option)`](crate::operation::get_object::GetObjectOutput::request_charged):

      If present, indicates that the requester was successfully charged for the request.

      This functionality is not supported for directory buckets.

      /// - [`replication_status(Option)`](crate::operation::get_object::GetObjectOutput::replication_status):

      Amazon S3 can return this if your request involves a bucket that is either a source or destination in a replication rule.

      This functionality is not supported for directory buckets.

      diff --git a/sdk/s3/src/client/head_object.rs b/sdk/s3/src/client/head_object.rs index 5c1207550724..440f8055a2b9 100644 --- a/sdk/s3/src/client/head_object.rs +++ b/sdk/s3/src/client/head_object.rs @@ -23,7 +23,7 @@ impl super::Client { /// - [`request_payer(RequestPayer)`](crate::operation::head_object::builders::HeadObjectFluentBuilder::request_payer) / [`set_request_payer(Option)`](crate::operation::head_object::builders::HeadObjectFluentBuilder::set_request_payer):
      required: **false**

      Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.

      This functionality is not supported for directory buckets.


      /// - [`part_number(i32)`](crate::operation::head_object::builders::HeadObjectFluentBuilder::part_number) / [`set_part_number(Option)`](crate::operation::head_object::builders::HeadObjectFluentBuilder::set_part_number):
      required: **false**

      Part number of the object being read. This is a positive integer between 1 and 10,000. Effectively performs a 'ranged' HEAD request for the part specified. Useful querying about the size of the part and the number of parts in this object.


      /// - [`expected_bucket_owner(impl Into)`](crate::operation::head_object::builders::HeadObjectFluentBuilder::expected_bucket_owner) / [`set_expected_bucket_owner(Option)`](crate::operation::head_object::builders::HeadObjectFluentBuilder::set_expected_bucket_owner):
      required: **false**

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).


      - /// - [`checksum_mode(ChecksumMode)`](crate::operation::head_object::builders::HeadObjectFluentBuilder::checksum_mode) / [`set_checksum_mode(Option)`](crate::operation::head_object::builders::HeadObjectFluentBuilder::set_checksum_mode):
      required: **false**

      To retrieve the checksum, this parameter must be enabled.

      In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.


      + /// - [`checksum_mode(ChecksumMode)`](crate::operation::head_object::builders::HeadObjectFluentBuilder::checksum_mode) / [`set_checksum_mode(Option)`](crate::operation::head_object::builders::HeadObjectFluentBuilder::set_checksum_mode):
      required: **false**

      To retrieve the checksum, this parameter must be enabled.

      General purpose buckets - If you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

      Directory buckets - If you enable ChecksumMode and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies and KMS key policies for the KMS key to retrieve the checksum of the object.


      /// - On success, responds with [`HeadObjectOutput`](crate::operation::head_object::HeadObjectOutput) with field(s): /// - [`delete_marker(Option)`](crate::operation::head_object::HeadObjectOutput::delete_marker):

      Specifies whether the object retrieved was (true) or was not (false) a Delete Marker. If false, this response header does not appear in the response.

      This functionality is not supported for directory buckets.

      /// - [`accept_ranges(Option)`](crate::operation::head_object::HeadObjectOutput::accept_ranges):

      Indicates that a range of bytes was specified.

      @@ -45,12 +45,12 @@ impl super::Client { /// - [`content_language(Option)`](crate::operation::head_object::HeadObjectOutput::content_language):

      The language the content is in.

      /// - [`content_type(Option)`](crate::operation::head_object::HeadObjectOutput::content_type):

      A standard MIME type describing the format of the object data.

      /// - [`website_redirect_location(Option)`](crate::operation::head_object::HeadObjectOutput::website_redirect_location):

      If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata.

      This functionality is not supported for directory buckets.

      - /// - [`server_side_encryption(Option)`](crate::operation::head_object::HeadObjectOutput::server_side_encryption):

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      + /// - [`server_side_encryption(Option)`](crate::operation::head_object::HeadObjectOutput::server_side_encryption):

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

      /// - [`metadata(Option>)`](crate::operation::head_object::HeadObjectOutput::metadata):

      A map of metadata to store with the object in S3.

      /// - [`sse_customer_algorithm(Option)`](crate::operation::head_object::HeadObjectOutput::sse_customer_algorithm):

      If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used.

      This functionality is not supported for directory buckets.

      /// - [`sse_customer_key_md5(Option)`](crate::operation::head_object::HeadObjectOutput::sse_customer_key_md5):

      If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key.

      This functionality is not supported for directory buckets.

      - /// - [`ssekms_key_id(Option)`](crate::operation::head_object::HeadObjectOutput::ssekms_key_id):

      If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

      This functionality is not supported for directory buckets.

      - /// - [`bucket_key_enabled(Option)`](crate::operation::head_object::HeadObjectOutput::bucket_key_enabled):

      Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      This functionality is not supported for directory buckets.

      + /// - [`ssekms_key_id(Option)`](crate::operation::head_object::HeadObjectOutput::ssekms_key_id):

      If present, indicates the ID of the KMS key that was used for object encryption.

      + /// - [`bucket_key_enabled(Option)`](crate::operation::head_object::HeadObjectOutput::bucket_key_enabled):

      Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      /// - [`storage_class(Option)`](crate::operation::head_object::HeadObjectOutput::storage_class):

      Provides storage class information of the object. Amazon S3 returns this header for all objects except for S3 Standard storage class objects.

      For more information, see Storage Classes.

      Directory buckets - Only the S3 Express One Zone storage class is supported by directory buckets to store objects.

      /// - [`request_charged(Option)`](crate::operation::head_object::HeadObjectOutput::request_charged):

      If present, indicates that the requester was successfully charged for the request.

      This functionality is not supported for directory buckets.

      /// - [`replication_status(Option)`](crate::operation::head_object::HeadObjectOutput::replication_status):

      Amazon S3 can return this header if your request involves a bucket that is either a source or a destination in a replication rule.

      In replication, you have a source bucket on which you configure replication and destination bucket or buckets where Amazon S3 stores object replicas. When you request an object (GetObject) or object metadata (HeadObject) from these buckets, Amazon S3 will return the x-amz-replication-status header in the response as follows:

      • If requesting an object from the source bucket, Amazon S3 will return the x-amz-replication-status header if the object in your request is eligible for replication.

        For example, suppose that in your replication configuration, you specify object prefix TaxDocs requesting Amazon S3 to replicate objects with key prefix TaxDocs. Any objects you upload with this key name prefix, for example TaxDocs/document1.pdf, are eligible for replication. For any object request with this key name prefix, Amazon S3 will return the x-amz-replication-status header with value PENDING, COMPLETED or FAILED indicating object replication status.

      • If requesting an object from a destination bucket, Amazon S3 will return the x-amz-replication-status header with value REPLICA if the object in your request is a replica that Amazon S3 created and there is no replica modification replication in progress.

      • When replicating objects to multiple destination buckets, the x-amz-replication-status header acts differently. The header of the source object will only return a value of COMPLETED when replication is successful to all destinations. The header will remain at value PENDING until replication has completed for all destinations. If one or more destinations fails replication the header will return FAILED.

      For more information, see Replication.

      This functionality is not supported for directory buckets.

      diff --git a/sdk/s3/src/client/put_bucket_encryption.rs b/sdk/s3/src/client/put_bucket_encryption.rs index 8bf5dab3b36a..8cc76e0bc82c 100644 --- a/sdk/s3/src/client/put_bucket_encryption.rs +++ b/sdk/s3/src/client/put_bucket_encryption.rs @@ -3,11 +3,11 @@ impl super::Client { /// Constructs a fluent builder for the [`PutBucketEncryption`](crate::operation::put_bucket_encryption::builders::PutBucketEncryptionFluentBuilder) operation. /// /// - The fluent builder is configurable: - /// - [`bucket(impl Into)`](crate::operation::put_bucket_encryption::builders::PutBucketEncryptionFluentBuilder::bucket) / [`set_bucket(Option)`](crate::operation::put_bucket_encryption::builders::PutBucketEncryptionFluentBuilder::set_bucket):
      required: **true**

      Specifies default encryption for a bucket using server-side encryption with different key options. By default, all buckets have a default encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). You can optionally configure default encryption for a bucket by using server-side encryption with an Amazon Web Services KMS key (SSE-KMS) or a customer-provided key (SSE-C). For information about the bucket default encryption feature, see Amazon S3 Bucket Default Encryption in the Amazon S3 User Guide.


      - /// - [`content_md5(impl Into)`](crate::operation::put_bucket_encryption::builders::PutBucketEncryptionFluentBuilder::content_md5) / [`set_content_md5(Option)`](crate::operation::put_bucket_encryption::builders::PutBucketEncryptionFluentBuilder::set_content_md5):
      required: **false**

      The base64-encoded 128-bit MD5 digest of the server-side encryption configuration.

      For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.


      - /// - [`checksum_algorithm(ChecksumAlgorithm)`](crate::operation::put_bucket_encryption::builders::PutBucketEncryptionFluentBuilder::checksum_algorithm) / [`set_checksum_algorithm(Option)`](crate::operation::put_bucket_encryption::builders::PutBucketEncryptionFluentBuilder::set_checksum_algorithm):
      required: **false**

      Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.

      If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.


      + /// - [`bucket(impl Into)`](crate::operation::put_bucket_encryption::builders::PutBucketEncryptionFluentBuilder::bucket) / [`set_bucket(Option)`](crate::operation::put_bucket_encryption::builders::PutBucketEncryptionFluentBuilder::set_bucket):
      required: **true**

      Specifies default encryption for a bucket using server-side encryption with different key options.

      Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide


      + /// - [`content_md5(impl Into)`](crate::operation::put_bucket_encryption::builders::PutBucketEncryptionFluentBuilder::content_md5) / [`set_content_md5(Option)`](crate::operation::put_bucket_encryption::builders::PutBucketEncryptionFluentBuilder::set_content_md5):
      required: **false**

      The base64-encoded 128-bit MD5 digest of the server-side encryption configuration.

      For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

      This functionality is not supported for directory buckets.


      + /// - [`checksum_algorithm(ChecksumAlgorithm)`](crate::operation::put_bucket_encryption::builders::PutBucketEncryptionFluentBuilder::checksum_algorithm) / [`set_checksum_algorithm(Option)`](crate::operation::put_bucket_encryption::builders::PutBucketEncryptionFluentBuilder::set_checksum_algorithm):
      required: **false**

      Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.

      If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.

      For directory buckets, when you use Amazon Web Services SDKs, CRC32 is the default checksum algorithm that's used for performance.


      /// - [`server_side_encryption_configuration(ServerSideEncryptionConfiguration)`](crate::operation::put_bucket_encryption::builders::PutBucketEncryptionFluentBuilder::server_side_encryption_configuration) / [`set_server_side_encryption_configuration(Option)`](crate::operation::put_bucket_encryption::builders::PutBucketEncryptionFluentBuilder::set_server_side_encryption_configuration):
      required: **true**

      Specifies the default server-side-encryption configuration.


      - /// - [`expected_bucket_owner(impl Into)`](crate::operation::put_bucket_encryption::builders::PutBucketEncryptionFluentBuilder::expected_bucket_owner) / [`set_expected_bucket_owner(Option)`](crate::operation::put_bucket_encryption::builders::PutBucketEncryptionFluentBuilder::set_expected_bucket_owner):
      required: **false**

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).


      + /// - [`expected_bucket_owner(impl Into)`](crate::operation::put_bucket_encryption::builders::PutBucketEncryptionFluentBuilder::expected_bucket_owner) / [`set_expected_bucket_owner(Option)`](crate::operation::put_bucket_encryption::builders::PutBucketEncryptionFluentBuilder::set_expected_bucket_owner):
      required: **false**

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

      For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code 501 Not Implemented.


      /// - On success, responds with [`PutBucketEncryptionOutput`](crate::operation::put_bucket_encryption::PutBucketEncryptionOutput) /// - On failure, responds with [`SdkError`](crate::operation::put_bucket_encryption::PutBucketEncryptionError) pub fn put_bucket_encryption(&self) -> crate::operation::put_bucket_encryption::builders::PutBucketEncryptionFluentBuilder { diff --git a/sdk/s3/src/client/put_object.rs b/sdk/s3/src/client/put_object.rs index 3d63e391944f..daac94e5e22e 100644 --- a/sdk/s3/src/client/put_object.rs +++ b/sdk/s3/src/client/put_object.rs @@ -26,15 +26,15 @@ impl super::Client { /// - [`grant_write_acp(impl Into)`](crate::operation::put_object::builders::PutObjectFluentBuilder::grant_write_acp) / [`set_grant_write_acp(Option)`](crate::operation::put_object::builders::PutObjectFluentBuilder::set_grant_write_acp):
      required: **false**

      Allows grantee to write the ACL for the applicable object.

      • This functionality is not supported for directory buckets.

      • This functionality is not supported for Amazon S3 on Outposts.


      /// - [`key(impl Into)`](crate::operation::put_object::builders::PutObjectFluentBuilder::key) / [`set_key(Option)`](crate::operation::put_object::builders::PutObjectFluentBuilder::set_key):
      required: **true**

      Object key for which the PUT action was initiated.


      /// - [`metadata(impl Into, impl Into)`](crate::operation::put_object::builders::PutObjectFluentBuilder::metadata) / [`set_metadata(Option>)`](crate::operation::put_object::builders::PutObjectFluentBuilder::set_metadata):
      required: **false**

      A map of metadata to store with the object in S3.


      - /// - [`server_side_encryption(ServerSideEncryption)`](crate::operation::put_object::builders::PutObjectFluentBuilder::server_side_encryption) / [`set_server_side_encryption(Option)`](crate::operation::put_object::builders::PutObjectFluentBuilder::set_server_side_encryption):
      required: **false**

      The server-side encryption algorithm that was used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

      General purpose buckets - You have four mutually exclusive options to protect data using server-side encryption in Amazon S3, depending on how you choose to manage the encryption keys. Specifically, the encryption key options are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or DSSE-KMS), and customer-provided keys (SSE-C). Amazon S3 encrypts data with server-side encryption by using Amazon S3 managed keys (SSE-S3) by default. You can optionally tell Amazon S3 to encrypt data at rest by using server-side encryption with other key options. For more information, see Using Server-Side Encryption in the Amazon S3 User Guide.

      Directory buckets - For directory buckets, only the server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) value is supported.


      + /// - [`server_side_encryption(ServerSideEncryption)`](crate::operation::put_object::builders::PutObjectFluentBuilder::server_side_encryption) / [`set_server_side_encryption(Option)`](crate::operation::put_object::builders::PutObjectFluentBuilder::set_server_side_encryption):
      required: **false**

      The server-side encryption algorithm that was used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

      • General purpose buckets - You have four mutually exclusive options to protect data using server-side encryption in Amazon S3, depending on how you choose to manage the encryption keys. Specifically, the encryption key options are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or DSSE-KMS), and customer-provided keys (SSE-C). Amazon S3 encrypts data with server-side encryption by using Amazon S3 managed keys (SSE-S3) by default. You can optionally tell Amazon S3 to encrypt data at rest by using server-side encryption with other key options. For more information, see Using Server-Side Encryption in the Amazon S3 User Guide.

      • Directory buckets - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

        In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the CreateSession request. You can't override the values of the encryption settings (x-amz-server-side-encryption, x-amz-server-side-encryption-aws-kms-key-id, x-amz-server-side-encryption-context, and x-amz-server-side-encryption-bucket-key-enabled) that are specified in the CreateSession request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the CreateSession request to protect new objects in the directory bucket.

        When you use the CLI or the Amazon Web Services SDKs, for CreateSession, the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the CreateSession request. It's not supported to override the encryption settings values in the CreateSession request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket.


      /// - [`storage_class(StorageClass)`](crate::operation::put_object::builders::PutObjectFluentBuilder::storage_class) / [`set_storage_class(Option)`](crate::operation::put_object::builders::PutObjectFluentBuilder::set_storage_class):
      required: **false**

      By default, Amazon S3 uses the STANDARD Storage Class to store newly created objects. The STANDARD storage class provides high durability and high availability. Depending on performance needs, you can specify a different Storage Class. For more information, see Storage Classes in the Amazon S3 User Guide.

      • For directory buckets, only the S3 Express One Zone storage class is supported to store newly created objects.

      • Amazon S3 on Outposts only uses the OUTPOSTS Storage Class.


      /// - [`website_redirect_location(impl Into)`](crate::operation::put_object::builders::PutObjectFluentBuilder::website_redirect_location) / [`set_website_redirect_location(Option)`](crate::operation::put_object::builders::PutObjectFluentBuilder::set_website_redirect_location):
      required: **false**

      If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata. For information about object metadata, see Object Key and Metadata in the Amazon S3 User Guide.

      In the following example, the request header sets the redirect to an object (anotherPage.html) in the same bucket:

      x-amz-website-redirect-location: /anotherPage.html

      In the following example, the request header sets the object redirect to another website:

      x-amz-website-redirect-location: http://www.example.com/

      For more information about website hosting in Amazon S3, see Hosting Websites on Amazon S3 and How to Configure Website Page Redirects in the Amazon S3 User Guide.

      This functionality is not supported for directory buckets.


      /// - [`sse_customer_algorithm(impl Into)`](crate::operation::put_object::builders::PutObjectFluentBuilder::sse_customer_algorithm) / [`set_sse_customer_algorithm(Option)`](crate::operation::put_object::builders::PutObjectFluentBuilder::set_sse_customer_algorithm):
      required: **false**

      Specifies the algorithm to use when encrypting the object (for example, AES256).

      This functionality is not supported for directory buckets.


      /// - [`sse_customer_key(impl Into)`](crate::operation::put_object::builders::PutObjectFluentBuilder::sse_customer_key) / [`set_sse_customer_key(Option)`](crate::operation::put_object::builders::PutObjectFluentBuilder::set_sse_customer_key):
      required: **false**

      Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon S3 does not store the encryption key. The key must be appropriate for use with the algorithm specified in the x-amz-server-side-encryption-customer-algorithm header.

      This functionality is not supported for directory buckets.


      /// - [`sse_customer_key_md5(impl Into)`](crate::operation::put_object::builders::PutObjectFluentBuilder::sse_customer_key_md5) / [`set_sse_customer_key_md5(Option)`](crate::operation::put_object::builders::PutObjectFluentBuilder::set_sse_customer_key_md5):
      required: **false**

      Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error.

      This functionality is not supported for directory buckets.


      - /// - [`ssekms_key_id(impl Into)`](crate::operation::put_object::builders::PutObjectFluentBuilder::ssekms_key_id) / [`set_ssekms_key_id(Option)`](crate::operation::put_object::builders::PutObjectFluentBuilder::set_ssekms_key_id):
      required: **false**

      If x-amz-server-side-encryption has a valid value of aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object. If you specify x-amz-server-side-encryption:aws:kms or x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key (aws/s3) to protect the data. If the KMS key does not exist in the same account that's issuing the command, you must use the full ARN and not just the ID.

      This functionality is not supported for directory buckets.


      - /// - [`ssekms_encryption_context(impl Into)`](crate::operation::put_object::builders::PutObjectFluentBuilder::ssekms_encryption_context) / [`set_ssekms_encryption_context(Option)`](crate::operation::put_object::builders::PutObjectFluentBuilder::set_ssekms_encryption_context):
      required: **false**

      Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject or CopyObject operations on this object. This value must be explicitly added during CopyObject operations.

      This functionality is not supported for directory buckets.


      - /// - [`bucket_key_enabled(bool)`](crate::operation::put_object::builders::PutObjectFluentBuilder::bucket_key_enabled) / [`set_bucket_key_enabled(Option)`](crate::operation::put_object::builders::PutObjectFluentBuilder::set_bucket_key_enabled):
      required: **false**

      Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.

      Specifying this header with a PUT action doesn’t affect bucket-level settings for S3 Bucket Key.

      This functionality is not supported for directory buckets.


      + /// - [`ssekms_key_id(impl Into)`](crate::operation::put_object::builders::PutObjectFluentBuilder::ssekms_key_id) / [`set_ssekms_key_id(Option)`](crate::operation::put_object::builders::PutObjectFluentBuilder::set_ssekms_key_id):
      required: **false**

      Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID.

      General purpose buckets - If you specify x-amz-server-side-encryption with aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key to use. If you specify x-amz-server-side-encryption:aws:kms or x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key (aws/s3) to protect the data.

      Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.


      + /// - [`ssekms_encryption_context(impl Into)`](crate::operation::put_object::builders::PutObjectFluentBuilder::ssekms_encryption_context) / [`set_ssekms_encryption_context(Option)`](crate::operation::put_object::builders::PutObjectFluentBuilder::set_ssekms_encryption_context):
      required: **false**

      Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

      General purpose buckets - This value must be explicitly added during CopyObject operations if you want an additional encryption context for your object. For more information, see Encryption context in the Amazon S3 User Guide.

      Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.


      + /// - [`bucket_key_enabled(bool)`](crate::operation::put_object::builders::PutObjectFluentBuilder::bucket_key_enabled) / [`set_bucket_key_enabled(Option)`](crate::operation::put_object::builders::PutObjectFluentBuilder::set_bucket_key_enabled):
      required: **false**

      Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS).

      General purpose buckets - Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key.

      Directory buckets - S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.


      /// - [`request_payer(RequestPayer)`](crate::operation::put_object::builders::PutObjectFluentBuilder::request_payer) / [`set_request_payer(Option)`](crate::operation::put_object::builders::PutObjectFluentBuilder::set_request_payer):
      required: **false**

      Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.

      This functionality is not supported for directory buckets.


      /// - [`tagging(impl Into)`](crate::operation::put_object::builders::PutObjectFluentBuilder::tagging) / [`set_tagging(Option)`](crate::operation::put_object::builders::PutObjectFluentBuilder::set_tagging):
      required: **false**

      The tag-set for the object. The tag-set must be encoded as URL Query parameters. (For example, "Key1=Value1")

      This functionality is not supported for directory buckets.


      /// - [`object_lock_mode(ObjectLockMode)`](crate::operation::put_object::builders::PutObjectFluentBuilder::object_lock_mode) / [`set_object_lock_mode(Option)`](crate::operation::put_object::builders::PutObjectFluentBuilder::set_object_lock_mode):
      required: **false**

      The Object Lock mode that you want to apply to this object.

      This functionality is not supported for directory buckets.


      @@ -48,13 +48,13 @@ impl super::Client { /// - [`checksum_crc32_c(Option)`](crate::operation::put_object::PutObjectOutput::checksum_crc32_c):

      The base64-encoded, 32-bit CRC32C checksum of the object. This will only be present if it was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the Amazon S3 User Guide.

      /// - [`checksum_sha1(Option)`](crate::operation::put_object::PutObjectOutput::checksum_sha1):

      The base64-encoded, 160-bit SHA-1 digest of the object. This will only be present if it was uploaded with the object. When you use the API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the Amazon S3 User Guide.

      /// - [`checksum_sha256(Option)`](crate::operation::put_object::PutObjectOutput::checksum_sha256):

      The base64-encoded, 256-bit SHA-256 digest of the object. This will only be present if it was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the Amazon S3 User Guide.

      - /// - [`server_side_encryption(Option)`](crate::operation::put_object::PutObjectOutput::server_side_encryption):

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      + /// - [`server_side_encryption(Option)`](crate::operation::put_object::PutObjectOutput::server_side_encryption):

      The server-side encryption algorithm used when you store this object in Amazon S3.

      /// - [`version_id(Option)`](crate::operation::put_object::PutObjectOutput::version_id):

      Version ID of the object.

      If you enable versioning for a bucket, Amazon S3 automatically generates a unique version ID for the object being stored. Amazon S3 returns this ID in the response. When you enable versioning for a bucket, if Amazon S3 receives multiple write requests for the same object simultaneously, it stores all of the objects. For more information about versioning, see Adding Objects to Versioning-Enabled Buckets in the Amazon S3 User Guide. For information about returning the versioning state of a bucket, see GetBucketVersioning.

      This functionality is not supported for directory buckets.

      /// - [`sse_customer_algorithm(Option)`](crate::operation::put_object::PutObjectOutput::sse_customer_algorithm):

      If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used.

      This functionality is not supported for directory buckets.

      /// - [`sse_customer_key_md5(Option)`](crate::operation::put_object::PutObjectOutput::sse_customer_key_md5):

      If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key.

      This functionality is not supported for directory buckets.

      - /// - [`ssekms_key_id(Option)`](crate::operation::put_object::PutObjectOutput::ssekms_key_id):

      If x-amz-server-side-encryption has a valid value of aws:kms or aws:kms:dsse, this header indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

      This functionality is not supported for directory buckets.

      - /// - [`ssekms_encryption_context(Option)`](crate::operation::put_object::PutObjectOutput::ssekms_encryption_context):

      If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject or CopyObject operations on this object.

      This functionality is not supported for directory buckets.

      - /// - [`bucket_key_enabled(Option)`](crate::operation::put_object::PutObjectOutput::bucket_key_enabled):

      Indicates whether the uploaded object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      This functionality is not supported for directory buckets.

      + /// - [`ssekms_key_id(Option)`](crate::operation::put_object::PutObjectOutput::ssekms_key_id):

      If present, indicates the ID of the KMS key that was used for object encryption.

      + /// - [`ssekms_encryption_context(Option)`](crate::operation::put_object::PutObjectOutput::ssekms_encryption_context):

      If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

      + /// - [`bucket_key_enabled(Option)`](crate::operation::put_object::PutObjectOutput::bucket_key_enabled):

      Indicates whether the uploaded object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      /// - [`request_charged(Option)`](crate::operation::put_object::PutObjectOutput::request_charged):

      If present, indicates that the requester was successfully charged for the request.

      This functionality is not supported for directory buckets.

      /// - On failure, responds with [`SdkError`](crate::operation::put_object::PutObjectError) pub fn put_object(&self) -> crate::operation::put_object::builders::PutObjectFluentBuilder { diff --git a/sdk/s3/src/client/upload_part.rs b/sdk/s3/src/client/upload_part.rs index 2dddc65489d8..b15ad5ce0e0f 100644 --- a/sdk/s3/src/client/upload_part.rs +++ b/sdk/s3/src/client/upload_part.rs @@ -21,7 +21,7 @@ impl super::Client { /// - [`request_payer(RequestPayer)`](crate::operation::upload_part::builders::UploadPartFluentBuilder::request_payer) / [`set_request_payer(Option)`](crate::operation::upload_part::builders::UploadPartFluentBuilder::set_request_payer):
      required: **false**

      Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.

      This functionality is not supported for directory buckets.


      /// - [`expected_bucket_owner(impl Into)`](crate::operation::upload_part::builders::UploadPartFluentBuilder::expected_bucket_owner) / [`set_expected_bucket_owner(Option)`](crate::operation::upload_part::builders::UploadPartFluentBuilder::set_expected_bucket_owner):
      required: **false**

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).


      /// - On success, responds with [`UploadPartOutput`](crate::operation::upload_part::UploadPartOutput) with field(s): - /// - [`server_side_encryption(Option)`](crate::operation::upload_part::UploadPartOutput::server_side_encryption):

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      + /// - [`server_side_encryption(Option)`](crate::operation::upload_part::UploadPartOutput::server_side_encryption):

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

      /// - [`e_tag(Option)`](crate::operation::upload_part::UploadPartOutput::e_tag):

      Entity tag for the uploaded object.

      /// - [`checksum_crc32(Option)`](crate::operation::upload_part::UploadPartOutput::checksum_crc32):

      The base64-encoded, 32-bit CRC32 checksum of the object. This will only be present if it was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the Amazon S3 User Guide.

      /// - [`checksum_crc32_c(Option)`](crate::operation::upload_part::UploadPartOutput::checksum_crc32_c):

      The base64-encoded, 32-bit CRC32C checksum of the object. This will only be present if it was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the Amazon S3 User Guide.

      @@ -29,8 +29,8 @@ impl super::Client { /// - [`checksum_sha256(Option)`](crate::operation::upload_part::UploadPartOutput::checksum_sha256):

      The base64-encoded, 256-bit SHA-256 digest of the object. This will only be present if it was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the Amazon S3 User Guide.

      /// - [`sse_customer_algorithm(Option)`](crate::operation::upload_part::UploadPartOutput::sse_customer_algorithm):

      If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used.

      This functionality is not supported for directory buckets.

      /// - [`sse_customer_key_md5(Option)`](crate::operation::upload_part::UploadPartOutput::sse_customer_key_md5):

      If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key.

      This functionality is not supported for directory buckets.

      - /// - [`ssekms_key_id(Option)`](crate::operation::upload_part::UploadPartOutput::ssekms_key_id):

      If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

      This functionality is not supported for directory buckets.

      - /// - [`bucket_key_enabled(Option)`](crate::operation::upload_part::UploadPartOutput::bucket_key_enabled):

      Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      This functionality is not supported for directory buckets.

      + /// - [`ssekms_key_id(Option)`](crate::operation::upload_part::UploadPartOutput::ssekms_key_id):

      If present, indicates the ID of the KMS key that was used for object encryption.

      + /// - [`bucket_key_enabled(Option)`](crate::operation::upload_part::UploadPartOutput::bucket_key_enabled):

      Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      /// - [`request_charged(Option)`](crate::operation::upload_part::UploadPartOutput::request_charged):

      If present, indicates that the requester was successfully charged for the request.

      This functionality is not supported for directory buckets.

      /// - On failure, responds with [`SdkError`](crate::operation::upload_part::UploadPartError) pub fn upload_part(&self) -> crate::operation::upload_part::builders::UploadPartFluentBuilder { diff --git a/sdk/s3/src/client/upload_part_copy.rs b/sdk/s3/src/client/upload_part_copy.rs index 392d20bae268..b34ecfb0a536 100644 --- a/sdk/s3/src/client/upload_part_copy.rs +++ b/sdk/s3/src/client/upload_part_copy.rs @@ -25,11 +25,11 @@ impl super::Client { /// - On success, responds with [`UploadPartCopyOutput`](crate::operation::upload_part_copy::UploadPartCopyOutput) with field(s): /// - [`copy_source_version_id(Option)`](crate::operation::upload_part_copy::UploadPartCopyOutput::copy_source_version_id):

      The version of the source object that was copied, if you have enabled versioning on the source bucket.

      This functionality is not supported when the source object is in a directory bucket.

      /// - [`copy_part_result(Option)`](crate::operation::upload_part_copy::UploadPartCopyOutput::copy_part_result):

      Container for all response elements.

      - /// - [`server_side_encryption(Option)`](crate::operation::upload_part_copy::UploadPartCopyOutput::server_side_encryption):

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      + /// - [`server_side_encryption(Option)`](crate::operation::upload_part_copy::UploadPartCopyOutput::server_side_encryption):

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

      /// - [`sse_customer_algorithm(Option)`](crate::operation::upload_part_copy::UploadPartCopyOutput::sse_customer_algorithm):

      If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used.

      This functionality is not supported for directory buckets.

      /// - [`sse_customer_key_md5(Option)`](crate::operation::upload_part_copy::UploadPartCopyOutput::sse_customer_key_md5):

      If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide the round-trip message integrity verification of the customer-provided encryption key.

      This functionality is not supported for directory buckets.

      - /// - [`ssekms_key_id(Option)`](crate::operation::upload_part_copy::UploadPartCopyOutput::ssekms_key_id):

      If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

      This functionality is not supported for directory buckets.

      - /// - [`bucket_key_enabled(Option)`](crate::operation::upload_part_copy::UploadPartCopyOutput::bucket_key_enabled):

      Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      This functionality is not supported for directory buckets.

      + /// - [`ssekms_key_id(Option)`](crate::operation::upload_part_copy::UploadPartCopyOutput::ssekms_key_id):

      If present, indicates the ID of the KMS key that was used for object encryption.

      + /// - [`bucket_key_enabled(Option)`](crate::operation::upload_part_copy::UploadPartCopyOutput::bucket_key_enabled):

      Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      /// - [`request_charged(Option)`](crate::operation::upload_part_copy::UploadPartCopyOutput::request_charged):

      If present, indicates that the requester was successfully charged for the request.

      This functionality is not supported for directory buckets.

      /// - On failure, responds with [`SdkError`](crate::operation::upload_part_copy::UploadPartCopyError) pub fn upload_part_copy(&self) -> crate::operation::upload_part_copy::builders::UploadPartCopyFluentBuilder { diff --git a/sdk/s3/src/lib.rs b/sdk/s3/src/lib.rs index ae041eaa952f..b1a9d350cc97 100644 --- a/sdk/s3/src/lib.rs +++ b/sdk/s3/src/lib.rs @@ -29,7 +29,7 @@ //! ```toml //! [dependencies] //! aws-config = { version = "1.1.7", features = ["behavior-version-latest"] } -//! aws-sdk-s3 = "1.50.0" +//! aws-sdk-s3 = "1.51.0" //! tokio = { version = "1", features = ["full"] } //! ``` //! diff --git a/sdk/s3/src/operation/complete_multipart_upload/_complete_multipart_upload_output.rs b/sdk/s3/src/operation/complete_multipart_upload/_complete_multipart_upload_output.rs index f589f46ae124..722541795160 100644 --- a/sdk/s3/src/operation/complete_multipart_upload/_complete_multipart_upload_output.rs +++ b/sdk/s3/src/operation/complete_multipart_upload/_complete_multipart_upload_output.rs @@ -25,21 +25,15 @@ pub struct CompleteMultipartUploadOutput { pub checksum_sha1: ::std::option::Option<::std::string::String>, ///

      The base64-encoded, 256-bit SHA-256 digest of the object. This will only be present if it was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the Amazon S3 User Guide.

      pub checksum_sha256: ::std::option::Option<::std::string::String>, - ///

      The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms).

      - ///

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      - ///
      + ///

      The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms).

      pub server_side_encryption: ::std::option::Option, ///

      Version ID of the newly created object, in case the bucket has versioning turned on.

      ///

      This functionality is not supported for directory buckets.

      ///
      pub version_id: ::std::option::Option<::std::string::String>, - ///

      If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      If present, indicates the ID of the KMS key that was used for object encryption.

      pub ssekms_key_id: ::std::option::Option<::std::string::String>, - ///

      Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      pub bucket_key_enabled: ::std::option::Option, ///

      If present, indicates that the requester was successfully charged for the request.

      ///

      This functionality is not supported for directory buckets.

      @@ -89,9 +83,7 @@ impl CompleteMultipartUploadOutput { pub fn checksum_sha256(&self) -> ::std::option::Option<&str> { self.checksum_sha256.as_deref() } - ///

      The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms).

      - ///

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      - ///
      + ///

      The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms).

      pub fn server_side_encryption(&self) -> ::std::option::Option<&crate::types::ServerSideEncryption> { self.server_side_encryption.as_ref() } @@ -101,15 +93,11 @@ impl CompleteMultipartUploadOutput { pub fn version_id(&self) -> ::std::option::Option<&str> { self.version_id.as_deref() } - ///

      If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      If present, indicates the ID of the KMS key that was used for object encryption.

      pub fn ssekms_key_id(&self) -> ::std::option::Option<&str> { self.ssekms_key_id.as_deref() } - ///

      Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      pub fn bucket_key_enabled(&self) -> ::std::option::Option { self.bucket_key_enabled } @@ -319,23 +307,17 @@ impl CompleteMultipartUploadOutputBuilder { pub fn get_checksum_sha256(&self) -> &::std::option::Option<::std::string::String> { &self.checksum_sha256 } - ///

      The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms).

      - ///

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      - ///
      + ///

      The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms).

      pub fn server_side_encryption(mut self, input: crate::types::ServerSideEncryption) -> Self { self.server_side_encryption = ::std::option::Option::Some(input); self } - ///

      The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms).

      - ///

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      - ///
      + ///

      The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms).

      pub fn set_server_side_encryption(mut self, input: ::std::option::Option) -> Self { self.server_side_encryption = input; self } - ///

      The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms).

      - ///

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      - ///
      + ///

      The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms).

      pub fn get_server_side_encryption(&self) -> &::std::option::Option { &self.server_side_encryption } @@ -359,43 +341,31 @@ impl CompleteMultipartUploadOutputBuilder { pub fn get_version_id(&self) -> &::std::option::Option<::std::string::String> { &self.version_id } - ///

      If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      If present, indicates the ID of the KMS key that was used for object encryption.

      pub fn ssekms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.ssekms_key_id = ::std::option::Option::Some(input.into()); self } - ///

      If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      If present, indicates the ID of the KMS key that was used for object encryption.

      pub fn set_ssekms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.ssekms_key_id = input; self } - ///

      If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      If present, indicates the ID of the KMS key that was used for object encryption.

      pub fn get_ssekms_key_id(&self) -> &::std::option::Option<::std::string::String> { &self.ssekms_key_id } - ///

      Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      pub fn bucket_key_enabled(mut self, input: bool) -> Self { self.bucket_key_enabled = ::std::option::Option::Some(input); self } - ///

      Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      pub fn set_bucket_key_enabled(mut self, input: ::std::option::Option) -> Self { self.bucket_key_enabled = input; self } - ///

      Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      pub fn get_bucket_key_enabled(&self) -> &::std::option::Option { &self.bucket_key_enabled } diff --git a/sdk/s3/src/operation/complete_multipart_upload/builders.rs b/sdk/s3/src/operation/complete_multipart_upload/builders.rs index 790269321e46..9a8fe21cd0e9 100644 --- a/sdk/s3/src/operation/complete_multipart_upload/builders.rs +++ b/sdk/s3/src/operation/complete_multipart_upload/builders.rs @@ -38,11 +38,11 @@ impl crate::operation::complete_multipart_upload::builders::CompleteMultipartUpl ///
      ///
        ///
      • -///

        General purpose bucket permissions - For information about permissions required to use the multipart upload API, see Multipart Upload and Permissions in the Amazon S3 User Guide.

      • -///
      • -///

        Directory bucket permissions - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the s3express:CreateSession permission to the directory bucket in a bucket policy or an IAM identity-based policy. Then, you make the CreateSession API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another CreateSession API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession .

      • -///
      • +///

        General purpose bucket permissions - For information about permissions required to use the multipart upload API, see Multipart Upload and Permissions in the Amazon S3 User Guide.

        ///

        If you provide an additional checksum value in your MultipartUpload requests and the object is encrypted with Key Management Service, you must have permission to use the kms:Decrypt action for the CompleteMultipartUpload request to succeed.

      • +///
      • +///

        Directory bucket permissions - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the s3express:CreateSession permission to the directory bucket in a bucket policy or an IAM identity-based policy. Then, you make the CreateSession API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another CreateSession API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession .

        +///

        If the object is encrypted with SSE-KMS, you must also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies and KMS key policies for the KMS key.

      • ///
      ///
      ///
      diff --git a/sdk/s3/src/operation/copy_object/_copy_object_input.rs b/sdk/s3/src/operation/copy_object/_copy_object_input.rs index 08f6834367ac..650b920e0987 100644 --- a/sdk/s3/src/operation/copy_object/_copy_object_input.rs +++ b/sdk/s3/src/operation/copy_object/_copy_object_input.rs @@ -187,12 +187,23 @@ pub struct CopyObjectInput { ///
    /// pub tagging_directive: ::std::option::Option, - ///

    The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse). Unrecognized or unsupported values won’t write a destination object and will receive a 400 Bad Request response.

    - ///

    Amazon S3 automatically encrypts all new objects that are copied to an S3 bucket. When copying an object, if you don't specify encryption information in your copy request, the encryption setting of the target object is set to the default encryption configuration of the destination bucket. By default, all buckets have a base level of encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). If the destination bucket has a default encryption configuration that uses server-side encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), or server-side encryption with customer-provided encryption keys (SSE-C), Amazon S3 uses the corresponding KMS key, or a customer-provided key to encrypt the target object copy.

    - ///

    When you perform a CopyObject operation, if you want to use a different type of encryption setting for the target object, you can specify appropriate encryption-related headers to encrypt the target object with an Amazon S3 managed key, a KMS key, or a customer-provided key. If the encryption setting in your request is different from the default encryption configuration of the destination bucket, the encryption setting in your request takes precedence.

    - ///

    With server-side encryption, Amazon S3 encrypts your data as it writes your data to disks in its data centers and decrypts the data when you access it. For more information about server-side encryption, see Using Server-Side Encryption in the Amazon S3 User Guide.

    - ///

    For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

    - ///
    + ///

    The server-side encryption algorithm used when storing this object in Amazon S3. Unrecognized or unsupported values won’t write a destination object and will receive a 400 Bad Request response.

    + ///

    Amazon S3 automatically encrypts all new objects that are copied to an S3 bucket. When copying an object, if you don't specify encryption information in your copy request, the encryption setting of the target object is set to the default encryption configuration of the destination bucket. By default, all buckets have a base level of encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). If the destination bucket has a different default encryption configuration, Amazon S3 uses the corresponding encryption key to encrypt the target object copy.

    + ///

    With server-side encryption, Amazon S3 encrypts your data as it writes your data to disks in its data centers and decrypts the data when you access it. For more information about server-side encryption, see Using Server-Side Encryption in the Amazon S3 User Guide.

    + ///

    General purpose buckets

    + ///
      + ///
    • + ///

      For general purpose buckets, there are the following supported options for server-side encryption: server-side encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), and server-side encryption with customer-provided encryption keys (SSE-C). Amazon S3 uses the corresponding KMS key, or a customer-provided key to encrypt the target object copy.

    • + ///
    • + ///

      When you perform a CopyObject operation, if you want to use a different type of encryption setting for the target object, you can specify appropriate encryption-related headers to encrypt the target object with an Amazon S3 managed key, a KMS key, or a customer-provided key. If the encryption setting in your request is different from the default encryption configuration of the destination bucket, the encryption setting in your request takes precedence.

    • + ///
    + ///

    Directory buckets

    + ///
      + ///
    • + ///

      For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

    • + ///
    • + ///

      To encrypt new object copies to a directory bucket with SSE-KMS, we recommend you specify SSE-KMS as the directory bucket's default encryption configuration with a KMS key (specifically, a customer managed key). Amazon Web Services managed key (aws/s3) isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. After you specify a customer managed key for SSE-KMS, you can't override the customer managed key for the bucket's SSE-KMS configuration. Then, when you perform a CopyObject operation and want to specify server-side encryption settings for new object copies with SSE-KMS in the encryption-related request headers, you must ensure the encryption key is the same customer managed key that you specified for the directory bucket's default encryption configuration.

    • + ///
    pub server_side_encryption: ::std::option::Option, ///

    If the x-amz-storage-class header is not used, the copied object will be stored in the STANDARD Storage Class by default. The STANDARD storage class provides high durability and high availability. Depending on performance needs, you can specify a different Storage Class.

    ///
      @@ -229,18 +240,17 @@ pub struct CopyObjectInput { ///

      This functionality is not supported when the destination bucket is a directory bucket.

      /// pub sse_customer_key_md5: ::std::option::Option<::std::string::String>, - ///

      Specifies the KMS ID (Key ID, Key ARN, or Key Alias) to use for object encryption. All GET and PUT requests for an object protected by KMS will fail if they're not made via SSL or using SigV4. For information about configuring any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature Version in Request Authentication in the Amazon S3 User Guide.

      - ///

      This functionality is not supported when the destination bucket is a directory bucket.

      - ///
      + ///

      Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. All GET and PUT requests for an object protected by KMS will fail if they're not made via SSL or using SigV4. For information about configuring any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature Version in Request Authentication in the Amazon S3 User Guide.

      + ///

      Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

      pub ssekms_key_id: ::std::option::Option<::std::string::String>, - ///

      Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. This value must be explicitly added to specify encryption context for CopyObject requests.

      - ///

      This functionality is not supported when the destination bucket is a directory bucket.

      - ///
      + ///

      Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for the destination object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      + ///

      General purpose buckets - This value must be explicitly added to specify encryption context for CopyObject requests if you want an additional encryption context for your destination object. The additional encryption context of the source object won't be copied to the destination object. For more information, see Encryption context in the Amazon S3 User Guide.

      + ///

      Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

      pub ssekms_encryption_context: ::std::option::Option<::std::string::String>, ///

      Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). If a target object uses SSE-KMS, you can enable an S3 Bucket Key for the object.

      ///

      Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Specifying this header with a COPY action doesn’t affect bucket-level settings for S3 Bucket Key.

      ///

      For more information, see Amazon S3 Bucket Keys in the Amazon S3 User Guide.

      - ///

      This functionality is not supported when the destination bucket is a directory bucket.

      + ///

      Directory buckets - S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

      ///
      pub bucket_key_enabled: ::std::option::Option, ///

      Specifies the algorithm to use when decrypting the source object (for example, AES256).

      @@ -532,12 +542,23 @@ impl CopyObjectInput { pub fn tagging_directive(&self) -> ::std::option::Option<&crate::types::TaggingDirective> { self.tagging_directive.as_ref() } - ///

      The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse). Unrecognized or unsupported values won’t write a destination object and will receive a 400 Bad Request response.

      - ///

      Amazon S3 automatically encrypts all new objects that are copied to an S3 bucket. When copying an object, if you don't specify encryption information in your copy request, the encryption setting of the target object is set to the default encryption configuration of the destination bucket. By default, all buckets have a base level of encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). If the destination bucket has a default encryption configuration that uses server-side encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), or server-side encryption with customer-provided encryption keys (SSE-C), Amazon S3 uses the corresponding KMS key, or a customer-provided key to encrypt the target object copy.

      - ///

      When you perform a CopyObject operation, if you want to use a different type of encryption setting for the target object, you can specify appropriate encryption-related headers to encrypt the target object with an Amazon S3 managed key, a KMS key, or a customer-provided key. If the encryption setting in your request is different from the default encryption configuration of the destination bucket, the encryption setting in your request takes precedence.

      - ///

      With server-side encryption, Amazon S3 encrypts your data as it writes your data to disks in its data centers and decrypts the data when you access it. For more information about server-side encryption, see Using Server-Side Encryption in the Amazon S3 User Guide.

      - ///

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      - ///
      + ///

      The server-side encryption algorithm used when storing this object in Amazon S3. Unrecognized or unsupported values won’t write a destination object and will receive a 400 Bad Request response.

      + ///

      Amazon S3 automatically encrypts all new objects that are copied to an S3 bucket. When copying an object, if you don't specify encryption information in your copy request, the encryption setting of the target object is set to the default encryption configuration of the destination bucket. By default, all buckets have a base level of encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). If the destination bucket has a different default encryption configuration, Amazon S3 uses the corresponding encryption key to encrypt the target object copy.

      + ///

      With server-side encryption, Amazon S3 encrypts your data as it writes your data to disks in its data centers and decrypts the data when you access it. For more information about server-side encryption, see Using Server-Side Encryption in the Amazon S3 User Guide.

      + ///

      General purpose buckets

      + ///
        + ///
      • + ///

        For general purpose buckets, there are the following supported options for server-side encryption: server-side encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), and server-side encryption with customer-provided encryption keys (SSE-C). Amazon S3 uses the corresponding KMS key, or a customer-provided key to encrypt the target object copy.

      • + ///
      • + ///

        When you perform a CopyObject operation, if you want to use a different type of encryption setting for the target object, you can specify appropriate encryption-related headers to encrypt the target object with an Amazon S3 managed key, a KMS key, or a customer-provided key. If the encryption setting in your request is different from the default encryption configuration of the destination bucket, the encryption setting in your request takes precedence.

      • + ///
      + ///

      Directory buckets

      + ///
        + ///
      • + ///

        For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

      • + ///
      • + ///

        To encrypt new object copies to a directory bucket with SSE-KMS, we recommend you specify SSE-KMS as the directory bucket's default encryption configuration with a KMS key (specifically, a customer managed key). Amazon Web Services managed key (aws/s3) isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. After you specify a customer managed key for SSE-KMS, you can't override the customer managed key for the bucket's SSE-KMS configuration. Then, when you perform a CopyObject operation and want to specify server-side encryption settings for new object copies with SSE-KMS in the encryption-related request headers, you must ensure the encryption key is the same customer managed key that you specified for the directory bucket's default encryption configuration.

      • + ///
      pub fn server_side_encryption(&self) -> ::std::option::Option<&crate::types::ServerSideEncryption> { self.server_side_encryption.as_ref() } @@ -586,22 +607,21 @@ impl CopyObjectInput { pub fn sse_customer_key_md5(&self) -> ::std::option::Option<&str> { self.sse_customer_key_md5.as_deref() } - ///

      Specifies the KMS ID (Key ID, Key ARN, or Key Alias) to use for object encryption. All GET and PUT requests for an object protected by KMS will fail if they're not made via SSL or using SigV4. For information about configuring any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature Version in Request Authentication in the Amazon S3 User Guide.

      - ///

      This functionality is not supported when the destination bucket is a directory bucket.

      - ///
      + ///

      Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. All GET and PUT requests for an object protected by KMS will fail if they're not made via SSL or using SigV4. For information about configuring any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature Version in Request Authentication in the Amazon S3 User Guide.

      + ///

      Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

      pub fn ssekms_key_id(&self) -> ::std::option::Option<&str> { self.ssekms_key_id.as_deref() } - ///

      Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. This value must be explicitly added to specify encryption context for CopyObject requests.

      - ///

      This functionality is not supported when the destination bucket is a directory bucket.

      - ///
      + ///

      Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for the destination object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      + ///

      General purpose buckets - This value must be explicitly added to specify encryption context for CopyObject requests if you want an additional encryption context for your destination object. The additional encryption context of the source object won't be copied to the destination object. For more information, see Encryption context in the Amazon S3 User Guide.

      + ///

      Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

      pub fn ssekms_encryption_context(&self) -> ::std::option::Option<&str> { self.ssekms_encryption_context.as_deref() } ///

      Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). If a target object uses SSE-KMS, you can enable an S3 Bucket Key for the object.

      ///

      Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Specifying this header with a COPY action doesn’t affect bucket-level settings for S3 Bucket Key.

      ///

      For more information, see Amazon S3 Bucket Keys in the Amazon S3 User Guide.

      - ///

      This functionality is not supported when the destination bucket is a directory bucket.

      + ///

      Directory buckets - S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

      ///
      pub fn bucket_key_enabled(&self) -> ::std::option::Option { self.bucket_key_enabled @@ -1524,32 +1544,65 @@ impl CopyObjectInputBuilder { pub fn get_tagging_directive(&self) -> &::std::option::Option { &self.tagging_directive } - ///

      The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse). Unrecognized or unsupported values won’t write a destination object and will receive a 400 Bad Request response.

      - ///

      Amazon S3 automatically encrypts all new objects that are copied to an S3 bucket. When copying an object, if you don't specify encryption information in your copy request, the encryption setting of the target object is set to the default encryption configuration of the destination bucket. By default, all buckets have a base level of encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). If the destination bucket has a default encryption configuration that uses server-side encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), or server-side encryption with customer-provided encryption keys (SSE-C), Amazon S3 uses the corresponding KMS key, or a customer-provided key to encrypt the target object copy.

      - ///

      When you perform a CopyObject operation, if you want to use a different type of encryption setting for the target object, you can specify appropriate encryption-related headers to encrypt the target object with an Amazon S3 managed key, a KMS key, or a customer-provided key. If the encryption setting in your request is different from the default encryption configuration of the destination bucket, the encryption setting in your request takes precedence.

      - ///

      With server-side encryption, Amazon S3 encrypts your data as it writes your data to disks in its data centers and decrypts the data when you access it. For more information about server-side encryption, see Using Server-Side Encryption in the Amazon S3 User Guide.

      - ///

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      - ///
      + ///

      The server-side encryption algorithm used when storing this object in Amazon S3. Unrecognized or unsupported values won’t write a destination object and will receive a 400 Bad Request response.

      + ///

      Amazon S3 automatically encrypts all new objects that are copied to an S3 bucket. When copying an object, if you don't specify encryption information in your copy request, the encryption setting of the target object is set to the default encryption configuration of the destination bucket. By default, all buckets have a base level of encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). If the destination bucket has a different default encryption configuration, Amazon S3 uses the corresponding encryption key to encrypt the target object copy.

      + ///

      With server-side encryption, Amazon S3 encrypts your data as it writes your data to disks in its data centers and decrypts the data when you access it. For more information about server-side encryption, see Using Server-Side Encryption in the Amazon S3 User Guide.

      + ///

      General purpose buckets

      + ///
        + ///
      • + ///

        For general purpose buckets, there are the following supported options for server-side encryption: server-side encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), and server-side encryption with customer-provided encryption keys (SSE-C). Amazon S3 uses the corresponding KMS key, or a customer-provided key to encrypt the target object copy.

      • + ///
      • + ///

        When you perform a CopyObject operation, if you want to use a different type of encryption setting for the target object, you can specify appropriate encryption-related headers to encrypt the target object with an Amazon S3 managed key, a KMS key, or a customer-provided key. If the encryption setting in your request is different from the default encryption configuration of the destination bucket, the encryption setting in your request takes precedence.

      • + ///
      + ///

      Directory buckets

      + ///
        + ///
      • + ///

        For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

      • + ///
      • + ///

        To encrypt new object copies to a directory bucket with SSE-KMS, we recommend you specify SSE-KMS as the directory bucket's default encryption configuration with a KMS key (specifically, a customer managed key). Amazon Web Services managed key (aws/s3) isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. After you specify a customer managed key for SSE-KMS, you can't override the customer managed key for the bucket's SSE-KMS configuration. Then, when you perform a CopyObject operation and want to specify server-side encryption settings for new object copies with SSE-KMS in the encryption-related request headers, you must ensure the encryption key is the same customer managed key that you specified for the directory bucket's default encryption configuration.

      • + ///
      pub fn server_side_encryption(mut self, input: crate::types::ServerSideEncryption) -> Self { self.server_side_encryption = ::std::option::Option::Some(input); self } - ///

      The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse). Unrecognized or unsupported values won’t write a destination object and will receive a 400 Bad Request response.

      - ///

      Amazon S3 automatically encrypts all new objects that are copied to an S3 bucket. When copying an object, if you don't specify encryption information in your copy request, the encryption setting of the target object is set to the default encryption configuration of the destination bucket. By default, all buckets have a base level of encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). If the destination bucket has a default encryption configuration that uses server-side encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), or server-side encryption with customer-provided encryption keys (SSE-C), Amazon S3 uses the corresponding KMS key, or a customer-provided key to encrypt the target object copy.

      - ///

      When you perform a CopyObject operation, if you want to use a different type of encryption setting for the target object, you can specify appropriate encryption-related headers to encrypt the target object with an Amazon S3 managed key, a KMS key, or a customer-provided key. If the encryption setting in your request is different from the default encryption configuration of the destination bucket, the encryption setting in your request takes precedence.

      - ///

      With server-side encryption, Amazon S3 encrypts your data as it writes your data to disks in its data centers and decrypts the data when you access it. For more information about server-side encryption, see Using Server-Side Encryption in the Amazon S3 User Guide.

      - ///

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      - ///
      + ///

      The server-side encryption algorithm used when storing this object in Amazon S3. Unrecognized or unsupported values won’t write a destination object and will receive a 400 Bad Request response.

      + ///

      Amazon S3 automatically encrypts all new objects that are copied to an S3 bucket. When copying an object, if you don't specify encryption information in your copy request, the encryption setting of the target object is set to the default encryption configuration of the destination bucket. By default, all buckets have a base level of encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). If the destination bucket has a different default encryption configuration, Amazon S3 uses the corresponding encryption key to encrypt the target object copy.

      + ///

      With server-side encryption, Amazon S3 encrypts your data as it writes your data to disks in its data centers and decrypts the data when you access it. For more information about server-side encryption, see Using Server-Side Encryption in the Amazon S3 User Guide.

      + ///

      General purpose buckets

      + ///
        + ///
      • + ///

        For general purpose buckets, there are the following supported options for server-side encryption: server-side encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), and server-side encryption with customer-provided encryption keys (SSE-C). Amazon S3 uses the corresponding KMS key, or a customer-provided key to encrypt the target object copy.

      • + ///
      • + ///

        When you perform a CopyObject operation, if you want to use a different type of encryption setting for the target object, you can specify appropriate encryption-related headers to encrypt the target object with an Amazon S3 managed key, a KMS key, or a customer-provided key. If the encryption setting in your request is different from the default encryption configuration of the destination bucket, the encryption setting in your request takes precedence.

      • + ///
      + ///

      Directory buckets

      + ///
        + ///
      • + ///

        For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

      • + ///
      • + ///

        To encrypt new object copies to a directory bucket with SSE-KMS, we recommend you specify SSE-KMS as the directory bucket's default encryption configuration with a KMS key (specifically, a customer managed key). Amazon Web Services managed key (aws/s3) isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. After you specify a customer managed key for SSE-KMS, you can't override the customer managed key for the bucket's SSE-KMS configuration. Then, when you perform a CopyObject operation and want to specify server-side encryption settings for new object copies with SSE-KMS in the encryption-related request headers, you must ensure the encryption key is the same customer managed key that you specified for the directory bucket's default encryption configuration.

      • + ///
      pub fn set_server_side_encryption(mut self, input: ::std::option::Option) -> Self { self.server_side_encryption = input; self } - ///

      The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse). Unrecognized or unsupported values won’t write a destination object and will receive a 400 Bad Request response.

      - ///

      Amazon S3 automatically encrypts all new objects that are copied to an S3 bucket. When copying an object, if you don't specify encryption information in your copy request, the encryption setting of the target object is set to the default encryption configuration of the destination bucket. By default, all buckets have a base level of encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). If the destination bucket has a default encryption configuration that uses server-side encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), or server-side encryption with customer-provided encryption keys (SSE-C), Amazon S3 uses the corresponding KMS key, or a customer-provided key to encrypt the target object copy.

      - ///

      When you perform a CopyObject operation, if you want to use a different type of encryption setting for the target object, you can specify appropriate encryption-related headers to encrypt the target object with an Amazon S3 managed key, a KMS key, or a customer-provided key. If the encryption setting in your request is different from the default encryption configuration of the destination bucket, the encryption setting in your request takes precedence.

      - ///

      With server-side encryption, Amazon S3 encrypts your data as it writes your data to disks in its data centers and decrypts the data when you access it. For more information about server-side encryption, see Using Server-Side Encryption in the Amazon S3 User Guide.

      - ///

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      - ///
      + ///

      The server-side encryption algorithm used when storing this object in Amazon S3. Unrecognized or unsupported values won’t write a destination object and will receive a 400 Bad Request response.

      + ///

      Amazon S3 automatically encrypts all new objects that are copied to an S3 bucket. When copying an object, if you don't specify encryption information in your copy request, the encryption setting of the target object is set to the default encryption configuration of the destination bucket. By default, all buckets have a base level of encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). If the destination bucket has a different default encryption configuration, Amazon S3 uses the corresponding encryption key to encrypt the target object copy.

      + ///

      With server-side encryption, Amazon S3 encrypts your data as it writes your data to disks in its data centers and decrypts the data when you access it. For more information about server-side encryption, see Using Server-Side Encryption in the Amazon S3 User Guide.

      + ///

      General purpose buckets

      + ///
        + ///
      • + ///

        For general purpose buckets, there are the following supported options for server-side encryption: server-side encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), and server-side encryption with customer-provided encryption keys (SSE-C). Amazon S3 uses the corresponding KMS key, or a customer-provided key to encrypt the target object copy.

      • + ///
      • + ///

        When you perform a CopyObject operation, if you want to use a different type of encryption setting for the target object, you can specify appropriate encryption-related headers to encrypt the target object with an Amazon S3 managed key, a KMS key, or a customer-provided key. If the encryption setting in your request is different from the default encryption configuration of the destination bucket, the encryption setting in your request takes precedence.

      • + ///
      + ///

      Directory buckets

      + ///
        + ///
      • + ///

        For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

      • + ///
      • + ///

        To encrypt new object copies to a directory bucket with SSE-KMS, we recommend you specify SSE-KMS as the directory bucket's default encryption configuration with a KMS key (specifically, a customer managed key). Amazon Web Services managed key (aws/s3) isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. After you specify a customer managed key for SSE-KMS, you can't override the customer managed key for the bucket's SSE-KMS configuration. Then, when you perform a CopyObject operation and want to specify server-side encryption settings for new object copies with SSE-KMS in the encryption-related request headers, you must ensure the encryption key is the same customer managed key that you specified for the directory bucket's default encryption configuration.

      • + ///
      pub fn get_server_side_encryption(&self) -> &::std::option::Option { &self.server_side_encryption } @@ -1698,50 +1751,47 @@ impl CopyObjectInputBuilder { pub fn get_sse_customer_key_md5(&self) -> &::std::option::Option<::std::string::String> { &self.sse_customer_key_md5 } - ///

      Specifies the KMS ID (Key ID, Key ARN, or Key Alias) to use for object encryption. All GET and PUT requests for an object protected by KMS will fail if they're not made via SSL or using SigV4. For information about configuring any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature Version in Request Authentication in the Amazon S3 User Guide.

      - ///

      This functionality is not supported when the destination bucket is a directory bucket.

      - ///
      + ///

      Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. All GET and PUT requests for an object protected by KMS will fail if they're not made via SSL or using SigV4. For information about configuring any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature Version in Request Authentication in the Amazon S3 User Guide.

      + ///

      Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

      pub fn ssekms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.ssekms_key_id = ::std::option::Option::Some(input.into()); self } - ///

      Specifies the KMS ID (Key ID, Key ARN, or Key Alias) to use for object encryption. All GET and PUT requests for an object protected by KMS will fail if they're not made via SSL or using SigV4. For information about configuring any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature Version in Request Authentication in the Amazon S3 User Guide.

      - ///

      This functionality is not supported when the destination bucket is a directory bucket.

      - ///
      + ///

      Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. All GET and PUT requests for an object protected by KMS will fail if they're not made via SSL or using SigV4. For information about configuring any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature Version in Request Authentication in the Amazon S3 User Guide.

      + ///

      Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

      pub fn set_ssekms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.ssekms_key_id = input; self } - ///

      Specifies the KMS ID (Key ID, Key ARN, or Key Alias) to use for object encryption. All GET and PUT requests for an object protected by KMS will fail if they're not made via SSL or using SigV4. For information about configuring any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature Version in Request Authentication in the Amazon S3 User Guide.

      - ///

      This functionality is not supported when the destination bucket is a directory bucket.

      - ///
      + ///

      Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. All GET and PUT requests for an object protected by KMS will fail if they're not made via SSL or using SigV4. For information about configuring any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature Version in Request Authentication in the Amazon S3 User Guide.

      + ///

      Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

      pub fn get_ssekms_key_id(&self) -> &::std::option::Option<::std::string::String> { &self.ssekms_key_id } - ///

      Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. This value must be explicitly added to specify encryption context for CopyObject requests.

      - ///

      This functionality is not supported when the destination bucket is a directory bucket.

      - ///
      + ///

      Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for the destination object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      + ///

      General purpose buckets - This value must be explicitly added to specify encryption context for CopyObject requests if you want an additional encryption context for your destination object. The additional encryption context of the source object won't be copied to the destination object. For more information, see Encryption context in the Amazon S3 User Guide.

      + ///

      Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

      pub fn ssekms_encryption_context(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.ssekms_encryption_context = ::std::option::Option::Some(input.into()); self } - ///

      Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. This value must be explicitly added to specify encryption context for CopyObject requests.

      - ///

      This functionality is not supported when the destination bucket is a directory bucket.

      - ///
      + ///

      Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for the destination object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      + ///

      General purpose buckets - This value must be explicitly added to specify encryption context for CopyObject requests if you want an additional encryption context for your destination object. The additional encryption context of the source object won't be copied to the destination object. For more information, see Encryption context in the Amazon S3 User Guide.

      + ///

      Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

      pub fn set_ssekms_encryption_context(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.ssekms_encryption_context = input; self } - ///

      Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. This value must be explicitly added to specify encryption context for CopyObject requests.

      - ///

      This functionality is not supported when the destination bucket is a directory bucket.

      - ///
      + ///

      Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for the destination object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      + ///

      General purpose buckets - This value must be explicitly added to specify encryption context for CopyObject requests if you want an additional encryption context for your destination object. The additional encryption context of the source object won't be copied to the destination object. For more information, see Encryption context in the Amazon S3 User Guide.

      + ///

      Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

      pub fn get_ssekms_encryption_context(&self) -> &::std::option::Option<::std::string::String> { &self.ssekms_encryption_context } ///

      Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). If a target object uses SSE-KMS, you can enable an S3 Bucket Key for the object.

      ///

      Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Specifying this header with a COPY action doesn’t affect bucket-level settings for S3 Bucket Key.

      ///

      For more information, see Amazon S3 Bucket Keys in the Amazon S3 User Guide.

      - ///

      This functionality is not supported when the destination bucket is a directory bucket.

      + ///

      Directory buckets - S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

      ///
      pub fn bucket_key_enabled(mut self, input: bool) -> Self { self.bucket_key_enabled = ::std::option::Option::Some(input); @@ -1750,7 +1800,7 @@ impl CopyObjectInputBuilder { ///

      Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). If a target object uses SSE-KMS, you can enable an S3 Bucket Key for the object.

      ///

      Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Specifying this header with a COPY action doesn’t affect bucket-level settings for S3 Bucket Key.

      ///

      For more information, see Amazon S3 Bucket Keys in the Amazon S3 User Guide.

      - ///

      This functionality is not supported when the destination bucket is a directory bucket.

      + ///

      Directory buckets - S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

      ///
      pub fn set_bucket_key_enabled(mut self, input: ::std::option::Option) -> Self { self.bucket_key_enabled = input; @@ -1759,7 +1809,7 @@ impl CopyObjectInputBuilder { ///

      Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). If a target object uses SSE-KMS, you can enable an S3 Bucket Key for the object.

      ///

      Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Specifying this header with a COPY action doesn’t affect bucket-level settings for S3 Bucket Key.

      ///

      For more information, see Amazon S3 Bucket Keys in the Amazon S3 User Guide.

      - ///

      This functionality is not supported when the destination bucket is a directory bucket.

      + ///

      Directory buckets - S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

      ///
      pub fn get_bucket_key_enabled(&self) -> &::std::option::Option { &self.bucket_key_enabled diff --git a/sdk/s3/src/operation/copy_object/_copy_object_output.rs b/sdk/s3/src/operation/copy_object/_copy_object_output.rs index 25feb298591b..3f3a0384aff8 100644 --- a/sdk/s3/src/operation/copy_object/_copy_object_output.rs +++ b/sdk/s3/src/operation/copy_object/_copy_object_output.rs @@ -17,9 +17,7 @@ pub struct CopyObjectOutput { ///

      This functionality is not supported for directory buckets.

      /// pub version_id: ::std::option::Option<::std::string::String>, - ///

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

      - ///

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      - ///
      + ///

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

      pub server_side_encryption: ::std::option::Option, ///

      If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used.

      ///

      This functionality is not supported for directory buckets.

      @@ -29,17 +27,11 @@ pub struct CopyObjectOutput { ///

      This functionality is not supported for directory buckets.

      ///
      pub sse_customer_key_md5: ::std::option::Option<::std::string::String>, - ///

      If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      If present, indicates the ID of the KMS key that was used for object encryption.

      pub ssekms_key_id: ::std::option::Option<::std::string::String>, - ///

      If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      pub ssekms_encryption_context: ::std::option::Option<::std::string::String>, - ///

      Indicates whether the copied object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Indicates whether the copied object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      pub bucket_key_enabled: ::std::option::Option, ///

      If present, indicates that the requester was successfully charged for the request.

      ///

      This functionality is not supported for directory buckets.

      @@ -71,9 +63,7 @@ impl CopyObjectOutput { pub fn version_id(&self) -> ::std::option::Option<&str> { self.version_id.as_deref() } - ///

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

      - ///

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      - ///
      + ///

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

      pub fn server_side_encryption(&self) -> ::std::option::Option<&crate::types::ServerSideEncryption> { self.server_side_encryption.as_ref() } @@ -89,21 +79,15 @@ impl CopyObjectOutput { pub fn sse_customer_key_md5(&self) -> ::std::option::Option<&str> { self.sse_customer_key_md5.as_deref() } - ///

      If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      If present, indicates the ID of the KMS key that was used for object encryption.

      pub fn ssekms_key_id(&self) -> ::std::option::Option<&str> { self.ssekms_key_id.as_deref() } - ///

      If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      pub fn ssekms_encryption_context(&self) -> ::std::option::Option<&str> { self.ssekms_encryption_context.as_deref() } - ///

      Indicates whether the copied object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Indicates whether the copied object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      pub fn bucket_key_enabled(&self) -> ::std::option::Option { self.bucket_key_enabled } @@ -243,23 +227,17 @@ impl CopyObjectOutputBuilder { pub fn get_version_id(&self) -> &::std::option::Option<::std::string::String> { &self.version_id } - ///

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

      - ///

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      - ///
      + ///

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

      pub fn server_side_encryption(mut self, input: crate::types::ServerSideEncryption) -> Self { self.server_side_encryption = ::std::option::Option::Some(input); self } - ///

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

      - ///

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      - ///
      + ///

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

      pub fn set_server_side_encryption(mut self, input: ::std::option::Option) -> Self { self.server_side_encryption = input; self } - ///

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

      - ///

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      - ///
      + ///

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

      pub fn get_server_side_encryption(&self) -> &::std::option::Option { &self.server_side_encryption } @@ -303,63 +281,45 @@ impl CopyObjectOutputBuilder { pub fn get_sse_customer_key_md5(&self) -> &::std::option::Option<::std::string::String> { &self.sse_customer_key_md5 } - ///

      If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      If present, indicates the ID of the KMS key that was used for object encryption.

      pub fn ssekms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.ssekms_key_id = ::std::option::Option::Some(input.into()); self } - ///

      If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      If present, indicates the ID of the KMS key that was used for object encryption.

      pub fn set_ssekms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.ssekms_key_id = input; self } - ///

      If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      If present, indicates the ID of the KMS key that was used for object encryption.

      pub fn get_ssekms_key_id(&self) -> &::std::option::Option<::std::string::String> { &self.ssekms_key_id } - ///

      If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      pub fn ssekms_encryption_context(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.ssekms_encryption_context = ::std::option::Option::Some(input.into()); self } - ///

      If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      pub fn set_ssekms_encryption_context(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.ssekms_encryption_context = input; self } - ///

      If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      pub fn get_ssekms_encryption_context(&self) -> &::std::option::Option<::std::string::String> { &self.ssekms_encryption_context } - ///

      Indicates whether the copied object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Indicates whether the copied object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      pub fn bucket_key_enabled(mut self, input: bool) -> Self { self.bucket_key_enabled = ::std::option::Option::Some(input); self } - ///

      Indicates whether the copied object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Indicates whether the copied object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      pub fn set_bucket_key_enabled(mut self, input: ::std::option::Option) -> Self { self.bucket_key_enabled = input; self } - ///

      Indicates whether the copied object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Indicates whether the copied object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      pub fn get_bucket_key_enabled(&self) -> &::std::option::Option { &self.bucket_key_enabled } diff --git a/sdk/s3/src/operation/copy_object/builders.rs b/sdk/s3/src/operation/copy_object/builders.rs index 7ff9def81bfc..7d98044c1503 100644 --- a/sdk/s3/src/operation/copy_object/builders.rs +++ b/sdk/s3/src/operation/copy_object/builders.rs @@ -69,6 +69,7 @@ impl crate::operation::copy_object::builders::CopyObjectInputBuilder { ///
    • ///

      If the copy destination is a directory bucket, you must have the s3express:CreateSession permission in the Action element of a policy to write the object to the destination. The s3express:SessionMode condition key can't be set to ReadOnly on the copy destination bucket.

    • ///
    +///

    If the object is encrypted with SSE-KMS, you must also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies and KMS key policies for the KMS key.

    ///

    For example policies, see Example bucket policies for S3 Express One Zone and Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone in the Amazon S3 User Guide.

    /// /// @@ -929,32 +930,65 @@ impl CopyObjectFluentBuilder { pub fn get_tagging_directive(&self) -> &::std::option::Option { self.inner.get_tagging_directive() } - ///

    The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse). Unrecognized or unsupported values won’t write a destination object and will receive a 400 Bad Request response.

    - ///

    Amazon S3 automatically encrypts all new objects that are copied to an S3 bucket. When copying an object, if you don't specify encryption information in your copy request, the encryption setting of the target object is set to the default encryption configuration of the destination bucket. By default, all buckets have a base level of encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). If the destination bucket has a default encryption configuration that uses server-side encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), or server-side encryption with customer-provided encryption keys (SSE-C), Amazon S3 uses the corresponding KMS key, or a customer-provided key to encrypt the target object copy.

    - ///

    When you perform a CopyObject operation, if you want to use a different type of encryption setting for the target object, you can specify appropriate encryption-related headers to encrypt the target object with an Amazon S3 managed key, a KMS key, or a customer-provided key. If the encryption setting in your request is different from the default encryption configuration of the destination bucket, the encryption setting in your request takes precedence.

    - ///

    With server-side encryption, Amazon S3 encrypts your data as it writes your data to disks in its data centers and decrypts the data when you access it. For more information about server-side encryption, see Using Server-Side Encryption in the Amazon S3 User Guide.

    - ///

    For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

    - ///
    + ///

    The server-side encryption algorithm used when storing this object in Amazon S3. Unrecognized or unsupported values won’t write a destination object and will receive a 400 Bad Request response.

    + ///

    Amazon S3 automatically encrypts all new objects that are copied to an S3 bucket. When copying an object, if you don't specify encryption information in your copy request, the encryption setting of the target object is set to the default encryption configuration of the destination bucket. By default, all buckets have a base level of encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). If the destination bucket has a different default encryption configuration, Amazon S3 uses the corresponding encryption key to encrypt the target object copy.

    + ///

    With server-side encryption, Amazon S3 encrypts your data as it writes your data to disks in its data centers and decrypts the data when you access it. For more information about server-side encryption, see Using Server-Side Encryption in the Amazon S3 User Guide.

    + ///

    General purpose buckets

    + ///
      + ///
    • + ///

      For general purpose buckets, there are the following supported options for server-side encryption: server-side encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), and server-side encryption with customer-provided encryption keys (SSE-C). Amazon S3 uses the corresponding KMS key, or a customer-provided key to encrypt the target object copy.

    • + ///
    • + ///

      When you perform a CopyObject operation, if you want to use a different type of encryption setting for the target object, you can specify appropriate encryption-related headers to encrypt the target object with an Amazon S3 managed key, a KMS key, or a customer-provided key. If the encryption setting in your request is different from the default encryption configuration of the destination bucket, the encryption setting in your request takes precedence.

    • + ///
    + ///

    Directory buckets

    + ///
      + ///
    • + ///

      For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

    • + ///
    • + ///

      To encrypt new object copies to a directory bucket with SSE-KMS, we recommend you specify SSE-KMS as the directory bucket's default encryption configuration with a KMS key (specifically, a customer managed key). Amazon Web Services managed key (aws/s3) isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. After you specify a customer managed key for SSE-KMS, you can't override the customer managed key for the bucket's SSE-KMS configuration. Then, when you perform a CopyObject operation and want to specify server-side encryption settings for new object copies with SSE-KMS in the encryption-related request headers, you must ensure the encryption key is the same customer managed key that you specified for the directory bucket's default encryption configuration.

    • + ///
    pub fn server_side_encryption(mut self, input: crate::types::ServerSideEncryption) -> Self { self.inner = self.inner.server_side_encryption(input); self } - ///

    The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse). Unrecognized or unsupported values won’t write a destination object and will receive a 400 Bad Request response.

    - ///

    Amazon S3 automatically encrypts all new objects that are copied to an S3 bucket. When copying an object, if you don't specify encryption information in your copy request, the encryption setting of the target object is set to the default encryption configuration of the destination bucket. By default, all buckets have a base level of encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). If the destination bucket has a default encryption configuration that uses server-side encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), or server-side encryption with customer-provided encryption keys (SSE-C), Amazon S3 uses the corresponding KMS key, or a customer-provided key to encrypt the target object copy.

    - ///

    When you perform a CopyObject operation, if you want to use a different type of encryption setting for the target object, you can specify appropriate encryption-related headers to encrypt the target object with an Amazon S3 managed key, a KMS key, or a customer-provided key. If the encryption setting in your request is different from the default encryption configuration of the destination bucket, the encryption setting in your request takes precedence.

    - ///

    With server-side encryption, Amazon S3 encrypts your data as it writes your data to disks in its data centers and decrypts the data when you access it. For more information about server-side encryption, see Using Server-Side Encryption in the Amazon S3 User Guide.

    - ///

    For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

    - ///
    + ///

    The server-side encryption algorithm used when storing this object in Amazon S3. Unrecognized or unsupported values won’t write a destination object and will receive a 400 Bad Request response.

    + ///

    Amazon S3 automatically encrypts all new objects that are copied to an S3 bucket. When copying an object, if you don't specify encryption information in your copy request, the encryption setting of the target object is set to the default encryption configuration of the destination bucket. By default, all buckets have a base level of encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). If the destination bucket has a different default encryption configuration, Amazon S3 uses the corresponding encryption key to encrypt the target object copy.

    + ///

    With server-side encryption, Amazon S3 encrypts your data as it writes your data to disks in its data centers and decrypts the data when you access it. For more information about server-side encryption, see Using Server-Side Encryption in the Amazon S3 User Guide.

    + ///

    General purpose buckets

    + ///
      + ///
    • + ///

      For general purpose buckets, there are the following supported options for server-side encryption: server-side encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), and server-side encryption with customer-provided encryption keys (SSE-C). Amazon S3 uses the corresponding KMS key, or a customer-provided key to encrypt the target object copy.

    • + ///
    • + ///

      When you perform a CopyObject operation, if you want to use a different type of encryption setting for the target object, you can specify appropriate encryption-related headers to encrypt the target object with an Amazon S3 managed key, a KMS key, or a customer-provided key. If the encryption setting in your request is different from the default encryption configuration of the destination bucket, the encryption setting in your request takes precedence.

    • + ///
    + ///

    Directory buckets

    + ///
      + ///
    • + ///

      For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

    • + ///
    • + ///

      To encrypt new object copies to a directory bucket with SSE-KMS, we recommend you specify SSE-KMS as the directory bucket's default encryption configuration with a KMS key (specifically, a customer managed key). Amazon Web Services managed key (aws/s3) isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. After you specify a customer managed key for SSE-KMS, you can't override the customer managed key for the bucket's SSE-KMS configuration. Then, when you perform a CopyObject operation and want to specify server-side encryption settings for new object copies with SSE-KMS in the encryption-related request headers, you must ensure the encryption key is the same customer managed key that you specified for the directory bucket's default encryption configuration.

    • + ///
    pub fn set_server_side_encryption(mut self, input: ::std::option::Option) -> Self { self.inner = self.inner.set_server_side_encryption(input); self } - ///

    The server-side encryption algorithm used when storing this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse). Unrecognized or unsupported values won’t write a destination object and will receive a 400 Bad Request response.

    - ///

    Amazon S3 automatically encrypts all new objects that are copied to an S3 bucket. When copying an object, if you don't specify encryption information in your copy request, the encryption setting of the target object is set to the default encryption configuration of the destination bucket. By default, all buckets have a base level of encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). If the destination bucket has a default encryption configuration that uses server-side encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), or server-side encryption with customer-provided encryption keys (SSE-C), Amazon S3 uses the corresponding KMS key, or a customer-provided key to encrypt the target object copy.

    - ///

    When you perform a CopyObject operation, if you want to use a different type of encryption setting for the target object, you can specify appropriate encryption-related headers to encrypt the target object with an Amazon S3 managed key, a KMS key, or a customer-provided key. If the encryption setting in your request is different from the default encryption configuration of the destination bucket, the encryption setting in your request takes precedence.

    - ///

    With server-side encryption, Amazon S3 encrypts your data as it writes your data to disks in its data centers and decrypts the data when you access it. For more information about server-side encryption, see Using Server-Side Encryption in the Amazon S3 User Guide.

    - ///

    For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

    - ///
    + ///

    The server-side encryption algorithm used when storing this object in Amazon S3. Unrecognized or unsupported values won’t write a destination object and will receive a 400 Bad Request response.

    + ///

    Amazon S3 automatically encrypts all new objects that are copied to an S3 bucket. When copying an object, if you don't specify encryption information in your copy request, the encryption setting of the target object is set to the default encryption configuration of the destination bucket. By default, all buckets have a base level of encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). If the destination bucket has a different default encryption configuration, Amazon S3 uses the corresponding encryption key to encrypt the target object copy.

    + ///

    With server-side encryption, Amazon S3 encrypts your data as it writes your data to disks in its data centers and decrypts the data when you access it. For more information about server-side encryption, see Using Server-Side Encryption in the Amazon S3 User Guide.

    + ///

    General purpose buckets

    + ///
      + ///
    • + ///

      For general purpose buckets, there are the following supported options for server-side encryption: server-side encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), and server-side encryption with customer-provided encryption keys (SSE-C). Amazon S3 uses the corresponding KMS key, or a customer-provided key to encrypt the target object copy.

    • + ///
    • + ///

      When you perform a CopyObject operation, if you want to use a different type of encryption setting for the target object, you can specify appropriate encryption-related headers to encrypt the target object with an Amazon S3 managed key, a KMS key, or a customer-provided key. If the encryption setting in your request is different from the default encryption configuration of the destination bucket, the encryption setting in your request takes precedence.

    • + ///
    + ///

    Directory buckets

    + ///
      + ///
    • + ///

      For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

    • + ///
    • + ///

      To encrypt new object copies to a directory bucket with SSE-KMS, we recommend you specify SSE-KMS as the directory bucket's default encryption configuration with a KMS key (specifically, a customer managed key). Amazon Web Services managed key (aws/s3) isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. After you specify a customer managed key for SSE-KMS, you can't override the customer managed key for the bucket's SSE-KMS configuration. Then, when you perform a CopyObject operation and want to specify server-side encryption settings for new object copies with SSE-KMS in the encryption-related request headers, you must ensure the encryption key is the same customer managed key that you specified for the directory bucket's default encryption configuration.

    • + ///
    pub fn get_server_side_encryption(&self) -> &::std::option::Option { self.inner.get_server_side_encryption() } @@ -1103,50 +1137,47 @@ impl CopyObjectFluentBuilder { pub fn get_sse_customer_key_md5(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_sse_customer_key_md5() } - ///

    Specifies the KMS ID (Key ID, Key ARN, or Key Alias) to use for object encryption. All GET and PUT requests for an object protected by KMS will fail if they're not made via SSL or using SigV4. For information about configuring any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature Version in Request Authentication in the Amazon S3 User Guide.

    - ///

    This functionality is not supported when the destination bucket is a directory bucket.

    - ///
    + ///

    Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. All GET and PUT requests for an object protected by KMS will fail if they're not made via SSL or using SigV4. For information about configuring any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature Version in Request Authentication in the Amazon S3 User Guide.

    + ///

    Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

    pub fn ssekms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.ssekms_key_id(input.into()); self } - ///

    Specifies the KMS ID (Key ID, Key ARN, or Key Alias) to use for object encryption. All GET and PUT requests for an object protected by KMS will fail if they're not made via SSL or using SigV4. For information about configuring any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature Version in Request Authentication in the Amazon S3 User Guide.

    - ///

    This functionality is not supported when the destination bucket is a directory bucket.

    - ///
    + ///

    Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. All GET and PUT requests for an object protected by KMS will fail if they're not made via SSL or using SigV4. For information about configuring any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature Version in Request Authentication in the Amazon S3 User Guide.

    + ///

    Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

    pub fn set_ssekms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.inner = self.inner.set_ssekms_key_id(input); self } - ///

    Specifies the KMS ID (Key ID, Key ARN, or Key Alias) to use for object encryption. All GET and PUT requests for an object protected by KMS will fail if they're not made via SSL or using SigV4. For information about configuring any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature Version in Request Authentication in the Amazon S3 User Guide.

    - ///

    This functionality is not supported when the destination bucket is a directory bucket.

    - ///
    + ///

    Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. All GET and PUT requests for an object protected by KMS will fail if they're not made via SSL or using SigV4. For information about configuring any of the officially supported Amazon Web Services SDKs and Amazon Web Services CLI, see Specifying the Signature Version in Request Authentication in the Amazon S3 User Guide.

    + ///

    Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

    pub fn get_ssekms_key_id(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_ssekms_key_id() } - ///

    Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. This value must be explicitly added to specify encryption context for CopyObject requests.

    - ///

    This functionality is not supported when the destination bucket is a directory bucket.

    - ///
    + ///

    Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for the destination object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

    + ///

    General purpose buckets - This value must be explicitly added to specify encryption context for CopyObject requests if you want an additional encryption context for your destination object. The additional encryption context of the source object won't be copied to the destination object. For more information, see Encryption context in the Amazon S3 User Guide.

    + ///

    Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

    pub fn ssekms_encryption_context(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.ssekms_encryption_context(input.into()); self } - ///

    Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. This value must be explicitly added to specify encryption context for CopyObject requests.

    - ///

    This functionality is not supported when the destination bucket is a directory bucket.

    - ///
    + ///

    Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for the destination object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

    + ///

    General purpose buckets - This value must be explicitly added to specify encryption context for CopyObject requests if you want an additional encryption context for your destination object. The additional encryption context of the source object won't be copied to the destination object. For more information, see Encryption context in the Amazon S3 User Guide.

    + ///

    Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

    pub fn set_ssekms_encryption_context(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.inner = self.inner.set_ssekms_encryption_context(input); self } - ///

    Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. This value must be explicitly added to specify encryption context for CopyObject requests.

    - ///

    This functionality is not supported when the destination bucket is a directory bucket.

    - ///
    + ///

    Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for the destination object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

    + ///

    General purpose buckets - This value must be explicitly added to specify encryption context for CopyObject requests if you want an additional encryption context for your destination object. The additional encryption context of the source object won't be copied to the destination object. For more information, see Encryption context in the Amazon S3 User Guide.

    + ///

    Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

    pub fn get_ssekms_encryption_context(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_ssekms_encryption_context() } ///

    Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). If a target object uses SSE-KMS, you can enable an S3 Bucket Key for the object.

    ///

    Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Specifying this header with a COPY action doesn’t affect bucket-level settings for S3 Bucket Key.

    ///

    For more information, see Amazon S3 Bucket Keys in the Amazon S3 User Guide.

    - ///

    This functionality is not supported when the destination bucket is a directory bucket.

    + ///

    Directory buckets - S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

    ///
    pub fn bucket_key_enabled(mut self, input: bool) -> Self { self.inner = self.inner.bucket_key_enabled(input); @@ -1155,7 +1186,7 @@ impl CopyObjectFluentBuilder { ///

    Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). If a target object uses SSE-KMS, you can enable an S3 Bucket Key for the object.

    ///

    Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Specifying this header with a COPY action doesn’t affect bucket-level settings for S3 Bucket Key.

    ///

    For more information, see Amazon S3 Bucket Keys in the Amazon S3 User Guide.

    - ///

    This functionality is not supported when the destination bucket is a directory bucket.

    + ///

    Directory buckets - S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

    ///
    pub fn set_bucket_key_enabled(mut self, input: ::std::option::Option) -> Self { self.inner = self.inner.set_bucket_key_enabled(input); @@ -1164,7 +1195,7 @@ impl CopyObjectFluentBuilder { ///

    Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). If a target object uses SSE-KMS, you can enable an S3 Bucket Key for the object.

    ///

    Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Specifying this header with a COPY action doesn’t affect bucket-level settings for S3 Bucket Key.

    ///

    For more information, see Amazon S3 Bucket Keys in the Amazon S3 User Guide.

    - ///

    This functionality is not supported when the destination bucket is a directory bucket.

    + ///

    Directory buckets - S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

    ///
    pub fn get_bucket_key_enabled(&self) -> &::std::option::Option { self.inner.get_bucket_key_enabled() diff --git a/sdk/s3/src/operation/create_multipart_upload/_create_multipart_upload_input.rs b/sdk/s3/src/operation/create_multipart_upload/_create_multipart_upload_input.rs index 048769035c5b..38453825999e 100644 --- a/sdk/s3/src/operation/create_multipart_upload/_create_multipart_upload_input.rs +++ b/sdk/s3/src/operation/create_multipart_upload/_create_multipart_upload_input.rs @@ -206,9 +206,14 @@ pub struct CreateMultipartUploadInput { pub key: ::std::option::Option<::std::string::String>, ///

    A map of metadata to store with the object in S3.

    pub metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, - ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

    - ///

    For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

    - ///
    + ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

    + ///
      + ///
    • + ///

      Directory buckets - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

      + ///

      In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the CreateSession request. You can't override the values of the encryption settings (x-amz-server-side-encryption, x-amz-server-side-encryption-aws-kms-key-id, x-amz-server-side-encryption-context, and x-amz-server-side-encryption-bucket-key-enabled) that are specified in the CreateSession request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the CreateSession request to protect new objects in the directory bucket.

      + ///

      When you use the CLI or the Amazon Web Services SDKs, for CreateSession, the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the CreateSession request. It's not supported to override the encryption settings values in the CreateSession request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket.

      + ///
    • + ///
    pub server_side_encryption: ::std::option::Option, ///

    By default, Amazon S3 uses the STANDARD Storage Class to store newly created objects. The STANDARD storage class provides high durability and high availability. Depending on performance needs, you can specify a different Storage Class. For more information, see Storage Classes in the Amazon S3 User Guide.

    ///
      @@ -235,18 +240,16 @@ pub struct CreateMultipartUploadInput { ///

      This functionality is not supported for directory buckets.

      /// pub sse_customer_key_md5: ::std::option::Option<::std::string::String>, - ///

      Specifies the ID (Key ID, Key ARN, or Key Alias) of the symmetric encryption customer managed key to use for object encryption.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID.

      + ///

      General purpose buckets - If you specify x-amz-server-side-encryption with aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key to use. If you specify x-amz-server-side-encryption:aws:kms or x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key (aws/s3) to protect the data.

      + ///

      Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

      pub ssekms_key_id: ::std::option::Option<::std::string::String>, - ///

      Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs.

      + ///

      Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

      pub ssekms_encryption_context: ::std::option::Option<::std::string::String>, - ///

      Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.

      - ///

      Specifying this header with an object action doesn’t affect bucket-level settings for S3 Bucket Key.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS).

      + ///

      General purpose buckets - Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key.

      + ///

      Directory buckets - S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

      pub bucket_key_enabled: ::std::option::Option, ///

      Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.

      ///

      This functionality is not supported for directory buckets.

      @@ -505,9 +508,14 @@ impl CreateMultipartUploadInput { pub fn metadata(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> { self.metadata.as_ref() } - ///

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

      - ///

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      - ///
      + ///

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

      + ///
        + ///
      • + ///

        Directory buckets - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

        + ///

        In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the CreateSession request. You can't override the values of the encryption settings (x-amz-server-side-encryption, x-amz-server-side-encryption-aws-kms-key-id, x-amz-server-side-encryption-context, and x-amz-server-side-encryption-bucket-key-enabled) that are specified in the CreateSession request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the CreateSession request to protect new objects in the directory bucket.

        + ///

        When you use the CLI or the Amazon Web Services SDKs, for CreateSession, the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the CreateSession request. It's not supported to override the encryption settings values in the CreateSession request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket.

        + ///
      • + ///
      pub fn server_side_encryption(&self) -> ::std::option::Option<&crate::types::ServerSideEncryption> { self.server_side_encryption.as_ref() } @@ -546,22 +554,20 @@ impl CreateMultipartUploadInput { pub fn sse_customer_key_md5(&self) -> ::std::option::Option<&str> { self.sse_customer_key_md5.as_deref() } - ///

      Specifies the ID (Key ID, Key ARN, or Key Alias) of the symmetric encryption customer managed key to use for object encryption.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID.

      + ///

      General purpose buckets - If you specify x-amz-server-side-encryption with aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key to use. If you specify x-amz-server-side-encryption:aws:kms or x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key (aws/s3) to protect the data.

      + ///

      Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

      pub fn ssekms_key_id(&self) -> ::std::option::Option<&str> { self.ssekms_key_id.as_deref() } - ///

      Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs.

      + ///

      Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

      pub fn ssekms_encryption_context(&self) -> ::std::option::Option<&str> { self.ssekms_encryption_context.as_deref() } - ///

      Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.

      - ///

      Specifying this header with an object action doesn’t affect bucket-level settings for S3 Bucket Key.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS).

      + ///

      General purpose buckets - Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key.

      + ///

      Directory buckets - S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

      pub fn bucket_key_enabled(&self) -> ::std::option::Option { self.bucket_key_enabled } @@ -1412,23 +1418,38 @@ impl CreateMultipartUploadInputBuilder { pub fn get_metadata(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> { &self.metadata } - ///

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

      - ///

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      - ///
      + ///

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

      + ///
        + ///
      • + ///

        Directory buckets - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

        + ///

        In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the CreateSession request. You can't override the values of the encryption settings (x-amz-server-side-encryption, x-amz-server-side-encryption-aws-kms-key-id, x-amz-server-side-encryption-context, and x-amz-server-side-encryption-bucket-key-enabled) that are specified in the CreateSession request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the CreateSession request to protect new objects in the directory bucket.

        + ///

        When you use the CLI or the Amazon Web Services SDKs, for CreateSession, the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the CreateSession request. It's not supported to override the encryption settings values in the CreateSession request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket.

        + ///
      • + ///
      pub fn server_side_encryption(mut self, input: crate::types::ServerSideEncryption) -> Self { self.server_side_encryption = ::std::option::Option::Some(input); self } - ///

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

      - ///

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      - ///
      + ///

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

      + ///
        + ///
      • + ///

        Directory buckets - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

        + ///

        In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the CreateSession request. You can't override the values of the encryption settings (x-amz-server-side-encryption, x-amz-server-side-encryption-aws-kms-key-id, x-amz-server-side-encryption-context, and x-amz-server-side-encryption-bucket-key-enabled) that are specified in the CreateSession request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the CreateSession request to protect new objects in the directory bucket.

        + ///

        When you use the CLI or the Amazon Web Services SDKs, for CreateSession, the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the CreateSession request. It's not supported to override the encryption settings values in the CreateSession request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket.

        + ///
      • + ///
      pub fn set_server_side_encryption(mut self, input: ::std::option::Option) -> Self { self.server_side_encryption = input; self } - ///

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

      - ///

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      - ///
      + ///

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

      + ///
        + ///
      • + ///

        Directory buckets - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

        + ///

        In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the CreateSession request. You can't override the values of the encryption settings (x-amz-server-side-encryption, x-amz-server-side-encryption-aws-kms-key-id, x-amz-server-side-encryption-context, and x-amz-server-side-encryption-bucket-key-enabled) that are specified in the CreateSession request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the CreateSession request to protect new objects in the directory bucket.

        + ///

        When you use the CLI or the Amazon Web Services SDKs, for CreateSession, the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the CreateSession request. It's not supported to override the encryption settings values in the CreateSession request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket.

        + ///
      • + ///
      pub fn get_server_side_encryption(&self) -> &::std::option::Option { &self.server_side_encryption } @@ -1547,66 +1568,60 @@ impl CreateMultipartUploadInputBuilder { pub fn get_sse_customer_key_md5(&self) -> &::std::option::Option<::std::string::String> { &self.sse_customer_key_md5 } - ///

      Specifies the ID (Key ID, Key ARN, or Key Alias) of the symmetric encryption customer managed key to use for object encryption.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID.

      + ///

      General purpose buckets - If you specify x-amz-server-side-encryption with aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key to use. If you specify x-amz-server-side-encryption:aws:kms or x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key (aws/s3) to protect the data.

      + ///

      Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

      pub fn ssekms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.ssekms_key_id = ::std::option::Option::Some(input.into()); self } - ///

      Specifies the ID (Key ID, Key ARN, or Key Alias) of the symmetric encryption customer managed key to use for object encryption.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID.

      + ///

      General purpose buckets - If you specify x-amz-server-side-encryption with aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key to use. If you specify x-amz-server-side-encryption:aws:kms or x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key (aws/s3) to protect the data.

      + ///

      Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

      pub fn set_ssekms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.ssekms_key_id = input; self } - ///

      Specifies the ID (Key ID, Key ARN, or Key Alias) of the symmetric encryption customer managed key to use for object encryption.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID.

      + ///

      General purpose buckets - If you specify x-amz-server-side-encryption with aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key to use. If you specify x-amz-server-side-encryption:aws:kms or x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key (aws/s3) to protect the data.

      + ///

      Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

      pub fn get_ssekms_key_id(&self) -> &::std::option::Option<::std::string::String> { &self.ssekms_key_id } - ///

      Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs.

      + ///

      Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

      pub fn ssekms_encryption_context(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.ssekms_encryption_context = ::std::option::Option::Some(input.into()); self } - ///

      Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs.

      + ///

      Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

      pub fn set_ssekms_encryption_context(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.ssekms_encryption_context = input; self } - ///

      Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs.

      + ///

      Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

      pub fn get_ssekms_encryption_context(&self) -> &::std::option::Option<::std::string::String> { &self.ssekms_encryption_context } - ///

      Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.

      - ///

      Specifying this header with an object action doesn’t affect bucket-level settings for S3 Bucket Key.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS).

      + ///

      General purpose buckets - Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key.

      + ///

      Directory buckets - S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

      pub fn bucket_key_enabled(mut self, input: bool) -> Self { self.bucket_key_enabled = ::std::option::Option::Some(input); self } - ///

      Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.

      - ///

      Specifying this header with an object action doesn’t affect bucket-level settings for S3 Bucket Key.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS).

      + ///

      General purpose buckets - Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key.

      + ///

      Directory buckets - S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

      pub fn set_bucket_key_enabled(mut self, input: ::std::option::Option) -> Self { self.bucket_key_enabled = input; self } - ///

      Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.

      - ///

      Specifying this header with an object action doesn’t affect bucket-level settings for S3 Bucket Key.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS).

      + ///

      General purpose buckets - Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key.

      + ///

      Directory buckets - S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

      pub fn get_bucket_key_enabled(&self) -> &::std::option::Option { &self.bucket_key_enabled } diff --git a/sdk/s3/src/operation/create_multipart_upload/_create_multipart_upload_output.rs b/sdk/s3/src/operation/create_multipart_upload/_create_multipart_upload_output.rs index 7fb118971002..74fe4ad88584 100644 --- a/sdk/s3/src/operation/create_multipart_upload/_create_multipart_upload_output.rs +++ b/sdk/s3/src/operation/create_multipart_upload/_create_multipart_upload_output.rs @@ -20,9 +20,7 @@ pub struct CreateMultipartUploadOutput { pub key: ::std::option::Option<::std::string::String>, ///

      ID for the initiated multipart upload.

      pub upload_id: ::std::option::Option<::std::string::String>, - ///

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

      - ///

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      - ///
      + ///

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

      pub server_side_encryption: ::std::option::Option, ///

      If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used.

      ///

      This functionality is not supported for directory buckets.

      @@ -32,17 +30,11 @@ pub struct CreateMultipartUploadOutput { ///

      This functionality is not supported for directory buckets.

      ///
      pub sse_customer_key_md5: ::std::option::Option<::std::string::String>, - ///

      If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      If present, indicates the ID of the KMS key that was used for object encryption.

      pub ssekms_key_id: ::std::option::Option<::std::string::String>, - ///

      If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs.

      pub ssekms_encryption_context: ::std::option::Option<::std::string::String>, - ///

      Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      pub bucket_key_enabled: ::std::option::Option, ///

      If present, indicates that the requester was successfully charged for the request.

      ///

      This functionality is not supported for directory buckets.

      @@ -81,9 +73,7 @@ impl CreateMultipartUploadOutput { pub fn upload_id(&self) -> ::std::option::Option<&str> { self.upload_id.as_deref() } - ///

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

      - ///

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      - ///
      + ///

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

      pub fn server_side_encryption(&self) -> ::std::option::Option<&crate::types::ServerSideEncryption> { self.server_side_encryption.as_ref() } @@ -99,21 +89,15 @@ impl CreateMultipartUploadOutput { pub fn sse_customer_key_md5(&self) -> ::std::option::Option<&str> { self.sse_customer_key_md5.as_deref() } - ///

      If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      If present, indicates the ID of the KMS key that was used for object encryption.

      pub fn ssekms_key_id(&self) -> ::std::option::Option<&str> { self.ssekms_key_id.as_deref() } - ///

      If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs.

      pub fn ssekms_encryption_context(&self) -> ::std::option::Option<&str> { self.ssekms_encryption_context.as_deref() } - ///

      Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      pub fn bucket_key_enabled(&self) -> ::std::option::Option { self.bucket_key_enabled } @@ -278,23 +262,17 @@ impl CreateMultipartUploadOutputBuilder { pub fn get_upload_id(&self) -> &::std::option::Option<::std::string::String> { &self.upload_id } - ///

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

      - ///

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      - ///
      + ///

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

      pub fn server_side_encryption(mut self, input: crate::types::ServerSideEncryption) -> Self { self.server_side_encryption = ::std::option::Option::Some(input); self } - ///

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

      - ///

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      - ///
      + ///

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

      pub fn set_server_side_encryption(mut self, input: ::std::option::Option) -> Self { self.server_side_encryption = input; self } - ///

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

      - ///

      For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

      - ///
      + ///

      The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

      pub fn get_server_side_encryption(&self) -> &::std::option::Option { &self.server_side_encryption } @@ -338,63 +316,45 @@ impl CreateMultipartUploadOutputBuilder { pub fn get_sse_customer_key_md5(&self) -> &::std::option::Option<::std::string::String> { &self.sse_customer_key_md5 } - ///

      If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      If present, indicates the ID of the KMS key that was used for object encryption.

      pub fn ssekms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.ssekms_key_id = ::std::option::Option::Some(input.into()); self } - ///

      If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      If present, indicates the ID of the KMS key that was used for object encryption.

      pub fn set_ssekms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.ssekms_key_id = input; self } - ///

      If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      If present, indicates the ID of the KMS key that was used for object encryption.

      pub fn get_ssekms_key_id(&self) -> &::std::option::Option<::std::string::String> { &self.ssekms_key_id } - ///

      If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs.

      pub fn ssekms_encryption_context(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.ssekms_encryption_context = ::std::option::Option::Some(input.into()); self } - ///

      If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs.

      pub fn set_ssekms_encryption_context(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.ssekms_encryption_context = input; self } - ///

      If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs.

      pub fn get_ssekms_encryption_context(&self) -> &::std::option::Option<::std::string::String> { &self.ssekms_encryption_context } - ///

      Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      pub fn bucket_key_enabled(mut self, input: bool) -> Self { self.bucket_key_enabled = ::std::option::Option::Some(input); self } - ///

      Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      pub fn set_bucket_key_enabled(mut self, input: ::std::option::Option) -> Self { self.bucket_key_enabled = input; self } - ///

      Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      - ///

      This functionality is not supported for directory buckets.

      - ///
      + ///

      Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      pub fn get_bucket_key_enabled(&self) -> &::std::option::Option { &self.bucket_key_enabled } diff --git a/sdk/s3/src/operation/create_multipart_upload/builders.rs b/sdk/s3/src/operation/create_multipart_upload/builders.rs index 49d56a7e0353..5b5e3552e11c 100644 --- a/sdk/s3/src/operation/create_multipart_upload/builders.rs +++ b/sdk/s3/src/operation/create_multipart_upload/builders.rs @@ -94,7 +94,12 @@ impl crate::operation::create_multipart_upload::builders::CreateMultipartUploadI ///

      For more information about server-side encryption with customer-provided encryption keys (SSE-C), see Protecting data using server-side encryption with customer-provided encryption keys (SSE-C) in the Amazon S3 User Guide.

      ///
    ///
  • -///

    Directory buckets -For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

  • +///

    Directory buckets - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

    +///

    In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the CreateSession request. You can't override the values of the encryption settings (x-amz-server-side-encryption, x-amz-server-side-encryption-aws-kms-key-id, x-amz-server-side-encryption-context, and x-amz-server-side-encryption-bucket-key-enabled) that are specified in the CreateSession request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the CreateSession request to protect new objects in the directory bucket.

    +///

    When you use the CLI or the Amazon Web Services SDKs, for CreateSession, the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the CreateSession request. It's not supported to override the encryption settings values in the CreateSession request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket.

    +///
    +///

    For directory buckets, when you perform a CreateMultipartUpload operation and an UploadPartCopy operation, the request headers you provide in the CreateMultipartUpload request must match the default encryption configuration of the destination bucket.

    +///
    /// /// ///
    @@ -928,23 +933,38 @@ impl CreateMultipartUploadFluentBuilder { pub fn get_metadata(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> { self.inner.get_metadata() } - ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

    - ///

    For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

    - ///
    + ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

    + ///
      + ///
    • + ///

      Directory buckets - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

      + ///

      In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the CreateSession request. You can't override the values of the encryption settings (x-amz-server-side-encryption, x-amz-server-side-encryption-aws-kms-key-id, x-amz-server-side-encryption-context, and x-amz-server-side-encryption-bucket-key-enabled) that are specified in the CreateSession request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the CreateSession request to protect new objects in the directory bucket.

      + ///

      When you use the CLI or the Amazon Web Services SDKs, for CreateSession, the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the CreateSession request. It's not supported to override the encryption settings values in the CreateSession request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket.

      + ///
    • + ///
    pub fn server_side_encryption(mut self, input: crate::types::ServerSideEncryption) -> Self { self.inner = self.inner.server_side_encryption(input); self } - ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

    - ///

    For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

    - ///
    + ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

    + ///
      + ///
    • + ///

      Directory buckets - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

      + ///

      In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the CreateSession request. You can't override the values of the encryption settings (x-amz-server-side-encryption, x-amz-server-side-encryption-aws-kms-key-id, x-amz-server-side-encryption-context, and x-amz-server-side-encryption-bucket-key-enabled) that are specified in the CreateSession request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the CreateSession request to protect new objects in the directory bucket.

      + ///

      When you use the CLI or the Amazon Web Services SDKs, for CreateSession, the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the CreateSession request. It's not supported to override the encryption settings values in the CreateSession request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket.

      + ///
    • + ///
    pub fn set_server_side_encryption(mut self, input: ::std::option::Option) -> Self { self.inner = self.inner.set_server_side_encryption(input); self } - ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

    - ///

    For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

    - ///
    + ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

    + ///
      + ///
    • + ///

      Directory buckets - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

      + ///

      In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the CreateSession request. You can't override the values of the encryption settings (x-amz-server-side-encryption, x-amz-server-side-encryption-aws-kms-key-id, x-amz-server-side-encryption-context, and x-amz-server-side-encryption-bucket-key-enabled) that are specified in the CreateSession request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the CreateSession request to protect new objects in the directory bucket.

      + ///

      When you use the CLI or the Amazon Web Services SDKs, for CreateSession, the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the CreateSession request. It's not supported to override the encryption settings values in the CreateSession request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket.

      + ///
    • + ///
    pub fn get_server_side_encryption(&self) -> &::std::option::Option { self.inner.get_server_side_encryption() } @@ -1063,66 +1083,60 @@ impl CreateMultipartUploadFluentBuilder { pub fn get_sse_customer_key_md5(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_sse_customer_key_md5() } - ///

    Specifies the ID (Key ID, Key ARN, or Key Alias) of the symmetric encryption customer managed key to use for object encryption.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID.

    + ///

    General purpose buckets - If you specify x-amz-server-side-encryption with aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key to use. If you specify x-amz-server-side-encryption:aws:kms or x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key (aws/s3) to protect the data.

    + ///

    Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

    pub fn ssekms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.ssekms_key_id(input.into()); self } - ///

    Specifies the ID (Key ID, Key ARN, or Key Alias) of the symmetric encryption customer managed key to use for object encryption.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID.

    + ///

    General purpose buckets - If you specify x-amz-server-side-encryption with aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key to use. If you specify x-amz-server-side-encryption:aws:kms or x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key (aws/s3) to protect the data.

    + ///

    Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

    pub fn set_ssekms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.inner = self.inner.set_ssekms_key_id(input); self } - ///

    Specifies the ID (Key ID, Key ARN, or Key Alias) of the symmetric encryption customer managed key to use for object encryption.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID.

    + ///

    General purpose buckets - If you specify x-amz-server-side-encryption with aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key to use. If you specify x-amz-server-side-encryption:aws:kms or x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key (aws/s3) to protect the data.

    + ///

    Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

    pub fn get_ssekms_key_id(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_ssekms_key_id() } - ///

    Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs.

    + ///

    Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

    pub fn ssekms_encryption_context(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.ssekms_encryption_context(input.into()); self } - ///

    Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs.

    + ///

    Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

    pub fn set_ssekms_encryption_context(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.inner = self.inner.set_ssekms_encryption_context(input); self } - ///

    Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs.

    + ///

    Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

    pub fn get_ssekms_encryption_context(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_ssekms_encryption_context() } - ///

    Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.

    - ///

    Specifying this header with an object action doesn’t affect bucket-level settings for S3 Bucket Key.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS).

    + ///

    General purpose buckets - Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key.

    + ///

    Directory buckets - S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

    pub fn bucket_key_enabled(mut self, input: bool) -> Self { self.inner = self.inner.bucket_key_enabled(input); self } - ///

    Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.

    - ///

    Specifying this header with an object action doesn’t affect bucket-level settings for S3 Bucket Key.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS).

    + ///

    General purpose buckets - Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key.

    + ///

    Directory buckets - S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

    pub fn set_bucket_key_enabled(mut self, input: ::std::option::Option) -> Self { self.inner = self.inner.set_bucket_key_enabled(input); self } - ///

    Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.

    - ///

    Specifying this header with an object action doesn’t affect bucket-level settings for S3 Bucket Key.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS).

    + ///

    General purpose buckets - Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key.

    + ///

    Directory buckets - S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

    pub fn get_bucket_key_enabled(&self) -> &::std::option::Option { self.inner.get_bucket_key_enabled() } diff --git a/sdk/s3/src/operation/create_session/_create_session_input.rs b/sdk/s3/src/operation/create_session/_create_session_input.rs index 54fb36b0bb90..e539151f794c 100644 --- a/sdk/s3/src/operation/create_session/_create_session_input.rs +++ b/sdk/s3/src/operation/create_session/_create_session_input.rs @@ -1,15 +1,28 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. #[allow(missing_docs)] // documentation missing in model #[non_exhaustive] -#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq)] pub struct CreateSessionInput { - ///

    Specifies the mode of the session that will be created, either ReadWrite or ReadOnly. By default, a ReadWrite session is created. A ReadWrite session is capable of executing all the Zonal endpoint APIs on a directory bucket. A ReadOnly session is constrained to execute the following Zonal endpoint APIs: GetObject, HeadObject, ListObjectsV2, GetObjectAttributes, ListParts, and ListMultipartUploads.

    + ///

    Specifies the mode of the session that will be created, either ReadWrite or ReadOnly. By default, a ReadWrite session is created. A ReadWrite session is capable of executing all the Zonal endpoint API operations on a directory bucket. A ReadOnly session is constrained to execute the following Zonal endpoint API operations: GetObject, HeadObject, ListObjectsV2, GetObjectAttributes, ListParts, and ListMultipartUploads.

    pub session_mode: ::std::option::Option, ///

    The name of the bucket that you create a session for.

    pub bucket: ::std::option::Option<::std::string::String>, + ///

    The server-side encryption algorithm to use when you store objects in the directory bucket.

    + ///

    For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). By default, Amazon S3 encrypts data with SSE-S3. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide.

    + pub server_side_encryption: ::std::option::Option, + ///

    If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Also, if the KMS key doesn't exist in the same account that't issuing the command, you must use the full Key ARN not the Key ID.

    + ///

    Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

    + pub ssekms_key_id: ::std::option::Option<::std::string::String>, + ///

    Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

    + ///

    General purpose buckets - This value must be explicitly added during CopyObject operations if you want an additional encryption context for your object. For more information, see Encryption context in the Amazon S3 User Guide.

    + ///

    Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

    + pub ssekms_encryption_context: ::std::option::Option<::std::string::String>, + ///

    Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using KMS keys (SSE-KMS).

    + ///

    S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

    + pub bucket_key_enabled: ::std::option::Option, } impl CreateSessionInput { - ///

    Specifies the mode of the session that will be created, either ReadWrite or ReadOnly. By default, a ReadWrite session is created. A ReadWrite session is capable of executing all the Zonal endpoint APIs on a directory bucket. A ReadOnly session is constrained to execute the following Zonal endpoint APIs: GetObject, HeadObject, ListObjectsV2, GetObjectAttributes, ListParts, and ListMultipartUploads.

    + ///

    Specifies the mode of the session that will be created, either ReadWrite or ReadOnly. By default, a ReadWrite session is created. A ReadWrite session is capable of executing all the Zonal endpoint API operations on a directory bucket. A ReadOnly session is constrained to execute the following Zonal endpoint API operations: GetObject, HeadObject, ListObjectsV2, GetObjectAttributes, ListParts, and ListMultipartUploads.

    pub fn session_mode(&self) -> ::std::option::Option<&crate::types::SessionMode> { self.session_mode.as_ref() } @@ -17,6 +30,39 @@ impl CreateSessionInput { pub fn bucket(&self) -> ::std::option::Option<&str> { self.bucket.as_deref() } + ///

    The server-side encryption algorithm to use when you store objects in the directory bucket.

    + ///

    For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). By default, Amazon S3 encrypts data with SSE-S3. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide.

    + pub fn server_side_encryption(&self) -> ::std::option::Option<&crate::types::ServerSideEncryption> { + self.server_side_encryption.as_ref() + } + ///

    If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Also, if the KMS key doesn't exist in the same account that't issuing the command, you must use the full Key ARN not the Key ID.

    + ///

    Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

    + pub fn ssekms_key_id(&self) -> ::std::option::Option<&str> { + self.ssekms_key_id.as_deref() + } + ///

    Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

    + ///

    General purpose buckets - This value must be explicitly added during CopyObject operations if you want an additional encryption context for your object. For more information, see Encryption context in the Amazon S3 User Guide.

    + ///

    Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

    + pub fn ssekms_encryption_context(&self) -> ::std::option::Option<&str> { + self.ssekms_encryption_context.as_deref() + } + ///

    Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using KMS keys (SSE-KMS).

    + ///

    S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

    + pub fn bucket_key_enabled(&self) -> ::std::option::Option { + self.bucket_key_enabled + } +} +impl ::std::fmt::Debug for CreateSessionInput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("CreateSessionInput"); + formatter.field("session_mode", &self.session_mode); + formatter.field("bucket", &self.bucket); + formatter.field("server_side_encryption", &self.server_side_encryption); + formatter.field("ssekms_key_id", &"*** Sensitive Data Redacted ***"); + formatter.field("ssekms_encryption_context", &"*** Sensitive Data Redacted ***"); + formatter.field("bucket_key_enabled", &self.bucket_key_enabled); + formatter.finish() + } } impl CreateSessionInput { /// Creates a new builder-style object to manufacture [`CreateSessionInput`](crate::operation::create_session::CreateSessionInput). @@ -26,24 +72,28 @@ impl CreateSessionInput { } /// A builder for [`CreateSessionInput`](crate::operation::create_session::CreateSessionInput). -#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)] #[non_exhaustive] pub struct CreateSessionInputBuilder { pub(crate) session_mode: ::std::option::Option, pub(crate) bucket: ::std::option::Option<::std::string::String>, + pub(crate) server_side_encryption: ::std::option::Option, + pub(crate) ssekms_key_id: ::std::option::Option<::std::string::String>, + pub(crate) ssekms_encryption_context: ::std::option::Option<::std::string::String>, + pub(crate) bucket_key_enabled: ::std::option::Option, } impl CreateSessionInputBuilder { - ///

    Specifies the mode of the session that will be created, either ReadWrite or ReadOnly. By default, a ReadWrite session is created. A ReadWrite session is capable of executing all the Zonal endpoint APIs on a directory bucket. A ReadOnly session is constrained to execute the following Zonal endpoint APIs: GetObject, HeadObject, ListObjectsV2, GetObjectAttributes, ListParts, and ListMultipartUploads.

    + ///

    Specifies the mode of the session that will be created, either ReadWrite or ReadOnly. By default, a ReadWrite session is created. A ReadWrite session is capable of executing all the Zonal endpoint API operations on a directory bucket. A ReadOnly session is constrained to execute the following Zonal endpoint API operations: GetObject, HeadObject, ListObjectsV2, GetObjectAttributes, ListParts, and ListMultipartUploads.

    pub fn session_mode(mut self, input: crate::types::SessionMode) -> Self { self.session_mode = ::std::option::Option::Some(input); self } - ///

    Specifies the mode of the session that will be created, either ReadWrite or ReadOnly. By default, a ReadWrite session is created. A ReadWrite session is capable of executing all the Zonal endpoint APIs on a directory bucket. A ReadOnly session is constrained to execute the following Zonal endpoint APIs: GetObject, HeadObject, ListObjectsV2, GetObjectAttributes, ListParts, and ListMultipartUploads.

    + ///

    Specifies the mode of the session that will be created, either ReadWrite or ReadOnly. By default, a ReadWrite session is created. A ReadWrite session is capable of executing all the Zonal endpoint API operations on a directory bucket. A ReadOnly session is constrained to execute the following Zonal endpoint API operations: GetObject, HeadObject, ListObjectsV2, GetObjectAttributes, ListParts, and ListMultipartUploads.

    pub fn set_session_mode(mut self, input: ::std::option::Option) -> Self { self.session_mode = input; self } - ///

    Specifies the mode of the session that will be created, either ReadWrite or ReadOnly. By default, a ReadWrite session is created. A ReadWrite session is capable of executing all the Zonal endpoint APIs on a directory bucket. A ReadOnly session is constrained to execute the following Zonal endpoint APIs: GetObject, HeadObject, ListObjectsV2, GetObjectAttributes, ListParts, and ListMultipartUploads.

    + ///

    Specifies the mode of the session that will be created, either ReadWrite or ReadOnly. By default, a ReadWrite session is created. A ReadWrite session is capable of executing all the Zonal endpoint API operations on a directory bucket. A ReadOnly session is constrained to execute the following Zonal endpoint API operations: GetObject, HeadObject, ListObjectsV2, GetObjectAttributes, ListParts, and ListMultipartUploads.

    pub fn get_session_mode(&self) -> &::std::option::Option { &self.session_mode } @@ -62,6 +112,77 @@ impl CreateSessionInputBuilder { pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> { &self.bucket } + ///

    The server-side encryption algorithm to use when you store objects in the directory bucket.

    + ///

    For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). By default, Amazon S3 encrypts data with SSE-S3. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide.

    + pub fn server_side_encryption(mut self, input: crate::types::ServerSideEncryption) -> Self { + self.server_side_encryption = ::std::option::Option::Some(input); + self + } + ///

    The server-side encryption algorithm to use when you store objects in the directory bucket.

    + ///

    For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). By default, Amazon S3 encrypts data with SSE-S3. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide.

    + pub fn set_server_side_encryption(mut self, input: ::std::option::Option) -> Self { + self.server_side_encryption = input; + self + } + ///

    The server-side encryption algorithm to use when you store objects in the directory bucket.

    + ///

    For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). By default, Amazon S3 encrypts data with SSE-S3. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide.

    + pub fn get_server_side_encryption(&self) -> &::std::option::Option { + &self.server_side_encryption + } + ///

    If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Also, if the KMS key doesn't exist in the same account that't issuing the command, you must use the full Key ARN not the Key ID.

    + ///

    Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

    + pub fn ssekms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.ssekms_key_id = ::std::option::Option::Some(input.into()); + self + } + ///

    If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Also, if the KMS key doesn't exist in the same account that't issuing the command, you must use the full Key ARN not the Key ID.

    + ///

    Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

    + pub fn set_ssekms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.ssekms_key_id = input; + self + } + ///

    If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Also, if the KMS key doesn't exist in the same account that't issuing the command, you must use the full Key ARN not the Key ID.

    + ///

    Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

    + pub fn get_ssekms_key_id(&self) -> &::std::option::Option<::std::string::String> { + &self.ssekms_key_id + } + ///

    Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

    + ///

    General purpose buckets - This value must be explicitly added during CopyObject operations if you want an additional encryption context for your object. For more information, see Encryption context in the Amazon S3 User Guide.

    + ///

    Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

    + pub fn ssekms_encryption_context(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.ssekms_encryption_context = ::std::option::Option::Some(input.into()); + self + } + ///

    Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

    + ///

    General purpose buckets - This value must be explicitly added during CopyObject operations if you want an additional encryption context for your object. For more information, see Encryption context in the Amazon S3 User Guide.

    + ///

    Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

    + pub fn set_ssekms_encryption_context(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.ssekms_encryption_context = input; + self + } + ///

    Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

    + ///

    General purpose buckets - This value must be explicitly added during CopyObject operations if you want an additional encryption context for your object. For more information, see Encryption context in the Amazon S3 User Guide.

    + ///

    Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

    + pub fn get_ssekms_encryption_context(&self) -> &::std::option::Option<::std::string::String> { + &self.ssekms_encryption_context + } + ///

    Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using KMS keys (SSE-KMS).

    + ///

    S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

    + pub fn bucket_key_enabled(mut self, input: bool) -> Self { + self.bucket_key_enabled = ::std::option::Option::Some(input); + self + } + ///

    Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using KMS keys (SSE-KMS).

    + ///

    S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

    + pub fn set_bucket_key_enabled(mut self, input: ::std::option::Option) -> Self { + self.bucket_key_enabled = input; + self + } + ///

    Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using KMS keys (SSE-KMS).

    + ///

    S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

    + pub fn get_bucket_key_enabled(&self) -> &::std::option::Option { + &self.bucket_key_enabled + } /// Consumes the builder and constructs a [`CreateSessionInput`](crate::operation::create_session::CreateSessionInput). pub fn build( self, @@ -69,6 +190,22 @@ impl CreateSessionInputBuilder { ::std::result::Result::Ok(crate::operation::create_session::CreateSessionInput { session_mode: self.session_mode, bucket: self.bucket, + server_side_encryption: self.server_side_encryption, + ssekms_key_id: self.ssekms_key_id, + ssekms_encryption_context: self.ssekms_encryption_context, + bucket_key_enabled: self.bucket_key_enabled, }) } } +impl ::std::fmt::Debug for CreateSessionInputBuilder { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("CreateSessionInputBuilder"); + formatter.field("session_mode", &self.session_mode); + formatter.field("bucket", &self.bucket); + formatter.field("server_side_encryption", &self.server_side_encryption); + formatter.field("ssekms_key_id", &"*** Sensitive Data Redacted ***"); + formatter.field("ssekms_encryption_context", &"*** Sensitive Data Redacted ***"); + formatter.field("bucket_key_enabled", &self.bucket_key_enabled); + formatter.finish() + } +} diff --git a/sdk/s3/src/operation/create_session/_create_session_output.rs b/sdk/s3/src/operation/create_session/_create_session_output.rs index 9a66bb1e85d2..4695611c5402 100644 --- a/sdk/s3/src/operation/create_session/_create_session_output.rs +++ b/sdk/s3/src/operation/create_session/_create_session_output.rs @@ -1,19 +1,56 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. #[allow(missing_docs)] // documentation missing in model #[non_exhaustive] -#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq)] pub struct CreateSessionOutput { + ///

    The server-side encryption algorithm used when you store objects in the directory bucket.

    + pub server_side_encryption: ::std::option::Option, + ///

    If you specify x-amz-server-side-encryption with aws:kms, this header indicates the ID of the KMS symmetric encryption customer managed key that was used for object encryption.

    + pub ssekms_key_id: ::std::option::Option<::std::string::String>, + ///

    If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

    + pub ssekms_encryption_context: ::std::option::Option<::std::string::String>, + ///

    Indicates whether to use an S3 Bucket Key for server-side encryption with KMS keys (SSE-KMS).

    + pub bucket_key_enabled: ::std::option::Option, ///

    The established temporary security credentials for the created session.

    pub credentials: ::std::option::Option, _extended_request_id: Option, _request_id: Option, } impl CreateSessionOutput { + ///

    The server-side encryption algorithm used when you store objects in the directory bucket.

    + pub fn server_side_encryption(&self) -> ::std::option::Option<&crate::types::ServerSideEncryption> { + self.server_side_encryption.as_ref() + } + ///

    If you specify x-amz-server-side-encryption with aws:kms, this header indicates the ID of the KMS symmetric encryption customer managed key that was used for object encryption.

    + pub fn ssekms_key_id(&self) -> ::std::option::Option<&str> { + self.ssekms_key_id.as_deref() + } + ///

    If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

    + pub fn ssekms_encryption_context(&self) -> ::std::option::Option<&str> { + self.ssekms_encryption_context.as_deref() + } + ///

    Indicates whether to use an S3 Bucket Key for server-side encryption with KMS keys (SSE-KMS).

    + pub fn bucket_key_enabled(&self) -> ::std::option::Option { + self.bucket_key_enabled + } ///

    The established temporary security credentials for the created session.

    pub fn credentials(&self) -> ::std::option::Option<&crate::types::SessionCredentials> { self.credentials.as_ref() } } +impl ::std::fmt::Debug for CreateSessionOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("CreateSessionOutput"); + formatter.field("server_side_encryption", &self.server_side_encryption); + formatter.field("ssekms_key_id", &"*** Sensitive Data Redacted ***"); + formatter.field("ssekms_encryption_context", &"*** Sensitive Data Redacted ***"); + formatter.field("bucket_key_enabled", &self.bucket_key_enabled); + formatter.field("credentials", &self.credentials); + formatter.field("_extended_request_id", &self._extended_request_id); + formatter.field("_request_id", &self._request_id); + formatter.finish() + } +} impl crate::s3_request_id::RequestIdExt for CreateSessionOutput { fn extended_request_id(&self) -> Option<&str> { self._extended_request_id.as_deref() @@ -32,14 +69,74 @@ impl CreateSessionOutput { } /// A builder for [`CreateSessionOutput`](crate::operation::create_session::CreateSessionOutput). -#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)] #[non_exhaustive] pub struct CreateSessionOutputBuilder { + pub(crate) server_side_encryption: ::std::option::Option, + pub(crate) ssekms_key_id: ::std::option::Option<::std::string::String>, + pub(crate) ssekms_encryption_context: ::std::option::Option<::std::string::String>, + pub(crate) bucket_key_enabled: ::std::option::Option, pub(crate) credentials: ::std::option::Option, _extended_request_id: Option, _request_id: Option, } impl CreateSessionOutputBuilder { + ///

    The server-side encryption algorithm used when you store objects in the directory bucket.

    + pub fn server_side_encryption(mut self, input: crate::types::ServerSideEncryption) -> Self { + self.server_side_encryption = ::std::option::Option::Some(input); + self + } + ///

    The server-side encryption algorithm used when you store objects in the directory bucket.

    + pub fn set_server_side_encryption(mut self, input: ::std::option::Option) -> Self { + self.server_side_encryption = input; + self + } + ///

    The server-side encryption algorithm used when you store objects in the directory bucket.

    + pub fn get_server_side_encryption(&self) -> &::std::option::Option { + &self.server_side_encryption + } + ///

    If you specify x-amz-server-side-encryption with aws:kms, this header indicates the ID of the KMS symmetric encryption customer managed key that was used for object encryption.

    + pub fn ssekms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.ssekms_key_id = ::std::option::Option::Some(input.into()); + self + } + ///

    If you specify x-amz-server-side-encryption with aws:kms, this header indicates the ID of the KMS symmetric encryption customer managed key that was used for object encryption.

    + pub fn set_ssekms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.ssekms_key_id = input; + self + } + ///

    If you specify x-amz-server-side-encryption with aws:kms, this header indicates the ID of the KMS symmetric encryption customer managed key that was used for object encryption.

    + pub fn get_ssekms_key_id(&self) -> &::std::option::Option<::std::string::String> { + &self.ssekms_key_id + } + ///

    If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

    + pub fn ssekms_encryption_context(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.ssekms_encryption_context = ::std::option::Option::Some(input.into()); + self + } + ///

    If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

    + pub fn set_ssekms_encryption_context(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.ssekms_encryption_context = input; + self + } + ///

    If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

    + pub fn get_ssekms_encryption_context(&self) -> &::std::option::Option<::std::string::String> { + &self.ssekms_encryption_context + } + ///

    Indicates whether to use an S3 Bucket Key for server-side encryption with KMS keys (SSE-KMS).

    + pub fn bucket_key_enabled(mut self, input: bool) -> Self { + self.bucket_key_enabled = ::std::option::Option::Some(input); + self + } + ///

    Indicates whether to use an S3 Bucket Key for server-side encryption with KMS keys (SSE-KMS).

    + pub fn set_bucket_key_enabled(mut self, input: ::std::option::Option) -> Self { + self.bucket_key_enabled = input; + self + } + ///

    Indicates whether to use an S3 Bucket Key for server-side encryption with KMS keys (SSE-KMS).

    + pub fn get_bucket_key_enabled(&self) -> &::std::option::Option { + &self.bucket_key_enabled + } ///

    The established temporary security credentials for the created session.

    /// This field is required. pub fn credentials(mut self, input: crate::types::SessionCredentials) -> Self { @@ -76,9 +173,26 @@ impl CreateSessionOutputBuilder { /// Consumes the builder and constructs a [`CreateSessionOutput`](crate::operation::create_session::CreateSessionOutput). pub fn build(self) -> crate::operation::create_session::CreateSessionOutput { crate::operation::create_session::CreateSessionOutput { + server_side_encryption: self.server_side_encryption, + ssekms_key_id: self.ssekms_key_id, + ssekms_encryption_context: self.ssekms_encryption_context, + bucket_key_enabled: self.bucket_key_enabled, credentials: self.credentials, _extended_request_id: self._extended_request_id, _request_id: self._request_id, } } } +impl ::std::fmt::Debug for CreateSessionOutputBuilder { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + let mut formatter = f.debug_struct("CreateSessionOutputBuilder"); + formatter.field("server_side_encryption", &self.server_side_encryption); + formatter.field("ssekms_key_id", &"*** Sensitive Data Redacted ***"); + formatter.field("ssekms_encryption_context", &"*** Sensitive Data Redacted ***"); + formatter.field("bucket_key_enabled", &self.bucket_key_enabled); + formatter.field("credentials", &self.credentials); + formatter.field("_extended_request_id", &self._extended_request_id); + formatter.field("_request_id", &self._request_id); + formatter.finish() + } +} diff --git a/sdk/s3/src/operation/create_session/builders.rs b/sdk/s3/src/operation/create_session/builders.rs index d5b76ee49815..02f0271828cd 100644 --- a/sdk/s3/src/operation/create_session/builders.rs +++ b/sdk/s3/src/operation/create_session/builders.rs @@ -22,16 +22,16 @@ impl crate::operation::create_session::builders::CreateSessionInputBuilder { } /// Fluent builder constructing a request to `CreateSession`. /// -///

    Creates a session that establishes temporary security credentials to support fast authentication and authorization for the Zonal endpoint APIs on directory buckets. For more information about Zonal endpoint APIs that include the Availability Zone in the request endpoint, see S3 Express One Zone APIs in the Amazon S3 User Guide.

    -///

    To make Zonal endpoint API requests on a directory bucket, use the CreateSession API operation. Specifically, you grant s3express:CreateSession permission to a bucket in a bucket policy or an IAM identity-based policy. Then, you use IAM credentials to make the CreateSession API request on the bucket, which returns temporary security credentials that include the access key ID, secret access key, session token, and expiration. These credentials have associated permissions to access the Zonal endpoint APIs. After the session is created, you don’t need to use other policies to grant permissions to each Zonal endpoint API individually. Instead, in your Zonal endpoint API requests, you sign your requests by applying the temporary security credentials of the session to the request headers and following the SigV4 protocol for authentication. You also apply the session token to the x-amz-s3session-token request header for authorization. Temporary security credentials are scoped to the bucket and expire after 5 minutes. After the expiration time, any calls that you make with those credentials will fail. You must use IAM credentials again to make a CreateSession API request that generates a new set of temporary credentials for use. Temporary credentials cannot be extended or refreshed beyond the original specified interval.

    +///

    Creates a session that establishes temporary security credentials to support fast authentication and authorization for the Zonal endpoint API operations on directory buckets. For more information about Zonal endpoint API operations that include the Availability Zone in the request endpoint, see S3 Express One Zone APIs in the Amazon S3 User Guide.

    +///

    To make Zonal endpoint API requests on a directory bucket, use the CreateSession API operation. Specifically, you grant s3express:CreateSession permission to a bucket in a bucket policy or an IAM identity-based policy. Then, you use IAM credentials to make the CreateSession API request on the bucket, which returns temporary security credentials that include the access key ID, secret access key, session token, and expiration. These credentials have associated permissions to access the Zonal endpoint API operations. After the session is created, you don’t need to use other policies to grant permissions to each Zonal endpoint API individually. Instead, in your Zonal endpoint API requests, you sign your requests by applying the temporary security credentials of the session to the request headers and following the SigV4 protocol for authentication. You also apply the session token to the x-amz-s3session-token request header for authorization. Temporary security credentials are scoped to the bucket and expire after 5 minutes. After the expiration time, any calls that you make with those credentials will fail. You must use IAM credentials again to make a CreateSession API request that generates a new set of temporary credentials for use. Temporary credentials cannot be extended or refreshed beyond the original specified interval.

    ///

    If you use Amazon Web Services SDKs, SDKs handle the session token refreshes automatically to avoid service interruptions when a session expires. We recommend that you use the Amazon Web Services SDKs to initiate and manage requests to the CreateSession API. For more information, see Performance guidelines and design patterns in the Amazon S3 User Guide.

    ///
      ///
    • ///

      You must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format https://bucket_name.s3express-az_id.region.amazonaws.com. Path-style requests are not supported. For more information, see Regional and Zonal endpoints in the Amazon S3 User Guide.

    • ///
    • -///

      CopyObject API operation - Unlike other Zonal endpoint APIs, the CopyObject API operation doesn't use the temporary security credentials returned from the CreateSession API operation for authentication and authorization. For information about authentication and authorization of the CopyObject API operation on directory buckets, see CopyObject.

    • +///

      CopyObject API operation - Unlike other Zonal endpoint API operations, the CopyObject API operation doesn't use the temporary security credentials returned from the CreateSession API operation for authentication and authorization. For information about authentication and authorization of the CopyObject API operation on directory buckets, see CopyObject.

      ///
    • -///

      HeadBucket API operation - Unlike other Zonal endpoint APIs, the HeadBucket API operation doesn't use the temporary security credentials returned from the CreateSession API operation for authentication and authorization. For information about authentication and authorization of the HeadBucket API operation on directory buckets, see HeadBucket.

    • +///

      HeadBucket API operation - Unlike other Zonal endpoint API operations, the HeadBucket API operation doesn't use the temporary security credentials returned from the CreateSession API operation for authentication and authorization. For information about authentication and authorization of the HeadBucket API operation on directory buckets, see HeadBucket.

      ///
    ///
    ///
    @@ -40,7 +40,20 @@ impl crate::operation::create_session::builders::CreateSessionInputBuilder { ///
    ///
    ///

    To obtain temporary security credentials, you must create a bucket policy or an IAM identity-based policy that grants s3express:CreateSession permission to the bucket. In a policy, you can have the s3express:SessionMode condition key to control who can create a ReadWrite or ReadOnly session. For more information about ReadWrite or ReadOnly sessions, see x-amz-create-session-mode . For example policies, see Example bucket policies for S3 Express One Zone and Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone in the Amazon S3 User Guide.

    -///

    To grant cross-account access to Zonal endpoint APIs, the bucket policy should also grant both accounts the s3express:CreateSession permission.

    +///

    To grant cross-account access to Zonal endpoint API operations, the bucket policy should also grant both accounts the s3express:CreateSession permission.

    +///

    If you want to encrypt objects with SSE-KMS, you must also have the kms:GenerateDataKey and the kms:Decrypt permissions in IAM identity-based policies and KMS key policies for the target KMS key.

    +///
    +///
    +/// Encryption +///
    +///
    +///

    For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

    +///

    For Zonal endpoint (object-level) API operations except CopyObject and UploadPartCopy, you authenticate and authorize requests through CreateSession for low latency. To encrypt new objects in a directory bucket with SSE-KMS, you must specify SSE-KMS as the directory bucket's default encryption configuration with a KMS key (specifically, a customer managed key). Then, when a session is created for Zonal endpoint API operations, new objects are automatically encrypted and decrypted with SSE-KMS and S3 Bucket Keys during the session.

    +///

    Only 1 customer managed key is supported per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported. After you specify SSE-KMS as your bucket's default encryption configuration with a customer managed key, you can't change the customer managed key for the bucket's SSE-KMS configuration.

    +///
    +///

    In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, you can't override the values of the encryption settings (x-amz-server-side-encryption, x-amz-server-side-encryption-aws-kms-key-id, x-amz-server-side-encryption-context, and x-amz-server-side-encryption-bucket-key-enabled) from the CreateSession request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the CreateSession request to protect new objects in the directory bucket.

    +///

    When you use the CLI or the Amazon Web Services SDKs, for CreateSession, the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the CreateSession request. It's not supported to override the encryption settings values in the CreateSession request. Also, in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), it's not supported to override the values of the encryption settings from the CreateSession request.

    +///
    ///
    ///
    /// HTTP Host header syntax @@ -134,17 +147,17 @@ impl CreateSessionFluentBuilder { self.config_override = config_override; self } - ///

    Specifies the mode of the session that will be created, either ReadWrite or ReadOnly. By default, a ReadWrite session is created. A ReadWrite session is capable of executing all the Zonal endpoint APIs on a directory bucket. A ReadOnly session is constrained to execute the following Zonal endpoint APIs: GetObject, HeadObject, ListObjectsV2, GetObjectAttributes, ListParts, and ListMultipartUploads.

    + ///

    Specifies the mode of the session that will be created, either ReadWrite or ReadOnly. By default, a ReadWrite session is created. A ReadWrite session is capable of executing all the Zonal endpoint API operations on a directory bucket. A ReadOnly session is constrained to execute the following Zonal endpoint API operations: GetObject, HeadObject, ListObjectsV2, GetObjectAttributes, ListParts, and ListMultipartUploads.

    pub fn session_mode(mut self, input: crate::types::SessionMode) -> Self { self.inner = self.inner.session_mode(input); self } - ///

    Specifies the mode of the session that will be created, either ReadWrite or ReadOnly. By default, a ReadWrite session is created. A ReadWrite session is capable of executing all the Zonal endpoint APIs on a directory bucket. A ReadOnly session is constrained to execute the following Zonal endpoint APIs: GetObject, HeadObject, ListObjectsV2, GetObjectAttributes, ListParts, and ListMultipartUploads.

    + ///

    Specifies the mode of the session that will be created, either ReadWrite or ReadOnly. By default, a ReadWrite session is created. A ReadWrite session is capable of executing all the Zonal endpoint API operations on a directory bucket. A ReadOnly session is constrained to execute the following Zonal endpoint API operations: GetObject, HeadObject, ListObjectsV2, GetObjectAttributes, ListParts, and ListMultipartUploads.

    pub fn set_session_mode(mut self, input: ::std::option::Option) -> Self { self.inner = self.inner.set_session_mode(input); self } - ///

    Specifies the mode of the session that will be created, either ReadWrite or ReadOnly. By default, a ReadWrite session is created. A ReadWrite session is capable of executing all the Zonal endpoint APIs on a directory bucket. A ReadOnly session is constrained to execute the following Zonal endpoint APIs: GetObject, HeadObject, ListObjectsV2, GetObjectAttributes, ListParts, and ListMultipartUploads.

    + ///

    Specifies the mode of the session that will be created, either ReadWrite or ReadOnly. By default, a ReadWrite session is created. A ReadWrite session is capable of executing all the Zonal endpoint API operations on a directory bucket. A ReadOnly session is constrained to execute the following Zonal endpoint API operations: GetObject, HeadObject, ListObjectsV2, GetObjectAttributes, ListParts, and ListMultipartUploads.

    pub fn get_session_mode(&self) -> &::std::option::Option { self.inner.get_session_mode() } @@ -162,4 +175,75 @@ impl CreateSessionFluentBuilder { pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_bucket() } + ///

    The server-side encryption algorithm to use when you store objects in the directory bucket.

    + ///

    For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). By default, Amazon S3 encrypts data with SSE-S3. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide.

    + pub fn server_side_encryption(mut self, input: crate::types::ServerSideEncryption) -> Self { + self.inner = self.inner.server_side_encryption(input); + self + } + ///

    The server-side encryption algorithm to use when you store objects in the directory bucket.

    + ///

    For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). By default, Amazon S3 encrypts data with SSE-S3. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide.

    + pub fn set_server_side_encryption(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_server_side_encryption(input); + self + } + ///

    The server-side encryption algorithm to use when you store objects in the directory bucket.

    + ///

    For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). By default, Amazon S3 encrypts data with SSE-S3. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide.

    + pub fn get_server_side_encryption(&self) -> &::std::option::Option { + self.inner.get_server_side_encryption() + } + ///

    If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Also, if the KMS key doesn't exist in the same account that't issuing the command, you must use the full Key ARN not the Key ID.

    + ///

    Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

    + pub fn ssekms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.ssekms_key_id(input.into()); + self + } + ///

    If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Also, if the KMS key doesn't exist in the same account that't issuing the command, you must use the full Key ARN not the Key ID.

    + ///

    Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

    + pub fn set_ssekms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_ssekms_key_id(input); + self + } + ///

    If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Also, if the KMS key doesn't exist in the same account that't issuing the command, you must use the full Key ARN not the Key ID.

    + ///

    Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

    + pub fn get_ssekms_key_id(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_ssekms_key_id() + } + ///

    Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

    + ///

    General purpose buckets - This value must be explicitly added during CopyObject operations if you want an additional encryption context for your object. For more information, see Encryption context in the Amazon S3 User Guide.

    + ///

    Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

    + pub fn ssekms_encryption_context(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { + self.inner = self.inner.ssekms_encryption_context(input.into()); + self + } + ///

    Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

    + ///

    General purpose buckets - This value must be explicitly added during CopyObject operations if you want an additional encryption context for your object. For more information, see Encryption context in the Amazon S3 User Guide.

    + ///

    Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

    + pub fn set_ssekms_encryption_context(mut self, input: ::std::option::Option<::std::string::String>) -> Self { + self.inner = self.inner.set_ssekms_encryption_context(input); + self + } + ///

    Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

    + ///

    General purpose buckets - This value must be explicitly added during CopyObject operations if you want an additional encryption context for your object. For more information, see Encryption context in the Amazon S3 User Guide.

    + ///

    Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

    + pub fn get_ssekms_encryption_context(&self) -> &::std::option::Option<::std::string::String> { + self.inner.get_ssekms_encryption_context() + } + ///

    Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using KMS keys (SSE-KMS).

    + ///

    S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

    + pub fn bucket_key_enabled(mut self, input: bool) -> Self { + self.inner = self.inner.bucket_key_enabled(input); + self + } + ///

    Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using KMS keys (SSE-KMS).

    + ///

    S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

    + pub fn set_bucket_key_enabled(mut self, input: ::std::option::Option) -> Self { + self.inner = self.inner.set_bucket_key_enabled(input); + self + } + ///

    Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using KMS keys (SSE-KMS).

    + ///

    S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

    + pub fn get_bucket_key_enabled(&self) -> &::std::option::Option { + self.inner.get_bucket_key_enabled() + } } diff --git a/sdk/s3/src/operation/delete_bucket_encryption/_delete_bucket_encryption_input.rs b/sdk/s3/src/operation/delete_bucket_encryption/_delete_bucket_encryption_input.rs index 0de6a0736680..420fa7d76e7e 100644 --- a/sdk/s3/src/operation/delete_bucket_encryption/_delete_bucket_encryption_input.rs +++ b/sdk/s3/src/operation/delete_bucket_encryption/_delete_bucket_encryption_input.rs @@ -4,16 +4,22 @@ #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] pub struct DeleteBucketEncryptionInput { ///

    The name of the bucket containing the server-side encryption configuration to delete.

    + ///

    Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide

    pub bucket: ::std::option::Option<::std::string::String>, - ///

    The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

    + ///

    The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

    + ///

    For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code 501 Not Implemented.

    + ///
    pub expected_bucket_owner: ::std::option::Option<::std::string::String>, } impl DeleteBucketEncryptionInput { ///

    The name of the bucket containing the server-side encryption configuration to delete.

    + ///

    Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide

    pub fn bucket(&self) -> ::std::option::Option<&str> { self.bucket.as_deref() } - ///

    The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

    + ///

    The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

    + ///

    For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code 501 Not Implemented.

    + ///
    pub fn expected_bucket_owner(&self) -> ::std::option::Option<&str> { self.expected_bucket_owner.as_deref() } @@ -34,31 +40,40 @@ pub struct DeleteBucketEncryptionInputBuilder { } impl DeleteBucketEncryptionInputBuilder { ///

    The name of the bucket containing the server-side encryption configuration to delete.

    + ///

    Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide

    /// This field is required. pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.bucket = ::std::option::Option::Some(input.into()); self } ///

    The name of the bucket containing the server-side encryption configuration to delete.

    + ///

    Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide

    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.bucket = input; self } ///

    The name of the bucket containing the server-side encryption configuration to delete.

    + ///

    Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide

    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> { &self.bucket } - ///

    The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

    + ///

    The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

    + ///

    For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code 501 Not Implemented.

    + ///
    pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.expected_bucket_owner = ::std::option::Option::Some(input.into()); self } - ///

    The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

    + ///

    The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

    + ///

    For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code 501 Not Implemented.

    + ///
    pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.expected_bucket_owner = input; self } - ///

    The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

    + ///

    The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

    + ///

    For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code 501 Not Implemented.

    + ///
    pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> { &self.expected_bucket_owner } diff --git a/sdk/s3/src/operation/delete_bucket_encryption/builders.rs b/sdk/s3/src/operation/delete_bucket_encryption/builders.rs index 7ecc48a0576f..bce12e8c92f8 100644 --- a/sdk/s3/src/operation/delete_bucket_encryption/builders.rs +++ b/sdk/s3/src/operation/delete_bucket_encryption/builders.rs @@ -22,11 +22,33 @@ impl crate::operation::delete_bucket_encryption::builders::DeleteBucketEncryptio } /// Fluent builder constructing a request to `DeleteBucketEncryption`. /// -/// -///

    This operation is not supported by directory buckets.

    +///

    This implementation of the DELETE action resets the default encryption for the bucket as server-side encryption with Amazon S3 managed keys (SSE-S3).

    +/// /// -///

    This implementation of the DELETE action resets the default encryption for the bucket as server-side encryption with Amazon S3 managed keys (SSE-S3). For information about the bucket default encryption feature, see Amazon S3 Bucket Default Encryption in the Amazon S3 User Guide.

    -///

    To use this operation, you must have permissions to perform the s3:PutEncryptionConfiguration action. The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Subresource Operations and Managing Access Permissions to your Amazon S3 Resources in the Amazon S3 User Guide.

    +///
    +///
    +/// Permissions +///
    +///
    +///
      +///
    • +///

      General purpose bucket permissions - The s3:PutEncryptionConfiguration permission is required in a policy. The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Operations and Managing Access Permissions to Your Amazon S3 Resources.

    • +///
    • +///

      Directory bucket permissions - To grant access to this API operation, you must have the s3express:PutEncryptionConfiguration permission in an IAM identity-based policy instead of a bucket policy. Cross-account access to this API operation isn't supported. This operation can only be performed by the Amazon Web Services account that owns the resource. For more information about directory bucket policies and permissions, see Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone in the Amazon S3 User Guide.

    • +///
    +///
    +///
    +/// HTTP Host header syntax +///
    +///
    +///

    Directory buckets - The HTTP Host header syntax is s3express-control.region.amazonaws.com.

    +///
    +///
    ///

    The following operations are related to DeleteBucketEncryption:

    ///
      ///
    • @@ -120,30 +142,39 @@ impl DeleteBucketEncryptionFluentBuilder { self } ///

      The name of the bucket containing the server-side encryption configuration to delete.

      + ///

      Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide

      pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.bucket(input.into()); self } ///

      The name of the bucket containing the server-side encryption configuration to delete.

      + ///

      Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide

      pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.inner = self.inner.set_bucket(input); self } ///

      The name of the bucket containing the server-side encryption configuration to delete.

      + ///

      Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide

      pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_bucket() } - ///

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

      + ///

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

      + ///

      For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code 501 Not Implemented.

      + ///
      pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.expected_bucket_owner(input.into()); self } - ///

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

      + ///

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

      + ///

      For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code 501 Not Implemented.

      + ///
      pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.inner = self.inner.set_expected_bucket_owner(input); self } - ///

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

      + ///

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

      + ///

      For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code 501 Not Implemented.

      + ///
      pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_expected_bucket_owner() } diff --git a/sdk/s3/src/operation/get_bucket_encryption/_get_bucket_encryption_input.rs b/sdk/s3/src/operation/get_bucket_encryption/_get_bucket_encryption_input.rs index f2683ee2e23c..d06f3a840f6c 100644 --- a/sdk/s3/src/operation/get_bucket_encryption/_get_bucket_encryption_input.rs +++ b/sdk/s3/src/operation/get_bucket_encryption/_get_bucket_encryption_input.rs @@ -4,16 +4,22 @@ #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] pub struct GetBucketEncryptionInput { ///

      The name of the bucket from which the server-side encryption configuration is retrieved.

      + ///

      Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide

      pub bucket: ::std::option::Option<::std::string::String>, - ///

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

      + ///

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

      + ///

      For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code 501 Not Implemented.

      + ///
      pub expected_bucket_owner: ::std::option::Option<::std::string::String>, } impl GetBucketEncryptionInput { ///

      The name of the bucket from which the server-side encryption configuration is retrieved.

      + ///

      Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide

      pub fn bucket(&self) -> ::std::option::Option<&str> { self.bucket.as_deref() } - ///

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

      + ///

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

      + ///

      For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code 501 Not Implemented.

      + ///
      pub fn expected_bucket_owner(&self) -> ::std::option::Option<&str> { self.expected_bucket_owner.as_deref() } @@ -34,31 +40,40 @@ pub struct GetBucketEncryptionInputBuilder { } impl GetBucketEncryptionInputBuilder { ///

      The name of the bucket from which the server-side encryption configuration is retrieved.

      + ///

      Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide

      /// This field is required. pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.bucket = ::std::option::Option::Some(input.into()); self } ///

      The name of the bucket from which the server-side encryption configuration is retrieved.

      + ///

      Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide

      pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.bucket = input; self } ///

      The name of the bucket from which the server-side encryption configuration is retrieved.

      + ///

      Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide

      pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> { &self.bucket } - ///

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

      + ///

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

      + ///

      For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code 501 Not Implemented.

      + ///
      pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.expected_bucket_owner = ::std::option::Option::Some(input.into()); self } - ///

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

      + ///

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

      + ///

      For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code 501 Not Implemented.

      + ///
      pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.expected_bucket_owner = input; self } - ///

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

      + ///

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

      + ///

      For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code 501 Not Implemented.

      + ///
      pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> { &self.expected_bucket_owner } diff --git a/sdk/s3/src/operation/get_bucket_encryption/builders.rs b/sdk/s3/src/operation/get_bucket_encryption/builders.rs index d298d8180368..8938a27e4fec 100644 --- a/sdk/s3/src/operation/get_bucket_encryption/builders.rs +++ b/sdk/s3/src/operation/get_bucket_encryption/builders.rs @@ -22,11 +22,33 @@ impl crate::operation::get_bucket_encryption::builders::GetBucketEncryptionInput } /// Fluent builder constructing a request to `GetBucketEncryption`. /// -/// -///

      This operation is not supported by directory buckets.

      +///

      Returns the default encryption configuration for an Amazon S3 bucket. By default, all buckets have a default encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3).

      +/// /// -///

      Returns the default encryption configuration for an Amazon S3 bucket. By default, all buckets have a default encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). For information about the bucket default encryption feature, see Amazon S3 Bucket Default Encryption in the Amazon S3 User Guide.

      -///

      To use this operation, you must have permission to perform the s3:GetEncryptionConfiguration action. The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Subresource Operations and Managing Access Permissions to Your Amazon S3 Resources.

      +///
      +///
      +/// Permissions +///
      +///
      +///
        +///
      • +///

        General purpose bucket permissions - The s3:GetEncryptionConfiguration permission is required in a policy. The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Operations and Managing Access Permissions to Your Amazon S3 Resources.

      • +///
      • +///

        Directory bucket permissions - To grant access to this API operation, you must have the s3express:GetEncryptionConfiguration permission in an IAM identity-based policy instead of a bucket policy. Cross-account access to this API operation isn't supported. This operation can only be performed by the Amazon Web Services account that owns the resource. For more information about directory bucket policies and permissions, see Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone in the Amazon S3 User Guide.

      • +///
      +///
      +///
      +/// HTTP Host header syntax +///
      +///
      +///

      Directory buckets - The HTTP Host header syntax is s3express-control.region.amazonaws.com.

      +///
      +///
      ///

      The following operations are related to GetBucketEncryption:

      ///
        ///
      • @@ -120,30 +142,39 @@ impl GetBucketEncryptionFluentBuilder { self } ///

        The name of the bucket from which the server-side encryption configuration is retrieved.

        + ///

        Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide

        pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.bucket(input.into()); self } ///

        The name of the bucket from which the server-side encryption configuration is retrieved.

        + ///

        Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide

        pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.inner = self.inner.set_bucket(input); self } ///

        The name of the bucket from which the server-side encryption configuration is retrieved.

        + ///

        Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide

        pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_bucket() } - ///

        The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

        + ///

        The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

        + ///

        For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code 501 Not Implemented.

        + ///
        pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.expected_bucket_owner(input.into()); self } - ///

        The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

        + ///

        The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

        + ///

        For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code 501 Not Implemented.

        + ///
        pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.inner = self.inner.set_expected_bucket_owner(input); self } - ///

        The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

        + ///

        The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

        + ///

        For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code 501 Not Implemented.

        + ///
        pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_expected_bucket_owner() } diff --git a/sdk/s3/src/operation/get_object/_get_object_input.rs b/sdk/s3/src/operation/get_object/_get_object_input.rs index 9ce1268adc0a..e283bf721678 100644 --- a/sdk/s3/src/operation/get_object/_get_object_input.rs +++ b/sdk/s3/src/operation/get_object/_get_object_input.rs @@ -109,7 +109,7 @@ pub struct GetObjectInput { ///

        The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

        pub expected_bucket_owner: ::std::option::Option<::std::string::String>, ///

        To retrieve the checksum, this mode must be enabled.

        - ///

        In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

        + ///

        General purpose buckets - In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

        pub checksum_mode: ::std::option::Option, } impl GetObjectInput { @@ -259,7 +259,7 @@ impl GetObjectInput { self.expected_bucket_owner.as_deref() } ///

        To retrieve the checksum, this mode must be enabled.

        - ///

        In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

        + ///

        General purpose buckets - In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

        pub fn checksum_mode(&self) -> ::std::option::Option<&crate::types::ChecksumMode> { self.checksum_mode.as_ref() } @@ -803,19 +803,19 @@ impl GetObjectInputBuilder { &self.expected_bucket_owner } ///

        To retrieve the checksum, this mode must be enabled.

        - ///

        In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

        + ///

        General purpose buckets - In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

        pub fn checksum_mode(mut self, input: crate::types::ChecksumMode) -> Self { self.checksum_mode = ::std::option::Option::Some(input); self } ///

        To retrieve the checksum, this mode must be enabled.

        - ///

        In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

        + ///

        General purpose buckets - In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

        pub fn set_checksum_mode(mut self, input: ::std::option::Option) -> Self { self.checksum_mode = input; self } ///

        To retrieve the checksum, this mode must be enabled.

        - ///

        In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

        + ///

        General purpose buckets - In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

        pub fn get_checksum_mode(&self) -> &::std::option::Option { &self.checksum_mode } diff --git a/sdk/s3/src/operation/get_object/_get_object_output.rs b/sdk/s3/src/operation/get_object/_get_object_output.rs index 4df773009189..08db7a04425c 100644 --- a/sdk/s3/src/operation/get_object/_get_object_output.rs +++ b/sdk/s3/src/operation/get_object/_get_object_output.rs @@ -62,9 +62,7 @@ pub struct GetObjectOutput { ///

        This functionality is not supported for directory buckets.

        /// pub website_redirect_location: ::std::option::Option<::std::string::String>, - ///

        The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

        - ///

        For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

        - ///
        + ///

        The server-side encryption algorithm used when you store this object in Amazon S3.

        pub server_side_encryption: ::std::option::Option, ///

        A map of metadata to store with the object in S3.

        pub metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, @@ -76,13 +74,9 @@ pub struct GetObjectOutput { ///

        This functionality is not supported for directory buckets.

        /// pub sse_customer_key_md5: ::std::option::Option<::std::string::String>, - ///

        If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        If present, indicates the ID of the KMS key that was used for object encryption.

        pub ssekms_key_id: ::std::option::Option<::std::string::String>, - ///

        Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

        pub bucket_key_enabled: ::std::option::Option, ///

        Provides storage class information of the object. Amazon S3 returns this header for all objects except for S3 Standard storage class objects.

        ///

        Directory buckets - Only the S3 Express One Zone storage class is supported by directory buckets to store objects.

        @@ -226,9 +220,7 @@ impl GetObjectOutput { pub fn website_redirect_location(&self) -> ::std::option::Option<&str> { self.website_redirect_location.as_deref() } - ///

        The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

        - ///

        For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

        - ///
        + ///

        The server-side encryption algorithm used when you store this object in Amazon S3.

        pub fn server_side_encryption(&self) -> ::std::option::Option<&crate::types::ServerSideEncryption> { self.server_side_encryption.as_ref() } @@ -248,15 +240,11 @@ impl GetObjectOutput { pub fn sse_customer_key_md5(&self) -> ::std::option::Option<&str> { self.sse_customer_key_md5.as_deref() } - ///

        If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        If present, indicates the ID of the KMS key that was used for object encryption.

        pub fn ssekms_key_id(&self) -> ::std::option::Option<&str> { self.ssekms_key_id.as_deref() } - ///

        Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

        pub fn bucket_key_enabled(&self) -> ::std::option::Option { self.bucket_key_enabled } @@ -772,23 +760,17 @@ impl GetObjectOutputBuilder { pub fn get_website_redirect_location(&self) -> &::std::option::Option<::std::string::String> { &self.website_redirect_location } - ///

        The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

        - ///

        For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

        - ///
        + ///

        The server-side encryption algorithm used when you store this object in Amazon S3.

        pub fn server_side_encryption(mut self, input: crate::types::ServerSideEncryption) -> Self { self.server_side_encryption = ::std::option::Option::Some(input); self } - ///

        The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

        - ///

        For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

        - ///
        + ///

        The server-side encryption algorithm used when you store this object in Amazon S3.

        pub fn set_server_side_encryption(mut self, input: ::std::option::Option) -> Self { self.server_side_encryption = input; self } - ///

        The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

        - ///

        For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

        - ///
        + ///

        The server-side encryption algorithm used when you store this object in Amazon S3.

        pub fn get_server_side_encryption(&self) -> &::std::option::Option { &self.server_side_encryption } @@ -852,43 +834,31 @@ impl GetObjectOutputBuilder { pub fn get_sse_customer_key_md5(&self) -> &::std::option::Option<::std::string::String> { &self.sse_customer_key_md5 } - ///

        If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        If present, indicates the ID of the KMS key that was used for object encryption.

        pub fn ssekms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.ssekms_key_id = ::std::option::Option::Some(input.into()); self } - ///

        If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        If present, indicates the ID of the KMS key that was used for object encryption.

        pub fn set_ssekms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.ssekms_key_id = input; self } - ///

        If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        If present, indicates the ID of the KMS key that was used for object encryption.

        pub fn get_ssekms_key_id(&self) -> &::std::option::Option<::std::string::String> { &self.ssekms_key_id } - ///

        Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

        pub fn bucket_key_enabled(mut self, input: bool) -> Self { self.bucket_key_enabled = ::std::option::Option::Some(input); self } - ///

        Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

        pub fn set_bucket_key_enabled(mut self, input: ::std::option::Option) -> Self { self.bucket_key_enabled = input; self } - ///

        Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

        pub fn get_bucket_key_enabled(&self) -> &::std::option::Option { &self.bucket_key_enabled } diff --git a/sdk/s3/src/operation/get_object/builders.rs b/sdk/s3/src/operation/get_object/builders.rs index 26801b9ce7b1..915145d960bd 100644 --- a/sdk/s3/src/operation/get_object/builders.rs +++ b/sdk/s3/src/operation/get_object/builders.rs @@ -44,7 +44,8 @@ impl crate::operation::get_object::builders::GetObjectInputBuilder { ///

        If you don’t have the s3:ListBucket permission, Amazon S3 returns an HTTP status code 403 Access Denied error.

      • ///
    • ///
    • -///

      Directory bucket permissions - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the s3express:CreateSession permission to the directory bucket in a bucket policy or an IAM identity-based policy. Then, you make the CreateSession API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another CreateSession API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession .

    • +///

      Directory bucket permissions - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the s3express:CreateSession permission to the directory bucket in a bucket policy or an IAM identity-based policy. Then, you make the CreateSession API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another CreateSession API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession .

      +///

      If the object is encrypted using SSE-KMS, you must also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies and KMS key policies for the KMS key.

      ///
    /// ///
    @@ -59,6 +60,7 @@ impl crate::operation::get_object::builders::GetObjectInputBuilder { ///
    ///
    ///

    Encryption request headers, like x-amz-server-side-encryption, should not be sent for the GetObject requests, if your object uses server-side encryption with Amazon S3 managed encryption keys (SSE-S3), server-side encryption with Key Management Service (KMS) keys (SSE-KMS), or dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS). If you include the header in your GetObject requests for the object that uses these types of keys, you’ll get an HTTP 400 Bad Request error.

    +///

    Directory buckets - For directory buckets, there are only two supported options for server-side encryption: SSE-S3 and SSE-KMS. SSE-C isn't supported. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide.

    ///
    ///
    /// Overriding response header values through the request @@ -706,19 +708,19 @@ impl GetObjectFluentBuilder { self.inner.get_expected_bucket_owner() } ///

    To retrieve the checksum, this mode must be enabled.

    - ///

    In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    General purpose buckets - In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    pub fn checksum_mode(mut self, input: crate::types::ChecksumMode) -> Self { self.inner = self.inner.checksum_mode(input); self } ///

    To retrieve the checksum, this mode must be enabled.

    - ///

    In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    General purpose buckets - In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    pub fn set_checksum_mode(mut self, input: ::std::option::Option) -> Self { self.inner = self.inner.set_checksum_mode(input); self } ///

    To retrieve the checksum, this mode must be enabled.

    - ///

    In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    General purpose buckets - In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    pub fn get_checksum_mode(&self) -> &::std::option::Option { self.inner.get_checksum_mode() } diff --git a/sdk/s3/src/operation/get_object_attributes/builders.rs b/sdk/s3/src/operation/get_object_attributes/builders.rs index 91c3553ae15e..0aaf782340d5 100644 --- a/sdk/s3/src/operation/get_object_attributes/builders.rs +++ b/sdk/s3/src/operation/get_object_attributes/builders.rs @@ -33,7 +33,7 @@ impl crate::operation::get_object_attributes::builders::GetObjectAttributesInput ///
    ///
      ///
    • -///

      General purpose bucket permissions - To use GetObjectAttributes, you must have READ access to the object. The permissions that you need to use this operation with depend on whether the bucket is versioned. If the bucket is versioned, you need both the s3:GetObjectVersion and s3:GetObjectVersionAttributes permissions for this operation. If the bucket is not versioned, you need the s3:GetObject and s3:GetObjectAttributes permissions. For more information, see Specifying Permissions in a Policy in the Amazon S3 User Guide. If the object that you request does not exist, the error Amazon S3 returns depends on whether you also have the s3:ListBucket permission.

      +///

      General purpose bucket permissions - To use GetObjectAttributes, you must have READ access to the object. The permissions that you need to use this operation depend on whether the bucket is versioned. If the bucket is versioned, you need both the s3:GetObjectVersion and s3:GetObjectVersionAttributes permissions for this operation. If the bucket is not versioned, you need the s3:GetObject and s3:GetObjectAttributes permissions. For more information, see Specifying Permissions in a Policy in the Amazon S3 User Guide. If the object that you request does not exist, the error Amazon S3 returns depends on whether you also have the s3:ListBucket permission.

      ///
        ///
      • ///

        If you have the s3:ListBucket permission on the bucket, Amazon S3 returns an HTTP status code 404 Not Found ("no such key") error.

      • @@ -41,7 +41,8 @@ impl crate::operation::get_object_attributes::builders::GetObjectAttributesInput ///

        If you don't have the s3:ListBucket permission, Amazon S3 returns an HTTP status code 403 Forbidden ("access denied") error.

        ///
    • ///
    • -///

      Directory bucket permissions - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the s3express:CreateSession permission to the directory bucket in a bucket policy or an IAM identity-based policy. Then, you make the CreateSession API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another CreateSession API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession .

    • +///

      Directory bucket permissions - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the s3express:CreateSession permission to the directory bucket in a bucket policy or an IAM identity-based policy. Then, you make the CreateSession API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another CreateSession API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession .

      +///

      If the object is encrypted with SSE-KMS, you must also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies and KMS key policies for the KMS key.

      ///
    ///
    ///
    @@ -61,7 +62,7 @@ impl crate::operation::get_object_attributes::builders::GetObjectAttributesInput ///

    x-amz-server-side-encryption-customer-key-MD5

    /// ///

    For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided Encryption Keys) in the Amazon S3 User Guide.

    -///

    Directory bucket permissions - For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

    +///

    Directory bucket permissions - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

    ///
    /// ///
    diff --git a/sdk/s3/src/operation/head_object/_head_object_input.rs b/sdk/s3/src/operation/head_object/_head_object_input.rs index 591030fff0ea..7bbdebf4dfcc 100644 --- a/sdk/s3/src/operation/head_object/_head_object_input.rs +++ b/sdk/s3/src/operation/head_object/_head_object_input.rs @@ -95,7 +95,8 @@ pub struct HeadObjectInput { ///

    The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

    pub expected_bucket_owner: ::std::option::Option<::std::string::String>, ///

    To retrieve the checksum, this parameter must be enabled.

    - ///

    In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    General purpose buckets - If you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    Directory buckets - If you enable ChecksumMode and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies and KMS key policies for the KMS key to retrieve the checksum of the object.

    pub checksum_mode: ::std::option::Option, } impl HeadObjectInput { @@ -231,7 +232,8 @@ impl HeadObjectInput { self.expected_bucket_owner.as_deref() } ///

    To retrieve the checksum, this parameter must be enabled.

    - ///

    In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    General purpose buckets - If you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    Directory buckets - If you enable ChecksumMode and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies and KMS key policies for the KMS key to retrieve the checksum of the object.

    pub fn checksum_mode(&self) -> ::std::option::Option<&crate::types::ChecksumMode> { self.checksum_mode.as_ref() } @@ -733,19 +735,22 @@ impl HeadObjectInputBuilder { &self.expected_bucket_owner } ///

    To retrieve the checksum, this parameter must be enabled.

    - ///

    In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    General purpose buckets - If you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    Directory buckets - If you enable ChecksumMode and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies and KMS key policies for the KMS key to retrieve the checksum of the object.

    pub fn checksum_mode(mut self, input: crate::types::ChecksumMode) -> Self { self.checksum_mode = ::std::option::Option::Some(input); self } ///

    To retrieve the checksum, this parameter must be enabled.

    - ///

    In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    General purpose buckets - If you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    Directory buckets - If you enable ChecksumMode and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies and KMS key policies for the KMS key to retrieve the checksum of the object.

    pub fn set_checksum_mode(mut self, input: ::std::option::Option) -> Self { self.checksum_mode = input; self } ///

    To retrieve the checksum, this parameter must be enabled.

    - ///

    In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    General purpose buckets - If you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    Directory buckets - If you enable ChecksumMode and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies and KMS key policies for the KMS key to retrieve the checksum of the object.

    pub fn get_checksum_mode(&self) -> &::std::option::Option { &self.checksum_mode } diff --git a/sdk/s3/src/operation/head_object/_head_object_output.rs b/sdk/s3/src/operation/head_object/_head_object_output.rs index 299cc02729da..f741b3ee5625 100644 --- a/sdk/s3/src/operation/head_object/_head_object_output.rs +++ b/sdk/s3/src/operation/head_object/_head_object_output.rs @@ -61,9 +61,7 @@ pub struct HeadObjectOutput { ///

    This functionality is not supported for directory buckets.

    /// pub website_redirect_location: ::std::option::Option<::std::string::String>, - ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

    - ///

    For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

    - ///
    + ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

    pub server_side_encryption: ::std::option::Option, ///

    A map of metadata to store with the object in S3.

    pub metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, @@ -75,13 +73,9 @@ pub struct HeadObjectOutput { ///

    This functionality is not supported for directory buckets.

    /// pub sse_customer_key_md5: ::std::option::Option<::std::string::String>, - ///

    If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    If present, indicates the ID of the KMS key that was used for object encryption.

    pub ssekms_key_id: ::std::option::Option<::std::string::String>, - ///

    Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    pub bucket_key_enabled: ::std::option::Option, ///

    Provides storage class information of the object. Amazon S3 returns this header for all objects except for S3 Standard storage class objects.

    ///

    For more information, see Storage Classes.

    @@ -228,9 +222,7 @@ impl HeadObjectOutput { pub fn website_redirect_location(&self) -> ::std::option::Option<&str> { self.website_redirect_location.as_deref() } - ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

    - ///

    For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

    - ///
    + ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

    pub fn server_side_encryption(&self) -> ::std::option::Option<&crate::types::ServerSideEncryption> { self.server_side_encryption.as_ref() } @@ -250,15 +242,11 @@ impl HeadObjectOutput { pub fn sse_customer_key_md5(&self) -> ::std::option::Option<&str> { self.sse_customer_key_md5.as_deref() } - ///

    If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    If present, indicates the ID of the KMS key that was used for object encryption.

    pub fn ssekms_key_id(&self) -> ::std::option::Option<&str> { self.ssekms_key_id.as_deref() } - ///

    Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    pub fn bucket_key_enabled(&self) -> ::std::option::Option { self.bucket_key_enabled } @@ -761,23 +749,17 @@ impl HeadObjectOutputBuilder { pub fn get_website_redirect_location(&self) -> &::std::option::Option<::std::string::String> { &self.website_redirect_location } - ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

    - ///

    For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

    - ///
    + ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

    pub fn server_side_encryption(mut self, input: crate::types::ServerSideEncryption) -> Self { self.server_side_encryption = ::std::option::Option::Some(input); self } - ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

    - ///

    For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

    - ///
    + ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

    pub fn set_server_side_encryption(mut self, input: ::std::option::Option) -> Self { self.server_side_encryption = input; self } - ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

    - ///

    For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

    - ///
    + ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

    pub fn get_server_side_encryption(&self) -> &::std::option::Option { &self.server_side_encryption } @@ -841,43 +823,31 @@ impl HeadObjectOutputBuilder { pub fn get_sse_customer_key_md5(&self) -> &::std::option::Option<::std::string::String> { &self.sse_customer_key_md5 } - ///

    If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    If present, indicates the ID of the KMS key that was used for object encryption.

    pub fn ssekms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.ssekms_key_id = ::std::option::Option::Some(input.into()); self } - ///

    If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    If present, indicates the ID of the KMS key that was used for object encryption.

    pub fn set_ssekms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.ssekms_key_id = input; self } - ///

    If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    If present, indicates the ID of the KMS key that was used for object encryption.

    pub fn get_ssekms_key_id(&self) -> &::std::option::Option<::std::string::String> { &self.ssekms_key_id } - ///

    Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    pub fn bucket_key_enabled(mut self, input: bool) -> Self { self.bucket_key_enabled = ::std::option::Option::Some(input); self } - ///

    Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    pub fn set_bucket_key_enabled(mut self, input: ::std::option::Option) -> Self { self.bucket_key_enabled = input; self } - ///

    Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Indicates whether the object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    pub fn get_bucket_key_enabled(&self) -> &::std::option::Option { &self.bucket_key_enabled } diff --git a/sdk/s3/src/operation/head_object/builders.rs b/sdk/s3/src/operation/head_object/builders.rs index 1b55a00aa176..ea0f1cceb757 100644 --- a/sdk/s3/src/operation/head_object/builders.rs +++ b/sdk/s3/src/operation/head_object/builders.rs @@ -43,7 +43,8 @@ impl crate::operation::head_object::builders::HeadObjectInputBuilder { ///

    If you don’t have the s3:ListBucket permission, Amazon S3 returns an HTTP status code 403 Forbidden error.

    /// ///
  • -///

    Directory bucket permissions - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the s3express:CreateSession permission to the directory bucket in a bucket policy or an IAM identity-based policy. Then, you make the CreateSession API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another CreateSession API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession .

  • +///

    Directory bucket permissions - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the s3express:CreateSession permission to the directory bucket in a bucket policy or an IAM identity-based policy. Then, you make the CreateSession API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another CreateSession API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession .

    +///

    If you enable x-amz-checksum-mode in the request and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies and KMS key policies for the KMS key to retrieve the checksum of the object.

    /// /// ///
    @@ -63,7 +64,7 @@ impl crate::operation::head_object::builders::HeadObjectInputBuilder { ///

    x-amz-server-side-encryption-customer-key-MD5

    /// ///

    For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided Encryption Keys) in the Amazon S3 User Guide.

    -///

    Directory bucket permissions - For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

    +///

    Directory bucket - For directory buckets, there are only two supported options for server-side encryption: SSE-S3 and SSE-KMS. SSE-C isn't supported. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide.

    ///
    /// ///
    @@ -671,19 +672,22 @@ impl HeadObjectFluentBuilder { self.inner.get_expected_bucket_owner() } ///

    To retrieve the checksum, this parameter must be enabled.

    - ///

    In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    General purpose buckets - If you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    Directory buckets - If you enable ChecksumMode and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies and KMS key policies for the KMS key to retrieve the checksum of the object.

    pub fn checksum_mode(mut self, input: crate::types::ChecksumMode) -> Self { self.inner = self.inner.checksum_mode(input); self } ///

    To retrieve the checksum, this parameter must be enabled.

    - ///

    In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    General purpose buckets - If you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    Directory buckets - If you enable ChecksumMode and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies and KMS key policies for the KMS key to retrieve the checksum of the object.

    pub fn set_checksum_mode(mut self, input: ::std::option::Option) -> Self { self.inner = self.inner.set_checksum_mode(input); self } ///

    To retrieve the checksum, this parameter must be enabled.

    - ///

    In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    General purpose buckets - If you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    Directory buckets - If you enable ChecksumMode and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies and KMS key policies for the KMS key to retrieve the checksum of the object.

    pub fn get_checksum_mode(&self) -> &::std::option::Option { self.inner.get_checksum_mode() } diff --git a/sdk/s3/src/operation/put_bucket_encryption/_put_bucket_encryption_input.rs b/sdk/s3/src/operation/put_bucket_encryption/_put_bucket_encryption_input.rs index af9a1f562581..3cbb4f9ae7b4 100644 --- a/sdk/s3/src/operation/put_bucket_encryption/_put_bucket_encryption_input.rs +++ b/sdk/s3/src/operation/put_bucket_encryption/_put_bucket_encryption_input.rs @@ -3,31 +3,43 @@ #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] pub struct PutBucketEncryptionInput { - ///

    Specifies default encryption for a bucket using server-side encryption with different key options. By default, all buckets have a default encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). You can optionally configure default encryption for a bucket by using server-side encryption with an Amazon Web Services KMS key (SSE-KMS) or a customer-provided key (SSE-C). For information about the bucket default encryption feature, see Amazon S3 Bucket Default Encryption in the Amazon S3 User Guide.

    + ///

    Specifies default encryption for a bucket using server-side encryption with different key options.

    + ///

    Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide

    pub bucket: ::std::option::Option<::std::string::String>, ///

    The base64-encoded 128-bit MD5 digest of the server-side encryption configuration.

    - ///

    For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

    + ///

    For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

    + ///

    This functionality is not supported for directory buckets.

    + ///
    pub content_md5: ::std::option::Option<::std::string::String>, ///

    Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - ///

    If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.

    + ///

    If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.

    + ///

    For directory buckets, when you use Amazon Web Services SDKs, CRC32 is the default checksum algorithm that's used for performance.

    + ///
    pub checksum_algorithm: ::std::option::Option, ///

    Specifies the default server-side-encryption configuration.

    pub server_side_encryption_configuration: ::std::option::Option, - ///

    The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

    + ///

    The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

    + ///

    For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code 501 Not Implemented.

    + ///
    pub expected_bucket_owner: ::std::option::Option<::std::string::String>, } impl PutBucketEncryptionInput { - ///

    Specifies default encryption for a bucket using server-side encryption with different key options. By default, all buckets have a default encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). You can optionally configure default encryption for a bucket by using server-side encryption with an Amazon Web Services KMS key (SSE-KMS) or a customer-provided key (SSE-C). For information about the bucket default encryption feature, see Amazon S3 Bucket Default Encryption in the Amazon S3 User Guide.

    + ///

    Specifies default encryption for a bucket using server-side encryption with different key options.

    + ///

    Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide

    pub fn bucket(&self) -> ::std::option::Option<&str> { self.bucket.as_deref() } ///

    The base64-encoded 128-bit MD5 digest of the server-side encryption configuration.

    - ///

    For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

    + ///

    For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

    + ///

    This functionality is not supported for directory buckets.

    + ///
    pub fn content_md5(&self) -> ::std::option::Option<&str> { self.content_md5.as_deref() } ///

    Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - ///

    If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.

    + ///

    If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.

    + ///

    For directory buckets, when you use Amazon Web Services SDKs, CRC32 is the default checksum algorithm that's used for performance.

    + ///
    pub fn checksum_algorithm(&self) -> ::std::option::Option<&crate::types::ChecksumAlgorithm> { self.checksum_algorithm.as_ref() } @@ -35,7 +47,9 @@ impl PutBucketEncryptionInput { pub fn server_side_encryption_configuration(&self) -> ::std::option::Option<&crate::types::ServerSideEncryptionConfiguration> { self.server_side_encryption_configuration.as_ref() } - ///

    The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

    + ///

    The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

    + ///

    For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code 501 Not Implemented.

    + ///
    pub fn expected_bucket_owner(&self) -> ::std::option::Option<&str> { self.expected_bucket_owner.as_deref() } @@ -58,52 +72,67 @@ pub struct PutBucketEncryptionInputBuilder { pub(crate) expected_bucket_owner: ::std::option::Option<::std::string::String>, } impl PutBucketEncryptionInputBuilder { - ///

    Specifies default encryption for a bucket using server-side encryption with different key options. By default, all buckets have a default encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). You can optionally configure default encryption for a bucket by using server-side encryption with an Amazon Web Services KMS key (SSE-KMS) or a customer-provided key (SSE-C). For information about the bucket default encryption feature, see Amazon S3 Bucket Default Encryption in the Amazon S3 User Guide.

    + ///

    Specifies default encryption for a bucket using server-side encryption with different key options.

    + ///

    Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide

    /// This field is required. pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.bucket = ::std::option::Option::Some(input.into()); self } - ///

    Specifies default encryption for a bucket using server-side encryption with different key options. By default, all buckets have a default encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). You can optionally configure default encryption for a bucket by using server-side encryption with an Amazon Web Services KMS key (SSE-KMS) or a customer-provided key (SSE-C). For information about the bucket default encryption feature, see Amazon S3 Bucket Default Encryption in the Amazon S3 User Guide.

    + ///

    Specifies default encryption for a bucket using server-side encryption with different key options.

    + ///

    Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide

    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.bucket = input; self } - ///

    Specifies default encryption for a bucket using server-side encryption with different key options. By default, all buckets have a default encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). You can optionally configure default encryption for a bucket by using server-side encryption with an Amazon Web Services KMS key (SSE-KMS) or a customer-provided key (SSE-C). For information about the bucket default encryption feature, see Amazon S3 Bucket Default Encryption in the Amazon S3 User Guide.

    + ///

    Specifies default encryption for a bucket using server-side encryption with different key options.

    + ///

    Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide

    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> { &self.bucket } ///

    The base64-encoded 128-bit MD5 digest of the server-side encryption configuration.

    - ///

    For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

    + ///

    For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

    + ///

    This functionality is not supported for directory buckets.

    + ///
    pub fn content_md5(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.content_md5 = ::std::option::Option::Some(input.into()); self } ///

    The base64-encoded 128-bit MD5 digest of the server-side encryption configuration.

    - ///

    For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

    + ///

    For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

    + ///

    This functionality is not supported for directory buckets.

    + ///
    pub fn set_content_md5(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.content_md5 = input; self } ///

    The base64-encoded 128-bit MD5 digest of the server-side encryption configuration.

    - ///

    For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

    + ///

    For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

    + ///

    This functionality is not supported for directory buckets.

    + ///
    pub fn get_content_md5(&self) -> &::std::option::Option<::std::string::String> { &self.content_md5 } ///

    Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - ///

    If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.

    + ///

    If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.

    + ///

    For directory buckets, when you use Amazon Web Services SDKs, CRC32 is the default checksum algorithm that's used for performance.

    + ///
    pub fn checksum_algorithm(mut self, input: crate::types::ChecksumAlgorithm) -> Self { self.checksum_algorithm = ::std::option::Option::Some(input); self } ///

    Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - ///

    If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.

    + ///

    If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.

    + ///

    For directory buckets, when you use Amazon Web Services SDKs, CRC32 is the default checksum algorithm that's used for performance.

    + ///
    pub fn set_checksum_algorithm(mut self, input: ::std::option::Option) -> Self { self.checksum_algorithm = input; self } ///

    Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.

    - ///

    If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.

    + ///

    If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.

    + ///

    For directory buckets, when you use Amazon Web Services SDKs, CRC32 is the default checksum algorithm that's used for performance.

    + ///
    pub fn get_checksum_algorithm(&self) -> &::std::option::Option { &self.checksum_algorithm } @@ -122,17 +151,23 @@ impl PutBucketEncryptionInputBuilder { pub fn get_server_side_encryption_configuration(&self) -> &::std::option::Option { &self.server_side_encryption_configuration } - ///

    The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

    + ///

    The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

    + ///

    For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code 501 Not Implemented.

    + ///
    pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.expected_bucket_owner = ::std::option::Option::Some(input.into()); self } - ///

    The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

    + ///

    The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

    + ///

    For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code 501 Not Implemented.

    + ///
    pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.expected_bucket_owner = input; self } - ///

    The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

    + ///

    The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

    + ///

    For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code 501 Not Implemented.

    + ///
    pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> { &self.expected_bucket_owner } diff --git a/sdk/s3/src/operation/put_bucket_encryption/builders.rs b/sdk/s3/src/operation/put_bucket_encryption/builders.rs index 465db9bb9c24..0f50eaecd12e 100644 --- a/sdk/s3/src/operation/put_bucket_encryption/builders.rs +++ b/sdk/s3/src/operation/put_bucket_encryption/builders.rs @@ -22,15 +22,58 @@ impl crate::operation::put_bucket_encryption::builders::PutBucketEncryptionInput } /// Fluent builder constructing a request to `PutBucketEncryption`. /// -/// -///

    This operation is not supported by directory buckets.

    +///

    This operation configures default encryption and Amazon S3 Bucket Keys for an existing bucket.

    +///

    Directory buckets - For directory buckets, you must make requests for this API operation to the Regional endpoint. These endpoints support path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. For more information, see Regional and Zonal endpoints in the Amazon S3 User Guide.

    ///
    -///

    This action uses the encryption subresource to configure default encryption and Amazon S3 Bucket Keys for an existing bucket.

    -///

    By default, all buckets have a default encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). You can optionally configure default encryption for a bucket by using server-side encryption with Key Management Service (KMS) keys (SSE-KMS) or dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS). If you specify default encryption by using SSE-KMS, you can also configure Amazon S3 Bucket Keys. If you use PutBucketEncryption to set your default bucket encryption to SSE-KMS, you should verify that your KMS key ID is correct. Amazon S3 does not validate the KMS key ID provided in PutBucketEncryption requests.

    +///

    By default, all buckets have a default encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3).

    +///
      +///
    • +///

      General purpose buckets

      +///
        +///
      • +///

        You can optionally configure default encryption for a bucket by using server-side encryption with Key Management Service (KMS) keys (SSE-KMS) or dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS). If you specify default encryption by using SSE-KMS, you can also configure Amazon S3 Bucket Keys. For information about the bucket default encryption feature, see Amazon S3 Bucket Default Encryption in the Amazon S3 User Guide.

      • +///
      • +///

        If you use PutBucketEncryption to set your default bucket encryption to SSE-KMS, you should verify that your KMS key ID is correct. Amazon S3 doesn't validate the KMS key ID provided in PutBucketEncryption requests.

      • +///
    • +///
    • +///

      Directory buckets - You can optionally configure default encryption for a bucket by using server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

      +///
        +///
      • +///

        We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

      • +///
      • +///

        Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

      • +///
      • +///

        S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

      • +///
      • +///

        When you specify an KMS customer managed key for encryption in your directory bucket, only use the key ID or key ARN. The key alias format of the KMS key isn't supported.

      • +///
      • +///

        For directory buckets, if you use PutBucketEncryption to set your default bucket encryption to SSE-KMS, Amazon S3 validates the KMS key ID provided in PutBucketEncryption requests.

      • +///
    • +///
    +///
    ///

    If you're specifying a customer managed KMS key, we recommend using a fully qualified KMS key ARN. If you use a KMS key alias instead, then KMS resolves the key within the requester’s account. This behavior can result in data that's encrypted with a KMS key that belongs to the requester, and not the bucket owner.

    ///

    Also, this action requires Amazon Web Services Signature Version 4. For more information, see Authenticating Requests (Amazon Web Services Signature Version 4).

    ///
    -///

    To use this operation, you must have permission to perform the s3:PutEncryptionConfiguration action. The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Subresource Operations and Managing Access Permissions to Your Amazon S3 Resources in the Amazon S3 User Guide.

    +///
    +///
    +/// Permissions +///
    +///
    +///
      +///
    • +///

      General purpose bucket permissions - The s3:PutEncryptionConfiguration permission is required in a policy. The bucket owner has this permission by default. The bucket owner can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Operations and Managing Access Permissions to Your Amazon S3 Resources in the Amazon S3 User Guide.

    • +///
    • +///

      Directory bucket permissions - To grant access to this API operation, you must have the s3express:PutEncryptionConfiguration permission in an IAM identity-based policy instead of a bucket policy. Cross-account access to this API operation isn't supported. This operation can only be performed by the Amazon Web Services account that owns the resource. For more information about directory bucket policies and permissions, see Amazon Web Services Identity and Access Management (IAM) for S3 Express One Zone in the Amazon S3 User Guide.

      +///

      To set a directory bucket default encryption with SSE-KMS, you must also have the kms:GenerateDataKey and the kms:Decrypt permissions in IAM identity-based policies and KMS key policies for the target KMS key.

    • +///
    +///
    +///
    +/// HTTP Host header syntax +///
    +///
    +///

    Directory buckets - The HTTP Host header syntax is s3express-control.region.amazonaws.com.

    +///
    +///
    ///

    The following operations are related to PutBucketEncryption:

    ///
      ///
    • @@ -123,51 +166,66 @@ impl PutBucketEncryptionFluentBuilder { self.config_override = config_override; self } - ///

      Specifies default encryption for a bucket using server-side encryption with different key options. By default, all buckets have a default encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). You can optionally configure default encryption for a bucket by using server-side encryption with an Amazon Web Services KMS key (SSE-KMS) or a customer-provided key (SSE-C). For information about the bucket default encryption feature, see Amazon S3 Bucket Default Encryption in the Amazon S3 User Guide.

      + ///

      Specifies default encryption for a bucket using server-side encryption with different key options.

      + ///

      Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide

      pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.bucket(input.into()); self } - ///

      Specifies default encryption for a bucket using server-side encryption with different key options. By default, all buckets have a default encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). You can optionally configure default encryption for a bucket by using server-side encryption with an Amazon Web Services KMS key (SSE-KMS) or a customer-provided key (SSE-C). For information about the bucket default encryption feature, see Amazon S3 Bucket Default Encryption in the Amazon S3 User Guide.

      + ///

      Specifies default encryption for a bucket using server-side encryption with different key options.

      + ///

      Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide

      pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.inner = self.inner.set_bucket(input); self } - ///

      Specifies default encryption for a bucket using server-side encryption with different key options. By default, all buckets have a default encryption configuration that uses server-side encryption with Amazon S3 managed keys (SSE-S3). You can optionally configure default encryption for a bucket by using server-side encryption with an Amazon Web Services KMS key (SSE-KMS) or a customer-provided key (SSE-C). For information about the bucket default encryption feature, see Amazon S3 Bucket Default Encryption in the Amazon S3 User Guide.

      + ///

      Specifies default encryption for a bucket using server-side encryption with different key options.

      + ///

      Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control.region_code.amazonaws.com/bucket-name . Virtual-hosted-style requests aren't supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must also follow the format bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). For information about bucket naming restrictions, see Directory bucket naming rules in the Amazon S3 User Guide

      pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_bucket() } ///

      The base64-encoded 128-bit MD5 digest of the server-side encryption configuration.

      - ///

      For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

      + ///

      For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

      + ///

      This functionality is not supported for directory buckets.

      + ///
      pub fn content_md5(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.content_md5(input.into()); self } ///

      The base64-encoded 128-bit MD5 digest of the server-side encryption configuration.

      - ///

      For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

      + ///

      For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

      + ///

      This functionality is not supported for directory buckets.

      + ///
      pub fn set_content_md5(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.inner = self.inner.set_content_md5(input); self } ///

      The base64-encoded 128-bit MD5 digest of the server-side encryption configuration.

      - ///

      For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

      + ///

      For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

      + ///

      This functionality is not supported for directory buckets.

      + ///
      pub fn get_content_md5(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_content_md5() } ///

      Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.

      - ///

      If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.

      + ///

      If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.

      + ///

      For directory buckets, when you use Amazon Web Services SDKs, CRC32 is the default checksum algorithm that's used for performance.

      + ///
      pub fn checksum_algorithm(mut self, input: crate::types::ChecksumAlgorithm) -> Self { self.inner = self.inner.checksum_algorithm(input); self } ///

      Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.

      - ///

      If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.

      + ///

      If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.

      + ///

      For directory buckets, when you use Amazon Web Services SDKs, CRC32 is the default checksum algorithm that's used for performance.

      + ///
      pub fn set_checksum_algorithm(mut self, input: ::std::option::Option) -> Self { self.inner = self.inner.set_checksum_algorithm(input); self } ///

      Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.

      - ///

      If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.

      + ///

      If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.

      + ///

      For directory buckets, when you use Amazon Web Services SDKs, CRC32 is the default checksum algorithm that's used for performance.

      + ///
      pub fn get_checksum_algorithm(&self) -> &::std::option::Option { self.inner.get_checksum_algorithm() } @@ -185,17 +243,23 @@ impl PutBucketEncryptionFluentBuilder { pub fn get_server_side_encryption_configuration(&self) -> &::std::option::Option { self.inner.get_server_side_encryption_configuration() } - ///

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

      + ///

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

      + ///

      For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code 501 Not Implemented.

      + ///
      pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.expected_bucket_owner(input.into()); self } - ///

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

      + ///

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

      + ///

      For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code 501 Not Implemented.

      + ///
      pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.inner = self.inner.set_expected_bucket_owner(input); self } - ///

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

      + ///

      The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

      + ///

      For directory buckets, this header is not supported in this API operation. If you specify this header, the request fails with the HTTP status code 501 Not Implemented.

      + ///
      pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_expected_bucket_owner() } diff --git a/sdk/s3/src/operation/put_object/_put_object_input.rs b/sdk/s3/src/operation/put_object/_put_object_input.rs index 91268b5b58fb..cef1a756e31a 100644 --- a/sdk/s3/src/operation/put_object/_put_object_input.rs +++ b/sdk/s3/src/operation/put_object/_put_object_input.rs @@ -113,8 +113,15 @@ pub struct PutObjectInput { ///

      A map of metadata to store with the object in S3.

      pub metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>, ///

      The server-side encryption algorithm that was used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

      - ///

      General purpose buckets - You have four mutually exclusive options to protect data using server-side encryption in Amazon S3, depending on how you choose to manage the encryption keys. Specifically, the encryption key options are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or DSSE-KMS), and customer-provided keys (SSE-C). Amazon S3 encrypts data with server-side encryption by using Amazon S3 managed keys (SSE-S3) by default. You can optionally tell Amazon S3 to encrypt data at rest by using server-side encryption with other key options. For more information, see Using Server-Side Encryption in the Amazon S3 User Guide.

      - ///

      Directory buckets - For directory buckets, only the server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) value is supported.

      + ///
        + ///
      • + ///

        General purpose buckets - You have four mutually exclusive options to protect data using server-side encryption in Amazon S3, depending on how you choose to manage the encryption keys. Specifically, the encryption key options are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or DSSE-KMS), and customer-provided keys (SSE-C). Amazon S3 encrypts data with server-side encryption by using Amazon S3 managed keys (SSE-S3) by default. You can optionally tell Amazon S3 to encrypt data at rest by using server-side encryption with other key options. For more information, see Using Server-Side Encryption in the Amazon S3 User Guide.

      • + ///
      • + ///

        Directory buckets - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

        + ///

        In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the CreateSession request. You can't override the values of the encryption settings (x-amz-server-side-encryption, x-amz-server-side-encryption-aws-kms-key-id, x-amz-server-side-encryption-context, and x-amz-server-side-encryption-bucket-key-enabled) that are specified in the CreateSession request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the CreateSession request to protect new objects in the directory bucket.

        + ///

        When you use the CLI or the Amazon Web Services SDKs, for CreateSession, the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the CreateSession request. It's not supported to override the encryption settings values in the CreateSession request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket.

        + ///
      • + ///
      pub server_side_encryption: ::std::option::Option, ///

      By default, Amazon S3 uses the STANDARD Storage Class to store newly created objects. The STANDARD storage class provides high durability and high availability. Depending on performance needs, you can specify a different Storage Class. For more information, see Storage Classes in the Amazon S3 User Guide.

      ///
        @@ -146,18 +153,17 @@ pub struct PutObjectInput { ///

        This functionality is not supported for directory buckets.

        /// pub sse_customer_key_md5: ::std::option::Option<::std::string::String>, - ///

        If x-amz-server-side-encryption has a valid value of aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object. If you specify x-amz-server-side-encryption:aws:kms or x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key (aws/s3) to protect the data. If the KMS key does not exist in the same account that's issuing the command, you must use the full ARN and not just the ID.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID.

        + ///

        General purpose buckets - If you specify x-amz-server-side-encryption with aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key to use. If you specify x-amz-server-side-encryption:aws:kms or x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key (aws/s3) to protect the data.

        + ///

        Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

        pub ssekms_key_id: ::std::option::Option<::std::string::String>, - ///

        Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject or CopyObject operations on this object. This value must be explicitly added during CopyObject operations.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

        + ///

        General purpose buckets - This value must be explicitly added during CopyObject operations if you want an additional encryption context for your object. For more information, see Encryption context in the Amazon S3 User Guide.

        + ///

        Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

        pub ssekms_encryption_context: ::std::option::Option<::std::string::String>, - ///

        Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.

        - ///

        Specifying this header with a PUT action doesn’t affect bucket-level settings for S3 Bucket Key.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS).

        + ///

        General purpose buckets - Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key.

        + ///

        Directory buckets - S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

        pub bucket_key_enabled: ::std::option::Option, ///

        Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for corresponding charges to copy the object. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.

        ///

        This functionality is not supported for directory buckets.

        @@ -340,8 +346,15 @@ impl PutObjectInput { self.metadata.as_ref() } ///

        The server-side encryption algorithm that was used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

        - ///

        General purpose buckets - You have four mutually exclusive options to protect data using server-side encryption in Amazon S3, depending on how you choose to manage the encryption keys. Specifically, the encryption key options are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or DSSE-KMS), and customer-provided keys (SSE-C). Amazon S3 encrypts data with server-side encryption by using Amazon S3 managed keys (SSE-S3) by default. You can optionally tell Amazon S3 to encrypt data at rest by using server-side encryption with other key options. For more information, see Using Server-Side Encryption in the Amazon S3 User Guide.

        - ///

        Directory buckets - For directory buckets, only the server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) value is supported.

        + ///
          + ///
        • + ///

          General purpose buckets - You have four mutually exclusive options to protect data using server-side encryption in Amazon S3, depending on how you choose to manage the encryption keys. Specifically, the encryption key options are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or DSSE-KMS), and customer-provided keys (SSE-C). Amazon S3 encrypts data with server-side encryption by using Amazon S3 managed keys (SSE-S3) by default. You can optionally tell Amazon S3 to encrypt data at rest by using server-side encryption with other key options. For more information, see Using Server-Side Encryption in the Amazon S3 User Guide.

        • + ///
        • + ///

          Directory buckets - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

          + ///

          In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the CreateSession request. You can't override the values of the encryption settings (x-amz-server-side-encryption, x-amz-server-side-encryption-aws-kms-key-id, x-amz-server-side-encryption-context, and x-amz-server-side-encryption-bucket-key-enabled) that are specified in the CreateSession request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the CreateSession request to protect new objects in the directory bucket.

          + ///

          When you use the CLI or the Amazon Web Services SDKs, for CreateSession, the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the CreateSession request. It's not supported to override the encryption settings values in the CreateSession request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket.

          + ///
        • + ///
        pub fn server_side_encryption(&self) -> ::std::option::Option<&crate::types::ServerSideEncryption> { self.server_side_encryption.as_ref() } @@ -385,22 +398,21 @@ impl PutObjectInput { pub fn sse_customer_key_md5(&self) -> ::std::option::Option<&str> { self.sse_customer_key_md5.as_deref() } - ///

        If x-amz-server-side-encryption has a valid value of aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object. If you specify x-amz-server-side-encryption:aws:kms or x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key (aws/s3) to protect the data. If the KMS key does not exist in the same account that's issuing the command, you must use the full ARN and not just the ID.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID.

        + ///

        General purpose buckets - If you specify x-amz-server-side-encryption with aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key to use. If you specify x-amz-server-side-encryption:aws:kms or x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key (aws/s3) to protect the data.

        + ///

        Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

        pub fn ssekms_key_id(&self) -> ::std::option::Option<&str> { self.ssekms_key_id.as_deref() } - ///

        Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject or CopyObject operations on this object. This value must be explicitly added during CopyObject operations.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

        + ///

        General purpose buckets - This value must be explicitly added during CopyObject operations if you want an additional encryption context for your object. For more information, see Encryption context in the Amazon S3 User Guide.

        + ///

        Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

        pub fn ssekms_encryption_context(&self) -> ::std::option::Option<&str> { self.ssekms_encryption_context.as_deref() } - ///

        Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.

        - ///

        Specifying this header with a PUT action doesn’t affect bucket-level settings for S3 Bucket Key.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS).

        + ///

        General purpose buckets - Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key.

        + ///

        Directory buckets - S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

        pub fn bucket_key_enabled(&self) -> ::std::option::Option { self.bucket_key_enabled } @@ -1057,22 +1069,43 @@ impl PutObjectInputBuilder { &self.metadata } ///

        The server-side encryption algorithm that was used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

        - ///

        General purpose buckets - You have four mutually exclusive options to protect data using server-side encryption in Amazon S3, depending on how you choose to manage the encryption keys. Specifically, the encryption key options are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or DSSE-KMS), and customer-provided keys (SSE-C). Amazon S3 encrypts data with server-side encryption by using Amazon S3 managed keys (SSE-S3) by default. You can optionally tell Amazon S3 to encrypt data at rest by using server-side encryption with other key options. For more information, see Using Server-Side Encryption in the Amazon S3 User Guide.

        - ///

        Directory buckets - For directory buckets, only the server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) value is supported.

        + ///
          + ///
        • + ///

          General purpose buckets - You have four mutually exclusive options to protect data using server-side encryption in Amazon S3, depending on how you choose to manage the encryption keys. Specifically, the encryption key options are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or DSSE-KMS), and customer-provided keys (SSE-C). Amazon S3 encrypts data with server-side encryption by using Amazon S3 managed keys (SSE-S3) by default. You can optionally tell Amazon S3 to encrypt data at rest by using server-side encryption with other key options. For more information, see Using Server-Side Encryption in the Amazon S3 User Guide.

        • + ///
        • + ///

          Directory buckets - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

          + ///

          In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the CreateSession request. You can't override the values of the encryption settings (x-amz-server-side-encryption, x-amz-server-side-encryption-aws-kms-key-id, x-amz-server-side-encryption-context, and x-amz-server-side-encryption-bucket-key-enabled) that are specified in the CreateSession request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the CreateSession request to protect new objects in the directory bucket.

          + ///

          When you use the CLI or the Amazon Web Services SDKs, for CreateSession, the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the CreateSession request. It's not supported to override the encryption settings values in the CreateSession request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket.

          + ///
        • + ///
        pub fn server_side_encryption(mut self, input: crate::types::ServerSideEncryption) -> Self { self.server_side_encryption = ::std::option::Option::Some(input); self } ///

        The server-side encryption algorithm that was used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

        - ///

        General purpose buckets - You have four mutually exclusive options to protect data using server-side encryption in Amazon S3, depending on how you choose to manage the encryption keys. Specifically, the encryption key options are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or DSSE-KMS), and customer-provided keys (SSE-C). Amazon S3 encrypts data with server-side encryption by using Amazon S3 managed keys (SSE-S3) by default. You can optionally tell Amazon S3 to encrypt data at rest by using server-side encryption with other key options. For more information, see Using Server-Side Encryption in the Amazon S3 User Guide.

        - ///

        Directory buckets - For directory buckets, only the server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) value is supported.

        + ///
          + ///
        • + ///

          General purpose buckets - You have four mutually exclusive options to protect data using server-side encryption in Amazon S3, depending on how you choose to manage the encryption keys. Specifically, the encryption key options are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or DSSE-KMS), and customer-provided keys (SSE-C). Amazon S3 encrypts data with server-side encryption by using Amazon S3 managed keys (SSE-S3) by default. You can optionally tell Amazon S3 to encrypt data at rest by using server-side encryption with other key options. For more information, see Using Server-Side Encryption in the Amazon S3 User Guide.

        • + ///
        • + ///

          Directory buckets - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

          + ///

          In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the CreateSession request. You can't override the values of the encryption settings (x-amz-server-side-encryption, x-amz-server-side-encryption-aws-kms-key-id, x-amz-server-side-encryption-context, and x-amz-server-side-encryption-bucket-key-enabled) that are specified in the CreateSession request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the CreateSession request to protect new objects in the directory bucket.

          + ///

          When you use the CLI or the Amazon Web Services SDKs, for CreateSession, the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the CreateSession request. It's not supported to override the encryption settings values in the CreateSession request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket.

          + ///
        • + ///
        pub fn set_server_side_encryption(mut self, input: ::std::option::Option) -> Self { self.server_side_encryption = input; self } ///

        The server-side encryption algorithm that was used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

        - ///

        General purpose buckets - You have four mutually exclusive options to protect data using server-side encryption in Amazon S3, depending on how you choose to manage the encryption keys. Specifically, the encryption key options are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or DSSE-KMS), and customer-provided keys (SSE-C). Amazon S3 encrypts data with server-side encryption by using Amazon S3 managed keys (SSE-S3) by default. You can optionally tell Amazon S3 to encrypt data at rest by using server-side encryption with other key options. For more information, see Using Server-Side Encryption in the Amazon S3 User Guide.

        - ///

        Directory buckets - For directory buckets, only the server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) value is supported.

        + ///
          + ///
        • + ///

          General purpose buckets - You have four mutually exclusive options to protect data using server-side encryption in Amazon S3, depending on how you choose to manage the encryption keys. Specifically, the encryption key options are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or DSSE-KMS), and customer-provided keys (SSE-C). Amazon S3 encrypts data with server-side encryption by using Amazon S3 managed keys (SSE-S3) by default. You can optionally tell Amazon S3 to encrypt data at rest by using server-side encryption with other key options. For more information, see Using Server-Side Encryption in the Amazon S3 User Guide.

        • + ///
        • + ///

          Directory buckets - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

          + ///

          In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the CreateSession request. You can't override the values of the encryption settings (x-amz-server-side-encryption, x-amz-server-side-encryption-aws-kms-key-id, x-amz-server-side-encryption-context, and x-amz-server-side-encryption-bucket-key-enabled) that are specified in the CreateSession request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the CreateSession request to protect new objects in the directory bucket.

          + ///

          When you use the CLI or the Amazon Web Services SDKs, for CreateSession, the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the CreateSession request. It's not supported to override the encryption settings values in the CreateSession request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket.

          + ///
        • + ///
        pub fn get_server_side_encryption(&self) -> &::std::option::Option { &self.server_side_encryption } @@ -1206,66 +1239,63 @@ impl PutObjectInputBuilder { pub fn get_sse_customer_key_md5(&self) -> &::std::option::Option<::std::string::String> { &self.sse_customer_key_md5 } - ///

        If x-amz-server-side-encryption has a valid value of aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object. If you specify x-amz-server-side-encryption:aws:kms or x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key (aws/s3) to protect the data. If the KMS key does not exist in the same account that's issuing the command, you must use the full ARN and not just the ID.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID.

        + ///

        General purpose buckets - If you specify x-amz-server-side-encryption with aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key to use. If you specify x-amz-server-side-encryption:aws:kms or x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key (aws/s3) to protect the data.

        + ///

        Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

        pub fn ssekms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.ssekms_key_id = ::std::option::Option::Some(input.into()); self } - ///

        If x-amz-server-side-encryption has a valid value of aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object. If you specify x-amz-server-side-encryption:aws:kms or x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key (aws/s3) to protect the data. If the KMS key does not exist in the same account that's issuing the command, you must use the full ARN and not just the ID.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID.

        + ///

        General purpose buckets - If you specify x-amz-server-side-encryption with aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key to use. If you specify x-amz-server-side-encryption:aws:kms or x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key (aws/s3) to protect the data.

        + ///

        Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

        pub fn set_ssekms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.ssekms_key_id = input; self } - ///

        If x-amz-server-side-encryption has a valid value of aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object. If you specify x-amz-server-side-encryption:aws:kms or x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key (aws/s3) to protect the data. If the KMS key does not exist in the same account that's issuing the command, you must use the full ARN and not just the ID.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID.

        + ///

        General purpose buckets - If you specify x-amz-server-side-encryption with aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key to use. If you specify x-amz-server-side-encryption:aws:kms or x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key (aws/s3) to protect the data.

        + ///

        Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

        pub fn get_ssekms_key_id(&self) -> &::std::option::Option<::std::string::String> { &self.ssekms_key_id } - ///

        Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject or CopyObject operations on this object. This value must be explicitly added during CopyObject operations.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

        + ///

        General purpose buckets - This value must be explicitly added during CopyObject operations if you want an additional encryption context for your object. For more information, see Encryption context in the Amazon S3 User Guide.

        + ///

        Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

        pub fn ssekms_encryption_context(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.ssekms_encryption_context = ::std::option::Option::Some(input.into()); self } - ///

        Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject or CopyObject operations on this object. This value must be explicitly added during CopyObject operations.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

        + ///

        General purpose buckets - This value must be explicitly added during CopyObject operations if you want an additional encryption context for your object. For more information, see Encryption context in the Amazon S3 User Guide.

        + ///

        Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

        pub fn set_ssekms_encryption_context(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.ssekms_encryption_context = input; self } - ///

        Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject or CopyObject operations on this object. This value must be explicitly added during CopyObject operations.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

        + ///

        General purpose buckets - This value must be explicitly added during CopyObject operations if you want an additional encryption context for your object. For more information, see Encryption context in the Amazon S3 User Guide.

        + ///

        Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

        pub fn get_ssekms_encryption_context(&self) -> &::std::option::Option<::std::string::String> { &self.ssekms_encryption_context } - ///

        Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.

        - ///

        Specifying this header with a PUT action doesn’t affect bucket-level settings for S3 Bucket Key.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS).

        + ///

        General purpose buckets - Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key.

        + ///

        Directory buckets - S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

        pub fn bucket_key_enabled(mut self, input: bool) -> Self { self.bucket_key_enabled = ::std::option::Option::Some(input); self } - ///

        Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.

        - ///

        Specifying this header with a PUT action doesn’t affect bucket-level settings for S3 Bucket Key.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS).

        + ///

        General purpose buckets - Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key.

        + ///

        Directory buckets - S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

        pub fn set_bucket_key_enabled(mut self, input: ::std::option::Option) -> Self { self.bucket_key_enabled = input; self } - ///

        Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.

        - ///

        Specifying this header with a PUT action doesn’t affect bucket-level settings for S3 Bucket Key.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS).

        + ///

        General purpose buckets - Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key.

        + ///

        Directory buckets - S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

        pub fn get_bucket_key_enabled(&self) -> &::std::option::Option { &self.bucket_key_enabled } diff --git a/sdk/s3/src/operation/put_object/_put_object_output.rs b/sdk/s3/src/operation/put_object/_put_object_output.rs index 84a0c9ec6618..868df40dd577 100644 --- a/sdk/s3/src/operation/put_object/_put_object_output.rs +++ b/sdk/s3/src/operation/put_object/_put_object_output.rs @@ -19,9 +19,7 @@ pub struct PutObjectOutput { pub checksum_sha1: ::std::option::Option<::std::string::String>, ///

        The base64-encoded, 256-bit SHA-256 digest of the object. This will only be present if it was uploaded with the object. When you use an API operation on an object that was uploaded using multipart uploads, this value may not be a direct checksum value of the full object. Instead, it's a calculation based on the checksum values of each individual part. For more information about how checksums are calculated with multipart uploads, see Checking object integrity in the Amazon S3 User Guide.

        pub checksum_sha256: ::std::option::Option<::std::string::String>, - ///

        The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

        - ///

        For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

        - ///
        + ///

        The server-side encryption algorithm used when you store this object in Amazon S3.

        pub server_side_encryption: ::std::option::Option, ///

        Version ID of the object.

        ///

        If you enable versioning for a bucket, Amazon S3 automatically generates a unique version ID for the object being stored. Amazon S3 returns this ID in the response. When you enable versioning for a bucket, if Amazon S3 receives multiple write requests for the same object simultaneously, it stores all of the objects. For more information about versioning, see Adding Objects to Versioning-Enabled Buckets in the Amazon S3 User Guide. For information about returning the versioning state of a bucket, see GetBucketVersioning.

        @@ -36,17 +34,11 @@ pub struct PutObjectOutput { ///

        This functionality is not supported for directory buckets.

        ///
        pub sse_customer_key_md5: ::std::option::Option<::std::string::String>, - ///

        If x-amz-server-side-encryption has a valid value of aws:kms or aws:kms:dsse, this header indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        If present, indicates the ID of the KMS key that was used for object encryption.

        pub ssekms_key_id: ::std::option::Option<::std::string::String>, - ///

        If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject or CopyObject operations on this object.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

        pub ssekms_encryption_context: ::std::option::Option<::std::string::String>, - ///

        Indicates whether the uploaded object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        Indicates whether the uploaded object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

        pub bucket_key_enabled: ::std::option::Option, ///

        If present, indicates that the requester was successfully charged for the request.

        ///

        This functionality is not supported for directory buckets.

        @@ -84,9 +76,7 @@ impl PutObjectOutput { pub fn checksum_sha256(&self) -> ::std::option::Option<&str> { self.checksum_sha256.as_deref() } - ///

        The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

        - ///

        For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

        - ///
        + ///

        The server-side encryption algorithm used when you store this object in Amazon S3.

        pub fn server_side_encryption(&self) -> ::std::option::Option<&crate::types::ServerSideEncryption> { self.server_side_encryption.as_ref() } @@ -109,21 +99,15 @@ impl PutObjectOutput { pub fn sse_customer_key_md5(&self) -> ::std::option::Option<&str> { self.sse_customer_key_md5.as_deref() } - ///

        If x-amz-server-side-encryption has a valid value of aws:kms or aws:kms:dsse, this header indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        If present, indicates the ID of the KMS key that was used for object encryption.

        pub fn ssekms_key_id(&self) -> ::std::option::Option<&str> { self.ssekms_key_id.as_deref() } - ///

        If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject or CopyObject operations on this object.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

        pub fn ssekms_encryption_context(&self) -> ::std::option::Option<&str> { self.ssekms_encryption_context.as_deref() } - ///

        Indicates whether the uploaded object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        Indicates whether the uploaded object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

        pub fn bucket_key_enabled(&self) -> ::std::option::Option { self.bucket_key_enabled } @@ -291,23 +275,17 @@ impl PutObjectOutputBuilder { pub fn get_checksum_sha256(&self) -> &::std::option::Option<::std::string::String> { &self.checksum_sha256 } - ///

        The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

        - ///

        For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

        - ///
        + ///

        The server-side encryption algorithm used when you store this object in Amazon S3.

        pub fn server_side_encryption(mut self, input: crate::types::ServerSideEncryption) -> Self { self.server_side_encryption = ::std::option::Option::Some(input); self } - ///

        The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

        - ///

        For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

        - ///
        + ///

        The server-side encryption algorithm used when you store this object in Amazon S3.

        pub fn set_server_side_encryption(mut self, input: ::std::option::Option) -> Self { self.server_side_encryption = input; self } - ///

        The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

        - ///

        For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

        - ///
        + ///

        The server-side encryption algorithm used when you store this object in Amazon S3.

        pub fn get_server_side_encryption(&self) -> &::std::option::Option { &self.server_side_encryption } @@ -374,63 +352,45 @@ impl PutObjectOutputBuilder { pub fn get_sse_customer_key_md5(&self) -> &::std::option::Option<::std::string::String> { &self.sse_customer_key_md5 } - ///

        If x-amz-server-side-encryption has a valid value of aws:kms or aws:kms:dsse, this header indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        If present, indicates the ID of the KMS key that was used for object encryption.

        pub fn ssekms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.ssekms_key_id = ::std::option::Option::Some(input.into()); self } - ///

        If x-amz-server-side-encryption has a valid value of aws:kms or aws:kms:dsse, this header indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        If present, indicates the ID of the KMS key that was used for object encryption.

        pub fn set_ssekms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.ssekms_key_id = input; self } - ///

        If x-amz-server-side-encryption has a valid value of aws:kms or aws:kms:dsse, this header indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        If present, indicates the ID of the KMS key that was used for object encryption.

        pub fn get_ssekms_key_id(&self) -> &::std::option::Option<::std::string::String> { &self.ssekms_key_id } - ///

        If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject or CopyObject operations on this object.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

        pub fn ssekms_encryption_context(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.ssekms_encryption_context = ::std::option::Option::Some(input.into()); self } - ///

        If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject or CopyObject operations on this object.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

        pub fn set_ssekms_encryption_context(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.ssekms_encryption_context = input; self } - ///

        If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject or CopyObject operations on this object.

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        If present, indicates the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

        pub fn get_ssekms_encryption_context(&self) -> &::std::option::Option<::std::string::String> { &self.ssekms_encryption_context } - ///

        Indicates whether the uploaded object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        Indicates whether the uploaded object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

        pub fn bucket_key_enabled(mut self, input: bool) -> Self { self.bucket_key_enabled = ::std::option::Option::Some(input); self } - ///

        Indicates whether the uploaded object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        Indicates whether the uploaded object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

        pub fn set_bucket_key_enabled(mut self, input: ::std::option::Option) -> Self { self.bucket_key_enabled = input; self } - ///

        Indicates whether the uploaded object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

        - ///

        This functionality is not supported for directory buckets.

        - ///
        + ///

        Indicates whether the uploaded object uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

        pub fn get_bucket_key_enabled(&self) -> &::std::option::Option { &self.bucket_key_enabled } diff --git a/sdk/s3/src/operation/put_object/builders.rs b/sdk/s3/src/operation/put_object/builders.rs index 994c7d497946..f5a8ae076928 100644 --- a/sdk/s3/src/operation/put_object/builders.rs +++ b/sdk/s3/src/operation/put_object/builders.rs @@ -60,7 +60,8 @@ impl crate::operation::put_object::builders::PutObjectInputBuilder { ///

        s3:PutObjectTagging - To successfully set the tag-set with your PutObject request, you must have the s3:PutObjectTagging.

        ///
    • ///
    • -///

      Directory bucket permissions - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the s3express:CreateSession permission to the directory bucket in a bucket policy or an IAM identity-based policy. Then, you make the CreateSession API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another CreateSession API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession .

    • +///

      Directory bucket permissions - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the s3express:CreateSession permission to the directory bucket in a bucket policy or an IAM identity-based policy. Then, you make the CreateSession API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another CreateSession API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession .

      +///

      If the object is encrypted with SSE-KMS, you must also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies and KMS key policies for the KMS key.

      ///
    /// ///
    @@ -739,22 +740,43 @@ impl PutObjectFluentBuilder { self.inner.get_metadata() } ///

    The server-side encryption algorithm that was used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

    - ///

    General purpose buckets - You have four mutually exclusive options to protect data using server-side encryption in Amazon S3, depending on how you choose to manage the encryption keys. Specifically, the encryption key options are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or DSSE-KMS), and customer-provided keys (SSE-C). Amazon S3 encrypts data with server-side encryption by using Amazon S3 managed keys (SSE-S3) by default. You can optionally tell Amazon S3 to encrypt data at rest by using server-side encryption with other key options. For more information, see Using Server-Side Encryption in the Amazon S3 User Guide.

    - ///

    Directory buckets - For directory buckets, only the server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) value is supported.

    + ///
      + ///
    • + ///

      General purpose buckets - You have four mutually exclusive options to protect data using server-side encryption in Amazon S3, depending on how you choose to manage the encryption keys. Specifically, the encryption key options are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or DSSE-KMS), and customer-provided keys (SSE-C). Amazon S3 encrypts data with server-side encryption by using Amazon S3 managed keys (SSE-S3) by default. You can optionally tell Amazon S3 to encrypt data at rest by using server-side encryption with other key options. For more information, see Using Server-Side Encryption in the Amazon S3 User Guide.

    • + ///
    • + ///

      Directory buckets - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

      + ///

      In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the CreateSession request. You can't override the values of the encryption settings (x-amz-server-side-encryption, x-amz-server-side-encryption-aws-kms-key-id, x-amz-server-side-encryption-context, and x-amz-server-side-encryption-bucket-key-enabled) that are specified in the CreateSession request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the CreateSession request to protect new objects in the directory bucket.

      + ///

      When you use the CLI or the Amazon Web Services SDKs, for CreateSession, the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the CreateSession request. It's not supported to override the encryption settings values in the CreateSession request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket.

      + ///
    • + ///
    pub fn server_side_encryption(mut self, input: crate::types::ServerSideEncryption) -> Self { self.inner = self.inner.server_side_encryption(input); self } ///

    The server-side encryption algorithm that was used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

    - ///

    General purpose buckets - You have four mutually exclusive options to protect data using server-side encryption in Amazon S3, depending on how you choose to manage the encryption keys. Specifically, the encryption key options are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or DSSE-KMS), and customer-provided keys (SSE-C). Amazon S3 encrypts data with server-side encryption by using Amazon S3 managed keys (SSE-S3) by default. You can optionally tell Amazon S3 to encrypt data at rest by using server-side encryption with other key options. For more information, see Using Server-Side Encryption in the Amazon S3 User Guide.

    - ///

    Directory buckets - For directory buckets, only the server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) value is supported.

    + ///
      + ///
    • + ///

      General purpose buckets - You have four mutually exclusive options to protect data using server-side encryption in Amazon S3, depending on how you choose to manage the encryption keys. Specifically, the encryption key options are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or DSSE-KMS), and customer-provided keys (SSE-C). Amazon S3 encrypts data with server-side encryption by using Amazon S3 managed keys (SSE-S3) by default. You can optionally tell Amazon S3 to encrypt data at rest by using server-side encryption with other key options. For more information, see Using Server-Side Encryption in the Amazon S3 User Guide.

    • + ///
    • + ///

      Directory buckets - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

      + ///

      In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the CreateSession request. You can't override the values of the encryption settings (x-amz-server-side-encryption, x-amz-server-side-encryption-aws-kms-key-id, x-amz-server-side-encryption-context, and x-amz-server-side-encryption-bucket-key-enabled) that are specified in the CreateSession request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the CreateSession request to protect new objects in the directory bucket.

      + ///

      When you use the CLI or the Amazon Web Services SDKs, for CreateSession, the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the CreateSession request. It's not supported to override the encryption settings values in the CreateSession request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket.

      + ///
    • + ///
    pub fn set_server_side_encryption(mut self, input: ::std::option::Option) -> Self { self.inner = self.inner.set_server_side_encryption(input); self } ///

    The server-side encryption algorithm that was used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

    - ///

    General purpose buckets - You have four mutually exclusive options to protect data using server-side encryption in Amazon S3, depending on how you choose to manage the encryption keys. Specifically, the encryption key options are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or DSSE-KMS), and customer-provided keys (SSE-C). Amazon S3 encrypts data with server-side encryption by using Amazon S3 managed keys (SSE-S3) by default. You can optionally tell Amazon S3 to encrypt data at rest by using server-side encryption with other key options. For more information, see Using Server-Side Encryption in the Amazon S3 User Guide.

    - ///

    Directory buckets - For directory buckets, only the server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) value is supported.

    + ///
      + ///
    • + ///

      General purpose buckets - You have four mutually exclusive options to protect data using server-side encryption in Amazon S3, depending on how you choose to manage the encryption keys. Specifically, the encryption key options are Amazon S3 managed keys (SSE-S3), Amazon Web Services KMS keys (SSE-KMS or DSSE-KMS), and customer-provided keys (SSE-C). Amazon S3 encrypts data with server-side encryption by using Amazon S3 managed keys (SSE-S3) by default. You can optionally tell Amazon S3 to encrypt data at rest by using server-side encryption with other key options. For more information, see Using Server-Side Encryption in the Amazon S3 User Guide.

    • + ///
    • + ///

      Directory buckets - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). We recommend that the bucket's default encryption uses the desired encryption configuration and you don't override the bucket default encryption in your CreateSession requests or PUT object requests. Then, new objects are automatically encrypted with the desired encryption settings. For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide. For more information about the encryption overriding behaviors in directory buckets, see Specifying server-side encryption with KMS for new object uploads.

      + ///

      In the Zonal endpoint API calls (except CopyObject and UploadPartCopy) using the REST API, the encryption request headers must match the encryption settings that are specified in the CreateSession request. You can't override the values of the encryption settings (x-amz-server-side-encryption, x-amz-server-side-encryption-aws-kms-key-id, x-amz-server-side-encryption-context, and x-amz-server-side-encryption-bucket-key-enabled) that are specified in the CreateSession request. You don't need to explicitly specify these encryption settings values in Zonal endpoint API calls, and Amazon S3 will use the encryption settings values from the CreateSession request to protect new objects in the directory bucket.

      + ///

      When you use the CLI or the Amazon Web Services SDKs, for CreateSession, the session token refreshes automatically to avoid service interruptions when a session expires. The CLI or the Amazon Web Services SDKs use the bucket's default encryption configuration for the CreateSession request. It's not supported to override the encryption settings values in the CreateSession request. So in the Zonal endpoint API calls (except CopyObject and UploadPartCopy), the encryption request headers must match the default encryption configuration of the directory bucket.

      + ///
    • + ///
    pub fn get_server_side_encryption(&self) -> &::std::option::Option { self.inner.get_server_side_encryption() } @@ -888,66 +910,63 @@ impl PutObjectFluentBuilder { pub fn get_sse_customer_key_md5(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_sse_customer_key_md5() } - ///

    If x-amz-server-side-encryption has a valid value of aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object. If you specify x-amz-server-side-encryption:aws:kms or x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key (aws/s3) to protect the data. If the KMS key does not exist in the same account that's issuing the command, you must use the full ARN and not just the ID.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID.

    + ///

    General purpose buckets - If you specify x-amz-server-side-encryption with aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key to use. If you specify x-amz-server-side-encryption:aws:kms or x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key (aws/s3) to protect the data.

    + ///

    Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

    pub fn ssekms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.ssekms_key_id(input.into()); self } - ///

    If x-amz-server-side-encryption has a valid value of aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object. If you specify x-amz-server-side-encryption:aws:kms or x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key (aws/s3) to protect the data. If the KMS key does not exist in the same account that's issuing the command, you must use the full ARN and not just the ID.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID.

    + ///

    General purpose buckets - If you specify x-amz-server-side-encryption with aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key to use. If you specify x-amz-server-side-encryption:aws:kms or x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key (aws/s3) to protect the data.

    + ///

    Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

    pub fn set_ssekms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.inner = self.inner.set_ssekms_key_id(input); self } - ///

    If x-amz-server-side-encryption has a valid value of aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object. If you specify x-amz-server-side-encryption:aws:kms or x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key (aws/s3) to protect the data. If the KMS key does not exist in the same account that's issuing the command, you must use the full ARN and not just the ID.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Specifies the KMS key ID (Key ID, Key ARN, or Key Alias) to use for object encryption. If the KMS key doesn't exist in the same account that's issuing the command, you must use the full Key ARN not the Key ID.

    + ///

    General purpose buckets - If you specify x-amz-server-side-encryption with aws:kms or aws:kms:dsse, this header specifies the ID (Key ID, Key ARN, or Key Alias) of the KMS key to use. If you specify x-amz-server-side-encryption:aws:kms or x-amz-server-side-encryption:aws:kms:dsse, but do not provide x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon Web Services managed key (aws/s3) to protect the data.

    + ///

    Directory buckets - If you specify x-amz-server-side-encryption with aws:kms, you must specify the x-amz-server-side-encryption-aws-kms-key-id header with the ID (Key ID or Key ARN) of the KMS symmetric encryption customer managed key to use. Otherwise, you get an HTTP 400 Bad Request error. Only use the key ID or key ARN. The key alias format of the KMS key isn't supported. Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

    pub fn get_ssekms_key_id(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_ssekms_key_id() } - ///

    Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject or CopyObject operations on this object. This value must be explicitly added during CopyObject operations.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

    + ///

    General purpose buckets - This value must be explicitly added during CopyObject operations if you want an additional encryption context for your object. For more information, see Encryption context in the Amazon S3 User Guide.

    + ///

    Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

    pub fn ssekms_encryption_context(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.ssekms_encryption_context(input.into()); self } - ///

    Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject or CopyObject operations on this object. This value must be explicitly added during CopyObject operations.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

    + ///

    General purpose buckets - This value must be explicitly added during CopyObject operations if you want an additional encryption context for your object. For more information, see Encryption context in the Amazon S3 User Guide.

    + ///

    Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

    pub fn set_ssekms_encryption_context(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.inner = self.inner.set_ssekms_encryption_context(input); self } - ///

    Specifies the Amazon Web Services KMS Encryption Context to use for object encryption. The value of this header is a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject or CopyObject operations on this object. This value must be explicitly added during CopyObject operations.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Specifies the Amazon Web Services KMS Encryption Context as an additional encryption context to use for object encryption. The value of this header is a Base64-encoded string of a UTF-8 encoded JSON, which contains the encryption context as key-value pairs. This value is stored as object metadata and automatically gets passed on to Amazon Web Services KMS for future GetObject operations on this object.

    + ///

    General purpose buckets - This value must be explicitly added during CopyObject operations if you want an additional encryption context for your object. For more information, see Encryption context in the Amazon S3 User Guide.

    + ///

    Directory buckets - You can optionally provide an explicit encryption context value. The value must match the default encryption context - the bucket Amazon Resource Name (ARN). An additional encryption context value is not supported.

    pub fn get_ssekms_encryption_context(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_ssekms_encryption_context() } - ///

    Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.

    - ///

    Specifying this header with a PUT action doesn’t affect bucket-level settings for S3 Bucket Key.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS).

    + ///

    General purpose buckets - Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key.

    + ///

    Directory buckets - S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

    pub fn bucket_key_enabled(mut self, input: bool) -> Self { self.inner = self.inner.bucket_key_enabled(input); self } - ///

    Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.

    - ///

    Specifying this header with a PUT action doesn’t affect bucket-level settings for S3 Bucket Key.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS).

    + ///

    General purpose buckets - Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key.

    + ///

    Directory buckets - S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

    pub fn set_bucket_key_enabled(mut self, input: ::std::option::Option) -> Self { self.inner = self.inner.set_bucket_key_enabled(input); self } - ///

    Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS). Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.

    - ///

    Specifying this header with a PUT action doesn’t affect bucket-level settings for S3 Bucket Key.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Key Management Service (KMS) keys (SSE-KMS).

    + ///

    General purpose buckets - Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS. Also, specifying this header with a PUT action doesn't affect bucket-level settings for S3 Bucket Key.

    + ///

    Directory buckets - S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

    pub fn get_bucket_key_enabled(&self) -> &::std::option::Option { self.inner.get_bucket_key_enabled() } diff --git a/sdk/s3/src/operation/upload_part/_upload_part_output.rs b/sdk/s3/src/operation/upload_part/_upload_part_output.rs index a35d39a8e760..4ae6860ad0d3 100644 --- a/sdk/s3/src/operation/upload_part/_upload_part_output.rs +++ b/sdk/s3/src/operation/upload_part/_upload_part_output.rs @@ -3,9 +3,7 @@ #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::PartialEq)] pub struct UploadPartOutput { - ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

    - ///

    For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

    - ///
    + ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

    pub server_side_encryption: ::std::option::Option, ///

    Entity tag for the uploaded object.

    pub e_tag: ::std::option::Option<::std::string::String>, @@ -25,13 +23,9 @@ pub struct UploadPartOutput { ///

    This functionality is not supported for directory buckets.

    /// pub sse_customer_key_md5: ::std::option::Option<::std::string::String>, - ///

    If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    If present, indicates the ID of the KMS key that was used for object encryption.

    pub ssekms_key_id: ::std::option::Option<::std::string::String>, - ///

    Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    pub bucket_key_enabled: ::std::option::Option, ///

    If present, indicates that the requester was successfully charged for the request.

    ///

    This functionality is not supported for directory buckets.

    @@ -41,9 +35,7 @@ pub struct UploadPartOutput { _request_id: Option, } impl UploadPartOutput { - ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

    - ///

    For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

    - ///
    + ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

    pub fn server_side_encryption(&self) -> ::std::option::Option<&crate::types::ServerSideEncryption> { self.server_side_encryption.as_ref() } @@ -79,15 +71,11 @@ impl UploadPartOutput { pub fn sse_customer_key_md5(&self) -> ::std::option::Option<&str> { self.sse_customer_key_md5.as_deref() } - ///

    If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    If present, indicates the ID of the KMS key that was used for object encryption.

    pub fn ssekms_key_id(&self) -> ::std::option::Option<&str> { self.ssekms_key_id.as_deref() } - ///

    Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    pub fn bucket_key_enabled(&self) -> ::std::option::Option { self.bucket_key_enabled } @@ -153,23 +141,17 @@ pub struct UploadPartOutputBuilder { _request_id: Option, } impl UploadPartOutputBuilder { - ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

    - ///

    For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

    - ///
    + ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

    pub fn server_side_encryption(mut self, input: crate::types::ServerSideEncryption) -> Self { self.server_side_encryption = ::std::option::Option::Some(input); self } - ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

    - ///

    For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

    - ///
    + ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

    pub fn set_server_side_encryption(mut self, input: ::std::option::Option) -> Self { self.server_side_encryption = input; self } - ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

    - ///

    For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

    - ///
    + ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

    pub fn get_server_side_encryption(&self) -> &::std::option::Option { &self.server_side_encryption } @@ -283,43 +265,31 @@ impl UploadPartOutputBuilder { pub fn get_sse_customer_key_md5(&self) -> &::std::option::Option<::std::string::String> { &self.sse_customer_key_md5 } - ///

    If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    If present, indicates the ID of the KMS key that was used for object encryption.

    pub fn ssekms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.ssekms_key_id = ::std::option::Option::Some(input.into()); self } - ///

    If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    If present, indicates the ID of the KMS key that was used for object encryption.

    pub fn set_ssekms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.ssekms_key_id = input; self } - ///

    If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    If present, indicates the ID of the KMS key that was used for object encryption.

    pub fn get_ssekms_key_id(&self) -> &::std::option::Option<::std::string::String> { &self.ssekms_key_id } - ///

    Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    pub fn bucket_key_enabled(mut self, input: bool) -> Self { self.bucket_key_enabled = ::std::option::Option::Some(input); self } - ///

    Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    pub fn set_bucket_key_enabled(mut self, input: ::std::option::Option) -> Self { self.bucket_key_enabled = input; self } - ///

    Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    pub fn get_bucket_key_enabled(&self) -> &::std::option::Option { &self.bucket_key_enabled } diff --git a/sdk/s3/src/operation/upload_part/builders.rs b/sdk/s3/src/operation/upload_part/builders.rs index 6cde42c05115..e26812a47bb2 100644 --- a/sdk/s3/src/operation/upload_part/builders.rs +++ b/sdk/s3/src/operation/upload_part/builders.rs @@ -43,7 +43,8 @@ impl crate::operation::upload_part::builders::UploadPartInputBuilder { ///

    General purpose bucket permissions - To perform a multipart upload with encryption using an Key Management Service key, the requester must have permission to the kms:Decrypt and kms:GenerateDataKey actions on the key. The requester must also have permissions for the kms:GenerateDataKey action for the CreateMultipartUpload API. Then, the requester needs permissions for the kms:Decrypt action on the UploadPart and UploadPartCopy APIs.

    ///

    These permissions are required because Amazon S3 must decrypt and read data from the encrypted file parts before it completes the multipart upload. For more information about KMS permissions, see Protecting data using server-side encryption with KMS in the Amazon S3 User Guide. For information about the permissions required to use the multipart upload API, see Multipart upload and permissions and Multipart upload API and permissions in the Amazon S3 User Guide.

    ///
  • -///

    Directory bucket permissions - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the s3express:CreateSession permission to the directory bucket in a bucket policy or an IAM identity-based policy. Then, you make the CreateSession API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another CreateSession API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession .

  • +///

    Directory bucket permissions - To grant access to this API operation on a directory bucket, we recommend that you use the CreateSession API operation for session-based authorization. Specifically, you grant the s3express:CreateSession permission to the directory bucket in a bucket policy or an IAM identity-based policy. Then, you make the CreateSession API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another CreateSession API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see CreateSession .

    +///

    If the object is encrypted with SSE-KMS, you must also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies and KMS key policies for the KMS key.

    /// /// ///
    @@ -70,11 +71,11 @@ impl crate::operation::upload_part::builders::UploadPartInputBuilder { ///

    x-amz-server-side-encryption-customer-key

    ///
  • ///

    x-amz-server-side-encryption-customer-key-MD5

  • -/// +/// +///

    For more information, see Using Server-Side Encryption in the Amazon S3 User Guide.

    ///
  • -///

    Directory bucket - For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

  • +///

    Directory buckets - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms).

    /// -///

    For more information, see Using Server-Side Encryption in the Amazon S3 User Guide.

    /// ///
    /// Special errors diff --git a/sdk/s3/src/operation/upload_part_copy/_upload_part_copy_output.rs b/sdk/s3/src/operation/upload_part_copy/_upload_part_copy_output.rs index 16ecc6e5f7c4..251ea2ecf3a3 100644 --- a/sdk/s3/src/operation/upload_part_copy/_upload_part_copy_output.rs +++ b/sdk/s3/src/operation/upload_part_copy/_upload_part_copy_output.rs @@ -9,9 +9,7 @@ pub struct UploadPartCopyOutput { pub copy_source_version_id: ::std::option::Option<::std::string::String>, ///

    Container for all response elements.

    pub copy_part_result: ::std::option::Option, - ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

    - ///

    For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

    - ///
    + ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

    pub server_side_encryption: ::std::option::Option, ///

    If server-side encryption with a customer-provided encryption key was requested, the response will include this header to confirm the encryption algorithm that's used.

    ///

    This functionality is not supported for directory buckets.

    @@ -21,13 +19,9 @@ pub struct UploadPartCopyOutput { ///

    This functionality is not supported for directory buckets.

    ///
    pub sse_customer_key_md5: ::std::option::Option<::std::string::String>, - ///

    If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    If present, indicates the ID of the KMS key that was used for object encryption.

    pub ssekms_key_id: ::std::option::Option<::std::string::String>, - ///

    Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    pub bucket_key_enabled: ::std::option::Option, ///

    If present, indicates that the requester was successfully charged for the request.

    ///

    This functionality is not supported for directory buckets.

    @@ -47,9 +41,7 @@ impl UploadPartCopyOutput { pub fn copy_part_result(&self) -> ::std::option::Option<&crate::types::CopyPartResult> { self.copy_part_result.as_ref() } - ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

    - ///

    For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

    - ///
    + ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

    pub fn server_side_encryption(&self) -> ::std::option::Option<&crate::types::ServerSideEncryption> { self.server_side_encryption.as_ref() } @@ -65,15 +57,11 @@ impl UploadPartCopyOutput { pub fn sse_customer_key_md5(&self) -> ::std::option::Option<&str> { self.sse_customer_key_md5.as_deref() } - ///

    If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    If present, indicates the ID of the KMS key that was used for object encryption.

    pub fn ssekms_key_id(&self) -> ::std::option::Option<&str> { self.ssekms_key_id.as_deref() } - ///

    Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    pub fn bucket_key_enabled(&self) -> ::std::option::Option { self.bucket_key_enabled } @@ -167,23 +155,17 @@ impl UploadPartCopyOutputBuilder { pub fn get_copy_part_result(&self) -> &::std::option::Option { &self.copy_part_result } - ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

    - ///

    For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

    - ///
    + ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

    pub fn server_side_encryption(mut self, input: crate::types::ServerSideEncryption) -> Self { self.server_side_encryption = ::std::option::Option::Some(input); self } - ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

    - ///

    For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

    - ///
    + ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

    pub fn set_server_side_encryption(mut self, input: ::std::option::Option) -> Self { self.server_side_encryption = input; self } - ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

    - ///

    For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

    - ///
    + ///

    The server-side encryption algorithm used when you store this object in Amazon S3 (for example, AES256, aws:kms).

    pub fn get_server_side_encryption(&self) -> &::std::option::Option { &self.server_side_encryption } @@ -227,43 +209,31 @@ impl UploadPartCopyOutputBuilder { pub fn get_sse_customer_key_md5(&self) -> &::std::option::Option<::std::string::String> { &self.sse_customer_key_md5 } - ///

    If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    If present, indicates the ID of the KMS key that was used for object encryption.

    pub fn ssekms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.ssekms_key_id = ::std::option::Option::Some(input.into()); self } - ///

    If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    If present, indicates the ID of the KMS key that was used for object encryption.

    pub fn set_ssekms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.ssekms_key_id = input; self } - ///

    If present, indicates the ID of the Key Management Service (KMS) symmetric encryption customer managed key that was used for the object.

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    If present, indicates the ID of the KMS key that was used for object encryption.

    pub fn get_ssekms_key_id(&self) -> &::std::option::Option<::std::string::String> { &self.ssekms_key_id } - ///

    Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    pub fn bucket_key_enabled(mut self, input: bool) -> Self { self.bucket_key_enabled = ::std::option::Option::Some(input); self } - ///

    Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    pub fn set_bucket_key_enabled(mut self, input: ::std::option::Option) -> Self { self.bucket_key_enabled = input; self } - ///

    Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    - ///

    This functionality is not supported for directory buckets.

    - ///
    + ///

    Indicates whether the multipart upload uses an S3 Bucket Key for server-side encryption with Key Management Service (KMS) keys (SSE-KMS).

    pub fn get_bucket_key_enabled(&self) -> &::std::option::Option { &self.bucket_key_enabled } diff --git a/sdk/s3/src/operation/upload_part_copy/builders.rs b/sdk/s3/src/operation/upload_part_copy/builders.rs index 13cd5f0df291..952edf70f971 100644 --- a/sdk/s3/src/operation/upload_part_copy/builders.rs +++ b/sdk/s3/src/operation/upload_part_copy/builders.rs @@ -63,6 +63,7 @@ impl crate::operation::upload_part_copy::builders::UploadPartCopyInputBuilder { ///
  • ///

    If the copy destination is a directory bucket, you must have the s3express:CreateSession permission in the Action element of a policy to write the object to the destination. The s3express:SessionMode condition key cannot be set to ReadOnly on the copy destination.

  • /// +///

    If the object is encrypted with SSE-KMS, you must also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies and KMS key policies for the KMS key.

    ///

    For example policies, see Example bucket policies for S3 Express One Zone and Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone in the Amazon S3 User Guide.

    /// /// @@ -74,7 +75,10 @@ impl crate::operation::upload_part_copy::builders::UploadPartCopyInputBuilder { ///
  • ///

    General purpose buckets - For information about using server-side encryption with customer-provided encryption keys with the UploadPartCopy operation, see CopyObject and UploadPart.

  • ///
  • -///

    Directory buckets - For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) is supported.

  • +///

    Directory buckets - For directory buckets, there are only two supported options for server-side encryption: server-side encryption with Amazon S3 managed keys (SSE-S3) (AES256) and server-side encryption with KMS keys (SSE-KMS) (aws:kms). For more information, see Protecting data with server-side encryption in the Amazon S3 User Guide.

    +///

    For directory buckets, when you perform a CreateMultipartUpload operation and an UploadPartCopy operation, the request headers you provide in the CreateMultipartUpload request must match the default encryption configuration of the destination bucket.

    +///
    +///

    S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through UploadPartCopy. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

    /// /// ///
    diff --git a/sdk/s3/src/protocol_serde.rs b/sdk/s3/src/protocol_serde.rs index 5ad9ca1edb3f..39369898c64e 100644 --- a/sdk/s3/src/protocol_serde.rs +++ b/sdk/s3/src/protocol_serde.rs @@ -303,6 +303,8 @@ pub(crate) mod shape_create_bucket_output; pub(crate) mod shape_create_multipart_upload_output; +pub(crate) mod shape_create_session_output; + pub(crate) mod shape_delete_object_output; pub(crate) mod shape_delete_object_tagging_output; diff --git a/sdk/s3/src/protocol_serde/shape_create_session.rs b/sdk/s3/src/protocol_serde/shape_create_session.rs index 50d6ed63b7da..58e673f1c511 100644 --- a/sdk/s3/src/protocol_serde/shape_create_session.rs +++ b/sdk/s3/src/protocol_serde/shape_create_session.rs @@ -48,6 +48,34 @@ pub fn de_create_session_http_response( let mut output = crate::operation::create_session::builders::CreateSessionOutputBuilder::default(); output = crate::protocol_serde::shape_create_session::de_create_session(_response_body, output) .map_err(crate::operation::create_session::CreateSessionError::unhandled)?; + output = output.set_bucket_key_enabled( + crate::protocol_serde::shape_create_session_output::de_bucket_key_enabled_header(_response_headers).map_err(|_| { + crate::operation::create_session::CreateSessionError::unhandled( + "Failed to parse BucketKeyEnabled from header `x-amz-server-side-encryption-bucket-key-enabled", + ) + })?, + ); + output = output.set_ssekms_encryption_context( + crate::protocol_serde::shape_create_session_output::de_ssekms_encryption_context_header(_response_headers).map_err(|_| { + crate::operation::create_session::CreateSessionError::unhandled( + "Failed to parse SSEKMSEncryptionContext from header `x-amz-server-side-encryption-context", + ) + })?, + ); + output = output.set_ssekms_key_id( + crate::protocol_serde::shape_create_session_output::de_ssekms_key_id_header(_response_headers).map_err(|_| { + crate::operation::create_session::CreateSessionError::unhandled( + "Failed to parse SSEKMSKeyId from header `x-amz-server-side-encryption-aws-kms-key-id", + ) + })?, + ); + output = output.set_server_side_encryption( + crate::protocol_serde::shape_create_session_output::de_server_side_encryption_header(_response_headers).map_err(|_| { + crate::operation::create_session::CreateSessionError::unhandled( + "Failed to parse ServerSideEncryption from header `x-amz-server-side-encryption", + ) + })?, + ); output._set_extended_request_id(crate::s3_request_id::RequestIdExt::extended_request_id(_response_headers).map(str::to_string)); output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string)); crate::serde_util::create_session_output_output_correct_errors(output).build() @@ -71,6 +99,59 @@ pub fn ser_create_session_headers( builder = builder.header("x-amz-create-session-mode", header_value); } } + if let ::std::option::Option::Some(inner_3) = &input.server_side_encryption { + let formatted_4 = inner_3.as_str(); + if !formatted_4.is_empty() { + let header_value = formatted_4; + let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + ::aws_smithy_types::error::operation::BuildError::invalid_field( + "server_side_encryption", + format!("`{}` cannot be used as a header value: {}", &header_value, err), + ) + })?; + builder = builder.header("x-amz-server-side-encryption", header_value); + } + } + if let ::std::option::Option::Some(inner_5) = &input.ssekms_key_id { + let formatted_6 = inner_5.as_str(); + if !formatted_6.is_empty() { + let header_value = formatted_6; + let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + ::aws_smithy_types::error::operation::BuildError::invalid_field( + "ssekms_key_id", + format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err), + ) + })?; + builder = builder.header("x-amz-server-side-encryption-aws-kms-key-id", header_value); + } + } + if let ::std::option::Option::Some(inner_7) = &input.ssekms_encryption_context { + let formatted_8 = inner_7.as_str(); + if !formatted_8.is_empty() { + let header_value = formatted_8; + let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + ::aws_smithy_types::error::operation::BuildError::invalid_field( + "ssekms_encryption_context", + format!("`{}` cannot be used as a header value: {}", &"*** Sensitive Data Redacted ***", err), + ) + })?; + builder = builder.header("x-amz-server-side-encryption-context", header_value); + } + } + if let ::std::option::Option::Some(inner_9) = &input.bucket_key_enabled { + let mut encoder = ::aws_smithy_types::primitive::Encoder::from(*inner_9); + let formatted_10 = encoder.encode(); + if !formatted_10.is_empty() { + let header_value = formatted_10; + let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + ::aws_smithy_types::error::operation::BuildError::invalid_field( + "bucket_key_enabled", + format!("`{}` cannot be used as a header value: {}", &header_value, err), + ) + })?; + builder = builder.header("x-amz-server-side-encryption-bucket-key-enabled", header_value); + } + } Ok(builder) } @@ -88,13 +169,13 @@ pub fn de_create_session( while let Some(mut tag) = decoder.next_tag() { match tag.start_el() { s if s.matches("Credentials") /* Credentials com.amazonaws.s3.synthetic#CreateSessionOutput$Credentials */ => { - let var_3 = + let var_11 = Some( crate::protocol_serde::shape_session_credentials::de_session_credentials(&mut tag) ? ) ; - builder = builder.set_credentials(var_3); + builder = builder.set_credentials(var_11); } , _ => {} diff --git a/sdk/s3/src/protocol_serde/shape_create_session_output.rs b/sdk/s3/src/protocol_serde/shape_create_session_output.rs new file mode 100644 index 000000000000..fd5734cfa1d8 --- /dev/null +++ b/sdk/s3/src/protocol_serde/shape_create_session_output.rs @@ -0,0 +1,37 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +pub(crate) fn de_bucket_key_enabled_header( + header_map: &::aws_smithy_runtime_api::http::Headers, +) -> ::std::result::Result<::std::option::Option, ::aws_smithy_http::header::ParseError> { + let headers = header_map.get_all("x-amz-server-side-encryption-bucket-key-enabled"); + let var_1 = ::aws_smithy_http::header::read_many_primitive::(headers)?; + if var_1.len() > 1 { + Err(::aws_smithy_http::header::ParseError::new(format!( + "expected one item but found {}", + var_1.len() + ))) + } else { + let mut var_1 = var_1; + Ok(var_1.pop()) + } +} + +pub(crate) fn de_ssekms_encryption_context_header( + header_map: &::aws_smithy_runtime_api::http::Headers, +) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> { + let headers = header_map.get_all("x-amz-server-side-encryption-context"); + ::aws_smithy_http::header::one_or_none(headers) +} + +pub(crate) fn de_ssekms_key_id_header( + header_map: &::aws_smithy_runtime_api::http::Headers, +) -> ::std::result::Result<::std::option::Option<::std::string::String>, ::aws_smithy_http::header::ParseError> { + let headers = header_map.get_all("x-amz-server-side-encryption-aws-kms-key-id"); + ::aws_smithy_http::header::one_or_none(headers) +} + +pub(crate) fn de_server_side_encryption_header( + header_map: &::aws_smithy_runtime_api::http::Headers, +) -> ::std::result::Result<::std::option::Option, ::aws_smithy_http::header::ParseError> { + let headers = header_map.get_all("x-amz-server-side-encryption"); + ::aws_smithy_http::header::one_or_none(headers) +} diff --git a/sdk/s3/src/types/_existing_object_replication.rs b/sdk/s3/src/types/_existing_object_replication.rs index fdd2e6e9ca13..6431cdeb457f 100644 --- a/sdk/s3/src/types/_existing_object_replication.rs +++ b/sdk/s3/src/types/_existing_object_replication.rs @@ -1,6 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -///

    Optional configuration to replicate existing source bucket objects. For more information, see Replicating Existing Objects in the Amazon S3 User Guide.

    +///

    Optional configuration to replicate existing source bucket objects.

    +///

    This parameter is no longer supported. To replicate existing objects, see Replicating existing objects with S3 Batch Replication in the Amazon S3 User Guide.

    +///
    #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] pub struct ExistingObjectReplication { diff --git a/sdk/s3/src/types/_replication_rule.rs b/sdk/s3/src/types/_replication_rule.rs index c92841437223..ec1327f6f95f 100644 --- a/sdk/s3/src/types/_replication_rule.rs +++ b/sdk/s3/src/types/_replication_rule.rs @@ -20,7 +20,9 @@ pub struct ReplicationRule { pub status: crate::types::ReplicationRuleStatus, ///

    A container that describes additional filters for identifying the source objects that you want to replicate. You can choose to enable or disable the replication of these objects. Currently, Amazon S3 supports only the filter that you can specify for objects created with server-side encryption using a customer managed key stored in Amazon Web Services Key Management Service (SSE-KMS).

    pub source_selection_criteria: ::std::option::Option, - ///

    Optional configuration to replicate existing source bucket objects. For more information, see Replicating Existing Objects in the Amazon S3 User Guide.

    + ///

    Optional configuration to replicate existing source bucket objects.

    + ///

    This parameter is no longer supported. To replicate existing objects, see Replicating existing objects with S3 Batch Replication in the Amazon S3 User Guide.

    + ///
    pub existing_object_replication: ::std::option::Option, ///

    A container for information about the replication destination and its configurations including enabling the S3 Replication Time Control (S3 RTC).

    pub destination: ::std::option::Option, @@ -59,7 +61,9 @@ impl ReplicationRule { pub fn source_selection_criteria(&self) -> ::std::option::Option<&crate::types::SourceSelectionCriteria> { self.source_selection_criteria.as_ref() } - ///

    Optional configuration to replicate existing source bucket objects. For more information, see Replicating Existing Objects in the Amazon S3 User Guide.

    + ///

    Optional configuration to replicate existing source bucket objects.

    + ///

    This parameter is no longer supported. To replicate existing objects, see Replicating existing objects with S3 Batch Replication in the Amazon S3 User Guide.

    + ///
    pub fn existing_object_replication(&self) -> ::std::option::Option<&crate::types::ExistingObjectReplication> { self.existing_object_replication.as_ref() } @@ -194,17 +198,23 @@ impl ReplicationRuleBuilder { pub fn get_source_selection_criteria(&self) -> &::std::option::Option { &self.source_selection_criteria } - ///

    Optional configuration to replicate existing source bucket objects. For more information, see Replicating Existing Objects in the Amazon S3 User Guide.

    + ///

    Optional configuration to replicate existing source bucket objects.

    + ///

    This parameter is no longer supported. To replicate existing objects, see Replicating existing objects with S3 Batch Replication in the Amazon S3 User Guide.

    + ///
    pub fn existing_object_replication(mut self, input: crate::types::ExistingObjectReplication) -> Self { self.existing_object_replication = ::std::option::Option::Some(input); self } - ///

    Optional configuration to replicate existing source bucket objects. For more information, see Replicating Existing Objects in the Amazon S3 User Guide.

    + ///

    Optional configuration to replicate existing source bucket objects.

    + ///

    This parameter is no longer supported. To replicate existing objects, see Replicating existing objects with S3 Batch Replication in the Amazon S3 User Guide.

    + ///
    pub fn set_existing_object_replication(mut self, input: ::std::option::Option) -> Self { self.existing_object_replication = input; self } - ///

    Optional configuration to replicate existing source bucket objects. For more information, see Replicating Existing Objects in the Amazon S3 User Guide.

    + ///

    Optional configuration to replicate existing source bucket objects.

    + ///

    This parameter is no longer supported. To replicate existing objects, see Replicating existing objects with S3 Batch Replication in the Amazon S3 User Guide.

    + ///
    pub fn get_existing_object_replication(&self) -> &::std::option::Option { &self.existing_object_replication } diff --git a/sdk/s3/src/types/_server_side_encryption_by_default.rs b/sdk/s3/src/types/_server_side_encryption_by_default.rs index 0a000dfff523..193d5ce54008 100644 --- a/sdk/s3/src/types/_server_side_encryption_by_default.rs +++ b/sdk/s3/src/types/_server_side_encryption_by_default.rs @@ -1,14 +1,30 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -///

    Describes the default server-side encryption to apply to new objects in the bucket. If a PUT Object request doesn't specify any server-side encryption, this default encryption will be applied. If you don't specify a customer managed key at configuration, Amazon S3 automatically creates an Amazon Web Services KMS key in your Amazon Web Services account the first time that you add an object encrypted with SSE-KMS to a bucket. By default, Amazon S3 uses this KMS key for SSE-KMS. For more information, see PUT Bucket encryption in the Amazon S3 API Reference.

    -///

    If you're specifying a customer managed KMS key, we recommend using a fully qualified KMS key ARN. If you use a KMS key alias instead, then KMS resolves the key within the requester’s account. This behavior can result in data that's encrypted with a KMS key that belongs to the requester, and not the bucket owner.

    +///

    Describes the default server-side encryption to apply to new objects in the bucket. If a PUT Object request doesn't specify any server-side encryption, this default encryption will be applied. For more information, see PutBucketEncryption.

    +///
      +///
    • +///

      General purpose buckets - If you don't specify a customer managed key at configuration, Amazon S3 automatically creates an Amazon Web Services KMS key (aws/s3) in your Amazon Web Services account the first time that you add an object encrypted with SSE-KMS to a bucket. By default, Amazon S3 uses this KMS key for SSE-KMS.

    • +///
    • +///

      Directory buckets - Your SSE-KMS configuration can only support 1 customer managed key per directory bucket for the lifetime of the bucket. Amazon Web Services managed key (aws/s3) isn't supported.

    • +///
    • +///

      Directory buckets - For directory buckets, there are only two supported options for server-side encryption: SSE-S3 and SSE-KMS.

    • +///
    ///
    #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::PartialEq)] pub struct ServerSideEncryptionByDefault { - ///

    Server-side encryption algorithm to use for the default encryption.

    + ///

    Server-side encryption algorithm to use for the default encryption.

    + ///

    For directory buckets, there are only two supported values for server-side encryption: AES256 and aws:kms.

    + ///
    pub sse_algorithm: crate::types::ServerSideEncryption, - ///

    Amazon Web Services Key Management Service (KMS) customer Amazon Web Services KMS key ID to use for the default encryption. This parameter is allowed if and only if SSEAlgorithm is set to aws:kms or aws:kms:dsse.

    + ///

    Amazon Web Services Key Management Service (KMS) customer managed key ID to use for the default encryption.

    + ///
      + ///
    • + ///

      General purpose buckets - This parameter is allowed if and only if SSEAlgorithm is set to aws:kms or aws:kms:dsse.

    • + ///
    • + ///

      Directory buckets - This parameter is allowed if and only if SSEAlgorithm is set to aws:kms.

    • + ///
    + ///
    ///

    You can specify the key ID, key alias, or the Amazon Resource Name (ARN) of the KMS key.

    ///
      ///
    • @@ -18,18 +34,33 @@ pub struct ServerSideEncryptionByDefault { ///
    • ///

      Key Alias: alias/alias-name

    • ///
    - ///

    If you use a key ID, you can run into a LogDestination undeliverable error when creating a VPC flow log.

    - ///

    If you are using encryption with cross-account or Amazon Web Services service operations you must use a fully qualified KMS key ARN. For more information, see Using encryption for cross-account operations.

    + ///

    If you are using encryption with cross-account or Amazon Web Services service operations, you must use a fully qualified KMS key ARN. For more information, see Using encryption for cross-account operations.

    + ///
      + ///
    • + ///

      General purpose buckets - If you're specifying a customer managed KMS key, we recommend using a fully qualified KMS key ARN. If you use a KMS key alias instead, then KMS resolves the key within the requester’s account. This behavior can result in data that's encrypted with a KMS key that belongs to the requester, and not the bucket owner. Also, if you use a key ID, you can run into a LogDestination undeliverable error when creating a VPC flow log.

    • + ///
    • + ///

      Directory buckets - When you specify an KMS customer managed key for encryption in your directory bucket, only use the key ID or key ARN. The key alias format of the KMS key isn't supported.

    • + ///
    + ///
    ///

    Amazon S3 only supports symmetric encryption KMS keys. For more information, see Asymmetric keys in Amazon Web Services KMS in the Amazon Web Services Key Management Service Developer Guide.

    ///
    pub kms_master_key_id: ::std::option::Option<::std::string::String>, } impl ServerSideEncryptionByDefault { - ///

    Server-side encryption algorithm to use for the default encryption.

    + ///

    Server-side encryption algorithm to use for the default encryption.

    + ///

    For directory buckets, there are only two supported values for server-side encryption: AES256 and aws:kms.

    + ///
    pub fn sse_algorithm(&self) -> &crate::types::ServerSideEncryption { &self.sse_algorithm } - ///

    Amazon Web Services Key Management Service (KMS) customer Amazon Web Services KMS key ID to use for the default encryption. This parameter is allowed if and only if SSEAlgorithm is set to aws:kms or aws:kms:dsse.

    + ///

    Amazon Web Services Key Management Service (KMS) customer managed key ID to use for the default encryption.

    + ///
      + ///
    • + ///

      General purpose buckets - This parameter is allowed if and only if SSEAlgorithm is set to aws:kms or aws:kms:dsse.

    • + ///
    • + ///

      Directory buckets - This parameter is allowed if and only if SSEAlgorithm is set to aws:kms.

    • + ///
    + ///
    ///

    You can specify the key ID, key alias, or the Amazon Resource Name (ARN) of the KMS key.

    ///
      ///
    • @@ -39,8 +70,14 @@ impl ServerSideEncryptionByDefault { ///
    • ///

      Key Alias: alias/alias-name

    • ///
    - ///

    If you use a key ID, you can run into a LogDestination undeliverable error when creating a VPC flow log.

    - ///

    If you are using encryption with cross-account or Amazon Web Services service operations you must use a fully qualified KMS key ARN. For more information, see Using encryption for cross-account operations.

    + ///

    If you are using encryption with cross-account or Amazon Web Services service operations, you must use a fully qualified KMS key ARN. For more information, see Using encryption for cross-account operations.

    + ///
      + ///
    • + ///

      General purpose buckets - If you're specifying a customer managed KMS key, we recommend using a fully qualified KMS key ARN. If you use a KMS key alias instead, then KMS resolves the key within the requester’s account. This behavior can result in data that's encrypted with a KMS key that belongs to the requester, and not the bucket owner. Also, if you use a key ID, you can run into a LogDestination undeliverable error when creating a VPC flow log.

    • + ///
    • + ///

      Directory buckets - When you specify an KMS customer managed key for encryption in your directory bucket, only use the key ID or key ARN. The key alias format of the KMS key isn't supported.

    • + ///
    + ///
    ///

    Amazon S3 only supports symmetric encryption KMS keys. For more information, see Asymmetric keys in Amazon Web Services KMS in the Amazon Web Services Key Management Service Developer Guide.

    ///
    pub fn kms_master_key_id(&self) -> ::std::option::Option<&str> { @@ -70,22 +107,35 @@ pub struct ServerSideEncryptionByDefaultBuilder { pub(crate) kms_master_key_id: ::std::option::Option<::std::string::String>, } impl ServerSideEncryptionByDefaultBuilder { - ///

    Server-side encryption algorithm to use for the default encryption.

    + ///

    Server-side encryption algorithm to use for the default encryption.

    + ///

    For directory buckets, there are only two supported values for server-side encryption: AES256 and aws:kms.

    + ///
    /// This field is required. pub fn sse_algorithm(mut self, input: crate::types::ServerSideEncryption) -> Self { self.sse_algorithm = ::std::option::Option::Some(input); self } - ///

    Server-side encryption algorithm to use for the default encryption.

    + ///

    Server-side encryption algorithm to use for the default encryption.

    + ///

    For directory buckets, there are only two supported values for server-side encryption: AES256 and aws:kms.

    + ///
    pub fn set_sse_algorithm(mut self, input: ::std::option::Option) -> Self { self.sse_algorithm = input; self } - ///

    Server-side encryption algorithm to use for the default encryption.

    + ///

    Server-side encryption algorithm to use for the default encryption.

    + ///

    For directory buckets, there are only two supported values for server-side encryption: AES256 and aws:kms.

    + ///
    pub fn get_sse_algorithm(&self) -> &::std::option::Option { &self.sse_algorithm } - ///

    Amazon Web Services Key Management Service (KMS) customer Amazon Web Services KMS key ID to use for the default encryption. This parameter is allowed if and only if SSEAlgorithm is set to aws:kms or aws:kms:dsse.

    + ///

    Amazon Web Services Key Management Service (KMS) customer managed key ID to use for the default encryption.

    + ///
      + ///
    • + ///

      General purpose buckets - This parameter is allowed if and only if SSEAlgorithm is set to aws:kms or aws:kms:dsse.

    • + ///
    • + ///

      Directory buckets - This parameter is allowed if and only if SSEAlgorithm is set to aws:kms.

    • + ///
    + ///
    ///

    You can specify the key ID, key alias, or the Amazon Resource Name (ARN) of the KMS key.

    ///
      ///
    • @@ -95,15 +145,28 @@ impl ServerSideEncryptionByDefaultBuilder { ///
    • ///

      Key Alias: alias/alias-name

    • ///
    - ///

    If you use a key ID, you can run into a LogDestination undeliverable error when creating a VPC flow log.

    - ///

    If you are using encryption with cross-account or Amazon Web Services service operations you must use a fully qualified KMS key ARN. For more information, see Using encryption for cross-account operations.

    + ///

    If you are using encryption with cross-account or Amazon Web Services service operations, you must use a fully qualified KMS key ARN. For more information, see Using encryption for cross-account operations.

    + ///
      + ///
    • + ///

      General purpose buckets - If you're specifying a customer managed KMS key, we recommend using a fully qualified KMS key ARN. If you use a KMS key alias instead, then KMS resolves the key within the requester’s account. This behavior can result in data that's encrypted with a KMS key that belongs to the requester, and not the bucket owner. Also, if you use a key ID, you can run into a LogDestination undeliverable error when creating a VPC flow log.

    • + ///
    • + ///

      Directory buckets - When you specify an KMS customer managed key for encryption in your directory bucket, only use the key ID or key ARN. The key alias format of the KMS key isn't supported.

    • + ///
    + ///
    ///

    Amazon S3 only supports symmetric encryption KMS keys. For more information, see Asymmetric keys in Amazon Web Services KMS in the Amazon Web Services Key Management Service Developer Guide.

    ///
    pub fn kms_master_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.kms_master_key_id = ::std::option::Option::Some(input.into()); self } - ///

    Amazon Web Services Key Management Service (KMS) customer Amazon Web Services KMS key ID to use for the default encryption. This parameter is allowed if and only if SSEAlgorithm is set to aws:kms or aws:kms:dsse.

    + ///

    Amazon Web Services Key Management Service (KMS) customer managed key ID to use for the default encryption.

    + ///
      + ///
    • + ///

      General purpose buckets - This parameter is allowed if and only if SSEAlgorithm is set to aws:kms or aws:kms:dsse.

    • + ///
    • + ///

      Directory buckets - This parameter is allowed if and only if SSEAlgorithm is set to aws:kms.

    • + ///
    + ///
    ///

    You can specify the key ID, key alias, or the Amazon Resource Name (ARN) of the KMS key.

    ///
      ///
    • @@ -113,15 +176,28 @@ impl ServerSideEncryptionByDefaultBuilder { ///
    • ///

      Key Alias: alias/alias-name

    • ///
    - ///

    If you use a key ID, you can run into a LogDestination undeliverable error when creating a VPC flow log.

    - ///

    If you are using encryption with cross-account or Amazon Web Services service operations you must use a fully qualified KMS key ARN. For more information, see Using encryption for cross-account operations.

    + ///

    If you are using encryption with cross-account or Amazon Web Services service operations, you must use a fully qualified KMS key ARN. For more information, see Using encryption for cross-account operations.

    + ///
      + ///
    • + ///

      General purpose buckets - If you're specifying a customer managed KMS key, we recommend using a fully qualified KMS key ARN. If you use a KMS key alias instead, then KMS resolves the key within the requester’s account. This behavior can result in data that's encrypted with a KMS key that belongs to the requester, and not the bucket owner. Also, if you use a key ID, you can run into a LogDestination undeliverable error when creating a VPC flow log.

    • + ///
    • + ///

      Directory buckets - When you specify an KMS customer managed key for encryption in your directory bucket, only use the key ID or key ARN. The key alias format of the KMS key isn't supported.

    • + ///
    + ///
    ///

    Amazon S3 only supports symmetric encryption KMS keys. For more information, see Asymmetric keys in Amazon Web Services KMS in the Amazon Web Services Key Management Service Developer Guide.

    ///
    pub fn set_kms_master_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self { self.kms_master_key_id = input; self } - ///

    Amazon Web Services Key Management Service (KMS) customer Amazon Web Services KMS key ID to use for the default encryption. This parameter is allowed if and only if SSEAlgorithm is set to aws:kms or aws:kms:dsse.

    + ///

    Amazon Web Services Key Management Service (KMS) customer managed key ID to use for the default encryption.

    + ///
      + ///
    • + ///

      General purpose buckets - This parameter is allowed if and only if SSEAlgorithm is set to aws:kms or aws:kms:dsse.

    • + ///
    • + ///

      Directory buckets - This parameter is allowed if and only if SSEAlgorithm is set to aws:kms.

    • + ///
    + ///
    ///

    You can specify the key ID, key alias, or the Amazon Resource Name (ARN) of the KMS key.

    ///
      ///
    • @@ -131,8 +207,14 @@ impl ServerSideEncryptionByDefaultBuilder { ///
    • ///

      Key Alias: alias/alias-name

    • ///
    - ///

    If you use a key ID, you can run into a LogDestination undeliverable error when creating a VPC flow log.

    - ///

    If you are using encryption with cross-account or Amazon Web Services service operations you must use a fully qualified KMS key ARN. For more information, see Using encryption for cross-account operations.

    + ///

    If you are using encryption with cross-account or Amazon Web Services service operations, you must use a fully qualified KMS key ARN. For more information, see Using encryption for cross-account operations.

    + ///
      + ///
    • + ///

      General purpose buckets - If you're specifying a customer managed KMS key, we recommend using a fully qualified KMS key ARN. If you use a KMS key alias instead, then KMS resolves the key within the requester’s account. This behavior can result in data that's encrypted with a KMS key that belongs to the requester, and not the bucket owner. Also, if you use a key ID, you can run into a LogDestination undeliverable error when creating a VPC flow log.

    • + ///
    • + ///

      Directory buckets - When you specify an KMS customer managed key for encryption in your directory bucket, only use the key ID or key ARN. The key alias format of the KMS key isn't supported.

    • + ///
    + ///
    ///

    Amazon S3 only supports symmetric encryption KMS keys. For more information, see Asymmetric keys in Amazon Web Services KMS in the Amazon Web Services Key Management Service Developer Guide.

    ///
    pub fn get_kms_master_key_id(&self) -> &::std::option::Option<::std::string::String> { diff --git a/sdk/s3/src/types/_server_side_encryption_rule.rs b/sdk/s3/src/types/_server_side_encryption_rule.rs index f4bcb4b24a25..e4dff4c66376 100644 --- a/sdk/s3/src/types/_server_side_encryption_rule.rs +++ b/sdk/s3/src/types/_server_side_encryption_rule.rs @@ -1,15 +1,26 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ///

    Specifies the default server-side encryption configuration.

    -///

    If you're specifying a customer managed KMS key, we recommend using a fully qualified KMS key ARN. If you use a KMS key alias instead, then KMS resolves the key within the requester’s account. This behavior can result in data that's encrypted with a KMS key that belongs to the requester, and not the bucket owner.

    +///
      +///
    • +///

      General purpose buckets - If you're specifying a customer managed KMS key, we recommend using a fully qualified KMS key ARN. If you use a KMS key alias instead, then KMS resolves the key within the requester’s account. This behavior can result in data that's encrypted with a KMS key that belongs to the requester, and not the bucket owner.

    • +///
    • +///

      Directory buckets - When you specify an KMS customer managed key for encryption in your directory bucket, only use the key ID or key ARN. The key alias format of the KMS key isn't supported.

    • +///
    ///
    #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] pub struct ServerSideEncryptionRule { ///

    Specifies the default server-side encryption to apply to new objects in the bucket. If a PUT Object request doesn't specify any server-side encryption, this default encryption will be applied.

    pub apply_server_side_encryption_by_default: ::std::option::Option, - ///

    Specifies whether Amazon S3 should use an S3 Bucket Key with server-side encryption using KMS (SSE-KMS) for new objects in the bucket. Existing objects are not affected. Setting the BucketKeyEnabled element to true causes Amazon S3 to use an S3 Bucket Key. By default, S3 Bucket Key is not enabled.

    - ///

    For more information, see Amazon S3 Bucket Keys in the Amazon S3 User Guide.

    + ///

    Specifies whether Amazon S3 should use an S3 Bucket Key with server-side encryption using KMS (SSE-KMS) for new objects in the bucket. Existing objects are not affected. Setting the BucketKeyEnabled element to true causes Amazon S3 to use an S3 Bucket Key.

    + ///
      + ///
    • + ///

      General purpose buckets - By default, S3 Bucket Key is not enabled. For more information, see Amazon S3 Bucket Keys in the Amazon S3 User Guide.

    • + ///
    • + ///

      Directory buckets - S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

    • + ///
    + ///
    pub bucket_key_enabled: ::std::option::Option, } impl ServerSideEncryptionRule { @@ -17,8 +28,14 @@ impl ServerSideEncryptionRule { pub fn apply_server_side_encryption_by_default(&self) -> ::std::option::Option<&crate::types::ServerSideEncryptionByDefault> { self.apply_server_side_encryption_by_default.as_ref() } - ///

    Specifies whether Amazon S3 should use an S3 Bucket Key with server-side encryption using KMS (SSE-KMS) for new objects in the bucket. Existing objects are not affected. Setting the BucketKeyEnabled element to true causes Amazon S3 to use an S3 Bucket Key. By default, S3 Bucket Key is not enabled.

    - ///

    For more information, see Amazon S3 Bucket Keys in the Amazon S3 User Guide.

    + ///

    Specifies whether Amazon S3 should use an S3 Bucket Key with server-side encryption using KMS (SSE-KMS) for new objects in the bucket. Existing objects are not affected. Setting the BucketKeyEnabled element to true causes Amazon S3 to use an S3 Bucket Key.

    + ///
      + ///
    • + ///

      General purpose buckets - By default, S3 Bucket Key is not enabled. For more information, see Amazon S3 Bucket Keys in the Amazon S3 User Guide.

    • + ///
    • + ///

      Directory buckets - S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

    • + ///
    + ///
    pub fn bucket_key_enabled(&self) -> ::std::option::Option { self.bucket_key_enabled } @@ -52,20 +69,38 @@ impl ServerSideEncryptionRuleBuilder { pub fn get_apply_server_side_encryption_by_default(&self) -> &::std::option::Option { &self.apply_server_side_encryption_by_default } - ///

    Specifies whether Amazon S3 should use an S3 Bucket Key with server-side encryption using KMS (SSE-KMS) for new objects in the bucket. Existing objects are not affected. Setting the BucketKeyEnabled element to true causes Amazon S3 to use an S3 Bucket Key. By default, S3 Bucket Key is not enabled.

    - ///

    For more information, see Amazon S3 Bucket Keys in the Amazon S3 User Guide.

    + ///

    Specifies whether Amazon S3 should use an S3 Bucket Key with server-side encryption using KMS (SSE-KMS) for new objects in the bucket. Existing objects are not affected. Setting the BucketKeyEnabled element to true causes Amazon S3 to use an S3 Bucket Key.

    + ///
      + ///
    • + ///

      General purpose buckets - By default, S3 Bucket Key is not enabled. For more information, see Amazon S3 Bucket Keys in the Amazon S3 User Guide.

    • + ///
    • + ///

      Directory buckets - S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

    • + ///
    + ///
    pub fn bucket_key_enabled(mut self, input: bool) -> Self { self.bucket_key_enabled = ::std::option::Option::Some(input); self } - ///

    Specifies whether Amazon S3 should use an S3 Bucket Key with server-side encryption using KMS (SSE-KMS) for new objects in the bucket. Existing objects are not affected. Setting the BucketKeyEnabled element to true causes Amazon S3 to use an S3 Bucket Key. By default, S3 Bucket Key is not enabled.

    - ///

    For more information, see Amazon S3 Bucket Keys in the Amazon S3 User Guide.

    + ///

    Specifies whether Amazon S3 should use an S3 Bucket Key with server-side encryption using KMS (SSE-KMS) for new objects in the bucket. Existing objects are not affected. Setting the BucketKeyEnabled element to true causes Amazon S3 to use an S3 Bucket Key.

    + ///
      + ///
    • + ///

      General purpose buckets - By default, S3 Bucket Key is not enabled. For more information, see Amazon S3 Bucket Keys in the Amazon S3 User Guide.

    • + ///
    • + ///

      Directory buckets - S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

    • + ///
    + ///
    pub fn set_bucket_key_enabled(mut self, input: ::std::option::Option) -> Self { self.bucket_key_enabled = input; self } - ///

    Specifies whether Amazon S3 should use an S3 Bucket Key with server-side encryption using KMS (SSE-KMS) for new objects in the bucket. Existing objects are not affected. Setting the BucketKeyEnabled element to true causes Amazon S3 to use an S3 Bucket Key. By default, S3 Bucket Key is not enabled.

    - ///

    For more information, see Amazon S3 Bucket Keys in the Amazon S3 User Guide.

    + ///

    Specifies whether Amazon S3 should use an S3 Bucket Key with server-side encryption using KMS (SSE-KMS) for new objects in the bucket. Existing objects are not affected. Setting the BucketKeyEnabled element to true causes Amazon S3 to use an S3 Bucket Key.

    + ///
      + ///
    • + ///

      General purpose buckets - By default, S3 Bucket Key is not enabled. For more information, see Amazon S3 Bucket Keys in the Amazon S3 User Guide.

    • + ///
    • + ///

      Directory buckets - S3 Bucket Keys are always enabled for GET and PUT operations in a directory bucket and can’t be disabled. S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from general purpose buckets to directory buckets, from directory buckets to general purpose buckets, or between directory buckets, through CopyObject, UploadPartCopy, the Copy operation in Batch Operations, or the import jobs. In this case, Amazon S3 makes a call to KMS every time a copy request is made for a KMS-encrypted object.

    • + ///
    + ///
    pub fn get_bucket_key_enabled(&self) -> &::std::option::Option { &self.bucket_key_enabled } diff --git a/sdk/s3/src/types/_session_credentials.rs b/sdk/s3/src/types/_session_credentials.rs index 22e0962075ff..4afaefaf1ca3 100644 --- a/sdk/s3/src/types/_session_credentials.rs +++ b/sdk/s3/src/types/_session_credentials.rs @@ -1,7 +1,7 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. ///

    The established temporary security credentials of the session.

    -///

    Directory buckets - These session credentials are only supported for the authentication and authorization of Zonal endpoint APIs on directory buckets.

    +///

    Directory buckets - These session credentials are only supported for the authentication and authorization of Zonal endpoint API operations on directory buckets.

    ///
    #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::PartialEq)] diff --git a/sdk/s3/src/waiters/object_exists.rs b/sdk/s3/src/waiters/object_exists.rs index ac3c9e40f2dc..50aa83a2450f 100644 --- a/sdk/s3/src/waiters/object_exists.rs +++ b/sdk/s3/src/waiters/object_exists.rs @@ -515,19 +515,22 @@ impl ObjectExistsFluentBuilder { self.inner.get_expected_bucket_owner() } ///

    To retrieve the checksum, this parameter must be enabled.

    - ///

    In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    General purpose buckets - If you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    Directory buckets - If you enable ChecksumMode and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies and KMS key policies for the KMS key to retrieve the checksum of the object.

    pub fn checksum_mode(mut self, input: crate::types::ChecksumMode) -> Self { self.inner = self.inner.checksum_mode(input); self } ///

    To retrieve the checksum, this parameter must be enabled.

    - ///

    In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    General purpose buckets - If you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    Directory buckets - If you enable ChecksumMode and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies and KMS key policies for the KMS key to retrieve the checksum of the object.

    pub fn set_checksum_mode(mut self, input: ::std::option::Option) -> Self { self.inner = self.inner.set_checksum_mode(input); self } ///

    To retrieve the checksum, this parameter must be enabled.

    - ///

    In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    General purpose buckets - If you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    Directory buckets - If you enable ChecksumMode and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies and KMS key policies for the KMS key to retrieve the checksum of the object.

    pub fn get_checksum_mode(&self) -> &::std::option::Option { self.inner.get_checksum_mode() } diff --git a/sdk/s3/src/waiters/object_not_exists.rs b/sdk/s3/src/waiters/object_not_exists.rs index d7b307a969ce..5b6f5d33216f 100644 --- a/sdk/s3/src/waiters/object_not_exists.rs +++ b/sdk/s3/src/waiters/object_not_exists.rs @@ -514,19 +514,22 @@ impl ObjectNotExistsFluentBuilder { self.inner.get_expected_bucket_owner() } ///

    To retrieve the checksum, this parameter must be enabled.

    - ///

    In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    General purpose buckets - If you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    Directory buckets - If you enable ChecksumMode and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies and KMS key policies for the KMS key to retrieve the checksum of the object.

    pub fn checksum_mode(mut self, input: crate::types::ChecksumMode) -> Self { self.inner = self.inner.checksum_mode(input); self } ///

    To retrieve the checksum, this parameter must be enabled.

    - ///

    In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    General purpose buckets - If you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    Directory buckets - If you enable ChecksumMode and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies and KMS key policies for the KMS key to retrieve the checksum of the object.

    pub fn set_checksum_mode(mut self, input: ::std::option::Option) -> Self { self.inner = self.inner.set_checksum_mode(input); self } ///

    To retrieve the checksum, this parameter must be enabled.

    - ///

    In addition, if you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    General purpose buckets - If you enable checksum mode and the object is uploaded with a checksum and encrypted with an Key Management Service (KMS) key, you must have permission to use the kms:Decrypt action to retrieve the checksum.

    + ///

    Directory buckets - If you enable ChecksumMode and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies and KMS key policies for the KMS key to retrieve the checksum of the object.

    pub fn get_checksum_mode(&self) -> &::std::option::Option { self.inner.get_checksum_mode() } diff --git a/tests/no-default-features/Cargo.toml b/tests/no-default-features/Cargo.toml index 3c5a8de716ec..1b300794bc93 100644 --- a/tests/no-default-features/Cargo.toml +++ b/tests/no-default-features/Cargo.toml @@ -21,7 +21,7 @@ version = "1.5.6" [dev-dependencies.aws-sdk-s3] path = "../../sdk/s3" default-features = false -version = "1.50.0" +version = "1.51.0" [dev-dependencies.aws-smithy-async] path = "../../sdk/aws-smithy-async" diff --git a/versions.toml b/versions.toml index 4b97faf045d4..cfcb53eec47f 100644 --- a/versions.toml +++ b/versions.toml @@ -610,9 +610,9 @@ model_hash = 'bf4538c4a88e7593ec09204cc1424a979ccc4bed2885498a403e0650d1607c9d' [crates.aws-sdk-costexplorer] category = 'AwsSdk' -version = '1.45.0' -source_hash = '8e5a1e940915a46fa150e001d6ed345375301f674c5160f5bc006900a85256ef' -model_hash = '95ef4077b223ff551fd9267ef0e8b609bf6b4a6ef40b3acce64ac1229ff4e703' +version = '1.46.0' +source_hash = '5954d79237e63429b5b622b23ba59d89e731b284b25d07b390598e91bde66f7d' +model_hash = '05964d8f2e4103b837f97f31b74f24daac274eab58ec15724511c38da67e9007' [crates.aws-sdk-costoptimizationhub] category = 'AwsSdk' @@ -700,9 +700,15 @@ model_hash = '72e64ece15c7f5f5b0d3baef12cae6f68c1b69455cec29dc1632f1074475be95' [crates.aws-sdk-directory] category = 'AwsSdk' -version = '1.44.0' -source_hash = '098089c0642b82e6efd883f49e4313c729fe4370626051c1ea21446e8ac868d4' -model_hash = '913a9972001b52ca4c82475a857f32497fae5adb42e91b39a0c726d477f49f35' +version = '1.45.0' +source_hash = '90a28f725ca63e7ac3f6814dbd77c5487c28d08ff32406426e8d3a3ea23627ec' +model_hash = 'cdb908c138dca9350f62713b5d9a95c6b587cd1fb712919647531d9fcb4ad5b0' + +[crates.aws-sdk-directoryservicedata] +category = 'AwsSdk' +version = '1.0.0' +source_hash = '9054952b36df8a96d1772dafed4fe2156aa41bcc9bdb3e97e1c1a5531dd74889' +model_hash = 'fdc5fb2884d3340748cf105624142f2241d55495905f61c3f5842eb9abfb70e8' [crates.aws-sdk-dlm] category = 'AwsSdk' @@ -982,9 +988,9 @@ model_hash = '2c97f5de5fc40115222b8f4b2eadc768ed5f4107083921c1a4efc05ee74ad219' [crates.aws-sdk-guardduty] category = 'AwsSdk' -version = '1.49.0' -source_hash = '5460ca2f0e9dfde7fb6d97aac666ad2345aa42371d248573ef587261cb9061e5' -model_hash = '905f4b938b3a923db6075621e4f858d81ebd41cae2c66941a73d7c89865c388c' +version = '1.50.0' +source_hash = 'e8e6e1ebbb1bc7bd1e8df9da2190e645f79af4e0409eae7e4630596be781e06e' +model_hash = 'ec2ff0b87ca2f4d0e4c5ec6691ef70903799eeb3880c7827ad0d594d213fac72' [crates.aws-sdk-health] category = 'AwsSdk' @@ -1348,9 +1354,9 @@ model_hash = 'cb991d1bbb4e7c18871035295cdf0aa3ade08068c49cb1bb4686c3113c55c1d9' [crates.aws-sdk-mailmanager] category = 'AwsSdk' -version = '1.18.0' -source_hash = '08a949a8b4fda1a49bbdce5f4b14070020d39602e22e640e135cdbab496fbaf8' -model_hash = '1cbba91b81b2ed85f6530ca87f9abdc38b82ceb76810abf065bce590acd8f7de' +version = '1.19.0' +source_hash = 'd895faa54fe8686bf06ffcd948135369d9b1f08de9d100cd646cdf3263265439' +model_hash = '5c2d67f8b4a34bd9ebcfc1dcfac85426d70babb032257304dedc67640416d71a' [crates.aws-sdk-managedblockchain] category = 'AwsSdk' @@ -1780,9 +1786,9 @@ model_hash = '33137a772550764a4312631b5ad37b61e0232d622a5d0bca86b20efd5bb76105' [crates.aws-sdk-rds] category = 'AwsSdk' -version = '1.55.0' -source_hash = '969fc236555cff6f1b7a5053464153cbd3f74452ec2b25dc863f986238416658' -model_hash = 'ec06761e15369d9c087d9546eacf94d6fb5b50ab7f71277e67bfc6aa9535e646' +version = '1.55.1' +source_hash = 'e4a791c4c165346a95e1bfae1e4f0d288025de0bb621f5ae941498d9004055a7' +model_hash = '759726b602767e7ddcbabdf54389ce03eb7fa7cbc5afba0569187c3055222569' [crates.aws-sdk-rdsdata] category = 'AwsSdk' @@ -1906,9 +1912,9 @@ model_hash = '34648839402316ab9da4bef0fe11beb9bc3ec1d05b3ff7d09664ab74c0cb3d2b' [crates.aws-sdk-s3] category = 'AwsSdk' -version = '1.50.0' -source_hash = 'b3cccd28a6a4ed35dbfea9a2bd9f8cf50ca9c0dc4fbe5df4755208d5e405e3ca' -model_hash = 'b32f386a3667d527a28335425b841a8e51ecb2bb470e13062740e75bd3e6bf14' +version = '1.51.0' +source_hash = '8bde392de212138de2fbb351f9625d7f09a0fe1c3a7e5911cedeee3867d6cc4b' +model_hash = 'b0d9f38f7b01685b7a551891e6f4cbacfb81bd69ff8f61eb6f69516bc806c53d' [crates.aws-sdk-s3control] category = 'AwsSdk' @@ -2487,393 +2493,11 @@ source_hash = 'db7face08f400b930054e717f7ee7a6a153796d82cbf0529f5a8846e4ed9ca67' category = 'AwsRuntime' version = '0.0.0' source_hash = 'e73be5cd8fa313370338d1d6cd7c32fffb873cc96e2d73ed45f7f44f06b00c50' - -[release] -tag = 'release-2024-09-17' - [release.crates] -aws-sdk-accessanalyzer = '1.46.0' -aws-sdk-account = '1.44.0' -aws-sdk-acm = '1.44.0' -aws-sdk-acmpca = '1.46.0' -aws-sdk-amp = '1.43.0' -aws-sdk-amplify = '1.46.0' -aws-sdk-amplifybackend = '1.43.0' -aws-sdk-amplifyuibuilder = '1.43.0' -aws-sdk-apigateway = '1.44.0' -aws-sdk-apigatewaymanagement = '1.43.0' -aws-sdk-apigatewayv2 = '1.43.0' -aws-sdk-appconfig = '1.45.0' -aws-sdk-appconfigdata = '1.43.0' -aws-sdk-appfabric = '1.43.0' -aws-sdk-appflow = '1.43.0' -aws-sdk-appintegrations = '1.44.0' -aws-sdk-applicationautoscaling = '1.47.0' -aws-sdk-applicationcostprofiler = '1.43.0' -aws-sdk-applicationdiscovery = '1.44.0' -aws-sdk-applicationinsights = '1.43.0' -aws-sdk-applicationsignals = '1.15.0' -aws-sdk-appmesh = '1.43.0' -aws-sdk-apprunner = '1.44.0' -aws-sdk-appstream = '1.45.0' -aws-sdk-appsync = '1.49.0' -aws-sdk-apptest = '1.13.0' -aws-sdk-arczonalshift = '1.44.0' -aws-sdk-artifact = '1.31.0' -aws-sdk-athena = '1.45.0' -aws-sdk-auditmanager = '1.44.0' -aws-sdk-autoscaling = '1.46.0' -aws-sdk-autoscalingplans = '1.43.0' -aws-sdk-b2bi = '1.44.0' -aws-sdk-backup = '1.46.0' -aws-sdk-backupgateway = '1.43.0' -aws-sdk-batch = '1.50.0' -aws-sdk-bcmdataexports = '1.41.0' -aws-sdk-bedrock = '1.51.0' -aws-sdk-bedrockagent = '1.51.0' -aws-sdk-bedrockagentruntime = '1.50.0' -aws-sdk-bedrockruntime = '1.50.0' -aws-sdk-billingconductor = '1.44.0' -aws-sdk-braket = '1.45.0' -aws-sdk-budgets = '1.43.0' -aws-sdk-chatbot = '1.31.0' -aws-sdk-chime = '1.43.0' -aws-sdk-chimesdkidentity = '1.43.0' -aws-sdk-chimesdkmediapipelines = '1.44.0' -aws-sdk-chimesdkmeetings = '1.44.0' -aws-sdk-chimesdkmessaging = '1.43.0' -aws-sdk-chimesdkvoice = '1.44.0' -aws-sdk-cleanrooms = '1.48.0' -aws-sdk-cleanroomsml = '1.42.0' -aws-sdk-cloud9 = '1.44.0' -aws-sdk-cloudcontrol = '1.43.0' -aws-sdk-clouddirectory = '1.43.0' -aws-sdk-cloudformation = '1.48.0' -aws-sdk-cloudfront = '1.45.0' -aws-sdk-cloudfrontkeyvaluestore = '1.43.0' -aws-sdk-cloudhsm = '1.43.0' -aws-sdk-cloudhsmv2 = '1.44.0' -aws-sdk-cloudsearch = '1.43.0' -aws-sdk-cloudsearchdomain = '1.43.0' -aws-sdk-cloudtrail = '1.46.0' -aws-sdk-cloudtraildata = '1.43.0' -aws-sdk-cloudwatch = '1.48.0' -aws-sdk-cloudwatchevents = '1.43.0' -aws-sdk-cloudwatchlogs = '1.49.0' -aws-sdk-codeartifact = '1.45.0' -aws-sdk-codebuild = '1.54.0' -aws-sdk-codecatalyst = '1.44.0' -aws-sdk-codecommit = '1.44.0' -aws-sdk-codeconnections = '1.25.0' -aws-sdk-codedeploy = '1.45.0' -aws-sdk-codeguruprofiler = '1.43.0' -aws-sdk-codegurureviewer = '1.43.0' -aws-sdk-codegurusecurity = '1.44.0' -aws-sdk-codepipeline = '1.47.0' -aws-sdk-codestarconnections = '1.45.0' -aws-sdk-codestarnotifications = '1.43.0' -aws-sdk-cognitoidentity = '1.44.0' -aws-sdk-cognitoidentityprovider = '1.51.0' -aws-sdk-cognitosync = '1.43.0' -aws-sdk-comprehend = '1.43.0' -aws-sdk-comprehendmedical = '1.43.0' -aws-sdk-computeoptimizer = '1.44.0' -aws-sdk-config = '1.45.0' -aws-sdk-connect = '1.63.0' -aws-sdk-connectcampaigns = '1.45.0' -aws-sdk-connectcases = '1.46.0' -aws-sdk-connectcontactlens = '1.44.0' -aws-sdk-connectparticipant = '1.44.0' -aws-sdk-controlcatalog = '1.25.0' -aws-sdk-controltower = '1.46.0' -aws-sdk-costandusagereport = '1.44.0' -aws-sdk-costexplorer = '1.45.0' -aws-sdk-costoptimizationhub = '1.43.0' -aws-sdk-customerprofiles = '1.45.0' -aws-sdk-databasemigration = '1.44.0' -aws-sdk-databrew = '1.43.0' -aws-sdk-dataexchange = '1.43.0' -aws-sdk-datapipeline = '1.43.0' -aws-sdk-datasync = '1.46.0' -aws-sdk-datazone = '1.54.0' -aws-sdk-dax = '1.43.0' -aws-sdk-deadline = '1.26.0' -aws-sdk-detective = '1.43.0' -aws-sdk-devicefarm = '1.45.0' -aws-sdk-devopsguru = '1.43.0' -aws-sdk-directconnect = '1.44.0' -aws-sdk-directory = '1.44.0' -aws-sdk-dlm = '1.43.0' -aws-sdk-docdb = '1.46.0' -aws-sdk-docdbelastic = '1.44.0' -aws-sdk-drs = '1.46.0' -aws-sdk-dynamodb = '1.46.0' -aws-sdk-dynamodbstreams = '1.43.0' -aws-sdk-ebs = '1.43.0' -aws-sdk-ec2 = '1.73.0' -aws-sdk-ec2instanceconnect = '1.43.0' -aws-sdk-ecr = '1.46.0' -aws-sdk-ecrpublic = '1.43.0' -aws-sdk-ecs = '1.45.0' -aws-sdk-efs = '1.44.0' -aws-sdk-eks = '1.50.0' -aws-sdk-eksauth = '1.41.0' -aws-sdk-elasticache = '1.46.0' -aws-sdk-elasticbeanstalk = '1.44.0' -aws-sdk-elasticinference = '1.43.0' -aws-sdk-elasticloadbalancing = '1.44.0' -aws-sdk-elasticloadbalancingv2 = '1.48.0' -aws-sdk-elasticsearch = '1.46.0' -aws-sdk-elastictranscoder = '1.44.0' -aws-sdk-emr = '1.47.0' -aws-sdk-emrcontainers = '1.47.0' -aws-sdk-emrserverless = '1.46.0' -aws-sdk-entityresolution = '1.47.0' -aws-sdk-eventbridge = '1.45.0' -aws-sdk-evidently = '1.43.0' -aws-sdk-finspace = '1.46.0' -aws-sdk-finspacedata = '1.43.0' -aws-sdk-firehose = '1.48.0' -aws-sdk-fis = '1.45.0' -aws-sdk-fms = '1.46.0' -aws-sdk-forecast = '1.43.0' -aws-sdk-forecastquery = '1.43.0' -aws-sdk-frauddetector = '1.43.0' -aws-sdk-freetier = '1.41.0' -aws-sdk-fsx = '1.47.0' -aws-sdk-gamelift = '1.46.0' -aws-sdk-glacier = '1.43.0' -aws-sdk-globalaccelerator = '1.45.0' -aws-sdk-glue = '1.61.0' -aws-sdk-grafana = '1.45.0' -aws-sdk-greengrass = '1.43.0' -aws-sdk-greengrassv2 = '1.44.0' -aws-sdk-groundstation = '1.44.0' -aws-sdk-guardduty = '1.49.0' -aws-sdk-health = '1.43.0' -aws-sdk-healthlake = '1.44.0' -aws-sdk-iam = '1.45.0' -aws-sdk-identitystore = '1.43.0' -aws-sdk-imagebuilder = '1.44.0' -aws-sdk-inspector = '1.43.0' -aws-sdk-inspector2 = '1.48.0' -aws-sdk-inspectorscan = '1.43.0' -aws-sdk-internetmonitor = '1.47.0' -aws-sdk-iot = '1.47.0' -aws-sdk-iot1clickdevices = '1.43.0' -aws-sdk-iot1clickprojects = '1.43.0' -aws-sdk-iotanalytics = '1.43.0' -aws-sdk-iotdataplane = '1.43.0' -aws-sdk-iotdeviceadvisor = '1.43.0' -aws-sdk-iotevents = '1.44.0' -aws-sdk-ioteventsdata = '1.43.0' -aws-sdk-iotfleethub = '1.43.0' -aws-sdk-iotfleetwise = '1.45.0' -aws-sdk-iotjobsdataplane = '1.43.0' -aws-sdk-iotsecuretunneling = '1.43.0' -aws-sdk-iotsitewise = '1.45.0' -aws-sdk-iotthingsgraph = '1.43.0' -aws-sdk-iottwinmaker = '1.43.0' -aws-sdk-iotwireless = '1.46.0' -aws-sdk-ivs = '1.47.0' -aws-sdk-ivschat = '1.44.0' -aws-sdk-ivsrealtime = '1.47.0' -aws-sdk-kafka = '1.47.0' -aws-sdk-kafkaconnect = '1.44.0' -aws-sdk-kendra = '1.44.0' -aws-sdk-kendraranking = '1.43.0' -aws-sdk-keyspaces = '1.44.0' -aws-sdk-kinesis = '1.44.0' -aws-sdk-kinesisanalytics = '1.43.0' -aws-sdk-kinesisanalyticsv2 = '1.47.0' -aws-sdk-kinesisvideo = '1.44.0' -aws-sdk-kinesisvideoarchivedmedia = '1.44.0' -aws-sdk-kinesisvideomedia = '1.43.0' -aws-sdk-kinesisvideosignaling = '1.43.0' -aws-sdk-kinesisvideowebrtcstorage = '1.44.0' -aws-sdk-kms = '1.44.0' -aws-sdk-lakeformation = '1.46.0' -aws-sdk-lambda = '1.46.0' -aws-sdk-launchwizard = '1.44.0' -aws-sdk-lexmodelbuilding = '1.43.0' -aws-sdk-lexmodelsv2 = '1.47.0' -aws-sdk-lexruntime = '1.43.0' -aws-sdk-lexruntimev2 = '1.43.0' -aws-sdk-licensemanager = '1.43.0' -aws-sdk-licensemanagerlinuxsubscriptions = '1.44.0' -aws-sdk-licensemanagerusersubscriptions = '1.43.0' -aws-sdk-lightsail = '1.47.0' -aws-sdk-location = '1.46.0' -aws-sdk-lookoutequipment = '1.45.0' -aws-sdk-lookoutmetrics = '1.43.0' -aws-sdk-lookoutvision = '1.43.0' -aws-sdk-m2 = '1.44.0' -aws-sdk-machinelearning = '1.43.0' -aws-sdk-macie2 = '1.45.0' -aws-sdk-mailmanager = '1.18.0' -aws-sdk-managedblockchain = '1.43.0' -aws-sdk-managedblockchainquery = '1.46.0' -aws-sdk-marketplaceagreement = '1.40.0' -aws-sdk-marketplacecatalog = '1.47.0' -aws-sdk-marketplacecommerceanalytics = '1.43.0' -aws-sdk-marketplacedeployment = '1.40.0' -aws-sdk-marketplaceentitlement = '1.44.0' -aws-sdk-marketplacemetering = '1.43.0' -aws-sdk-mediaconnect = '1.45.0' -aws-sdk-mediaconvert = '1.49.0' -aws-sdk-medialive = '1.53.0' -aws-sdk-mediapackage = '1.43.0' -aws-sdk-mediapackagev2 = '1.46.0' -aws-sdk-mediapackagevod = '1.43.0' -aws-sdk-mediastore = '1.43.0' -aws-sdk-mediastoredata = '1.43.0' -aws-sdk-mediatailor = '1.45.0' -aws-sdk-medicalimaging = '1.46.0' -aws-sdk-memorydb = '1.43.0' -aws-sdk-mgn = '1.43.0' -aws-sdk-migrationhub = '1.43.0' -aws-sdk-migrationhubconfig = '1.43.0' -aws-sdk-migrationhuborchestrator = '1.44.0' -aws-sdk-migrationhubrefactorspaces = '1.43.0' -aws-sdk-migrationhubstrategy = '1.43.0' -aws-sdk-mq = '1.44.0' -aws-sdk-mturk = '1.43.0' -aws-sdk-mwaa = '1.46.0' -aws-sdk-neptune = '1.44.0' -aws-sdk-neptunedata = '1.43.0' -aws-sdk-neptunegraph = '1.41.0' -aws-sdk-networkfirewall = '1.44.0' -aws-sdk-networkmanager = '1.45.0' -aws-sdk-networkmonitor = '1.34.0' -aws-sdk-nimble = '1.43.0' -aws-sdk-oam = '1.45.0' -aws-sdk-omics = '1.46.0' -aws-sdk-opensearch = '1.52.0' -aws-sdk-opensearchserverless = '1.45.0' -aws-sdk-opsworks = '1.43.0' -aws-sdk-opsworkscm = '1.43.0' -aws-sdk-organizations = '1.47.0' -aws-sdk-osis = '1.45.0' -aws-sdk-outposts = '1.46.0' -aws-sdk-panorama = '1.43.0' -aws-sdk-paymentcryptography = '1.46.0' -aws-sdk-paymentcryptographydata = '1.45.0' -aws-sdk-pcaconnectorad = '1.43.0' -aws-sdk-pcaconnectorscep = '1.13.0' -aws-sdk-pcs = '1.4.0' -aws-sdk-personalize = '1.45.0' -aws-sdk-personalizeevents = '1.43.0' -aws-sdk-personalizeruntime = '1.43.0' -aws-sdk-pi = '1.44.0' -aws-sdk-pinpoint = '1.45.0' -aws-sdk-pinpointemail = '1.43.0' -aws-sdk-pinpointsmsvoice = '1.43.0' -aws-sdk-pinpointsmsvoicev2 = '1.44.0' -aws-sdk-pipes = '1.45.0' -aws-sdk-polly = '1.45.0' -aws-sdk-pricing = '1.45.0' -aws-sdk-privatenetworks = '1.43.0' -aws-sdk-proton = '1.43.0' -aws-sdk-qapps = '1.10.0' -aws-sdk-qbusiness = '1.45.0' -aws-sdk-qconnect = '1.46.0' -aws-sdk-qldb = '1.43.0' -aws-sdk-qldbsession = '1.43.0' -aws-sdk-quicksight = '1.52.0' -aws-sdk-ram = '1.43.0' -aws-sdk-rbin = '1.44.0' -aws-sdk-rds = '1.55.0' -aws-sdk-rdsdata = '1.43.0' -aws-sdk-redshift = '1.44.0' -aws-sdk-redshiftdata = '1.44.0' -aws-sdk-redshiftserverless = '1.45.0' -aws-sdk-rekognition = '1.46.0' -aws-sdk-repostspace = '1.41.0' -aws-sdk-resiliencehub = '1.44.0' -aws-sdk-resourceexplorer2 = '1.44.0' -aws-sdk-resourcegroups = '1.44.0' -aws-sdk-resourcegroupstagging = '1.43.0' -aws-sdk-robomaker = '1.43.0' -aws-sdk-rolesanywhere = '1.47.0' -aws-sdk-route53 = '1.46.0' -aws-sdk-route53domains = '1.45.0' -aws-sdk-route53profiles = '1.22.0' -aws-sdk-route53recoverycluster = '1.43.0' -aws-sdk-route53recoverycontrolconfig = '1.43.0' -aws-sdk-route53recoveryreadiness = '1.43.0' -aws-sdk-route53resolver = '1.47.0' -aws-sdk-rum = '1.43.0' -aws-sdk-s3 = '1.50.0' -aws-sdk-s3control = '1.46.0' -aws-sdk-s3outposts = '1.43.0' -aws-sdk-sagemaker = '1.72.0' -aws-sdk-sagemakera2iruntime = '1.43.0' -aws-sdk-sagemakeredge = '1.43.0' -aws-sdk-sagemakerfeaturestoreruntime = '1.44.0' -aws-sdk-sagemakergeospatial = '1.43.0' -aws-sdk-sagemakermetrics = '1.43.0' -aws-sdk-sagemakerruntime = '1.45.0' -aws-sdk-savingsplans = '1.44.0' -aws-sdk-scheduler = '1.43.0' -aws-sdk-schemas = '1.43.0' -aws-sdk-secretsmanager = '1.47.0' -aws-sdk-securityhub = '1.46.0' -aws-sdk-securitylake = '1.45.0' -aws-sdk-serverlessapplicationrepository = '1.43.0' -aws-sdk-servicecatalog = '1.44.0' -aws-sdk-servicecatalogappregistry = '1.43.0' -aws-sdk-servicediscovery = '1.43.0' -aws-sdk-servicequotas = '1.43.0' -aws-sdk-ses = '1.45.0' -aws-sdk-sesv2 = '1.46.0' -aws-sdk-sfn = '1.46.0' -aws-sdk-shield = '1.43.0' -aws-sdk-signer = '1.43.0' -aws-sdk-simspaceweaver = '1.43.0' -aws-sdk-sms = '1.43.0' -aws-sdk-snowball = '1.43.0' -aws-sdk-snowdevicemanagement = '1.43.0' -aws-sdk-sns = '1.44.0' -aws-sdk-sqs = '1.43.0' -aws-sdk-ssm = '1.48.0' -aws-sdk-ssmcontacts = '1.43.0' -aws-sdk-ssmincidents = '1.43.0' -aws-sdk-ssmquicksetup = '1.7.0' -aws-sdk-ssmsap = '1.45.0' -aws-sdk-sso = '1.43.0' -aws-sdk-ssoadmin = '1.43.0' -aws-sdk-ssooidc = '1.44.0' -aws-sdk-storagegateway = '1.47.0' -aws-sdk-sts = '1.43.0' -aws-sdk-supplychain = '1.34.0' -aws-sdk-support = '1.44.0' -aws-sdk-supportapp = '1.43.0' -aws-sdk-swf = '1.45.0' -aws-sdk-synthetics = '1.44.0' -aws-sdk-taxsettings = '1.15.0' -aws-sdk-textract = '1.43.0' -aws-sdk-timestreaminfluxdb = '1.26.0' -aws-sdk-timestreamquery = '1.44.0' -aws-sdk-timestreamwrite = '1.43.0' -aws-sdk-tnb = '1.44.0' -aws-sdk-transcribe = '1.44.0' -aws-sdk-transcribestreaming = '1.43.0' -aws-sdk-transfer = '1.47.0' -aws-sdk-translate = '1.43.0' -aws-sdk-trustedadvisor = '1.44.0' -aws-sdk-verifiedpermissions = '1.49.0' -aws-sdk-voiceid = '1.43.0' -aws-sdk-vpclattice = '1.44.0' -aws-sdk-waf = '1.44.0' -aws-sdk-wafregional = '1.44.0' -aws-sdk-wafv2 = '1.47.0' -aws-sdk-wellarchitected = '1.44.0' -aws-sdk-wisdom = '1.44.0' -aws-sdk-workdocs = '1.43.0' -aws-sdk-worklink = '1.43.0' -aws-sdk-workmail = '1.43.0' -aws-sdk-workmailmessageflow = '1.43.0' -aws-sdk-workspaces = '1.49.0' -aws-sdk-workspacesthinclient = '1.44.0' -aws-sdk-workspacesweb = '1.45.0' -aws-sdk-xray = '1.43.0' +aws-sdk-costexplorer = '1.46.0' +aws-sdk-directory = '1.45.0' +aws-sdk-directoryservicedata = '1.0.0' +aws-sdk-guardduty = '1.50.0' +aws-sdk-mailmanager = '1.19.0' +aws-sdk-rds = '1.55.1' +aws-sdk-s3 = '1.51.0'