From d35f788701b3cb534eee60c10df6cbdb5e3f28ce Mon Sep 17 00:00:00 2001 From: AWS SDK for Go v2 automation user Date: Mon, 15 May 2023 18:18:50 +0000 Subject: [PATCH] Regenerated Clients --- .../098500eee7ec44f69f6ce7a11fbd46d3.json | 8 + .../0aba22ed88e246f7b5e8aadcece36916.json | 8 + .../6c7f5ba501f34eb8b115166eb0b8dcc8.json | 8 + .../9629df9a620f498a8fd2888e82b0a43d.json | 8 + .../b029974d8b45429d8117f2429480868f.json | 8 + .../f8930ac3fda24c48afa8e1fc6bea31cd.json | 8 + service/athena/deserializers.go | 5 + service/athena/serializers.go | 7 + service/athena/types/types.go | 4 + .../api_op_ListDevEnvironmentSessions.go | 240 ++++++++++ service/codecatalyst/deserializers.go | 285 ++++++++++++ service/codecatalyst/doc.go | 2 + service/codecatalyst/generated.json | 1 + service/codecatalyst/serializers.go | 104 +++++ service/codecatalyst/types/types.go | 32 ++ service/codecatalyst/validators.go | 45 ++ service/rekognition/deserializers.go | 138 ++++++ service/rekognition/types/enums.go | 2 + service/rekognition/types/types.go | 19 + service/rolesanywhere/api_op_CreateProfile.go | 13 +- .../rolesanywhere/api_op_CreateTrustAnchor.go | 14 +- .../rolesanywhere/api_op_DisableProfile.go | 5 +- .../api_op_DisableTrustAnchor.go | 4 +- service/rolesanywhere/api_op_EnableProfile.go | 4 +- service/rolesanywhere/api_op_GetSubject.go | 10 +- service/rolesanywhere/api_op_ImportCrl.go | 6 +- service/rolesanywhere/api_op_ListCrls.go | 8 +- service/rolesanywhere/api_op_ListProfiles.go | 4 +- service/rolesanywhere/api_op_ListSubjects.go | 4 +- .../rolesanywhere/api_op_ListTrustAnchors.go | 4 +- .../api_op_PutNotificationSettings.go | 134 ++++++ .../api_op_ResetNotificationSettings.go | 133 ++++++ service/rolesanywhere/api_op_UpdateCrl.go | 8 +- service/rolesanywhere/api_op_UpdateProfile.go | 11 +- .../rolesanywhere/api_op_UpdateTrustAnchor.go | 14 +- service/rolesanywhere/deserializers.go | 425 ++++++++++++++++++ service/rolesanywhere/doc.go | 31 +- service/rolesanywhere/generated.json | 2 + service/rolesanywhere/serializers.go | 227 ++++++++++ service/rolesanywhere/types/enums.go | 34 ++ service/rolesanywhere/types/types.go | 125 ++++-- service/rolesanywhere/validators.go | 164 +++++++ .../internal/endpoints/endpoints.go | 24 + service/transfer/api_op_CreateServer.go | 15 +- service/transfer/api_op_CreateUser.go | 2 +- service/transfer/api_op_CreateWorkflow.go | 4 +- service/transfer/api_op_DeleteHostKey.go | 2 +- service/transfer/api_op_DescribeExecution.go | 5 +- service/transfer/api_op_DescribeUser.go | 4 +- service/transfer/api_op_ImportSshPublicKey.go | 10 +- service/transfer/api_op_ListExecutions.go | 13 +- service/transfer/api_op_ListUsers.go | 4 +- service/transfer/api_op_ListWorkflows.go | 3 +- service/transfer/api_op_TagResource.go | 4 +- .../transfer/api_op_TestIdentityProvider.go | 27 +- service/transfer/api_op_UpdateServer.go | 16 +- service/transfer/api_op_UpdateUser.go | 8 +- service/transfer/deserializers.go | 9 + service/transfer/serializers.go | 5 + service/transfer/types/enums.go | 22 + service/transfer/types/types.go | 71 ++- 61 files changed, 2397 insertions(+), 167 deletions(-) create mode 100644 .changelog/098500eee7ec44f69f6ce7a11fbd46d3.json create mode 100644 .changelog/0aba22ed88e246f7b5e8aadcece36916.json create mode 100644 .changelog/6c7f5ba501f34eb8b115166eb0b8dcc8.json create mode 100644 .changelog/9629df9a620f498a8fd2888e82b0a43d.json create mode 100644 .changelog/b029974d8b45429d8117f2429480868f.json create mode 100644 .changelog/f8930ac3fda24c48afa8e1fc6bea31cd.json create mode 100644 service/codecatalyst/api_op_ListDevEnvironmentSessions.go create mode 100644 service/rolesanywhere/api_op_PutNotificationSettings.go create mode 100644 service/rolesanywhere/api_op_ResetNotificationSettings.go diff --git a/.changelog/098500eee7ec44f69f6ce7a11fbd46d3.json b/.changelog/098500eee7ec44f69f6ce7a11fbd46d3.json new file mode 100644 index 00000000000..dc975053afa --- /dev/null +++ b/.changelog/098500eee7ec44f69f6ce7a11fbd46d3.json @@ -0,0 +1,8 @@ +{ + "id": "098500ee-e7ec-44f6-9f6c-e7a11fbd46d3", + "type": "feature", + "description": "Adds support for custom notification settings in a trust anchor. Introduces PutNotificationSettings and ResetNotificationSettings API's. Updates DurationSeconds max value to 3600.", + "modules": [ + "service/rolesanywhere" + ] +} \ No newline at end of file diff --git a/.changelog/0aba22ed88e246f7b5e8aadcece36916.json b/.changelog/0aba22ed88e246f7b5e8aadcece36916.json new file mode 100644 index 00000000000..57550154a30 --- /dev/null +++ b/.changelog/0aba22ed88e246f7b5e8aadcece36916.json @@ -0,0 +1,8 @@ +{ + "id": "0aba22ed-88e2-46f7-b5e8-aadcece36916", + "type": "feature", + "description": "This release adds a new EyeDirection attribute in Amazon Rekognition DetectFaces and IndexFaces APIs which predicts the yaw and pitch angles of a person's eye gaze direction for each face detected in the image.", + "modules": [ + "service/rekognition" + ] +} \ No newline at end of file diff --git a/.changelog/6c7f5ba501f34eb8b115166eb0b8dcc8.json b/.changelog/6c7f5ba501f34eb8b115166eb0b8dcc8.json new file mode 100644 index 00000000000..9a02d4a4813 --- /dev/null +++ b/.changelog/6c7f5ba501f34eb8b115166eb0b8dcc8.json @@ -0,0 +1,8 @@ +{ + "id": "6c7f5ba5-01f3-4eb8-b115-166eb0b8dcc8", + "type": "feature", + "description": "Added a fix to make clusterarn a required field in ListClientVpcConnections and RejectClientVpcConnection APIs", + "modules": [ + "service/kafka" + ] +} \ No newline at end of file diff --git a/.changelog/9629df9a620f498a8fd2888e82b0a43d.json b/.changelog/9629df9a620f498a8fd2888e82b0a43d.json new file mode 100644 index 00000000000..ec056bae08e --- /dev/null +++ b/.changelog/9629df9a620f498a8fd2888e82b0a43d.json @@ -0,0 +1,8 @@ +{ + "id": "9629df9a-620f-498a-8fd2-888e82b0a43d", + "type": "feature", + "description": "With this release, the users can list the active sessions connected to their Dev Environment on AWS CodeCatalyst", + "modules": [ + "service/codecatalyst" + ] +} \ No newline at end of file diff --git a/.changelog/b029974d8b45429d8117f2429480868f.json b/.changelog/b029974d8b45429d8117f2429480868f.json new file mode 100644 index 00000000000..dff0e986e32 --- /dev/null +++ b/.changelog/b029974d8b45429d8117f2429480868f.json @@ -0,0 +1,8 @@ +{ + "id": "b029974d-8b45-429d-8117-f2429480868f", + "type": "feature", + "description": "You can now define custom spark properties at start of the session for use cases like cluster encryption, table formats, and general Spark tuning.", + "modules": [ + "service/athena" + ] +} \ No newline at end of file diff --git a/.changelog/f8930ac3fda24c48afa8e1fc6bea31cd.json b/.changelog/f8930ac3fda24c48afa8e1fc6bea31cd.json new file mode 100644 index 00000000000..4913d66e8b4 --- /dev/null +++ b/.changelog/f8930ac3fda24c48afa8e1fc6bea31cd.json @@ -0,0 +1,8 @@ +{ + "id": "f8930ac3-fda2-4c48-afa8-e1fc6bea31cd", + "type": "feature", + "description": "This release introduces the ability to require both password and SSH key when users authenticate to your Transfer Family servers that use the SFTP protocol.", + "modules": [ + "service/transfer" + ] +} \ No newline at end of file diff --git a/service/athena/deserializers.go b/service/athena/deserializers.go index 644205330a2..a571598e4cd 100644 --- a/service/athena/deserializers.go +++ b/service/athena/deserializers.go @@ -9521,6 +9521,11 @@ func awsAwsjson11_deserializeDocumentEngineConfiguration(v **types.EngineConfigu sv.MaxConcurrentDpus = int32(i64) } + case "SparkProperties": + if err := awsAwsjson11_deserializeDocumentParametersMap(&sv.SparkProperties, value); err != nil { + return err + } + default: _, _ = key, value diff --git a/service/athena/serializers.go b/service/athena/serializers.go index e3c90b774e1..4a4938c617f 100644 --- a/service/athena/serializers.go +++ b/service/athena/serializers.go @@ -3805,6 +3805,13 @@ func awsAwsjson11_serializeDocumentEngineConfiguration(v *types.EngineConfigurat ok.Integer(v.MaxConcurrentDpus) } + if v.SparkProperties != nil { + ok := object.Key("SparkProperties") + if err := awsAwsjson11_serializeDocumentParametersMap(v.SparkProperties, ok); err != nil { + return err + } + } + return nil } diff --git a/service/athena/types/types.go b/service/athena/types/types.go index 7e756375ecf..a693b3efb8a 100644 --- a/service/athena/types/types.go +++ b/service/athena/types/types.go @@ -441,6 +441,10 @@ type EngineConfiguration struct { // 1. DefaultExecutorDpuSize *int32 + // Specifies custom jar files and Spark properties for use cases like cluster + // encryption, table formats, and general Spark tuning. + SparkProperties map[string]string + noSmithyDocumentSerde } diff --git a/service/codecatalyst/api_op_ListDevEnvironmentSessions.go b/service/codecatalyst/api_op_ListDevEnvironmentSessions.go new file mode 100644 index 00000000000..19fcd35b78a --- /dev/null +++ b/service/codecatalyst/api_op_ListDevEnvironmentSessions.go @@ -0,0 +1,240 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package codecatalyst + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/codecatalyst/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a list of active sessions for a Dev Environment in a project. +func (c *Client) ListDevEnvironmentSessions(ctx context.Context, params *ListDevEnvironmentSessionsInput, optFns ...func(*Options)) (*ListDevEnvironmentSessionsOutput, error) { + if params == nil { + params = &ListDevEnvironmentSessionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListDevEnvironmentSessions", params, optFns, c.addOperationListDevEnvironmentSessionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListDevEnvironmentSessionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListDevEnvironmentSessionsInput struct { + + // The system-generated unique ID of the Dev Environment. + // + // This member is required. + DevEnvironmentId *string + + // The name of the project in the space. + // + // This member is required. + ProjectName *string + + // The name of the space. + // + // This member is required. + SpaceName *string + + // The maximum number of results to show in a single call to this API. If the + // number of results is larger than the number you specified, the response will + // include a NextToken element, which you can use to obtain additional results. + MaxResults *int32 + + // A token returned from a call to this API to indicate the next batch of results + // to return, if any. + NextToken *string + + noSmithyDocumentSerde +} + +type ListDevEnvironmentSessionsOutput struct { + + // Information about each session retrieved in the list. + // + // This member is required. + Items []types.DevEnvironmentSessionSummary + + // A token returned from a call to this API to indicate the next batch of results + // to return, if any. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListDevEnvironmentSessionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListDevEnvironmentSessions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListDevEnvironmentSessions{}, 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 = addRetryMiddlewares(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 = addBearerAuthSignerMiddleware(stack, options); err != nil { + return err + } + if err = addOpListDevEnvironmentSessionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDevEnvironmentSessions(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 +} + +// ListDevEnvironmentSessionsAPIClient is a client that implements the +// ListDevEnvironmentSessions operation. +type ListDevEnvironmentSessionsAPIClient interface { + ListDevEnvironmentSessions(context.Context, *ListDevEnvironmentSessionsInput, ...func(*Options)) (*ListDevEnvironmentSessionsOutput, error) +} + +var _ ListDevEnvironmentSessionsAPIClient = (*Client)(nil) + +// ListDevEnvironmentSessionsPaginatorOptions is the paginator options for +// ListDevEnvironmentSessions +type ListDevEnvironmentSessionsPaginatorOptions struct { + // The maximum number of results to show in a single call to this API. If the + // number of results is larger than the number you specified, the response will + // include a NextToken element, which you can use to obtain additional results. + 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 +} + +// ListDevEnvironmentSessionsPaginator is a paginator for +// ListDevEnvironmentSessions +type ListDevEnvironmentSessionsPaginator struct { + options ListDevEnvironmentSessionsPaginatorOptions + client ListDevEnvironmentSessionsAPIClient + params *ListDevEnvironmentSessionsInput + nextToken *string + firstPage bool +} + +// NewListDevEnvironmentSessionsPaginator returns a new +// ListDevEnvironmentSessionsPaginator +func NewListDevEnvironmentSessionsPaginator(client ListDevEnvironmentSessionsAPIClient, params *ListDevEnvironmentSessionsInput, optFns ...func(*ListDevEnvironmentSessionsPaginatorOptions)) *ListDevEnvironmentSessionsPaginator { + if params == nil { + params = &ListDevEnvironmentSessionsInput{} + } + + options := ListDevEnvironmentSessionsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListDevEnvironmentSessionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDevEnvironmentSessionsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListDevEnvironmentSessions page. +func (p *ListDevEnvironmentSessionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDevEnvironmentSessionsOutput, 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.ListDevEnvironmentSessions(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_opListDevEnvironmentSessions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListDevEnvironmentSessions", + } +} diff --git a/service/codecatalyst/deserializers.go b/service/codecatalyst/deserializers.go index fc1fce7cd16..64e21012521 100644 --- a/service/codecatalyst/deserializers.go +++ b/service/codecatalyst/deserializers.go @@ -2609,6 +2609,177 @@ func awsRestjson1_deserializeOpDocumentListDevEnvironmentsOutput(v **ListDevEnvi return nil } +type awsRestjson1_deserializeOpListDevEnvironmentSessions struct { +} + +func (*awsRestjson1_deserializeOpListDevEnvironmentSessions) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListDevEnvironmentSessions) 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_deserializeOpErrorListDevEnvironmentSessions(response, &metadata) + } + output := &ListDevEnvironmentSessionsOutput{} + 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_deserializeOpDocumentListDevEnvironmentSessionsOutput(&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_deserializeOpErrorListDevEnvironmentSessions(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("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListDevEnvironmentSessionsOutput(v **ListDevEnvironmentSessionsOutput, 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 *ListDevEnvironmentSessionsOutput + if *v == nil { + sv = &ListDevEnvironmentSessionsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "items": + if err := awsRestjson1_deserializeDocumentDevEnvironmentSessionsSummaryList(&sv.Items, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpListEventLogs struct { } @@ -5160,6 +5331,120 @@ func awsRestjson1_deserializeDocumentDevEnvironmentRepositorySummary(v **types.D return nil } +func awsRestjson1_deserializeDocumentDevEnvironmentSessionsSummaryList(v *[]types.DevEnvironmentSessionSummary, 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.DevEnvironmentSessionSummary + if *v == nil { + cv = []types.DevEnvironmentSessionSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DevEnvironmentSessionSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentDevEnvironmentSessionSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentDevEnvironmentSessionSummary(v **types.DevEnvironmentSessionSummary, 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.DevEnvironmentSessionSummary + if *v == nil { + sv = &types.DevEnvironmentSessionSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "devEnvironmentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Uuid to be of type string, got %T instead", value) + } + sv.DevEnvironmentId = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "projectName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.ProjectName = ptr.String(jtv) + } + + case "spaceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.SpaceName = ptr.String(jtv) + } + + case "startedTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.StartedTime = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentDevEnvironmentSummary(v **types.DevEnvironmentSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/codecatalyst/doc.go b/service/codecatalyst/doc.go index 9c8f46c292c..5d43bf0a3a6 100644 --- a/service/codecatalyst/doc.go +++ b/service/codecatalyst/doc.go @@ -26,6 +26,8 @@ // CodeCatalyst. // - ListDevEnvironments , which retrieves a list of Dev Environments in a // project. +// - ListDevEnvironmentSessions , which retrieves a list of active Dev +// Environment sessions in a project. // - ListProjects , which retrieves a list of projects in a space. // - ListSourceRepositories , which retrieves a list of source repositories in a // project. diff --git a/service/codecatalyst/generated.json b/service/codecatalyst/generated.json index cf0087c754b..a316aa5d206 100644 --- a/service/codecatalyst/generated.json +++ b/service/codecatalyst/generated.json @@ -21,6 +21,7 @@ "api_op_GetSubscription.go", "api_op_GetUserDetails.go", "api_op_ListAccessTokens.go", + "api_op_ListDevEnvironmentSessions.go", "api_op_ListDevEnvironments.go", "api_op_ListEventLogs.go", "api_op_ListProjects.go", diff --git a/service/codecatalyst/serializers.go b/service/codecatalyst/serializers.go index 1f7f4c247d1..abf9447d3a2 100644 --- a/service/codecatalyst/serializers.go +++ b/service/codecatalyst/serializers.go @@ -1109,6 +1109,110 @@ func awsRestjson1_serializeOpDocumentListDevEnvironmentsInput(v *ListDevEnvironm return nil } +type awsRestjson1_serializeOpListDevEnvironmentSessions struct { +} + +func (*awsRestjson1_serializeOpListDevEnvironmentSessions) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListDevEnvironmentSessions) 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.(*ListDevEnvironmentSessionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/spaces/{spaceName}/projects/{projectName}/devEnvironments/{devEnvironmentId}/sessions") + 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} + } + + if err := awsRestjson1_serializeOpHttpBindingsListDevEnvironmentSessionsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListDevEnvironmentSessionsInput(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_serializeOpHttpBindingsListDevEnvironmentSessionsInput(v *ListDevEnvironmentSessionsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DevEnvironmentId == nil || len(*v.DevEnvironmentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member devEnvironmentId must not be empty")} + } + if v.DevEnvironmentId != nil { + if err := encoder.SetURI("devEnvironmentId").String(*v.DevEnvironmentId); err != nil { + return err + } + } + + if v.ProjectName == nil || len(*v.ProjectName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member projectName must not be empty")} + } + if v.ProjectName != nil { + if err := encoder.SetURI("projectName").String(*v.ProjectName); err != nil { + return err + } + } + + if v.SpaceName == nil || len(*v.SpaceName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member spaceName must not be empty")} + } + if v.SpaceName != nil { + if err := encoder.SetURI("spaceName").String(*v.SpaceName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListDevEnvironmentSessionsInput(v *ListDevEnvironmentSessionsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + type awsRestjson1_serializeOpListEventLogs struct { } diff --git a/service/codecatalyst/types/types.go b/service/codecatalyst/types/types.go index a076e1e8e88..0f677155cd8 100644 --- a/service/codecatalyst/types/types.go +++ b/service/codecatalyst/types/types.go @@ -74,6 +74,38 @@ type DevEnvironmentSessionConfiguration struct { noSmithyDocumentSerde } +// Information about active sessions for a Dev Environment. +type DevEnvironmentSessionSummary struct { + + // The system-generated unique ID of the Dev Environment. + // + // This member is required. + DevEnvironmentId *string + + // The system-generated unique ID of the Dev Environment session. + // + // This member is required. + Id *string + + // The name of the project in the space. + // + // This member is required. + ProjectName *string + + // The name of the space. + // + // This member is required. + SpaceName *string + + // The date and time the session started, in coordinated universal time (UTC) + // timestamp format as specified in RFC 3339 (https://www.rfc-editor.org/rfc/rfc3339#section-5.6) + // + // This member is required. + StartedTime *time.Time + + noSmithyDocumentSerde +} + // Information about a Dev Environment. type DevEnvironmentSummary struct { diff --git a/service/codecatalyst/validators.go b/service/codecatalyst/validators.go index 42a1804ea41..05ecf9eaace 100644 --- a/service/codecatalyst/validators.go +++ b/service/codecatalyst/validators.go @@ -230,6 +230,26 @@ func (m *validateOpGetSubscription) HandleInitialize(ctx context.Context, in mid return next.HandleInitialize(ctx, in) } +type validateOpListDevEnvironmentSessions struct { +} + +func (*validateOpListDevEnvironmentSessions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListDevEnvironmentSessions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListDevEnvironmentSessionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListDevEnvironmentSessionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListDevEnvironments struct { } @@ -474,6 +494,10 @@ func addOpGetSubscriptionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetSubscription{}, middleware.After) } +func addOpListDevEnvironmentSessionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListDevEnvironmentSessions{}, middleware.After) +} + func addOpListDevEnvironmentsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListDevEnvironments{}, middleware.After) } @@ -882,6 +906,27 @@ func validateOpGetSubscriptionInput(v *GetSubscriptionInput) error { } } +func validateOpListDevEnvironmentSessionsInput(v *ListDevEnvironmentSessionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListDevEnvironmentSessionsInput"} + if v.SpaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SpaceName")) + } + if v.ProjectName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) + } + if v.DevEnvironmentId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DevEnvironmentId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListDevEnvironmentsInput(v *ListDevEnvironmentsInput) error { if v == nil { return nil diff --git a/service/rekognition/deserializers.go b/service/rekognition/deserializers.go index 5a995253450..16b0ae8e599 100644 --- a/service/rekognition/deserializers.go +++ b/service/rekognition/deserializers.go @@ -12225,6 +12225,139 @@ func awsAwsjson11_deserializeDocumentEvaluationResult(v **types.EvaluationResult return nil } +func awsAwsjson11_deserializeDocumentEyeDirection(v **types.EyeDirection, 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.EyeDirection + if *v == nil { + sv = &types.EyeDirection{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Confidence": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Confidence = ptr.Float32(float32(f64)) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Confidence = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected Percent to be a JSON Number, got %T instead", value) + + } + } + + case "Pitch": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Pitch = ptr.Float32(float32(f64)) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Pitch = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected Degree to be a JSON Number, got %T instead", value) + + } + } + + case "Yaw": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Yaw = ptr.Float32(float32(f64)) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Yaw = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected Degree to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentEyeglasses(v **types.Eyeglasses, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12555,6 +12688,11 @@ func awsAwsjson11_deserializeDocumentFaceDetail(v **types.FaceDetail, value inte return err } + case "EyeDirection": + if err := awsAwsjson11_deserializeDocumentEyeDirection(&sv.EyeDirection, value); err != nil { + return err + } + case "Eyeglasses": if err := awsAwsjson11_deserializeDocumentEyeglasses(&sv.Eyeglasses, value); err != nil { return err diff --git a/service/rekognition/types/enums.go b/service/rekognition/types/enums.go index b07c27ba023..6294d2bedfd 100644 --- a/service/rekognition/types/enums.go +++ b/service/rekognition/types/enums.go @@ -11,6 +11,7 @@ const ( AttributeAgeRange Attribute = "AGE_RANGE" AttributeBeard Attribute = "BEARD" AttributeEmotions Attribute = "EMOTIONS" + AttributeEyeDirection Attribute = "EYE_DIRECTION" AttributeEyeglasses Attribute = "EYEGLASSES" AttributeEyesOpen Attribute = "EYES_OPEN" AttributeGender Attribute = "GENDER" @@ -31,6 +32,7 @@ func (Attribute) Values() []Attribute { "AGE_RANGE", "BEARD", "EMOTIONS", + "EYE_DIRECTION", "EYEGLASSES", "EYES_OPEN", "GENDER", diff --git a/service/rekognition/types/types.go b/service/rekognition/types/types.go index f73a1cacaff..2fce567ea35 100644 --- a/service/rekognition/types/types.go +++ b/service/rekognition/types/types.go @@ -785,6 +785,22 @@ type EvaluationResult struct { noSmithyDocumentSerde } +// Indicates the direction the eyes are gazing in (independent of the head pose) +// as determined by its pitch and yaw. +type EyeDirection struct { + + // The confidence that the service has in its predicted eye direction. + Confidence *float32 + + // Value representing eye direction on the pitch axis. + Pitch *float32 + + // Value representing eye direction on the yaw axis. + Yaw *float32 + + noSmithyDocumentSerde +} + // Indicates whether or not the face is wearing eye glasses, and the confidence // level in the determination. type Eyeglasses struct { @@ -879,6 +895,9 @@ type FaceDetail struct { // person pretending to have a sad face might not be sad emotionally. Emotions []Emotion + // Indicates the direction the eyes are gazing in, as defined by pitch and yaw. + EyeDirection *EyeDirection + // Indicates whether or not the face is wearing eye glasses, and the confidence // level in the determination. Eyeglasses *Eyeglasses diff --git a/service/rolesanywhere/api_op_CreateProfile.go b/service/rolesanywhere/api_op_CreateProfile.go index 09fc3771ddf..cf6b83e28d1 100644 --- a/service/rolesanywhere/api_op_CreateProfile.go +++ b/service/rolesanywhere/api_op_CreateProfile.go @@ -11,10 +11,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a profile. A profile is configuration resource to list the roles that -// RolesAnywhere service is trusted to assume. In addition, by applying a profile -// you can intersect permissions with IAM managed policies. Required permissions: -// rolesanywhere:CreateProfile . +// Creates a profile, a list of the roles that Roles Anywhere service is trusted +// to assume. You use profiles to intersect permissions with IAM managed policies. +// Required permissions: rolesanywhere:CreateProfile . func (c *Client) CreateProfile(ctx context.Context, params *CreateProfileInput, optFns ...func(*Options)) (*CreateProfileOutput, error) { if params == nil { params = &CreateProfileInput{} @@ -37,8 +36,8 @@ type CreateProfileInput struct { // This member is required. Name *string - // A list of IAM roles that this profile can assume in a CreateSession (https://docs.aws.amazon.com/rolesanywhere/latest/APIReference/API_CreateSession.html) - // operation. + // A list of IAM roles that this profile can assume in a temporary credential + // request. // // This member is required. RoleArns []string @@ -52,7 +51,7 @@ type CreateProfileInput struct { // A list of managed policy ARNs that apply to the vended session credentials. ManagedPolicyArns []string - // Specifies whether instance properties are required in CreateSession (https://docs.aws.amazon.com/rolesanywhere/latest/APIReference/API_CreateSession.html) + // Specifies whether instance properties are required in temporary credential // requests with this profile. RequireInstanceProperties *bool diff --git a/service/rolesanywhere/api_op_CreateTrustAnchor.go b/service/rolesanywhere/api_op_CreateTrustAnchor.go index 8012076ff36..9a7571058c2 100644 --- a/service/rolesanywhere/api_op_CreateTrustAnchor.go +++ b/service/rolesanywhere/api_op_CreateTrustAnchor.go @@ -11,12 +11,11 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a trust anchor. You establish trust between IAM Roles Anywhere and your -// certificate authority (CA) by configuring a trust anchor. A Trust Anchor is -// defined either as a reference to a AWS Certificate Manager Private Certificate -// Authority (ACM PCA), or by uploading a Certificate Authority (CA) certificate. -// Your AWS workloads can authenticate with the trust anchor using certificates -// issued by the trusted Certificate Authority (CA) in exchange for temporary AWS +// Creates a trust anchor to establish trust between IAM Roles Anywhere and your +// certificate authority (CA). You can define a trust anchor as a reference to an +// Private Certificate Authority (Private CA) or by uploading a CA certificate. +// Your Amazon Web Services workloads can authenticate with the trust anchor using +// certificates issued by the CA in exchange for temporary Amazon Web Services // credentials. Required permissions: rolesanywhere:CreateTrustAnchor . func (c *Client) CreateTrustAnchor(ctx context.Context, params *CreateTrustAnchorInput, optFns ...func(*Options)) (*CreateTrustAnchorOutput, error) { if params == nil { @@ -48,6 +47,9 @@ type CreateTrustAnchorInput struct { // Specifies whether the trust anchor is enabled. Enabled *bool + // A list of notification settings to be associated to the trust anchor. + NotificationSettings []types.NotificationSetting + // The tags to attach to the trust anchor. Tags []types.Tag diff --git a/service/rolesanywhere/api_op_DisableProfile.go b/service/rolesanywhere/api_op_DisableProfile.go index f763cf681b4..a14b4592a3f 100644 --- a/service/rolesanywhere/api_op_DisableProfile.go +++ b/service/rolesanywhere/api_op_DisableProfile.go @@ -11,9 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Disables a profile. When disabled, CreateSession (https://docs.aws.amazon.com/rolesanywhere/latest/APIReference/API_CreateSession.html) -// requests with this profile fail. Required permissions: -// rolesanywhere:DisableProfile . +// Disables a profile. When disabled, temporary credential requests with this +// profile fail. Required permissions: rolesanywhere:DisableProfile . func (c *Client) DisableProfile(ctx context.Context, params *DisableProfileInput, optFns ...func(*Options)) (*DisableProfileOutput, error) { if params == nil { params = &DisableProfileInput{} diff --git a/service/rolesanywhere/api_op_DisableTrustAnchor.go b/service/rolesanywhere/api_op_DisableTrustAnchor.go index f421c597519..a2fe6e5af17 100644 --- a/service/rolesanywhere/api_op_DisableTrustAnchor.go +++ b/service/rolesanywhere/api_op_DisableTrustAnchor.go @@ -11,8 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Disables a trust anchor. When disabled, CreateSession (https://docs.aws.amazon.com/rolesanywhere/latest/APIReference/API_CreateSession.html) -// requests specifying this trust anchor are unauthorized. Required permissions: +// Disables a trust anchor. When disabled, temporary credential requests +// specifying this trust anchor are unauthorized. Required permissions: // rolesanywhere:DisableTrustAnchor . func (c *Client) DisableTrustAnchor(ctx context.Context, params *DisableTrustAnchorInput, optFns ...func(*Options)) (*DisableTrustAnchorOutput, error) { if params == nil { diff --git a/service/rolesanywhere/api_op_EnableProfile.go b/service/rolesanywhere/api_op_EnableProfile.go index e4c57ad29b9..37c7ef011e2 100644 --- a/service/rolesanywhere/api_op_EnableProfile.go +++ b/service/rolesanywhere/api_op_EnableProfile.go @@ -11,8 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Enables the roles in a profile to receive session credentials in CreateSession (https://docs.aws.amazon.com/rolesanywhere/latest/APIReference/API_CreateSession.html) -// . Required permissions: rolesanywhere:EnableProfile . +// Enables temporary credential requests for a profile. Required permissions: +// rolesanywhere:EnableProfile . func (c *Client) EnableProfile(ctx context.Context, params *EnableProfileInput, optFns ...func(*Options)) (*EnableProfileOutput, error) { if params == nil { params = &EnableProfileInput{} diff --git a/service/rolesanywhere/api_op_GetSubject.go b/service/rolesanywhere/api_op_GetSubject.go index f52b2ec5cfc..e7e271d8351 100644 --- a/service/rolesanywhere/api_op_GetSubject.go +++ b/service/rolesanywhere/api_op_GetSubject.go @@ -11,11 +11,11 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Gets a Subject. A Subject associates a certificate identity with authentication -// attempts by CreateSession. The Subject resources stores audit information such -// as status of the last authentication attempt, the certificate data used in the -// attempt, and the last time the associated identity attempted authentication. -// Required permissions: rolesanywhere:GetSubject . +// Gets a subject, which associates a certificate identity with authentication +// attempts. The subject stores auditing information such as the status of the last +// authentication attempt, the certificate data used in the attempt, and the last +// time the associated identity attempted authentication. Required permissions: +// rolesanywhere:GetSubject . func (c *Client) GetSubject(ctx context.Context, params *GetSubjectInput, optFns ...func(*Options)) (*GetSubjectOutput, error) { if params == nil { params = &GetSubjectInput{} diff --git a/service/rolesanywhere/api_op_ImportCrl.go b/service/rolesanywhere/api_op_ImportCrl.go index 194b180564f..ecace56216f 100644 --- a/service/rolesanywhere/api_op_ImportCrl.go +++ b/service/rolesanywhere/api_op_ImportCrl.go @@ -11,9 +11,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Imports the certificate revocation list (CRL). CRl is a list of certificates +// Imports the certificate revocation list (CRL). A CRL is a list of certificates // that have been revoked by the issuing certificate Authority (CA). IAM Roles -// Anywhere validates against the crl list before issuing credentials. Required +// Anywhere validates against the CRL before issuing credentials. Required // permissions: rolesanywhere:ImportCrl . func (c *Client) ImportCrl(ctx context.Context, params *ImportCrlInput, optFns ...func(*Options)) (*ImportCrlOutput, error) { if params == nil { @@ -32,7 +32,7 @@ func (c *Client) ImportCrl(ctx context.Context, params *ImportCrlInput, optFns . type ImportCrlInput struct { - // The x509 v3 specified certificate revocation list + // The x509 v3 specified certificate revocation list (CRL). // // This member is required. CrlData []byte diff --git a/service/rolesanywhere/api_op_ListCrls.go b/service/rolesanywhere/api_op_ListCrls.go index deb4c2140e5..0973d0e51c3 100644 --- a/service/rolesanywhere/api_op_ListCrls.go +++ b/service/rolesanywhere/api_op_ListCrls.go @@ -12,8 +12,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists all Crls in the authenticated account and Amazon Web Services Region. -// Required permissions: rolesanywhere:ListCrls . +// Lists all certificate revocation lists (CRL) in the authenticated account and +// Amazon Web Services Region. Required permissions: rolesanywhere:ListCrls . func (c *Client) ListCrls(ctx context.Context, params *ListCrlsInput, optFns ...func(*Options)) (*ListCrlsOutput, error) { if params == nil { params = &ListCrlsInput{} @@ -32,7 +32,7 @@ func (c *Client) ListCrls(ctx context.Context, params *ListCrlsInput, optFns ... type ListCrlsInput struct { // A token that indicates where the output should continue from, if a previous - // operation did not show all results. To get the next results, call the operation + // request did not show all results. To get the next results, make the request // again with this value. NextToken *string @@ -48,7 +48,7 @@ type ListCrlsOutput struct { Crls []types.CrlDetail // A token that indicates where the output should continue from, if a previous - // operation did not show all results. To get the next results, call the operation + // request did not show all results. To get the next results, make the request // again with this value. NextToken *string diff --git a/service/rolesanywhere/api_op_ListProfiles.go b/service/rolesanywhere/api_op_ListProfiles.go index 1e9505ef8ff..29e0f030e8d 100644 --- a/service/rolesanywhere/api_op_ListProfiles.go +++ b/service/rolesanywhere/api_op_ListProfiles.go @@ -32,7 +32,7 @@ func (c *Client) ListProfiles(ctx context.Context, params *ListProfilesInput, op type ListProfilesInput struct { // A token that indicates where the output should continue from, if a previous - // operation did not show all results. To get the next results, call the operation + // request did not show all results. To get the next results, make the request // again with this value. NextToken *string @@ -45,7 +45,7 @@ type ListProfilesInput struct { type ListProfilesOutput struct { // A token that indicates where the output should continue from, if a previous - // operation did not show all results. To get the next results, call the operation + // request did not show all results. To get the next results, make the request // again with this value. NextToken *string diff --git a/service/rolesanywhere/api_op_ListSubjects.go b/service/rolesanywhere/api_op_ListSubjects.go index 82d46e5a9ef..c7c72cd0688 100644 --- a/service/rolesanywhere/api_op_ListSubjects.go +++ b/service/rolesanywhere/api_op_ListSubjects.go @@ -32,7 +32,7 @@ func (c *Client) ListSubjects(ctx context.Context, params *ListSubjectsInput, op type ListSubjectsInput struct { // A token that indicates where the output should continue from, if a previous - // operation did not show all results. To get the next results, call the operation + // request did not show all results. To get the next results, make the request // again with this value. NextToken *string @@ -45,7 +45,7 @@ type ListSubjectsInput struct { type ListSubjectsOutput struct { // A token that indicates where the output should continue from, if a previous - // operation did not show all results. To get the next results, call the operation + // request did not show all results. To get the next results, make the request // again with this value. NextToken *string diff --git a/service/rolesanywhere/api_op_ListTrustAnchors.go b/service/rolesanywhere/api_op_ListTrustAnchors.go index 436c34d15d9..2d5127d1c39 100644 --- a/service/rolesanywhere/api_op_ListTrustAnchors.go +++ b/service/rolesanywhere/api_op_ListTrustAnchors.go @@ -32,7 +32,7 @@ func (c *Client) ListTrustAnchors(ctx context.Context, params *ListTrustAnchorsI type ListTrustAnchorsInput struct { // A token that indicates where the output should continue from, if a previous - // operation did not show all results. To get the next results, call the operation + // request did not show all results. To get the next results, make the request // again with this value. NextToken *string @@ -45,7 +45,7 @@ type ListTrustAnchorsInput struct { type ListTrustAnchorsOutput struct { // A token that indicates where the output should continue from, if a previous - // operation did not show all results. To get the next results, call the operation + // request did not show all results. To get the next results, make the request // again with this value. NextToken *string diff --git a/service/rolesanywhere/api_op_PutNotificationSettings.go b/service/rolesanywhere/api_op_PutNotificationSettings.go new file mode 100644 index 00000000000..d2857032b06 --- /dev/null +++ b/service/rolesanywhere/api_op_PutNotificationSettings.go @@ -0,0 +1,134 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rolesanywhere + +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/aws-sdk-go-v2/service/rolesanywhere/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Attaches a list of notification settings to a trust anchor. A notification +// setting includes information such as event name, threshold, status of the +// notification setting, and the channel to notify. Required permissions: +// rolesanywhere:PutNotificationSettings . +func (c *Client) PutNotificationSettings(ctx context.Context, params *PutNotificationSettingsInput, optFns ...func(*Options)) (*PutNotificationSettingsOutput, error) { + if params == nil { + params = &PutNotificationSettingsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutNotificationSettings", params, optFns, c.addOperationPutNotificationSettingsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutNotificationSettingsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutNotificationSettingsInput struct { + + // A list of notification settings to be associated to the trust anchor. + // + // This member is required. + NotificationSettings []types.NotificationSetting + + // The unique identifier of the trust anchor. + // + // This member is required. + TrustAnchorId *string + + noSmithyDocumentSerde +} + +type PutNotificationSettingsOutput struct { + + // The state of the trust anchor after a read or write operation. + // + // This member is required. + TrustAnchor *types.TrustAnchorDetail + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutNotificationSettingsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutNotificationSettings{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutNotificationSettings{}, 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 = addOpPutNotificationSettingsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutNotificationSettings(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_opPutNotificationSettings(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "rolesanywhere", + OperationName: "PutNotificationSettings", + } +} diff --git a/service/rolesanywhere/api_op_ResetNotificationSettings.go b/service/rolesanywhere/api_op_ResetNotificationSettings.go new file mode 100644 index 00000000000..47332660d78 --- /dev/null +++ b/service/rolesanywhere/api_op_ResetNotificationSettings.go @@ -0,0 +1,133 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rolesanywhere + +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/aws-sdk-go-v2/service/rolesanywhere/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Resets the custom notification setting to IAM Roles Anywhere default setting. +// Required permissions: rolesanywhere:ResetNotificationSettings . +func (c *Client) ResetNotificationSettings(ctx context.Context, params *ResetNotificationSettingsInput, optFns ...func(*Options)) (*ResetNotificationSettingsOutput, error) { + if params == nil { + params = &ResetNotificationSettingsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ResetNotificationSettings", params, optFns, c.addOperationResetNotificationSettingsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ResetNotificationSettingsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ResetNotificationSettingsInput struct { + + // A list of notification setting keys to reset. A notification setting key + // includes the event and the channel. + // + // This member is required. + NotificationSettingKeys []types.NotificationSettingKey + + // The unique identifier of the trust anchor. + // + // This member is required. + TrustAnchorId *string + + noSmithyDocumentSerde +} + +type ResetNotificationSettingsOutput struct { + + // The state of the trust anchor after a read or write operation. + // + // This member is required. + TrustAnchor *types.TrustAnchorDetail + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationResetNotificationSettingsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpResetNotificationSettings{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpResetNotificationSettings{}, 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 = addOpResetNotificationSettingsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opResetNotificationSettings(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_opResetNotificationSettings(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "rolesanywhere", + OperationName: "ResetNotificationSettings", + } +} diff --git a/service/rolesanywhere/api_op_UpdateCrl.go b/service/rolesanywhere/api_op_UpdateCrl.go index bfa49e99783..ff668521b6b 100644 --- a/service/rolesanywhere/api_op_UpdateCrl.go +++ b/service/rolesanywhere/api_op_UpdateCrl.go @@ -11,9 +11,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Updates the certificate revocation list (CRL). CRl is a list of certificates -// that have been revoked by the issuing certificate Authority (CA). IAM Roles -// Anywhere validates against the crl list before issuing credentials. Required +// Updates the certificate revocation list (CRL). A CRL is a list of certificates +// that have been revoked by the issuing certificate authority (CA). IAM Roles +// Anywhere validates against the CRL before issuing credentials. Required // permissions: rolesanywhere:UpdateCrl . func (c *Client) UpdateCrl(ctx context.Context, params *UpdateCrlInput, optFns ...func(*Options)) (*UpdateCrlOutput, error) { if params == nil { @@ -37,7 +37,7 @@ type UpdateCrlInput struct { // This member is required. CrlId *string - // The x509 v3 specified certificate revocation list + // The x509 v3 specified certificate revocation list (CRL). CrlData []byte // The name of the Crl. diff --git a/service/rolesanywhere/api_op_UpdateProfile.go b/service/rolesanywhere/api_op_UpdateProfile.go index e0495186310..d0e5d873175 100644 --- a/service/rolesanywhere/api_op_UpdateProfile.go +++ b/service/rolesanywhere/api_op_UpdateProfile.go @@ -11,10 +11,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Updates the profile. A profile is configuration resource to list the roles that -// RolesAnywhere service is trusted to assume. In addition, by applying a profile -// you can scope-down permissions with IAM managed policies. Required permissions: -// rolesanywhere:UpdateProfile . +// Updates a profile, a list of the roles that IAM Roles Anywhere service is +// trusted to assume. You use profiles to intersect permissions with IAM managed +// policies. Required permissions: rolesanywhere:UpdateProfile . func (c *Client) UpdateProfile(ctx context.Context, params *UpdateProfileInput, optFns ...func(*Options)) (*UpdateProfileOutput, error) { if params == nil { params = &UpdateProfileInput{} @@ -46,8 +45,8 @@ type UpdateProfileInput struct { // The name of the profile. Name *string - // A list of IAM roles that this profile can assume in a CreateSession (https://docs.aws.amazon.com/rolesanywhere/latest/APIReference/API_CreateSession.html) - // operation. + // A list of IAM roles that this profile can assume in a temporary credential + // request. RoleArns []string // A session policy that applies to the trust boundary of the vended session diff --git a/service/rolesanywhere/api_op_UpdateTrustAnchor.go b/service/rolesanywhere/api_op_UpdateTrustAnchor.go index 988c0801f7a..9d47081be11 100644 --- a/service/rolesanywhere/api_op_UpdateTrustAnchor.go +++ b/service/rolesanywhere/api_op_UpdateTrustAnchor.go @@ -11,13 +11,13 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Updates the trust anchor.You establish trust between IAM Roles Anywhere and -// your certificate authority (CA) by configuring a trust anchor. A Trust Anchor is -// defined either as a reference to a AWS Certificate Manager Private Certificate -// Authority (ACM PCA), or by uploading a Certificate Authority (CA) certificate. -// Your AWS workloads can authenticate with the trust anchor using certificates -// issued by the trusted Certificate Authority (CA) in exchange for temporary AWS -// credentials. Required permissions: rolesanywhere:UpdateTrustAnchor . +// Updates a trust anchor. You establish trust between IAM Roles Anywhere and your +// certificate authority (CA) by configuring a trust anchor. You can define a trust +// anchor as a reference to an Private Certificate Authority (Private CA) or by +// uploading a CA certificate. Your Amazon Web Services workloads can authenticate +// with the trust anchor using certificates issued by the CA in exchange for +// temporary Amazon Web Services credentials. Required permissions: +// rolesanywhere:UpdateTrustAnchor . func (c *Client) UpdateTrustAnchor(ctx context.Context, params *UpdateTrustAnchorInput, optFns ...func(*Options)) (*UpdateTrustAnchorOutput, error) { if params == nil { params = &UpdateTrustAnchorInput{} diff --git a/service/rolesanywhere/deserializers.go b/service/rolesanywhere/deserializers.go index 42773e9ff58..492235ebedb 100644 --- a/service/rolesanywhere/deserializers.go +++ b/service/rolesanywhere/deserializers.go @@ -3209,6 +3209,312 @@ func awsRestjson1_deserializeOpDocumentListTrustAnchorsOutput(v **ListTrustAncho return nil } +type awsRestjson1_deserializeOpPutNotificationSettings struct { +} + +func (*awsRestjson1_deserializeOpPutNotificationSettings) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutNotificationSettings) 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_deserializeOpErrorPutNotificationSettings(response, &metadata) + } + output := &PutNotificationSettingsOutput{} + 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_deserializeOpDocumentPutNotificationSettingsOutput(&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_deserializeOpErrorPutNotificationSettings(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("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentPutNotificationSettingsOutput(v **PutNotificationSettingsOutput, 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 *PutNotificationSettingsOutput + if *v == nil { + sv = &PutNotificationSettingsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "trustAnchor": + if err := awsRestjson1_deserializeDocumentTrustAnchorDetail(&sv.TrustAnchor, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpResetNotificationSettings struct { +} + +func (*awsRestjson1_deserializeOpResetNotificationSettings) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpResetNotificationSettings) 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_deserializeOpErrorResetNotificationSettings(response, &metadata) + } + output := &ResetNotificationSettingsOutput{} + 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_deserializeOpDocumentResetNotificationSettingsOutput(&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_deserializeOpErrorResetNotificationSettings(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("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentResetNotificationSettingsOutput(v **ResetNotificationSettingsOutput, 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 *ResetNotificationSettingsOutput + if *v == nil { + sv = &ResetNotificationSettingsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "trustAnchor": + if err := awsRestjson1_deserializeDocumentTrustAnchorDetail(&sv.TrustAnchor, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpTagResource struct { } @@ -4469,6 +4775,120 @@ func awsRestjson1_deserializeDocumentManagedPolicyList(v *[]string, value interf return nil } +func awsRestjson1_deserializeDocumentNotificationSettingDetail(v **types.NotificationSettingDetail, 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.NotificationSettingDetail + if *v == nil { + sv = &types.NotificationSettingDetail{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "channel": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotificationChannel to be of type string, got %T instead", value) + } + sv.Channel = types.NotificationChannel(jtv) + } + + case "configuredBy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ConfiguredBy = ptr.String(jtv) + } + + case "enabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Enabled = ptr.Bool(jtv) + } + + case "event": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotificationEvent to be of type string, got %T instead", value) + } + sv.Event = types.NotificationEvent(jtv) + } + + case "threshold": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Threshold = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentNotificationSettingDetails(v *[]types.NotificationSettingDetail, 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.NotificationSettingDetail + if *v == nil { + cv = []types.NotificationSettingDetail{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.NotificationSettingDetail + destAddr := &col + if err := awsRestjson1_deserializeDocumentNotificationSettingDetail(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentProfileDetail(v **types.ProfileDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -5253,6 +5673,11 @@ func awsRestjson1_deserializeDocumentTrustAnchorDetail(v **types.TrustAnchorDeta sv.Name = ptr.String(jtv) } + case "notificationSettings": + if err := awsRestjson1_deserializeDocumentNotificationSettingDetails(&sv.NotificationSettings, value); err != nil { + return err + } + case "source": if err := awsRestjson1_deserializeDocumentSource(&sv.Source, value); err != nil { return err diff --git a/service/rolesanywhere/doc.go b/service/rolesanywhere/doc.go index b329178ae79..5ee4bb2f220 100644 --- a/service/rolesanywhere/doc.go +++ b/service/rolesanywhere/doc.go @@ -3,19 +3,20 @@ // Package rolesanywhere provides the API client, operations, and parameter types // for IAM Roles Anywhere. // -// AWS Identity and Access Management Roles Anywhere provides a secure way for -// your workloads such as servers, containers, and applications running outside of -// AWS to obtain Temporary AWS credentials. Your workloads can use the same IAM -// policies and roles that you have configured with native AWS applications to -// access AWS resources. Using IAM Roles Anywhere will eliminate the need to manage -// long term credentials for workloads running outside of AWS. To use IAM Roles -// Anywhere customer workloads will need to use X.509 certificates issued by their -// Certificate Authority (CA) . The Certificate Authority (CA) needs to be -// registered with IAM Roles Anywhere as a trust anchor to establish trust between -// customer PKI and IAM Roles Anywhere. Customers who do not manage their own PKI -// system can use AWS Certificate Manager Private Certificate Authority (ACM PCA) -// to create a Certificate Authority and use that to establish trust with IAM Roles -// Anywhere This guide describes the IAM rolesanywhere operations that you can call -// programmatically. For general information about IAM Roles Anywhere see -// https://docs.aws.amazon.com/ (https://docs.aws.amazon.com/) +// Identity and Access Management Roles Anywhere provides a secure way for your +// workloads such as servers, containers, and applications that run outside of +// Amazon Web Services to obtain temporary Amazon Web Services credentials. Your +// workloads can use the same IAM policies and roles you have for native Amazon Web +// Services applications to access Amazon Web Services resources. Using IAM Roles +// Anywhere eliminates the need to manage long-term credentials for workloads +// running outside of Amazon Web Services. To use IAM Roles Anywhere, your +// workloads must use X.509 certificates issued by their certificate authority +// (CA). You register the CA with IAM Roles Anywhere as a trust anchor to establish +// trust between your public key infrastructure (PKI) and IAM Roles Anywhere. If +// you don't manage your own PKI system, you can use Private Certificate Authority +// to create a CA and then use that to establish trust with IAM Roles Anywhere. +// This guide describes the IAM Roles Anywhere operations that you can call +// programmatically. For more information about IAM Roles Anywhere, see the IAM +// Roles Anywhere User Guide (https://docs.aws.amazon.com/rolesanywhere/latest/userguide/introduction.html) +// . package rolesanywhere diff --git a/service/rolesanywhere/generated.json b/service/rolesanywhere/generated.json index 875a81418cd..084f448e708 100644 --- a/service/rolesanywhere/generated.json +++ b/service/rolesanywhere/generated.json @@ -29,6 +29,8 @@ "api_op_ListSubjects.go", "api_op_ListTagsForResource.go", "api_op_ListTrustAnchors.go", + "api_op_PutNotificationSettings.go", + "api_op_ResetNotificationSettings.go", "api_op_TagResource.go", "api_op_UntagResource.go", "api_op_UpdateCrl.go", diff --git a/service/rolesanywhere/serializers.go b/service/rolesanywhere/serializers.go index 6950863e7fc..97549515625 100644 --- a/service/rolesanywhere/serializers.go +++ b/service/rolesanywhere/serializers.go @@ -193,6 +193,13 @@ func awsRestjson1_serializeOpDocumentCreateTrustAnchorInput(v *CreateTrustAnchor ok.String(*v.Name) } + if v.NotificationSettings != nil { + ok := object.Key("notificationSettings") + if err := awsRestjson1_serializeDocumentNotificationSettings(v.NotificationSettings, ok); err != nil { + return err + } + } + if v.Source != nil { ok := object.Key("source") if err := awsRestjson1_serializeDocumentSource(v.Source, ok); err != nil { @@ -1335,6 +1342,156 @@ func awsRestjson1_serializeOpHttpBindingsListTrustAnchorsInput(v *ListTrustAncho return nil } +type awsRestjson1_serializeOpPutNotificationSettings struct { +} + +func (*awsRestjson1_serializeOpPutNotificationSettings) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutNotificationSettings) 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.(*PutNotificationSettingsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/put-notifications-settings") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + 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_serializeOpDocumentPutNotificationSettingsInput(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_serializeOpHttpBindingsPutNotificationSettingsInput(v *PutNotificationSettingsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentPutNotificationSettingsInput(v *PutNotificationSettingsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.NotificationSettings != nil { + ok := object.Key("notificationSettings") + if err := awsRestjson1_serializeDocumentNotificationSettings(v.NotificationSettings, ok); err != nil { + return err + } + } + + if v.TrustAnchorId != nil { + ok := object.Key("trustAnchorId") + ok.String(*v.TrustAnchorId) + } + + return nil +} + +type awsRestjson1_serializeOpResetNotificationSettings struct { +} + +func (*awsRestjson1_serializeOpResetNotificationSettings) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpResetNotificationSettings) 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.(*ResetNotificationSettingsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/reset-notifications-settings") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + 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_serializeOpDocumentResetNotificationSettingsInput(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_serializeOpHttpBindingsResetNotificationSettingsInput(v *ResetNotificationSettingsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentResetNotificationSettingsInput(v *ResetNotificationSettingsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.NotificationSettingKeys != nil { + ok := object.Key("notificationSettingKeys") + if err := awsRestjson1_serializeDocumentNotificationSettingKeys(v.NotificationSettingKeys, ok); err != nil { + return err + } + } + + if v.TrustAnchorId != nil { + ok := object.Key("trustAnchorId") + ok.String(*v.TrustAnchorId) + } + + return nil +} + type awsRestjson1_serializeOpTagResource struct { } @@ -1775,6 +1932,76 @@ func awsRestjson1_serializeDocumentManagedPolicyList(v []string, value smithyjso return nil } +func awsRestjson1_serializeDocumentNotificationSetting(v *types.NotificationSetting, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Channel) > 0 { + ok := object.Key("channel") + ok.String(string(v.Channel)) + } + + if v.Enabled != nil { + ok := object.Key("enabled") + ok.Boolean(*v.Enabled) + } + + if len(v.Event) > 0 { + ok := object.Key("event") + ok.String(string(v.Event)) + } + + if v.Threshold != nil { + ok := object.Key("threshold") + ok.Integer(*v.Threshold) + } + + return nil +} + +func awsRestjson1_serializeDocumentNotificationSettingKey(v *types.NotificationSettingKey, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Channel) > 0 { + ok := object.Key("channel") + ok.String(string(v.Channel)) + } + + if len(v.Event) > 0 { + ok := object.Key("event") + ok.String(string(v.Event)) + } + + return nil +} + +func awsRestjson1_serializeDocumentNotificationSettingKeys(v []types.NotificationSettingKey, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentNotificationSettingKey(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentNotificationSettings(v []types.NotificationSetting, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentNotificationSetting(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentRoleArnList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() diff --git a/service/rolesanywhere/types/enums.go b/service/rolesanywhere/types/enums.go index b9e45b35c4c..e3f70da6f7a 100644 --- a/service/rolesanywhere/types/enums.go +++ b/service/rolesanywhere/types/enums.go @@ -2,6 +2,40 @@ package types +type NotificationChannel string + +// Enum values for NotificationChannel +const ( + NotificationChannelAll NotificationChannel = "ALL" +) + +// Values returns all known values for NotificationChannel. 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 (NotificationChannel) Values() []NotificationChannel { + return []NotificationChannel{ + "ALL", + } +} + +type NotificationEvent string + +// Enum values for NotificationEvent +const ( + NotificationEventCaCertificateExpiry NotificationEvent = "CA_CERTIFICATE_EXPIRY" + NotificationEventEndEntityCertificateExpiry NotificationEvent = "END_ENTITY_CERTIFICATE_EXPIRY" +) + +// Values returns all known values for NotificationEvent. 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 (NotificationEvent) Values() []NotificationEvent { + return []NotificationEvent{ + "CA_CERTIFICATE_EXPIRY", + "END_ENTITY_CERTIFICATE_EXPIRY", + } +} + type TrustAnchorType string // Enum values for TrustAnchorType diff --git a/service/rolesanywhere/types/types.go b/service/rolesanywhere/types/types.go index f52f2a345a9..3b622d872e4 100644 --- a/service/rolesanywhere/types/types.go +++ b/service/rolesanywhere/types/types.go @@ -7,23 +7,21 @@ import ( "time" ) -// A record of a presented X509 credential to CreateSession (https://docs.aws.amazon.com/rolesanywhere/latest/APIReference/API_CreateSession.html) -// . +// A record of a presented X509 credential from a temporary credential request. type CredentialSummary struct { // Indicates whether the credential is enabled. Enabled *bool - // Indicates whether the CreateSession (https://docs.aws.amazon.com/rolesanywhere/latest/APIReference/API_CreateSession.html) - // operation was successful. + // Indicates whether the temporary credential request was successful. Failed *bool // The fully qualified domain name of the issuing certificate for the presented // end-entity certificate. Issuer *string - // The ISO-8601 time stamp of when the certificate was last used in a CreateSession (https://docs.aws.amazon.com/rolesanywhere/latest/APIReference/API_CreateSession.html) - // operation. + // The ISO-8601 time stamp of when the certificate was last used in a temporary + // credential request. SeenAt *time.Time // The serial number of the certificate. @@ -73,20 +71,94 @@ type CrlDetail struct { // instance. type InstanceProperty struct { - // Indicates whether the CreateSession (https://docs.aws.amazon.com/rolesanywhere/latest/APIReference/API_CreateSession.html) - // operation was successful. + // Indicates whether the temporary credential request was successful. Failed *bool // A list of instanceProperty objects. Properties map[string]string - // The ISO-8601 time stamp of when the certificate was last used in a CreateSession (https://docs.aws.amazon.com/rolesanywhere/latest/APIReference/API_CreateSession.html) - // operation. + // The ISO-8601 time stamp of when the certificate was last used in a temporary + // credential request. SeenAt *time.Time noSmithyDocumentSerde } +// Customizable notification settings that will be applied to notification events. +// IAM Roles Anywhere consumes these settings while notifying across multiple +// channels - CloudWatch metrics, EventBridge, and Health Dashboard. +type NotificationSetting struct { + + // Indicates whether the notification setting is enabled. + // + // This member is required. + Enabled *bool + + // The event to which this notification setting is applied. + // + // This member is required. + Event NotificationEvent + + // The specified channel of notification. IAM Roles Anywhere uses CloudWatch + // metrics, EventBridge, and Health Dashboard to notify for an event. In the + // absence of a specific channel, IAM Roles Anywhere applies this setting to 'ALL' + // channels. + Channel NotificationChannel + + // The number of days before a notification event. This value is required for a + // notification setting that is enabled. + Threshold *int32 + + noSmithyDocumentSerde +} + +// The state of a notification setting. A notification setting includes +// information such as event name, threshold, status of the notification setting, +// and the channel to notify. +type NotificationSettingDetail struct { + + // Indicates whether the notification setting is enabled. + // + // This member is required. + Enabled *bool + + // The event to which this notification setting is applied. + // + // This member is required. + Event NotificationEvent + + // The specified channel of notification. IAM Roles Anywhere uses CloudWatch + // metrics, EventBridge, and Health Dashboard to notify for an event. In the + // absence of a specific channel, IAM Roles Anywhere applies this setting to 'ALL' + // channels. + Channel NotificationChannel + + // The principal that configured the notification setting. For default settings + // configured by IAM Roles Anywhere, the value is rolesanywhere.amazonaws.com , and + // for customized notifications settings, it is the respective account ID. + ConfiguredBy *string + + // The number of days before a notification event. + Threshold *int32 + + noSmithyDocumentSerde +} + +// A notification setting key to reset. A notification setting key includes the +// event and the channel. +type NotificationSettingKey struct { + + // The notification setting event to reset. + // + // This member is required. + Event NotificationEvent + + // The specified channel of notification. + Channel NotificationChannel + + noSmithyDocumentSerde +} + // The state of the profile after a read or write operation. type ProfileDetail struct { @@ -114,12 +186,12 @@ type ProfileDetail struct { // The unique identifier of the profile. ProfileId *string - // Specifies whether instance properties are required in CreateSession (https://docs.aws.amazon.com/rolesanywhere/latest/APIReference/API_CreateSession.html) + // Specifies whether instance properties are required in temporary credential // requests with this profile. RequireInstanceProperties *bool - // A list of IAM roles that this profile can assume in a CreateSession (https://docs.aws.amazon.com/rolesanywhere/latest/APIReference/API_CreateSession.html) - // operation. + // A list of IAM roles that this profile can assume in a temporary credential + // request. RoleArns []string // A session policy that applies to the trust boundary of the vended session @@ -154,9 +226,9 @@ type SourceData interface { isSourceData() } -// The root certificate of the Certificate Manager Private Certificate Authority -// specified by this ARN is used in trust validation for CreateSession (https://docs.aws.amazon.com/rolesanywhere/latest/APIReference/API_CreateSession.html) -// operations. Included for trust anchors of type AWS_ACM_PCA . +// The root certificate of the Private Certificate Authority specified by this ARN +// is used in trust validation for temporary credential requests. Included for +// trust anchors of type AWS_ACM_PCA . type SourceDataMemberAcmPcaArn struct { Value string @@ -182,7 +254,7 @@ type SubjectDetail struct { CreatedAt *time.Time // The temporary session credentials vended at the last authenticating call with - // this Subject. + // this subject. Credentials []CredentialSummary // The enabled status of the subject. @@ -191,7 +263,7 @@ type SubjectDetail struct { // The specified instance properties associated with the request. InstanceProperties []InstanceProperty - // The ISO-8601 timestamp of the last time this Subject requested temporary + // The ISO-8601 timestamp of the last time this subject requested temporary // session credentials. LastSeenAt *time.Time @@ -210,20 +282,18 @@ type SubjectDetail struct { noSmithyDocumentSerde } -// A summary representation of Subject resources returned in read operations; -// primarily ListSubjects. +// A summary representation of subjects. type SubjectSummary struct { - // The ISO-8601 time stamp of when the certificate was first used in a - // CreateSession (https://docs.aws.amazon.com/rolesanywhere/latest/APIReference/API_CreateSession.html) - // operation. + // The ISO-8601 time stamp of when the certificate was first used in a temporary + // credential request. CreatedAt *time.Time - // The enabled status of the Subject. + // The enabled status of the subject. Enabled *bool - // The ISO-8601 time stamp of when the certificate was last used in a CreateSession (https://docs.aws.amazon.com/rolesanywhere/latest/APIReference/API_CreateSession.html) - // operation. + // The ISO-8601 time stamp of when the certificate was last used in a temporary + // credential request. LastSeenAt *time.Time // The ARN of the resource. @@ -269,6 +339,9 @@ type TrustAnchorDetail struct { // The name of the trust anchor. Name *string + // A list of notification settings to be associated to the trust anchor. + NotificationSettings []NotificationSettingDetail + // The trust anchor type and its related certificate data. Source *Source diff --git a/service/rolesanywhere/validators.go b/service/rolesanywhere/validators.go index 552b09b033c..ce7df671d5b 100644 --- a/service/rolesanywhere/validators.go +++ b/service/rolesanywhere/validators.go @@ -350,6 +350,46 @@ func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpPutNotificationSettings struct { +} + +func (*validateOpPutNotificationSettings) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutNotificationSettings) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutNotificationSettingsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutNotificationSettingsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpResetNotificationSettings struct { +} + +func (*validateOpResetNotificationSettings) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpResetNotificationSettings) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ResetNotificationSettingsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpResetNotificationSettingsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpTagResource struct { } @@ -518,6 +558,14 @@ func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } +func addOpPutNotificationSettingsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutNotificationSettings{}, middleware.After) +} + +func addOpResetNotificationSettingsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpResetNotificationSettings{}, middleware.After) +} + func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } @@ -538,6 +586,73 @@ func addOpUpdateTrustAnchorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateTrustAnchor{}, middleware.After) } +func validateNotificationSetting(v *types.NotificationSetting) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "NotificationSetting"} + if v.Enabled == nil { + invalidParams.Add(smithy.NewErrParamRequired("Enabled")) + } + if len(v.Event) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Event")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateNotificationSettingKey(v *types.NotificationSettingKey) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "NotificationSettingKey"} + if len(v.Event) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Event")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateNotificationSettingKeys(v []types.NotificationSettingKey) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "NotificationSettingKeys"} + for i := range v { + if err := validateNotificationSettingKey(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateNotificationSettings(v []types.NotificationSetting) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "NotificationSettings"} + for i := range v { + if err := validateNotificationSetting(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateTag(v *types.Tag) error { if v == nil { return nil @@ -612,6 +727,11 @@ func validateOpCreateTrustAnchorInput(v *CreateTrustAnchorInput) error { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } + if v.NotificationSettings != nil { + if err := validateNotificationSettings(v.NotificationSettings); err != nil { + invalidParams.AddNested("NotificationSettings", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -855,6 +975,50 @@ func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { } } +func validateOpPutNotificationSettingsInput(v *PutNotificationSettingsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutNotificationSettingsInput"} + if v.TrustAnchorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("TrustAnchorId")) + } + if v.NotificationSettings == nil { + invalidParams.Add(smithy.NewErrParamRequired("NotificationSettings")) + } else if v.NotificationSettings != nil { + if err := validateNotificationSettings(v.NotificationSettings); err != nil { + invalidParams.AddNested("NotificationSettings", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpResetNotificationSettingsInput(v *ResetNotificationSettingsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ResetNotificationSettingsInput"} + if v.TrustAnchorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("TrustAnchorId")) + } + if v.NotificationSettingKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("NotificationSettingKeys")) + } else if v.NotificationSettingKeys != nil { + if err := validateNotificationSettingKeys(v.NotificationSettingKeys); err != nil { + invalidParams.AddNested("NotificationSettingKeys", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil diff --git a/service/route53resolver/internal/endpoints/endpoints.go b/service/route53resolver/internal/endpoints/endpoints.go index f19ca5feb14..e9412595677 100644 --- a/service/route53resolver/internal/endpoints/endpoints.go +++ b/service/route53resolver/internal/endpoints/endpoints.go @@ -374,9 +374,33 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "us-gov-east-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "route53resolver.us-gov-east-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-gov-east-1-fips", + }: endpoints.Endpoint{ + Hostname: "route53resolver.us-gov-east-1.amazonaws.com", + Deprecated: aws.TrueTernary, + }, endpoints.EndpointKey{ Region: "us-gov-west-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "route53resolver.us-gov-west-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-gov-west-1-fips", + }: endpoints.Endpoint{ + Hostname: "route53resolver.us-gov-west-1.amazonaws.com", + Deprecated: aws.TrueTernary, + }, }, }, } diff --git a/service/transfer/api_op_CreateServer.go b/service/transfer/api_op_CreateServer.go index f034a096185..43c5c0ac73d 100644 --- a/service/transfer/api_op_CreateServer.go +++ b/service/transfer/api_op_CreateServer.go @@ -99,11 +99,11 @@ type CreateServerInput struct { // in the Transfer Family User Guide. HostKey *string - // Required when IdentityProviderType is set to AWS_DIRECTORY_SERVICE or - // API_GATEWAY . Accepts an array containing all of the information required to use - // a directory in AWS_DIRECTORY_SERVICE or invoke a customer-supplied - // authentication API, including the API Gateway URL. Not required when - // IdentityProviderType is set to SERVICE_MANAGED . + // Required when IdentityProviderType is set to AWS_DIRECTORY_SERVICE , Amazon Web + // Services_LAMBDA or API_GATEWAY . Accepts an array containing all of the + // information required to use a directory in AWS_DIRECTORY_SERVICE or invoke a + // customer-supplied authentication API, including the API Gateway URL. Not + // required when IdentityProviderType is set to SERVICE_MANAGED . IdentityProviderDetails *types.IdentityProviderDetails // The mode of authentication for a server. The default value is SERVICE_MANAGED , @@ -117,7 +117,7 @@ type CreateServerInput struct { // provide an Amazon API Gateway endpoint URL to call for authentication by using // the IdentityProviderDetails parameter. Use the AWS_LAMBDA value to directly use // an Lambda function as your identity provider. If you choose this value, you must - // specify the ARN for the Lambda function in the Function parameter or the + // specify the ARN for the Lambda function in the Function parameter for the // IdentityProviderDetails data type. IdentityProviderType types.IdentityProviderType @@ -191,7 +191,8 @@ type CreateServerInput struct { // that's used for executing the workflow. In addition to a workflow to execute // when a file is uploaded completely, WorkflowDetails can also contain a workflow // ID (and execution role) for a workflow to execute on partial upload. A partial - // upload occurs when a file is open when the session disconnects. + // upload occurs when the server session disconnects while the file is still being + // uploaded. WorkflowDetails *types.WorkflowDetails noSmithyDocumentSerde diff --git a/service/transfer/api_op_CreateUser.go b/service/transfer/api_op_CreateUser.go index d6428bab6b4..7c079442915 100644 --- a/service/transfer/api_op_CreateUser.go +++ b/service/transfer/api_op_CreateUser.go @@ -134,7 +134,7 @@ type CreateUserOutput struct { // This member is required. ServerId *string - // A unique string that identifies a user account associated with a server. + // A unique string that identifies a Transfer Family user. // // This member is required. UserName *string diff --git a/service/transfer/api_op_CreateWorkflow.go b/service/transfer/api_op_CreateWorkflow.go index 2889e3c0294..6b4d6c7e83f 100644 --- a/service/transfer/api_op_CreateWorkflow.go +++ b/service/transfer/api_op_CreateWorkflow.go @@ -50,9 +50,9 @@ type CreateWorkflowInput struct { Description *string // Specifies the steps (actions) to take if errors are encountered during - // execution of the workflow. For custom steps, the lambda function needs to send + // execution of the workflow. For custom steps, the Lambda function needs to send // FAILURE to the call back API to kick off the exception steps. Additionally, if - // the lambda does not send SUCCESS before it times out, the exception steps are + // the Lambda does not send SUCCESS before it times out, the exception steps are // executed. OnExceptionSteps []types.WorkflowStep diff --git a/service/transfer/api_op_DeleteHostKey.go b/service/transfer/api_op_DeleteHostKey.go index 5b3a7f8eec7..f8763b966b6 100644 --- a/service/transfer/api_op_DeleteHostKey.go +++ b/service/transfer/api_op_DeleteHostKey.go @@ -10,7 +10,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes the host key that's specified in the HoskKeyId parameter. +// Deletes the host key that's specified in the HostKeyId parameter. func (c *Client) DeleteHostKey(ctx context.Context, params *DeleteHostKeyInput, optFns ...func(*Options)) (*DeleteHostKeyOutput, error) { if params == nil { params = &DeleteHostKeyInput{} diff --git a/service/transfer/api_op_DescribeExecution.go b/service/transfer/api_op_DescribeExecution.go index 189fc618145..bd6fbc16694 100644 --- a/service/transfer/api_op_DescribeExecution.go +++ b/service/transfer/api_op_DescribeExecution.go @@ -12,7 +12,10 @@ import ( ) // You can use DescribeExecution to check the details of the execution of the -// specified workflow. +// specified workflow. This API call only returns details for in-progress +// workflows. If you provide an ID for an execution that is not in progress, or if +// the execution doesn't match the specified workflow ID, you receive a +// ResourceNotFound exception. func (c *Client) DescribeExecution(ctx context.Context, params *DescribeExecutionInput, optFns ...func(*Options)) (*DescribeExecutionOutput, error) { if params == nil { params = &DescribeExecutionInput{} diff --git a/service/transfer/api_op_DescribeUser.go b/service/transfer/api_op_DescribeUser.go index 8413f022f07..772c2378f09 100644 --- a/service/transfer/api_op_DescribeUser.go +++ b/service/transfer/api_op_DescribeUser.go @@ -54,8 +54,8 @@ type DescribeUserOutput struct { // This member is required. ServerId *string - // An array containing the properties of the user account for the ServerID value - // that you specified. + // An array containing the properties of the Transfer Family user for the ServerID + // value that you specified. // // This member is required. User *types.DescribedUser diff --git a/service/transfer/api_op_ImportSshPublicKey.go b/service/transfer/api_op_ImportSshPublicKey.go index 9313b9ffc75..8b340370458 100644 --- a/service/transfer/api_op_ImportSshPublicKey.go +++ b/service/transfer/api_op_ImportSshPublicKey.go @@ -10,10 +10,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Adds a Secure Shell (SSH) public key to a user account identified by a UserName -// value assigned to the specific file transfer protocol-enabled server, identified -// by ServerId . The response returns the UserName value, the ServerId value, and -// the name of the SshPublicKeyId . +// Adds a Secure Shell (SSH) public key to a Transfer Family user identified by a +// UserName value assigned to the specific file transfer protocol-enabled server, +// identified by ServerId . The response returns the UserName value, the ServerId +// value, and the name of the SshPublicKeyId . func (c *Client) ImportSshPublicKey(ctx context.Context, params *ImportSshPublicKeyInput, optFns ...func(*Options)) (*ImportSshPublicKeyOutput, error) { if params == nil { params = &ImportSshPublicKeyInput{} @@ -42,7 +42,7 @@ type ImportSshPublicKeyInput struct { // This member is required. SshPublicKeyBody *string - // The name of the user account that is assigned to one or more servers. + // The name of the Transfer Family user that is assigned to one or more servers. // // This member is required. UserName *string diff --git a/service/transfer/api_op_ListExecutions.go b/service/transfer/api_op_ListExecutions.go index 83253130fe8..146cf9f287c 100644 --- a/service/transfer/api_op_ListExecutions.go +++ b/service/transfer/api_op_ListExecutions.go @@ -12,7 +12,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists all executions for the specified workflow. +// Lists all in-progress executions for the specified workflow. If the specified +// workflow ID cannot be found, ListExecutions returns a ResourceNotFound +// exception. func (c *Client) ListExecutions(ctx context.Context, params *ListExecutionsInput, optFns ...func(*Options)) (*ListExecutionsOutput, error) { if params == nil { params = &ListExecutionsInput{} @@ -56,14 +58,7 @@ type ListExecutionsInput struct { type ListExecutionsOutput struct { - // Returns the details for each execution. - // - NextToken: returned from a call to several APIs, you can use pass it to a - // subsequent command to continue listing additional executions. - // - StartTime: timestamp indicating when the execution began. - // - Executions: details of the execution, including the execution ID, initial - // file location, and Service metadata. - // - Status: one of the following values: IN_PROGRESS , COMPLETED , EXCEPTION , - // HANDLING_EXEPTION . + // Returns the details for each execution, in a ListedExecution array. // // This member is required. Executions []types.ListedExecution diff --git a/service/transfer/api_op_ListUsers.go b/service/transfer/api_op_ListUsers.go index 954bb9bd2c7..e5a670a92c4 100644 --- a/service/transfer/api_op_ListUsers.go +++ b/service/transfer/api_op_ListUsers.go @@ -54,8 +54,8 @@ type ListUsersOutput struct { // This member is required. ServerId *string - // Returns the user accounts and their properties for the ServerId value that you - // specify. + // Returns the Transfer Family users and their properties for the ServerId value + // that you specify. // // This member is required. Users []types.ListedUser diff --git a/service/transfer/api_op_ListWorkflows.go b/service/transfer/api_op_ListWorkflows.go index 6af81b4cca8..b1d8612342b 100644 --- a/service/transfer/api_op_ListWorkflows.go +++ b/service/transfer/api_op_ListWorkflows.go @@ -12,7 +12,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists all of your workflows. +// Lists all workflows associated with your Amazon Web Services account for your +// current region. func (c *Client) ListWorkflows(ctx context.Context, params *ListWorkflowsInput, optFns ...func(*Options)) (*ListWorkflowsOutput, error) { if params == nil { params = &ListWorkflowsInput{} diff --git a/service/transfer/api_op_TagResource.go b/service/transfer/api_op_TagResource.go index 32db483dafd..c067b8df4b1 100644 --- a/service/transfer/api_op_TagResource.go +++ b/service/transfer/api_op_TagResource.go @@ -38,8 +38,8 @@ type TagResourceInput struct { Arn *string // Key-value pairs assigned to ARNs that you can use to group and search for - // resources by type. You can attach this metadata to user accounts for any - // purpose. + // resources by type. You can attach this metadata to resources (servers, users, + // workflows, and so on) for any purpose. // // This member is required. Tags []types.Tag diff --git a/service/transfer/api_op_TestIdentityProvider.go b/service/transfer/api_op_TestIdentityProvider.go index 50d0f9f3c3c..d896ab73352 100644 --- a/service/transfer/api_op_TestIdentityProvider.go +++ b/service/transfer/api_op_TestIdentityProvider.go @@ -18,8 +18,15 @@ import ( // can troubleshoot issues with the identity provider integration to ensure that // your users can successfully use the service. The ServerId and UserName // parameters are required. The ServerProtocol , SourceIp , and UserPassword are -// all optional. You cannot use TestIdentityProvider if the IdentityProviderType -// of your server is SERVICE_MANAGED . +// all optional. Note the following: +// +// - You cannot use TestIdentityProvider if the IdentityProviderType of your +// server is SERVICE_MANAGED . +// +// - TestIdentityProvider does not work with keys: it only accepts passwords. +// +// - TestIdentityProvider can test the password operation for a custom Identity +// Provider that handles keys and passwords. // // - If you provide any incorrect values for any parameters, the Response field // is empty. @@ -31,7 +38,9 @@ import ( // - If you enter a Server ID for the --server-id parameter that does not // identify an actual Transfer server, you receive the following error: An error // occurred (ResourceNotFoundException) when calling the TestIdentityProvider -// operation: Unknown server +// operation: Unknown server . It is possible your sever is in a different +// region. You can specify a region by adding the following: --region region-code +// , such as --region us-east-2 to specify a server in US East (Ohio). func (c *Client) TestIdentityProvider(ctx context.Context, params *TestIdentityProviderInput, optFns ...func(*Options)) (*TestIdentityProviderOutput, error) { if params == nil { params = &TestIdentityProviderInput{} @@ -55,7 +64,7 @@ type TestIdentityProviderInput struct { // This member is required. ServerId *string - // The name of the user account to be tested. + // The name of the account to be tested. // // This member is required. UserName *string @@ -64,12 +73,13 @@ type TestIdentityProviderInput struct { // - Secure Shell (SSH) File Transfer Protocol (SFTP) // - File Transfer Protocol Secure (FTPS) // - File Transfer Protocol (FTP) + // - Applicability Statement 2 (AS2) ServerProtocol types.Protocol - // The source IP address of the user account to be tested. + // The source IP address of the account to be tested. SourceIp *string - // The password of the user account to be tested. + // The password of the account to be tested. UserPassword *string noSmithyDocumentSerde @@ -77,7 +87,8 @@ type TestIdentityProviderInput struct { type TestIdentityProviderOutput struct { - // The HTTP status code that is the response from your API Gateway. + // The HTTP status code that is the response from your API Gateway or your Lambda + // function. // // This member is required. StatusCode int32 @@ -92,7 +103,7 @@ type TestIdentityProviderOutput struct { // to an incorrect username or password. Message *string - // The response that is returned from your API Gateway. + // The response that is returned from your API Gateway or your Lambda function. Response *string // Metadata pertaining to the operation's result. diff --git a/service/transfer/api_op_UpdateServer.go b/service/transfer/api_op_UpdateServer.go index 5a0c3d55ad3..08da2962aad 100644 --- a/service/transfer/api_op_UpdateServer.go +++ b/service/transfer/api_op_UpdateServer.go @@ -31,8 +31,8 @@ func (c *Client) UpdateServer(ctx context.Context, params *UpdateServerInput, op type UpdateServerInput struct { - // A system-assigned unique identifier for a server instance that the user account - // is assigned to. + // A system-assigned unique identifier for a server instance that the Transfer + // Family user is assigned to. // // This member is required. ServerId *string @@ -170,10 +170,10 @@ type UpdateServerInput struct { // that's used for executing the workflow. In addition to a workflow to execute // when a file is uploaded completely, WorkflowDetails can also contain a workflow // ID (and execution role) for a workflow to execute on partial upload. A partial - // upload occurs when a file is open when the session disconnects. To remove an - // associated workflow from a server, you can provide an empty OnUpload object, as - // in the following example. aws transfer update-server --server-id - // s-01234567890abcdef --workflow-details '{"OnUpload":[]}' + // upload occurs when the server session disconnects while the file is still being + // uploaded. To remove an associated workflow from a server, you can provide an + // empty OnUpload object, as in the following example. aws transfer update-server + // --server-id s-01234567890abcdef --workflow-details '{"OnUpload":[]}' WorkflowDetails *types.WorkflowDetails noSmithyDocumentSerde @@ -181,8 +181,8 @@ type UpdateServerInput struct { type UpdateServerOutput struct { - // A system-assigned unique identifier for a server that the user account is - // assigned to. + // A system-assigned unique identifier for a server that the Transfer Family user + // is assigned to. // // This member is required. ServerId *string diff --git a/service/transfer/api_op_UpdateUser.go b/service/transfer/api_op_UpdateUser.go index c5ef1d077cd..14a569a25d5 100644 --- a/service/transfer/api_op_UpdateUser.go +++ b/service/transfer/api_op_UpdateUser.go @@ -32,8 +32,8 @@ func (c *Client) UpdateUser(ctx context.Context, params *UpdateUserInput, optFns type UpdateUserInput struct { - // A system-assigned unique identifier for a server instance that the user account - // is assigned to. + // A system-assigned unique identifier for a Transfer Family server instance that + // the user is assigned to. // // This member is required. ServerId *string @@ -113,8 +113,8 @@ type UpdateUserInput struct { // update a user's properties. type UpdateUserOutput struct { - // A system-assigned unique identifier for a server instance that the user account - // is assigned to. + // A system-assigned unique identifier for a Transfer Family server instance that + // the account is assigned to. // // This member is required. ServerId *string diff --git a/service/transfer/deserializers.go b/service/transfer/deserializers.go index 41240159b35..12a6720cc73 100644 --- a/service/transfer/deserializers.go +++ b/service/transfer/deserializers.go @@ -9294,6 +9294,15 @@ func awsAwsjson11_deserializeDocumentIdentityProviderDetails(v **types.IdentityP sv.InvocationRole = ptr.String(jtv) } + case "SftpAuthenticationMethods": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SftpAuthenticationMethods to be of type string, got %T instead", value) + } + sv.SftpAuthenticationMethods = types.SftpAuthenticationMethods(jtv) + } + case "Url": if value != nil { jtv, ok := value.(string) diff --git a/service/transfer/serializers.go b/service/transfer/serializers.go index 6e6e08ea9ae..bd6a22f8255 100644 --- a/service/transfer/serializers.go +++ b/service/transfer/serializers.go @@ -3507,6 +3507,11 @@ func awsAwsjson11_serializeDocumentIdentityProviderDetails(v *types.IdentityProv ok.String(*v.InvocationRole) } + if len(v.SftpAuthenticationMethods) > 0 { + ok := object.Key("SftpAuthenticationMethods") + ok.String(string(v.SftpAuthenticationMethods)) + } + if v.Url != nil { ok := object.Key("Url") ok.String(*v.Url) diff --git a/service/transfer/types/enums.go b/service/transfer/types/enums.go index 339dc86bc02..d77bce84ff0 100644 --- a/service/transfer/types/enums.go +++ b/service/transfer/types/enums.go @@ -416,6 +416,28 @@ func (SetStatOption) Values() []SetStatOption { } } +type SftpAuthenticationMethods string + +// Enum values for SftpAuthenticationMethods +const ( + SftpAuthenticationMethodsPassword SftpAuthenticationMethods = "PASSWORD" + SftpAuthenticationMethodsPublicKey SftpAuthenticationMethods = "PUBLIC_KEY" + SftpAuthenticationMethodsPublicKeyOrPassword SftpAuthenticationMethods = "PUBLIC_KEY_OR_PASSWORD" + SftpAuthenticationMethodsPublicKeyAndPassword SftpAuthenticationMethods = "PUBLIC_KEY_AND_PASSWORD" +) + +// Values returns all known values for SftpAuthenticationMethods. 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 (SftpAuthenticationMethods) Values() []SftpAuthenticationMethods { + return []SftpAuthenticationMethods{ + "PASSWORD", + "PUBLIC_KEY", + "PUBLIC_KEY_OR_PASSWORD", + "PUBLIC_KEY_AND_PASSWORD", + } +} + type SigningAlg string // Enum values for SigningAlg diff --git a/service/transfer/types/types.go b/service/transfer/types/types.go index 216cc9a8027..feea2f50601 100644 --- a/service/transfer/types/types.go +++ b/service/transfer/types/types.go @@ -51,23 +51,28 @@ type As2ConnectorConfig struct { // Each step type has its own StepDetails structure. type CopyStepDetails struct { - // Specifies the location for the file being copied. Use ${Transfer:username} or + // Specifies the location for the file being copied. Use ${Transfer:UserName} or // ${Transfer:UploadDate} in this field to parametrize the destination prefix by // username or uploaded date. - // - Set the value of DestinationFileLocation to ${Transfer:username} to copy + // - Set the value of DestinationFileLocation to ${Transfer:UserName} to copy // uploaded files to an Amazon S3 bucket that is prefixed with the name of the // Transfer Family user that uploaded the file. // - Set the value of DestinationFileLocation to ${Transfer:UploadDate} to copy // uploaded files to an Amazon S3 bucket that is prefixed with the date of the // upload. The system resolves UploadDate to a date format of YYYY-MM-DD, based - // on the date the file is uploaded. + // on the date the file is uploaded in UTC. DestinationFileLocation *InputFileLocation // The name of the step, used as an identifier. Name *string // A flag that indicates whether to overwrite an existing file of the same name. - // The default is FALSE . + // The default is FALSE . If the workflow is processing a file that has the same + // name as an existing file, the behavior is as follows: + // - If OverwriteExisting is TRUE , the existing file is replaced with the file + // being processed. + // - If OverwriteExisting is FALSE , nothing happens, and the workflow processing + // stops. OverwriteExisting OverwriteExisting // Specifies which file to use as input to the workflow step: either the output @@ -97,7 +102,7 @@ type CustomStepDetails struct { // ${original.file} . SourceFileLocation *string - // The ARN for the lambda function that is being called. + // The ARN for the Lambda function that is being called. Target *string // Timeout, in seconds, for the step. @@ -109,7 +114,16 @@ type CustomStepDetails struct { // Each step type has its own StepDetails structure. type DecryptStepDetails struct { - // Specifies the location for the file that's being processed. + // Specifies the location for the file being decrypted. Use ${Transfer:UserName} + // or ${Transfer:UploadDate} in this field to parametrize the destination prefix + // by username or uploaded date. + // - Set the value of DestinationFileLocation to ${Transfer:UserName} to decrypt + // uploaded files to an Amazon S3 bucket that is prefixed with the name of the + // Transfer Family user that uploaded the file. + // - Set the value of DestinationFileLocation to ${Transfer:UploadDate} to + // decrypt uploaded files to an Amazon S3 bucket that is prefixed with the date of + // the upload. The system resolves UploadDate to a date format of YYYY-MM-DD, + // based on the date the file is uploaded in UTC. // // This member is required. DestinationFileLocation *InputFileLocation @@ -123,7 +137,12 @@ type DecryptStepDetails struct { Name *string // A flag that indicates whether to overwrite an existing file of the same name. - // The default is FALSE . + // The default is FALSE . If the workflow is processing a file that has the same + // name as an existing file, the behavior is as follows: + // - If OverwriteExisting is TRUE , the existing file is replaced with the file + // being processed. + // - If OverwriteExisting is FALSE , nothing happens, and the workflow processing + // stops. OverwriteExisting OverwriteExisting // Specifies which file to use as input to the workflow step: either the output @@ -556,7 +575,7 @@ type DescribedServer struct { // provide an Amazon API Gateway endpoint URL to call for authentication by using // the IdentityProviderDetails parameter. Use the AWS_LAMBDA value to directly use // an Lambda function as your identity provider. If you choose this value, you must - // specify the ARN for the Lambda function in the Function parameter or the + // specify the ARN for the Lambda function in the Function parameter for the // IdentityProviderDetails data type. IdentityProviderType IdentityProviderType @@ -647,7 +666,8 @@ type DescribedServer struct { // that's used for executing the workflow. In addition to a workflow to execute // when a file is uploaded completely, WorkflowDetails can also contain a workflow // ID (and execution role) for a workflow to execute on partial upload. A partial - // upload occurs when a file is open when the session disconnects. + // upload occurs when the server session disconnects while the file is still being + // uploaded. WorkflowDetails *WorkflowDetails noSmithyDocumentSerde @@ -921,12 +941,25 @@ type IdentityProviderDetails struct { // The identifier of the Directory Service directory that you want to stop sharing. DirectoryId *string - // The ARN for a lambda function to use for the Identity provider. + // The ARN for a Lambda function to use for the Identity provider. Function *string + // This parameter is only applicable if your IdentityProviderType is API_GATEWAY . // Provides the type of InvocationRole used to authenticate the user account. InvocationRole *string + // For SFTP-enabled servers, and for custom identity providers only, you can + // specify whether to authenticate using a password, SSH key pair, or both. + // - PASSWORD - users must provide their password to connect. + // - PUBLIC_KEY - users must provide their private key to connect. + // - PUBLIC_KEY_OR_PASSWORD - users can authenticate with either their password + // or their key. This is the default value. + // - PUBLIC_KEY_AND_PASSWORD - users must provide both their private key and + // their password to connect. The server checks the key first, and then if the key + // is valid, the system prompts for a password. If the private key provided does + // not match the public key that is stored, authentication fails. + SftpAuthenticationMethods SftpAuthenticationMethods + // Provides the location of the service endpoint used to authenticate users. Url *string @@ -1171,7 +1204,7 @@ type ListedServer struct { // provide an Amazon API Gateway endpoint URL to call for authentication by using // the IdentityProviderDetails parameter. Use the AWS_LAMBDA value to directly use // an Lambda function as your identity provider. If you choose this value, you must - // specify the ARN for the Lambda function in the Function parameter or the + // specify the ARN for the Lambda function in the Function parameter for the // IdentityProviderDetails data type. IdentityProviderType IdentityProviderType @@ -1444,13 +1477,14 @@ type ServiceMetadata struct { } // Provides information about the public Secure Shell (SSH) key that is associated -// with a user account for the specific file transfer protocol-enabled server (as -// identified by ServerId ). The information returned includes the date the key was -// imported, the public key contents, and the public key ID. A user can store more -// than one SSH public key associated with their user name on a specific server. +// with a Transfer Family user for the specific file transfer protocol-enabled +// server (as identified by ServerId ). The information returned includes the date +// the key was imported, the public key contents, and the public key ID. A user can +// store more than one SSH public key associated with their user name on a specific +// server. type SshPublicKey struct { - // Specifies the date that the public key was added to the user account. + // Specifies the date that the public key was added to the Transfer Family user. // // This member is required. DateImported *time.Time @@ -1520,7 +1554,7 @@ type UserDetails struct { // This member is required. ServerId *string - // A unique string that identifies a user account associated with a server. + // A unique string that identifies a Transfer Family user associated with a server. // // This member is required. UserName *string @@ -1536,7 +1570,8 @@ type UserDetails struct { // that's used for executing the workflow. In addition to a workflow to execute // when a file is uploaded completely, WorkflowDetails can also contain a workflow // ID (and execution role) for a workflow to execute on partial upload. A partial -// upload occurs when a file is open when the session disconnects. +// upload occurs when the server session disconnects while the file is still being +// uploaded. type WorkflowDetail struct { // Includes the necessary permissions for S3, EFS, and Lambda operations that