diff --git a/.changelog/6f18ff54681f40c9b7bfb6213e718fd5.json b/.changelog/6f18ff54681f40c9b7bfb6213e718fd5.json new file mode 100644 index 00000000000..e8b09eb8f0d --- /dev/null +++ b/.changelog/6f18ff54681f40c9b7bfb6213e718fd5.json @@ -0,0 +1,8 @@ +{ + "id": "6f18ff54-681f-40c9-b7bf-b6213e718fd5", + "type": "feature", + "description": "This release provides a way to search for existing tags within an instance. Before tagging a resource, ensure consistency by searching for pre-existing key:value pairs.", + "modules": [ + "service/connect" + ] +} \ No newline at end of file diff --git a/.changelog/96d08fe0a417405499cdf8353abf5e8c.json b/.changelog/96d08fe0a417405499cdf8353abf5e8c.json new file mode 100644 index 00000000000..09aca32b0de --- /dev/null +++ b/.changelog/96d08fe0a417405499cdf8353abf5e8c.json @@ -0,0 +1,8 @@ +{ + "id": "96d08fe0-a417-4054-99cd-f8353abf5e8c", + "type": "feature", + "description": "Support for a new API \"GetMFADevice\" to present MFA device metadata such as device certifications", + "modules": [ + "service/iam" + ] +} \ No newline at end of file diff --git a/.changelog/bd82137112cb4445a5b18d172f5fbbb9.json b/.changelog/bd82137112cb4445a5b18d172f5fbbb9.json new file mode 100644 index 00000000000..27033340fc9 --- /dev/null +++ b/.changelog/bd82137112cb4445a5b18d172f5fbbb9.json @@ -0,0 +1,8 @@ +{ + "id": "bd821371-12cb-4445-a5b1-8d172f5fbbb9", + "type": "feature", + "description": "Added time zone estimation support for journeys", + "modules": [ + "service/pinpoint" + ] +} \ No newline at end of file diff --git a/.changelog/bdaf6ddc0eb9459991135ce8b23a778a.json b/.changelog/bdaf6ddc0eb9459991135ce8b23a778a.json new file mode 100644 index 00000000000..24cf8e77883 --- /dev/null +++ b/.changelog/bdaf6ddc0eb9459991135ce8b23a778a.json @@ -0,0 +1,8 @@ +{ + "id": "bdaf6ddc-0eb9-4599-9113-5ce8b23a778a", + "type": "feature", + "description": "Timestamp Starting Position For Kinesis and Kafka Data Sources in a Glue Streaming Job", + "modules": [ + "service/glue" + ] +} \ No newline at end of file diff --git a/.changelog/d81777ddf6914a5dbbb8b6d9ebc0c402.json b/.changelog/d81777ddf6914a5dbbb8b6d9ebc0c402.json new file mode 100644 index 00000000000..3f2c581d4b2 --- /dev/null +++ b/.changelog/d81777ddf6914a5dbbb8b6d9ebc0c402.json @@ -0,0 +1,8 @@ +{ + "id": "d81777dd-f691-4a5d-bbb8-b6d9ebc0c402", + "type": "feature", + "description": "Add support for user.extra.sessionName in Kubernetes Audit Logs Findings.", + "modules": [ + "service/guardduty" + ] +} \ No newline at end of file diff --git a/service/connect/api_op_ClaimPhoneNumber.go b/service/connect/api_op_ClaimPhoneNumber.go index cdf85a2d135..208b8230bec 100644 --- a/service/connect/api_op_ClaimPhoneNumber.go +++ b/service/connect/api_op_ClaimPhoneNumber.go @@ -21,7 +21,19 @@ import ( // SearchAvailablePhoneNumbers (https://docs.aws.amazon.com/connect/latest/APIReference/API_SearchAvailablePhoneNumbers.html) // API for available phone numbers that you can claim. Call the DescribePhoneNumber (https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribePhoneNumber.html) // API to verify the status of a previous ClaimPhoneNumber (https://docs.aws.amazon.com/connect/latest/APIReference/API_ClaimPhoneNumber.html) -// operation. +// operation. If you plan to claim and release numbers frequently during a 30 day +// period, contact us for a service quota exception. Otherwise, it is possible you +// will be blocked from claiming and releasing any more numbers until 30 days past +// the oldest number released has expired. By default you can claim and release up +// to 200% of your maximum number of active phone numbers during any 30 day period. +// If you claim and release phone numbers using the UI or API during a rolling 30 +// day cycle that exceeds 200% of your phone number service level quota, you will +// be blocked from claiming any more numbers until 30 days past the oldest number +// released has expired. For example, if you already have 99 claimed numbers and a +// service level quota of 99 phone numbers, and in any 30 day period you release +// 99, claim 99, and then release 99, you will have exceeded the 200% limit. At +// that point you are blocked from claiming any more numbers until you open an +// Amazon Web Services support ticket. func (c *Client) ClaimPhoneNumber(ctx context.Context, params *ClaimPhoneNumberInput, optFns ...func(*Options)) (*ClaimPhoneNumberOutput, error) { if params == nil { params = &ClaimPhoneNumberInput{} diff --git a/service/connect/api_op_ReleasePhoneNumber.go b/service/connect/api_op_ReleasePhoneNumber.go index c9313a3cf7f..a4e05f9a01a 100644 --- a/service/connect/api_op_ReleasePhoneNumber.go +++ b/service/connect/api_op_ReleasePhoneNumber.go @@ -18,7 +18,19 @@ import ( // Connect console. After releasing a phone number, the phone number enters into a // cooldown period of 30 days. It cannot be searched for or claimed again until the // period has ended. If you accidentally release a phone number, contact Amazon Web -// Services Support. +// Services Support. If you plan to claim and release numbers frequently during a +// 30 day period, contact us for a service quota exception. Otherwise, it is +// possible you will be blocked from claiming and releasing any more numbers until +// 30 days past the oldest number released has expired. By default you can claim +// and release up to 200% of your maximum number of active phone numbers during any +// 30 day period. If you claim and release phone numbers using the UI or API during +// a rolling 30 day cycle that exceeds 200% of your phone number service level +// quota, you will be blocked from claiming any more numbers until 30 days past the +// oldest number released has expired. For example, if you already have 99 claimed +// numbers and a service level quota of 99 phone numbers, and in any 30 day period +// you release 99, claim 99, and then release 99, you will have exceeded the 200% +// limit. At that point you are blocked from claiming any more numbers until you +// open an Amazon Web Services support ticket. func (c *Client) ReleasePhoneNumber(ctx context.Context, params *ReleasePhoneNumberInput, optFns ...func(*Options)) (*ReleasePhoneNumberOutput, error) { if params == nil { params = &ReleasePhoneNumberInput{} diff --git a/service/connect/api_op_SearchResourceTags.go b/service/connect/api_op_SearchResourceTags.go new file mode 100644 index 00000000000..83c58c0422d --- /dev/null +++ b/service/connect/api_op_SearchResourceTags.go @@ -0,0 +1,235 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connect + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/connect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Searches tags used in an Amazon Connect instance using optional search criteria. +func (c *Client) SearchResourceTags(ctx context.Context, params *SearchResourceTagsInput, optFns ...func(*Options)) (*SearchResourceTagsOutput, error) { + if params == nil { + params = &SearchResourceTagsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SearchResourceTags", params, optFns, c.addOperationSearchResourceTagsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SearchResourceTagsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SearchResourceTagsInput struct { + + // The identifier of the Amazon Connect instance. You can find the instanceId in + // the Amazon Resource Name (ARN) of the instance. + // + // This member is required. + InstanceId *string + + // The maximum number of results to return per page. + MaxResults *int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + // The list of resource types to be used to search tags from. If not provided or + // if any empty list is provided, this API will search from all supported resource + // types. + ResourceTypes []string + + // The search criteria to be used to return tags. + SearchCriteria *types.ResourceTagsSearchCriteria + + noSmithyDocumentSerde +} + +type SearchResourceTagsOutput struct { + + // If there are additional results, this is the token for the next set of results. + NextToken *string + + // A list of tags used in the Amazon Connect instance. + Tags []types.TagSet + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSearchResourceTagsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpSearchResourceTags{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSearchResourceTags{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpSearchResourceTagsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchResourceTags(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// SearchResourceTagsAPIClient is a client that implements the SearchResourceTags +// operation. +type SearchResourceTagsAPIClient interface { + SearchResourceTags(context.Context, *SearchResourceTagsInput, ...func(*Options)) (*SearchResourceTagsOutput, error) +} + +var _ SearchResourceTagsAPIClient = (*Client)(nil) + +// SearchResourceTagsPaginatorOptions is the paginator options for +// SearchResourceTags +type SearchResourceTagsPaginatorOptions struct { + // The maximum number of results to return per page. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// SearchResourceTagsPaginator is a paginator for SearchResourceTags +type SearchResourceTagsPaginator struct { + options SearchResourceTagsPaginatorOptions + client SearchResourceTagsAPIClient + params *SearchResourceTagsInput + nextToken *string + firstPage bool +} + +// NewSearchResourceTagsPaginator returns a new SearchResourceTagsPaginator +func NewSearchResourceTagsPaginator(client SearchResourceTagsAPIClient, params *SearchResourceTagsInput, optFns ...func(*SearchResourceTagsPaginatorOptions)) *SearchResourceTagsPaginator { + if params == nil { + params = &SearchResourceTagsInput{} + } + + options := SearchResourceTagsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &SearchResourceTagsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchResourceTagsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next SearchResourceTags page. +func (p *SearchResourceTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchResourceTagsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.SearchResourceTags(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opSearchResourceTags(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "connect", + OperationName: "SearchResourceTags", + } +} diff --git a/service/connect/deserializers.go b/service/connect/deserializers.go index c1020e54aab..6e87253b99a 100644 --- a/service/connect/deserializers.go +++ b/service/connect/deserializers.go @@ -20605,6 +20605,177 @@ func awsRestjson1_deserializeOpDocumentSearchQuickConnectsOutput(v **SearchQuick return nil } +type awsRestjson1_deserializeOpSearchResourceTags struct { +} + +func (*awsRestjson1_deserializeOpSearchResourceTags) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpSearchResourceTags) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorSearchResourceTags(response, &metadata) + } + output := &SearchResourceTagsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentSearchResourceTagsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorSearchResourceTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("MaximumResultReturnedException", errorCode): + return awsRestjson1_deserializeErrorMaximumResultReturnedException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentSearchResourceTagsOutput(v **SearchResourceTagsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *SearchResourceTagsOutput + if *v == nil { + sv = &SearchResourceTagsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken2500 to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "Tags": + if err := awsRestjson1_deserializeDocumentTagsList(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpSearchRoutingProfiles struct { } @@ -28016,6 +28187,42 @@ func awsRestjson1_deserializeErrorLimitExceededException(response *smithyhttp.Re return output } +func awsRestjson1_deserializeErrorMaximumResultReturnedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.MaximumResultReturnedException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentMaximumResultReturnedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + func awsRestjson1_deserializeErrorOutboundContactNotPermittedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.OutboundContactNotPermittedException{} var buff [1024]byte @@ -35638,6 +35845,46 @@ func awsRestjson1_deserializeDocumentListPhoneNumbersSummaryList(v *[]types.List return nil } +func awsRestjson1_deserializeDocumentMaximumResultReturnedException(v **types.MaximumResultReturnedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.MaximumResultReturnedException + if *v == nil { + sv = &types.MaximumResultReturnedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentMediaConcurrencies(v *[]types.MediaConcurrency, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -39843,6 +40090,89 @@ func awsRestjson1_deserializeDocumentTagRestrictedResourceList(v *[]string, valu return nil } +func awsRestjson1_deserializeDocumentTagSet(v **types.TagSet, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.TagSet + if *v == nil { + sv = &types.TagSet{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "key": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) + } + sv.Key = ptr.String(jtv) + } + + case "value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTagsList(v *[]types.TagSet, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.TagSet + if *v == nil { + cv = []types.TagSet{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.TagSet + destAddr := &col + if err := awsRestjson1_deserializeDocumentTagSet(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentTaskActionDefinition(v **types.TaskActionDefinition, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/connect/generated.json b/service/connect/generated.json index b9cfd4b8bc4..43801ff00a2 100644 --- a/service/connect/generated.json +++ b/service/connect/generated.json @@ -144,6 +144,7 @@ "api_op_SearchPrompts.go", "api_op_SearchQueues.go", "api_op_SearchQuickConnects.go", + "api_op_SearchResourceTags.go", "api_op_SearchRoutingProfiles.go", "api_op_SearchSecurityProfiles.go", "api_op_SearchUsers.go", diff --git a/service/connect/serializers.go b/service/connect/serializers.go index 6af125ac9c6..99a683aa696 100644 --- a/service/connect/serializers.go +++ b/service/connect/serializers.go @@ -10668,6 +10668,98 @@ func awsRestjson1_serializeOpDocumentSearchQuickConnectsInput(v *SearchQuickConn return nil } +type awsRestjson1_serializeOpSearchResourceTags struct { +} + +func (*awsRestjson1_serializeOpSearchResourceTags) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpSearchResourceTags) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SearchResourceTagsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/search-resource-tags") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentSearchResourceTagsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsSearchResourceTagsInput(v *SearchResourceTagsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentSearchResourceTagsInput(v *SearchResourceTagsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.InstanceId != nil { + ok := object.Key("InstanceId") + ok.String(*v.InstanceId) + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if v.ResourceTypes != nil { + ok := object.Key("ResourceTypes") + if err := awsRestjson1_serializeDocumentResourceTypeList(v.ResourceTypes, ok); err != nil { + return err + } + } + + if v.SearchCriteria != nil { + ok := object.Key("SearchCriteria") + if err := awsRestjson1_serializeDocumentResourceTagsSearchCriteria(v.SearchCriteria, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpSearchRoutingProfiles struct { } @@ -17932,6 +18024,31 @@ func awsRestjson1_serializeDocumentRequiredTaskTemplateFields(v []types.Required return nil } +func awsRestjson1_serializeDocumentResourceTagsSearchCriteria(v *types.ResourceTagsSearchCriteria, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.TagSearchCondition != nil { + ok := object.Key("TagSearchCondition") + if err := awsRestjson1_serializeDocumentTagSearchCondition(v.TagSearchCondition, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentResourceTypeList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsRestjson1_serializeDocumentRoutingProfileQueueConfig(v *types.RoutingProfileQueueConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -18393,6 +18510,33 @@ func awsRestjson1_serializeDocumentTagRestrictedResourceList(v []string, value s return nil } +func awsRestjson1_serializeDocumentTagSearchCondition(v *types.TagSearchCondition, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.TagKey != nil { + ok := object.Key("tagKey") + ok.String(*v.TagKey) + } + + if len(v.TagKeyComparisonType) > 0 { + ok := object.Key("tagKeyComparisonType") + ok.String(string(v.TagKeyComparisonType)) + } + + if v.TagValue != nil { + ok := object.Key("tagValue") + ok.String(*v.TagValue) + } + + if len(v.TagValueComparisonType) > 0 { + ok := object.Key("tagValueComparisonType") + ok.String(string(v.TagValueComparisonType)) + } + + return nil +} + func awsRestjson1_serializeDocumentTaskActionDefinition(v *types.TaskActionDefinition, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/connect/types/errors.go b/service/connect/types/errors.go index 05327d9dade..c1cb305b0b2 100644 --- a/service/connect/types/errors.go +++ b/service/connect/types/errors.go @@ -324,6 +324,33 @@ func (e *LimitExceededException) ErrorCode() string { } func (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// Maximum number (1000) of tags have been returned with current request. Consider +// changing request parameters to get more tags. +type MaximumResultReturnedException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *MaximumResultReturnedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *MaximumResultReturnedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *MaximumResultReturnedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "MaximumResultReturnedException" + } + return *e.ErrorCodeOverride +} +func (e *MaximumResultReturnedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The contact is not permitted. type OutboundContactNotPermittedException struct { Message *string diff --git a/service/connect/types/types.go b/service/connect/types/types.go index 592028927ac..55fb79e928a 100644 --- a/service/connect/types/types.go +++ b/service/connect/types/types.go @@ -2779,6 +2779,15 @@ type RequiredFieldInfo struct { noSmithyDocumentSerde } +// The search criteria to be used to search tags. +type ResourceTagsSearchCriteria struct { + + // The search criteria to be used to return tags. + TagSearchCondition *TagSearchCondition + + noSmithyDocumentSerde +} + // Contains information about a routing profile. type RoutingProfile struct { @@ -3344,6 +3353,38 @@ type TagCondition struct { noSmithyDocumentSerde } +// The search criteria to be used to return tags. +type TagSearchCondition struct { + + // The tag key used in the tag search condition. + TagKey *string + + // The type of comparison to be made when evaluating the tag key in tag search + // condition. + TagKeyComparisonType StringComparisonType + + // The tag value used in the tag search condition. + TagValue *string + + // The type of comparison to be made when evaluating the tag value in tag search + // condition. + TagValueComparisonType StringComparisonType + + noSmithyDocumentSerde +} + +// A tag set contains tag key and tag value. +type TagSet struct { + + // The tag key in the tagSet. + Key *string + + // The tag value in the tagSet. + Value *string + + noSmithyDocumentSerde +} + // Information about the task action. type TaskActionDefinition struct { diff --git a/service/connect/validators.go b/service/connect/validators.go index dc63ffe2ca2..5bbbcdd732c 100644 --- a/service/connect/validators.go +++ b/service/connect/validators.go @@ -2670,6 +2670,26 @@ func (m *validateOpSearchQuickConnects) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpSearchResourceTags struct { +} + +func (*validateOpSearchResourceTags) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSearchResourceTags) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SearchResourceTagsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSearchResourceTagsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpSearchRoutingProfiles struct { } @@ -4322,6 +4342,10 @@ func addOpSearchQuickConnectsValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpSearchQuickConnects{}, middleware.After) } +func addOpSearchResourceTagsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSearchResourceTags{}, middleware.After) +} + func addOpSearchRoutingProfilesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpSearchRoutingProfiles{}, middleware.After) } @@ -8261,6 +8285,21 @@ func validateOpSearchQuickConnectsInput(v *SearchQuickConnectsInput) error { } } +func validateOpSearchResourceTagsInput(v *SearchResourceTagsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SearchResourceTagsInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpSearchRoutingProfilesInput(v *SearchRoutingProfilesInput) error { if v == nil { return nil diff --git a/service/glue/deserializers.go b/service/glue/deserializers.go index 5cfd4634aaf..b6298366872 100644 --- a/service/glue/deserializers.go +++ b/service/glue/deserializers.go @@ -39703,6 +39703,19 @@ func awsAwsjson11_deserializeDocumentKafkaStreamingSourceOptions(v **types.Kafka sv.StartingOffsets = ptr.String(jtv) } + case "StartingTimestamp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Iso8601DateTime to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.StartingTimestamp = ptr.Time(t) + } + case "SubscribePattern": if value != nil { jtv, ok := value.(string) @@ -40029,6 +40042,19 @@ func awsAwsjson11_deserializeDocumentKinesisStreamingSourceOptions(v **types.Kin sv.StartingPosition = types.StartingPosition(jtv) } + case "StartingTimestamp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Iso8601DateTime to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.StartingTimestamp = ptr.Time(t) + } + case "StreamArn": if value != nil { jtv, ok := value.(string) diff --git a/service/glue/serializers.go b/service/glue/serializers.go index 825f02673ab..b7046cf43c8 100644 --- a/service/glue/serializers.go +++ b/service/glue/serializers.go @@ -15425,6 +15425,11 @@ func awsAwsjson11_serializeDocumentKafkaStreamingSourceOptions(v *types.KafkaStr ok.String(*v.StartingOffsets) } + if v.StartingTimestamp != nil { + ok := object.Key("StartingTimestamp") + ok.String(smithytime.FormatDateTime(*v.StartingTimestamp)) + } + if v.SubscribePattern != nil { ok := object.Key("SubscribePattern") ok.String(*v.SubscribePattern) @@ -15543,6 +15548,11 @@ func awsAwsjson11_serializeDocumentKinesisStreamingSourceOptions(v *types.Kinesi ok.String(string(v.StartingPosition)) } + if v.StartingTimestamp != nil { + ok := object.Key("StartingTimestamp") + ok.String(smithytime.FormatDateTime(*v.StartingTimestamp)) + } + if v.StreamArn != nil { ok := object.Key("StreamArn") ok.String(*v.StreamArn) diff --git a/service/glue/types/enums.go b/service/glue/types/enums.go index 3a8e36d9408..71f97280730 100644 --- a/service/glue/types/enums.go +++ b/service/glue/types/enums.go @@ -1652,6 +1652,7 @@ const ( StartingPositionLatest StartingPosition = "latest" StartingPositionTrimHorizon StartingPosition = "trim_horizon" StartingPositionEarliest StartingPosition = "earliest" + StartingPositionTimestamp StartingPosition = "timestamp" ) // Values returns all known values for StartingPosition. Note that this can be @@ -1662,6 +1663,7 @@ func (StartingPosition) Values() []StartingPosition { "latest", "trim_horizon", "earliest", + "timestamp", } } diff --git a/service/glue/types/types.go b/service/glue/types/types.go index 4e1c8f62bd2..fb79b4252d6 100644 --- a/service/glue/types/types.go +++ b/service/glue/types/types.go @@ -4317,6 +4317,13 @@ type KafkaStreamingSourceOptions struct { // are "earliest" or "latest" . The default value is "latest" . StartingOffsets *string + // The timestamp of the record in the Kafka topic to start reading data from. The + // possible values are a timestamp string in UTC format of the pattern + // yyyy-mm-ddTHH:MM:SSZ (where Z represents a UTC timezone offset with a +/-. For + // example: "2023-04-04T08:00:00+08:00"). Only one of StartingTimestamp or + // StartingOffsets must be set. + StartingTimestamp *time.Time + // A Java regex string that identifies the topic list to subscribe to. You must // specify at least one of "topicName" , "assign" or "subscribePattern" . SubscribePattern *string @@ -4425,10 +4432,20 @@ type KinesisStreamingSourceOptions struct { RoleSessionName *string // The starting position in the Kinesis data stream to read data from. The - // possible values are "latest" , "trim_horizon" , or "earliest" . The default - // value is "latest" . + // possible values are "latest" , "trim_horizon" , "earliest" , or a timestamp + // string in UTC format in the pattern yyyy-mm-ddTHH:MM:SSZ (where Z represents a + // UTC timezone offset with a +/-. For example: "2023-04-04T08:00:00-04:00"). The + // default value is "latest" . Note: Using a value that is a timestamp string in + // UTC format for "startingPosition" is supported only for Glue version 4.0 or + // later. StartingPosition StartingPosition + // The timestamp of the record in the Kinesis data stream to start reading data + // from. The possible values are a timestamp string in UTC format of the pattern + // yyyy-mm-ddTHH:MM:SSZ (where Z represents a UTC timezone offset with a +/-. For + // example: "2023-04-04T08:00:00+08:00"). + StartingTimestamp *time.Time + // The Amazon Resource Name (ARN) of the Kinesis data stream. StreamArn *string diff --git a/service/guardduty/api_op_ListTagsForResource.go b/service/guardduty/api_op_ListTagsForResource.go index c44bedcd97a..ded2dbfa491 100644 --- a/service/guardduty/api_op_ListTagsForResource.go +++ b/service/guardduty/api_op_ListTagsForResource.go @@ -11,9 +11,9 @@ import ( ) // Lists tags for a resource. Tagging is currently supported for detectors, -// finding filters, IP sets, and threat intel sets, with a limit of 50 tags per -// resource. When invoked, this operation returns all assigned tags for a given -// resource. +// finding filters, IP sets, threat intel sets, publishing destination, with a +// limit of 50 tags per resource. When invoked, this operation returns all assigned +// tags for a given resource. func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { if params == nil { params = &ListTagsForResourceInput{} diff --git a/service/guardduty/deserializers.go b/service/guardduty/deserializers.go index e35c9ed1b84..97edce66ecc 100644 --- a/service/guardduty/deserializers.go +++ b/service/guardduty/deserializers.go @@ -13965,6 +13965,11 @@ func awsRestjson1_deserializeDocumentKubernetesUserDetails(v **types.KubernetesU return err } + case "sessionName": + if err := awsRestjson1_deserializeDocumentSessionNameList(&sv.SessionName, value); err != nil { + return err + } + case "uid": if value != nil { jtv, ok := value.(string) @@ -18546,6 +18551,42 @@ func awsRestjson1_deserializeDocumentServiceAdditionalInfo(v **types.ServiceAddi return nil } +func awsRestjson1_deserializeDocumentSessionNameList(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentSourceIps(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/guardduty/types/types.go b/service/guardduty/types/types.go index f5cba7092e3..ee4d458096f 100644 --- a/service/guardduty/types/types.go +++ b/service/guardduty/types/types.go @@ -1251,6 +1251,10 @@ type KubernetesUserDetails struct { // The groups that include the user who called the Kubernetes API. Groups []string + // Entity that assumes the IAM role when Kubernetes RBAC permissions are assigned + // to that role. + SessionName []string + // The user ID of the user who called the Kubernetes API. Uid *string diff --git a/service/iam/api_op_AttachGroupPolicy.go b/service/iam/api_op_AttachGroupPolicy.go index 3d26330d21c..0fbf91cc41f 100644 --- a/service/iam/api_op_AttachGroupPolicy.go +++ b/service/iam/api_op_AttachGroupPolicy.go @@ -12,8 +12,9 @@ import ( // Attaches the specified managed policy to the specified IAM group. You use this // operation to attach a managed policy to a group. To embed an inline policy in a -// group, use PutGroupPolicy . As a best practice, you can validate your IAM -// policies. To learn more, see Validating IAM policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_policy-validator.html) +// group, use PutGroupPolicy (https://docs.aws.amazon.com/IAM/latest/APIReference/API_PutGroupPolicy.html) +// . As a best practice, you can validate your IAM policies. To learn more, see +// Validating IAM policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_policy-validator.html) // in the IAM User Guide. For more information about policies, see Managed // policies and inline policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) // in the IAM User Guide. diff --git a/service/iam/api_op_AttachRolePolicy.go b/service/iam/api_op_AttachRolePolicy.go index f9b2156657c..781ee62085e 100644 --- a/service/iam/api_op_AttachRolePolicy.go +++ b/service/iam/api_op_AttachRolePolicy.go @@ -14,10 +14,11 @@ import ( // attach a managed policy to a role, the managed policy becomes part of the role's // permission (access) policy. You cannot use a managed policy as the role's trust // policy. The role's trust policy is created at the same time as the role, using -// CreateRole . You can update a role's trust policy using UpdateAssumeRolePolicy . -// Use this operation to attach a managed policy to a role. To embed an inline -// policy in a role, use PutRolePolicy . For more information about policies, see -// Managed policies and inline policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// CreateRole (https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateRole.html) +// . You can update a role's trust policy using UpdateAssumerolePolicy (https://docs.aws.amazon.com/IAM/latest/APIReference/API_UpdateAssumeRolePolicy.html) +// . Use this operation to attach a managed policy to a role. To embed an inline +// policy in a role, use PutRolePolicy (https://docs.aws.amazon.com/IAM/latest/APIReference/API_PutRolePolicy.html) +// . For more information about policies, see Managed policies and inline policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) // in the IAM User Guide. As a best practice, you can validate your IAM policies. // To learn more, see Validating IAM policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_policy-validator.html) // in the IAM User Guide. diff --git a/service/iam/api_op_AttachUserPolicy.go b/service/iam/api_op_AttachUserPolicy.go index 5dcccf52860..22fcb243127 100644 --- a/service/iam/api_op_AttachUserPolicy.go +++ b/service/iam/api_op_AttachUserPolicy.go @@ -12,8 +12,9 @@ import ( // Attaches the specified managed policy to the specified user. You use this // operation to attach a managed policy to a user. To embed an inline policy in a -// user, use PutUserPolicy . As a best practice, you can validate your IAM -// policies. To learn more, see Validating IAM policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_policy-validator.html) +// user, use PutUserPolicy (https://docs.aws.amazon.com/IAM/latest/APIReference/API_PutUserPolicy.html) +// . As a best practice, you can validate your IAM policies. To learn more, see +// Validating IAM policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_policy-validator.html) // in the IAM User Guide. For more information about policies, see Managed // policies and inline policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) // in the IAM User Guide. diff --git a/service/iam/api_op_GetMFADevice.go b/service/iam/api_op_GetMFADevice.go new file mode 100644 index 00000000000..509e7e07f71 --- /dev/null +++ b/service/iam/api_op_GetMFADevice.go @@ -0,0 +1,144 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iam + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves information about an MFA device for a specified user. +func (c *Client) GetMFADevice(ctx context.Context, params *GetMFADeviceInput, optFns ...func(*Options)) (*GetMFADeviceOutput, error) { + if params == nil { + params = &GetMFADeviceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetMFADevice", params, optFns, c.addOperationGetMFADeviceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetMFADeviceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetMFADeviceInput struct { + + // Serial number that uniquely identifies the MFA device. For this API, we only + // accept FIDO security key ARNs (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html) + // . + // + // This member is required. + SerialNumber *string + + // The friendly name identifying the user. + UserName *string + + noSmithyDocumentSerde +} + +type GetMFADeviceOutput struct { + + // Serial number that uniquely identifies the MFA device. For this API, we only + // accept FIDO security key ARNs (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html) + // . + // + // This member is required. + SerialNumber *string + + // The certifications of a specified user's MFA device. We currently provide + // FIPS-140-2, FIPS-140-3, and FIDO certification levels obtained from FIDO + // Alliance Metadata Service (MDS) (https://fidoalliance.org/metadata/) . + Certifications map[string]string + + // The date that a specified user's MFA device was first enabled. + EnableDate *time.Time + + // The friendly name identifying the user. + UserName *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetMFADeviceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsquery_serializeOpGetMFADevice{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetMFADevice{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetMFADeviceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMFADevice(options.Region), middleware.Before); err != nil { + return err + } + if err = awsmiddleware.AddRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetMFADevice(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iam", + OperationName: "GetMFADevice", + } +} diff --git a/service/iam/api_op_ListInstanceProfileTags.go b/service/iam/api_op_ListInstanceProfileTags.go index dfa2050c888..a4ee716568d 100644 --- a/service/iam/api_op_ListInstanceProfileTags.go +++ b/service/iam/api_op_ListInstanceProfileTags.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -151,6 +152,104 @@ func (c *Client) addOperationListInstanceProfileTagsMiddlewares(stack *middlewar return nil } +// ListInstanceProfileTagsAPIClient is a client that implements the +// ListInstanceProfileTags operation. +type ListInstanceProfileTagsAPIClient interface { + ListInstanceProfileTags(context.Context, *ListInstanceProfileTagsInput, ...func(*Options)) (*ListInstanceProfileTagsOutput, error) +} + +var _ ListInstanceProfileTagsAPIClient = (*Client)(nil) + +// ListInstanceProfileTagsPaginatorOptions is the paginator options for +// ListInstanceProfileTags +type ListInstanceProfileTagsPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true . If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true , and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListInstanceProfileTagsPaginator is a paginator for ListInstanceProfileTags +type ListInstanceProfileTagsPaginator struct { + options ListInstanceProfileTagsPaginatorOptions + client ListInstanceProfileTagsAPIClient + params *ListInstanceProfileTagsInput + nextToken *string + firstPage bool +} + +// NewListInstanceProfileTagsPaginator returns a new +// ListInstanceProfileTagsPaginator +func NewListInstanceProfileTagsPaginator(client ListInstanceProfileTagsAPIClient, params *ListInstanceProfileTagsInput, optFns ...func(*ListInstanceProfileTagsPaginatorOptions)) *ListInstanceProfileTagsPaginator { + if params == nil { + params = &ListInstanceProfileTagsInput{} + } + + options := ListInstanceProfileTagsPaginatorOptions{} + if params.MaxItems != nil { + options.Limit = *params.MaxItems + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListInstanceProfileTagsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInstanceProfileTagsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListInstanceProfileTags page. +func (p *ListInstanceProfileTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInstanceProfileTagsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxItems = limit + + result, err := p.client.ListInstanceProfileTags(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInstanceProfileTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListMFADeviceTags.go b/service/iam/api_op_ListMFADeviceTags.go index d989d302488..0b5c0afdfb7 100644 --- a/service/iam/api_op_ListMFADeviceTags.go +++ b/service/iam/api_op_ListMFADeviceTags.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -152,6 +153,102 @@ func (c *Client) addOperationListMFADeviceTagsMiddlewares(stack *middleware.Stac return nil } +// ListMFADeviceTagsAPIClient is a client that implements the ListMFADeviceTags +// operation. +type ListMFADeviceTagsAPIClient interface { + ListMFADeviceTags(context.Context, *ListMFADeviceTagsInput, ...func(*Options)) (*ListMFADeviceTagsOutput, error) +} + +var _ ListMFADeviceTagsAPIClient = (*Client)(nil) + +// ListMFADeviceTagsPaginatorOptions is the paginator options for ListMFADeviceTags +type ListMFADeviceTagsPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true . If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true , and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListMFADeviceTagsPaginator is a paginator for ListMFADeviceTags +type ListMFADeviceTagsPaginator struct { + options ListMFADeviceTagsPaginatorOptions + client ListMFADeviceTagsAPIClient + params *ListMFADeviceTagsInput + nextToken *string + firstPage bool +} + +// NewListMFADeviceTagsPaginator returns a new ListMFADeviceTagsPaginator +func NewListMFADeviceTagsPaginator(client ListMFADeviceTagsAPIClient, params *ListMFADeviceTagsInput, optFns ...func(*ListMFADeviceTagsPaginatorOptions)) *ListMFADeviceTagsPaginator { + if params == nil { + params = &ListMFADeviceTagsInput{} + } + + options := ListMFADeviceTagsPaginatorOptions{} + if params.MaxItems != nil { + options.Limit = *params.MaxItems + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListMFADeviceTagsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMFADeviceTagsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListMFADeviceTags page. +func (p *ListMFADeviceTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMFADeviceTagsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxItems = limit + + result, err := p.client.ListMFADeviceTags(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMFADeviceTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListOpenIDConnectProviderTags.go b/service/iam/api_op_ListOpenIDConnectProviderTags.go index 257c9c8865c..41f7e4351db 100644 --- a/service/iam/api_op_ListOpenIDConnectProviderTags.go +++ b/service/iam/api_op_ListOpenIDConnectProviderTags.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -154,6 +155,105 @@ func (c *Client) addOperationListOpenIDConnectProviderTagsMiddlewares(stack *mid return nil } +// ListOpenIDConnectProviderTagsAPIClient is a client that implements the +// ListOpenIDConnectProviderTags operation. +type ListOpenIDConnectProviderTagsAPIClient interface { + ListOpenIDConnectProviderTags(context.Context, *ListOpenIDConnectProviderTagsInput, ...func(*Options)) (*ListOpenIDConnectProviderTagsOutput, error) +} + +var _ ListOpenIDConnectProviderTagsAPIClient = (*Client)(nil) + +// ListOpenIDConnectProviderTagsPaginatorOptions is the paginator options for +// ListOpenIDConnectProviderTags +type ListOpenIDConnectProviderTagsPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true . If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true , and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListOpenIDConnectProviderTagsPaginator is a paginator for +// ListOpenIDConnectProviderTags +type ListOpenIDConnectProviderTagsPaginator struct { + options ListOpenIDConnectProviderTagsPaginatorOptions + client ListOpenIDConnectProviderTagsAPIClient + params *ListOpenIDConnectProviderTagsInput + nextToken *string + firstPage bool +} + +// NewListOpenIDConnectProviderTagsPaginator returns a new +// ListOpenIDConnectProviderTagsPaginator +func NewListOpenIDConnectProviderTagsPaginator(client ListOpenIDConnectProviderTagsAPIClient, params *ListOpenIDConnectProviderTagsInput, optFns ...func(*ListOpenIDConnectProviderTagsPaginatorOptions)) *ListOpenIDConnectProviderTagsPaginator { + if params == nil { + params = &ListOpenIDConnectProviderTagsInput{} + } + + options := ListOpenIDConnectProviderTagsPaginatorOptions{} + if params.MaxItems != nil { + options.Limit = *params.MaxItems + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListOpenIDConnectProviderTagsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOpenIDConnectProviderTagsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListOpenIDConnectProviderTags page. +func (p *ListOpenIDConnectProviderTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOpenIDConnectProviderTagsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxItems = limit + + result, err := p.client.ListOpenIDConnectProviderTags(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOpenIDConnectProviderTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListPolicyTags.go b/service/iam/api_op_ListPolicyTags.go index 7a25ac71f40..5b75e6dab93 100644 --- a/service/iam/api_op_ListPolicyTags.go +++ b/service/iam/api_op_ListPolicyTags.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -151,6 +152,102 @@ func (c *Client) addOperationListPolicyTagsMiddlewares(stack *middleware.Stack, return nil } +// ListPolicyTagsAPIClient is a client that implements the ListPolicyTags +// operation. +type ListPolicyTagsAPIClient interface { + ListPolicyTags(context.Context, *ListPolicyTagsInput, ...func(*Options)) (*ListPolicyTagsOutput, error) +} + +var _ ListPolicyTagsAPIClient = (*Client)(nil) + +// ListPolicyTagsPaginatorOptions is the paginator options for ListPolicyTags +type ListPolicyTagsPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true . If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true , and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListPolicyTagsPaginator is a paginator for ListPolicyTags +type ListPolicyTagsPaginator struct { + options ListPolicyTagsPaginatorOptions + client ListPolicyTagsAPIClient + params *ListPolicyTagsInput + nextToken *string + firstPage bool +} + +// NewListPolicyTagsPaginator returns a new ListPolicyTagsPaginator +func NewListPolicyTagsPaginator(client ListPolicyTagsAPIClient, params *ListPolicyTagsInput, optFns ...func(*ListPolicyTagsPaginatorOptions)) *ListPolicyTagsPaginator { + if params == nil { + params = &ListPolicyTagsInput{} + } + + options := ListPolicyTagsPaginatorOptions{} + if params.MaxItems != nil { + options.Limit = *params.MaxItems + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListPolicyTagsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPolicyTagsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListPolicyTags page. +func (p *ListPolicyTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPolicyTagsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxItems = limit + + result, err := p.client.ListPolicyTags(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPolicyTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListRoleTags.go b/service/iam/api_op_ListRoleTags.go index 633ab0dbd0b..31640ee6fad 100644 --- a/service/iam/api_op_ListRoleTags.go +++ b/service/iam/api_op_ListRoleTags.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -152,6 +153,101 @@ func (c *Client) addOperationListRoleTagsMiddlewares(stack *middleware.Stack, op return nil } +// ListRoleTagsAPIClient is a client that implements the ListRoleTags operation. +type ListRoleTagsAPIClient interface { + ListRoleTags(context.Context, *ListRoleTagsInput, ...func(*Options)) (*ListRoleTagsOutput, error) +} + +var _ ListRoleTagsAPIClient = (*Client)(nil) + +// ListRoleTagsPaginatorOptions is the paginator options for ListRoleTags +type ListRoleTagsPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true . If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true , and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListRoleTagsPaginator is a paginator for ListRoleTags +type ListRoleTagsPaginator struct { + options ListRoleTagsPaginatorOptions + client ListRoleTagsAPIClient + params *ListRoleTagsInput + nextToken *string + firstPage bool +} + +// NewListRoleTagsPaginator returns a new ListRoleTagsPaginator +func NewListRoleTagsPaginator(client ListRoleTagsAPIClient, params *ListRoleTagsInput, optFns ...func(*ListRoleTagsPaginatorOptions)) *ListRoleTagsPaginator { + if params == nil { + params = &ListRoleTagsInput{} + } + + options := ListRoleTagsPaginatorOptions{} + if params.MaxItems != nil { + options.Limit = *params.MaxItems + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListRoleTagsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRoleTagsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListRoleTags page. +func (p *ListRoleTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRoleTagsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxItems = limit + + result, err := p.client.ListRoleTags(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRoleTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListSAMLProviderTags.go b/service/iam/api_op_ListSAMLProviderTags.go index 65fc2da2675..9725917ddb2 100644 --- a/service/iam/api_op_ListSAMLProviderTags.go +++ b/service/iam/api_op_ListSAMLProviderTags.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -154,6 +155,103 @@ func (c *Client) addOperationListSAMLProviderTagsMiddlewares(stack *middleware.S return nil } +// ListSAMLProviderTagsAPIClient is a client that implements the +// ListSAMLProviderTags operation. +type ListSAMLProviderTagsAPIClient interface { + ListSAMLProviderTags(context.Context, *ListSAMLProviderTagsInput, ...func(*Options)) (*ListSAMLProviderTagsOutput, error) +} + +var _ ListSAMLProviderTagsAPIClient = (*Client)(nil) + +// ListSAMLProviderTagsPaginatorOptions is the paginator options for +// ListSAMLProviderTags +type ListSAMLProviderTagsPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true . If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true , and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListSAMLProviderTagsPaginator is a paginator for ListSAMLProviderTags +type ListSAMLProviderTagsPaginator struct { + options ListSAMLProviderTagsPaginatorOptions + client ListSAMLProviderTagsAPIClient + params *ListSAMLProviderTagsInput + nextToken *string + firstPage bool +} + +// NewListSAMLProviderTagsPaginator returns a new ListSAMLProviderTagsPaginator +func NewListSAMLProviderTagsPaginator(client ListSAMLProviderTagsAPIClient, params *ListSAMLProviderTagsInput, optFns ...func(*ListSAMLProviderTagsPaginatorOptions)) *ListSAMLProviderTagsPaginator { + if params == nil { + params = &ListSAMLProviderTagsInput{} + } + + options := ListSAMLProviderTagsPaginatorOptions{} + if params.MaxItems != nil { + options.Limit = *params.MaxItems + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListSAMLProviderTagsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSAMLProviderTagsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListSAMLProviderTags page. +func (p *ListSAMLProviderTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSAMLProviderTagsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxItems = limit + + result, err := p.client.ListSAMLProviderTags(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSAMLProviderTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListServerCertificateTags.go b/service/iam/api_op_ListServerCertificateTags.go index 46442d63109..5f08b50af9b 100644 --- a/service/iam/api_op_ListServerCertificateTags.go +++ b/service/iam/api_op_ListServerCertificateTags.go @@ -4,6 +4,7 @@ package iam import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/iam/types" @@ -155,6 +156,104 @@ func (c *Client) addOperationListServerCertificateTagsMiddlewares(stack *middlew return nil } +// ListServerCertificateTagsAPIClient is a client that implements the +// ListServerCertificateTags operation. +type ListServerCertificateTagsAPIClient interface { + ListServerCertificateTags(context.Context, *ListServerCertificateTagsInput, ...func(*Options)) (*ListServerCertificateTagsOutput, error) +} + +var _ ListServerCertificateTagsAPIClient = (*Client)(nil) + +// ListServerCertificateTagsPaginatorOptions is the paginator options for +// ListServerCertificateTags +type ListServerCertificateTagsPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true . If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true , and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListServerCertificateTagsPaginator is a paginator for ListServerCertificateTags +type ListServerCertificateTagsPaginator struct { + options ListServerCertificateTagsPaginatorOptions + client ListServerCertificateTagsAPIClient + params *ListServerCertificateTagsInput + nextToken *string + firstPage bool +} + +// NewListServerCertificateTagsPaginator returns a new +// ListServerCertificateTagsPaginator +func NewListServerCertificateTagsPaginator(client ListServerCertificateTagsAPIClient, params *ListServerCertificateTagsInput, optFns ...func(*ListServerCertificateTagsPaginatorOptions)) *ListServerCertificateTagsPaginator { + if params == nil { + params = &ListServerCertificateTagsInput{} + } + + options := ListServerCertificateTagsPaginatorOptions{} + if params.MaxItems != nil { + options.Limit = *params.MaxItems + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListServerCertificateTagsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.Marker, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListServerCertificateTagsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListServerCertificateTags page. +func (p *ListServerCertificateTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListServerCertificateTagsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxItems = limit + + result, err := p.client.ListServerCertificateTags(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListServerCertificateTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_PutGroupPolicy.go b/service/iam/api_op_PutGroupPolicy.go index f278bffe54b..8c772526a2b 100644 --- a/service/iam/api_op_PutGroupPolicy.go +++ b/service/iam/api_op_PutGroupPolicy.go @@ -12,9 +12,9 @@ import ( // Adds or updates an inline policy document that is embedded in the specified IAM // group. A user can also have managed policies attached to it. To attach a managed -// policy to a group, use AttachGroupPolicy . To create a new managed policy, use -// CreatePolicy . For information about policies, see Managed policies and inline -// policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// policy to a group, use AttachGroupPolicy (https://docs.aws.amazon.com/IAM/latest/APIReference/API_AttachGroupPolicy.html) +// . To create a new managed policy, use CreatePolicy (https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreatePolicy.html) +// . For information about policies, see Managed policies and inline policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) // in the IAM User Guide. For information about the maximum number of inline // policies that you can embed in a group, see IAM and STS quotas (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html) // in the IAM User Guide. Because policy documents can be large, you should use diff --git a/service/iam/api_op_PutRolePolicy.go b/service/iam/api_op_PutRolePolicy.go index a0405c9f1f3..8a765ed82e9 100644 --- a/service/iam/api_op_PutRolePolicy.go +++ b/service/iam/api_op_PutRolePolicy.go @@ -13,13 +13,14 @@ import ( // Adds or updates an inline policy document that is embedded in the specified IAM // role. When you embed an inline policy in a role, the inline policy is used as // part of the role's access (permissions) policy. The role's trust policy is -// created at the same time as the role, using CreateRole . You can update a role's -// trust policy using UpdateAssumeRolePolicy . For more information about IAM -// roles, see Using roles to delegate permissions and federate identities (https://docs.aws.amazon.com/IAM/latest/UserGuide/roles-toplevel.html) +// created at the same time as the role, using CreateRole (https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateRole.html) +// . You can update a role's trust policy using UpdateAssumerolePolicy (https://docs.aws.amazon.com/IAM/latest/APIReference/API_UpdateAssumeRolePolicy.html) +// . For more information about IAM roles, see Using roles to delegate permissions +// and federate identities (https://docs.aws.amazon.com/IAM/latest/UserGuide/roles-toplevel.html) // . A role can also have a managed policy attached to it. To attach a managed -// policy to a role, use AttachRolePolicy . To create a new managed policy, use -// CreatePolicy . For information about policies, see Managed policies and inline -// policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// policy to a role, use AttachRolePolicy (https://docs.aws.amazon.com/IAM/latest/APIReference/API_AttachRolePolicy.html) +// . To create a new managed policy, use CreatePolicy (https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreatePolicy.html) +// . For information about policies, see Managed policies and inline policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) // in the IAM User Guide. For information about the maximum number of inline // policies that you can embed with a role, see IAM and STS quotas (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html) // in the IAM User Guide. Because policy documents can be large, you should use diff --git a/service/iam/api_op_PutUserPolicy.go b/service/iam/api_op_PutUserPolicy.go index 6e8ba8e69d3..382ba4e2ead 100644 --- a/service/iam/api_op_PutUserPolicy.go +++ b/service/iam/api_op_PutUserPolicy.go @@ -12,9 +12,9 @@ import ( // Adds or updates an inline policy document that is embedded in the specified IAM // user. An IAM user can also have a managed policy attached to it. To attach a -// managed policy to a user, use AttachUserPolicy . To create a new managed policy, -// use CreatePolicy . For information about policies, see Managed policies and -// inline policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) +// managed policy to a user, use AttachUserPolicy (https://docs.aws.amazon.com/IAM/latest/APIReference/API_AttachUserPolicy.html) +// . To create a new managed policy, use CreatePolicy (https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreatePolicy.html) +// . For information about policies, see Managed policies and inline policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) // in the IAM User Guide. For information about the maximum number of inline // policies that you can embed in a user, see IAM and STS quotas (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html) // in the IAM User Guide. Because policy documents can be large, you should use diff --git a/service/iam/deserializers.go b/service/iam/deserializers.go index e372adee06d..a083668aee2 100644 --- a/service/iam/deserializers.go +++ b/service/iam/deserializers.go @@ -6113,6 +6113,117 @@ func awsAwsquery_deserializeOpErrorGetLoginProfile(response *smithyhttp.Response } } +type awsAwsquery_deserializeOpGetMFADevice struct { +} + +func (*awsAwsquery_deserializeOpGetMFADevice) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpGetMFADevice) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorGetMFADevice(response, &metadata) + } + output := &GetMFADeviceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("GetMFADeviceResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentGetMFADeviceOutput(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorGetMFADevice(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("NoSuchEntity", errorCode): + return awsAwsquery_deserializeErrorNoSuchEntityException(response, errorBody) + + case strings.EqualFold("ServiceFailure", errorCode): + return awsAwsquery_deserializeErrorServiceFailureException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsquery_deserializeOpGetOpenIDConnectProvider struct { } @@ -17752,6 +17863,104 @@ func awsAwsquery_deserializeDocumentCertificateListTypeUnwrapped(v *[]types.Sign *v = sv return nil } +func awsAwsquery_deserializeDocumentCertificationMapType(v *map[string]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv map[string]string + if *v == nil { + sv = make(map[string]string, 0) + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("entry", t.Name.Local): + entryDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCertificationMapTypeUnwrapped(&sv, entryDecoder); err != nil { + return err + } + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentCertificationMapTypeUnwrapped(v *map[string]string, decoder smithyxml.NodeDecoder) error { + var sv map[string]string + if *v == nil { + sv = make(map[string]string, 0) + } else { + sv = *v + } + + var ek string + var ev string + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + sv[ek] = ev + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("key", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + ek = xtv + } + + case strings.EqualFold("value", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + ev = xtv + } + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} func awsAwsquery_deserializeDocumentClientIDListType(v *[]string, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -27522,6 +27731,91 @@ func awsAwsquery_deserializeOpDocumentGetLoginProfileOutput(v **GetLoginProfileO return nil } +func awsAwsquery_deserializeOpDocumentGetMFADeviceOutput(v **GetMFADeviceOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetMFADeviceOutput + if *v == nil { + sv = &GetMFADeviceOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Certifications", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCertificationMapType(&sv.Certifications, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("EnableDate", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.EnableDate = ptr.Time(t) + } + + case strings.EqualFold("SerialNumber", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SerialNumber = ptr.String(xtv) + } + + case strings.EqualFold("UserName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.UserName = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsAwsquery_deserializeOpDocumentGetOpenIDConnectProviderOutput(v **GetOpenIDConnectProviderOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/iam/generated.json b/service/iam/generated.json index 555771c9712..eec96dbddea 100644 --- a/service/iam/generated.json +++ b/service/iam/generated.json @@ -71,6 +71,7 @@ "api_op_GetGroupPolicy.go", "api_op_GetInstanceProfile.go", "api_op_GetLoginProfile.go", + "api_op_GetMFADevice.go", "api_op_GetOpenIDConnectProvider.go", "api_op_GetOrganizationsAccessReport.go", "api_op_GetPolicy.go", diff --git a/service/iam/serializers.go b/service/iam/serializers.go index 6b545841637..fecaa9de057 100644 --- a/service/iam/serializers.go +++ b/service/iam/serializers.go @@ -4027,6 +4027,70 @@ func (m *awsAwsquery_serializeOpGetLoginProfile) HandleSerialize(ctx context.Con return next.HandleSerialize(ctx, in) } +type awsAwsquery_serializeOpGetMFADevice struct { +} + +func (*awsAwsquery_serializeOpGetMFADevice) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpGetMFADevice) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetMFADeviceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("GetMFADevice") + body.Key("Version").String("2010-05-08") + + if err := awsAwsquery_serializeOpDocumentGetMFADeviceInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsquery_serializeOpGetOpenIDConnectProvider struct { } @@ -11273,6 +11337,23 @@ func awsAwsquery_serializeOpDocumentGetLoginProfileInput(v *GetLoginProfileInput return nil } +func awsAwsquery_serializeOpDocumentGetMFADeviceInput(v *GetMFADeviceInput, value query.Value) error { + object := value.Object() + _ = object + + if v.SerialNumber != nil { + objectKey := object.Key("SerialNumber") + objectKey.String(*v.SerialNumber) + } + + if v.UserName != nil { + objectKey := object.Key("UserName") + objectKey.String(*v.UserName) + } + + return nil +} + func awsAwsquery_serializeOpDocumentGetOpenIDConnectProviderInput(v *GetOpenIDConnectProviderInput, value query.Value) error { object := value.Object() _ = object diff --git a/service/iam/validators.go b/service/iam/validators.go index 8cde7f1724f..69084268dc4 100644 --- a/service/iam/validators.go +++ b/service/iam/validators.go @@ -1130,6 +1130,26 @@ func (m *validateOpGetLoginProfile) HandleInitialize(ctx context.Context, in mid return next.HandleInitialize(ctx, in) } +type validateOpGetMFADevice struct { +} + +func (*validateOpGetMFADevice) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetMFADevice) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetMFADeviceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetMFADeviceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetOpenIDConnectProvider struct { } @@ -2914,6 +2934,10 @@ func addOpGetLoginProfileValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetLoginProfile{}, middleware.After) } +func addOpGetMFADeviceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetMFADevice{}, middleware.After) +} + func addOpGetOpenIDConnectProviderValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetOpenIDConnectProvider{}, middleware.After) } @@ -4217,6 +4241,21 @@ func validateOpGetLoginProfileInput(v *GetLoginProfileInput) error { } } +func validateOpGetMFADeviceInput(v *GetMFADeviceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetMFADeviceInput"} + if v.SerialNumber == nil { + invalidParams.Add(smithy.NewErrParamRequired("SerialNumber")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetOpenIDConnectProviderInput(v *GetOpenIDConnectProviderInput) error { if v == nil { return nil diff --git a/service/pinpoint/deserializers.go b/service/pinpoint/deserializers.go index 15d1f81c35c..e13b16b2718 100644 --- a/service/pinpoint/deserializers.go +++ b/service/pinpoint/deserializers.go @@ -27370,6 +27370,11 @@ func awsRestjson1_deserializeDocumentJourneyResponse(v **types.JourneyResponse, return err } + case "TimezoneEstimationMethods": + if err := awsRestjson1_deserializeDocumentListOf__TimezoneEstimationMethodsElement(&sv.TimezoneEstimationMethods, value); err != nil { + return err + } + case "WaitForQuietTime": if value != nil { jtv, ok := value.(bool) @@ -27921,6 +27926,42 @@ func awsRestjson1_deserializeDocumentListOf__string(v *[]string, value interface return nil } +func awsRestjson1_deserializeDocumentListOf__TimezoneEstimationMethodsElement(v *[]types.TimezoneEstimationMethodsElement, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.TimezoneEstimationMethodsElement + if *v == nil { + cv = []types.TimezoneEstimationMethodsElement{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.TimezoneEstimationMethodsElement + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected __TimezoneEstimationMethodsElement to be of type string, got %T instead", value) + } + col = types.TimezoneEstimationMethodsElement(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentListOfActivityResponse(v *[]types.ActivityResponse, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/pinpoint/serializers.go b/service/pinpoint/serializers.go index a8c3697b324..945c9624d56 100644 --- a/service/pinpoint/serializers.go +++ b/service/pinpoint/serializers.go @@ -11455,6 +11455,17 @@ func awsRestjson1_serializeDocumentListOf__string(v []string, value smithyjson.V return nil } +func awsRestjson1_serializeDocumentListOf__TimezoneEstimationMethodsElement(v []types.TimezoneEstimationMethodsElement, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + func awsRestjson1_serializeDocumentListOfClosedDaysRules(v []types.ClosedDaysRule, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -13558,6 +13569,13 @@ func awsRestjson1_serializeDocumentWriteJourneyRequest(v *types.WriteJourneyRequ ok.String(string(v.State)) } + if v.TimezoneEstimationMethods != nil { + ok := object.Key("TimezoneEstimationMethods") + if err := awsRestjson1_serializeDocumentListOf__TimezoneEstimationMethodsElement(v.TimezoneEstimationMethods, ok); err != nil { + return err + } + } + if v.WaitForQuietTime { ok := object.Key("WaitForQuietTime") ok.Boolean(v.WaitForQuietTime) diff --git a/service/pinpoint/types/enums.go b/service/pinpoint/types/enums.go index 5c1aa11e8e1..9ccb39d9d4f 100644 --- a/service/pinpoint/types/enums.go +++ b/service/pinpoint/types/enums.go @@ -42,6 +42,25 @@ func (EndpointTypesElement) Values() []EndpointTypesElement { } } +type TimezoneEstimationMethodsElement string + +// Enum values for TimezoneEstimationMethodsElement +const ( + TimezoneEstimationMethodsElementPhoneNumber TimezoneEstimationMethodsElement = "PHONE_NUMBER" + TimezoneEstimationMethodsElementPostalCode TimezoneEstimationMethodsElement = "POSTAL_CODE" +) + +// Values returns all known values for TimezoneEstimationMethodsElement. Note that +// this can be expanded in the future, and so it is only as up to date as the +// client. The ordering of this slice is not guaranteed to be stable across +// updates. +func (TimezoneEstimationMethodsElement) Values() []TimezoneEstimationMethodsElement { + return []TimezoneEstimationMethodsElement{ + "PHONE_NUMBER", + "POSTAL_CODE", + } +} + type Action string // Enum values for Action diff --git a/service/pinpoint/types/types.go b/service/pinpoint/types/types.go index 7218698ec24..504e333e8a1 100644 --- a/service/pinpoint/types/types.go +++ b/service/pinpoint/types/types.go @@ -4118,6 +4118,19 @@ type JourneyResponse struct { // This object is not used or supported. Tags map[string]string + // An array of time zone estimation methods, if any, to use for determining an + // Endpoints (https://docs.aws.amazon.com/pinpoint/latest/apireference/apps-application-id-endpoints-endpoint-id.html) + // time zone if the Endpoint does not have a value for the Demographic.Timezone + // attribute. + // - PHONE_NUMBER - A time zone is determined based on the Endpoint.Address and + // Endpoint.Location.Country. + // - POSTAL_CODE - A time zone is determined based on the + // Endpoint.Location.PostalCode and Endpoint.Location.Country. POSTAL_CODE + // detection is only supported in the United States, United Kingdom, Australia, New + // Zealand, Canada, France, Italy, Spain, Germany and in regions where Amazon + // Pinpoint is available. + TimezoneEstimationMethods []TimezoneEstimationMethodsElement + // Indicates whether endpoints in quiet hours should enter a wait activity until // quiet hours have elapsed. WaitForQuietTime bool @@ -6842,6 +6855,19 @@ type WriteJourneyRequest struct { // Journey State resource. State State + // An array of time zone estimation methods, if any, to use for determining an + // Endpoints (https://docs.aws.amazon.com/pinpoint/latest/apireference/apps-application-id-endpoints-endpoint-id.html) + // time zone if the Endpoint does not have a value for the Demographic.Timezone + // attribute. + // - PHONE_NUMBER - A time zone is determined based on the Endpoint.Address and + // Endpoint.Location.Country. + // - POSTAL_CODE - A time zone is determined based on the + // Endpoint.Location.PostalCode and Endpoint.Location.Country. POSTAL_CODE + // detection is only supported in the United States, United Kingdom, Australia, New + // Zealand, Canada, France, Italy, Spain, Germany and in regions where Amazon + // Pinpoint is available. + TimezoneEstimationMethods []TimezoneEstimationMethodsElement + // Specifies whether endpoints in quiet hours should enter a wait till the end of // their quiet hours. WaitForQuietTime bool