repo_name
stringlengths
1
52
repo_creator
stringclasses
6 values
programming_language
stringclasses
4 values
code
stringlengths
0
9.68M
num_lines
int64
1
234k
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mturk/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The ListWorkersWithQualificationType operation returns all of the Workers that // have been associated with a given Qualification type. func (c *Client) ListWorkersWithQualificationType(ctx context.Context, params *ListWorkersWithQualificationTypeInput, optFns ...func(*Options)) (*ListWorkersWithQualificationTypeOutput, error) { if params == nil { params = &ListWorkersWithQualificationTypeInput{} } result, metadata, err := c.invokeOperation(ctx, "ListWorkersWithQualificationType", params, optFns, c.addOperationListWorkersWithQualificationTypeMiddlewares) if err != nil { return nil, err } out := result.(*ListWorkersWithQualificationTypeOutput) out.ResultMetadata = metadata return out, nil } type ListWorkersWithQualificationTypeInput struct { // The ID of the Qualification type of the Qualifications to return. // // This member is required. QualificationTypeId *string // Limit the number of results returned. MaxResults *int32 // Pagination Token NextToken *string // The status of the Qualifications to return. Can be Granted | Revoked . Status types.QualificationStatus noSmithyDocumentSerde } type ListWorkersWithQualificationTypeOutput struct { // If the previous response was incomplete (because there is more data to // retrieve), Amazon Mechanical Turk returns a pagination token in the response. // You can use this pagination token to retrieve the next set of results. NextToken *string // The number of Qualifications on this page in the filtered results list, // equivalent to the number of Qualifications being returned by this call. NumResults *int32 // The list of Qualification elements returned by this call. Qualifications []types.Qualification // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListWorkersWithQualificationTypeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListWorkersWithQualificationType{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListWorkersWithQualificationType{}, 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 = addOpListWorkersWithQualificationTypeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListWorkersWithQualificationType(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 } // ListWorkersWithQualificationTypeAPIClient is a client that implements the // ListWorkersWithQualificationType operation. type ListWorkersWithQualificationTypeAPIClient interface { ListWorkersWithQualificationType(context.Context, *ListWorkersWithQualificationTypeInput, ...func(*Options)) (*ListWorkersWithQualificationTypeOutput, error) } var _ ListWorkersWithQualificationTypeAPIClient = (*Client)(nil) // ListWorkersWithQualificationTypePaginatorOptions is the paginator options for // ListWorkersWithQualificationType type ListWorkersWithQualificationTypePaginatorOptions struct { // Limit the number of results returned. 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 } // ListWorkersWithQualificationTypePaginator is a paginator for // ListWorkersWithQualificationType type ListWorkersWithQualificationTypePaginator struct { options ListWorkersWithQualificationTypePaginatorOptions client ListWorkersWithQualificationTypeAPIClient params *ListWorkersWithQualificationTypeInput nextToken *string firstPage bool } // NewListWorkersWithQualificationTypePaginator returns a new // ListWorkersWithQualificationTypePaginator func NewListWorkersWithQualificationTypePaginator(client ListWorkersWithQualificationTypeAPIClient, params *ListWorkersWithQualificationTypeInput, optFns ...func(*ListWorkersWithQualificationTypePaginatorOptions)) *ListWorkersWithQualificationTypePaginator { if params == nil { params = &ListWorkersWithQualificationTypeInput{} } options := ListWorkersWithQualificationTypePaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListWorkersWithQualificationTypePaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListWorkersWithQualificationTypePaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListWorkersWithQualificationType page. func (p *ListWorkersWithQualificationTypePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkersWithQualificationTypeOutput, 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.ListWorkersWithQualificationType(ctx, &params, 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_opListWorkersWithQualificationType(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "ListWorkersWithQualificationType", } }
238
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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/mturk/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The NotifyWorkers operation sends an email to one or more Workers that you // specify with the Worker ID. You can specify up to 100 Worker IDs to send the // same message with a single call to the NotifyWorkers operation. The // NotifyWorkers operation will send a notification email to a Worker only if you // have previously approved or rejected work from the Worker. func (c *Client) NotifyWorkers(ctx context.Context, params *NotifyWorkersInput, optFns ...func(*Options)) (*NotifyWorkersOutput, error) { if params == nil { params = &NotifyWorkersInput{} } result, metadata, err := c.invokeOperation(ctx, "NotifyWorkers", params, optFns, c.addOperationNotifyWorkersMiddlewares) if err != nil { return nil, err } out := result.(*NotifyWorkersOutput) out.ResultMetadata = metadata return out, nil } type NotifyWorkersInput struct { // The text of the email message to send. Can include up to 4,096 characters // // This member is required. MessageText *string // The subject line of the email message to send. Can include up to 200 characters. // // This member is required. Subject *string // A list of Worker IDs you wish to notify. You can notify upto 100 Workers at a // time. // // This member is required. WorkerIds []string noSmithyDocumentSerde } type NotifyWorkersOutput struct { // When MTurk sends notifications to the list of Workers, it returns back any // failures it encounters in this list of NotifyWorkersFailureStatus objects. NotifyWorkersFailureStatuses []types.NotifyWorkersFailureStatus // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationNotifyWorkersMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpNotifyWorkers{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpNotifyWorkers{}, 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 = addOpNotifyWorkersValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opNotifyWorkers(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_opNotifyWorkers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "NotifyWorkers", } }
141
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The RejectAssignment operation rejects the results of a completed assignment. // You can include an optional feedback message with the rejection, which the // Worker can see in the Status section of the web site. When you include a // feedback message with the rejection, it helps the Worker understand why the // assignment was rejected, and can improve the quality of the results the Worker // submits in the future. Only the Requester who created the HIT can reject an // assignment for the HIT. func (c *Client) RejectAssignment(ctx context.Context, params *RejectAssignmentInput, optFns ...func(*Options)) (*RejectAssignmentOutput, error) { if params == nil { params = &RejectAssignmentInput{} } result, metadata, err := c.invokeOperation(ctx, "RejectAssignment", params, optFns, c.addOperationRejectAssignmentMiddlewares) if err != nil { return nil, err } out := result.(*RejectAssignmentOutput) out.ResultMetadata = metadata return out, nil } type RejectAssignmentInput struct { // The ID of the assignment. The assignment must correspond to a HIT created by // the Requester. // // This member is required. AssignmentId *string // A message for the Worker, which the Worker can see in the Status section of the // web site. // // This member is required. RequesterFeedback *string noSmithyDocumentSerde } type RejectAssignmentOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationRejectAssignmentMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpRejectAssignment{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRejectAssignment{}, 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 = addOpRejectAssignmentValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRejectAssignment(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_opRejectAssignment(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "RejectAssignment", } }
133
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The RejectQualificationRequest operation rejects a user's request for a // Qualification. You can provide a text message explaining why the request was // rejected. The Worker who made the request can see this message. func (c *Client) RejectQualificationRequest(ctx context.Context, params *RejectQualificationRequestInput, optFns ...func(*Options)) (*RejectQualificationRequestOutput, error) { if params == nil { params = &RejectQualificationRequestInput{} } result, metadata, err := c.invokeOperation(ctx, "RejectQualificationRequest", params, optFns, c.addOperationRejectQualificationRequestMiddlewares) if err != nil { return nil, err } out := result.(*RejectQualificationRequestOutput) out.ResultMetadata = metadata return out, nil } type RejectQualificationRequestInput struct { // The ID of the Qualification request, as returned by the // ListQualificationRequests operation. // // This member is required. QualificationRequestId *string // A text message explaining why the request was rejected, to be shown to the // Worker who made the request. Reason *string noSmithyDocumentSerde } type RejectQualificationRequestOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationRejectQualificationRequestMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpRejectQualificationRequest{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRejectQualificationRequest{}, 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 = addOpRejectQualificationRequestValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRejectQualificationRequest(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_opRejectQualificationRequest(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "RejectQualificationRequest", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The SendBonus operation issues a payment of money from your account to a // Worker. This payment happens separately from the reward you pay to the Worker // when you approve the Worker's assignment. The SendBonus operation requires the // Worker's ID and the assignment ID as parameters to initiate payment of the // bonus. You must include a message that explains the reason for the bonus // payment, as the Worker may not be expecting the payment. Amazon Mechanical Turk // collects a fee for bonus payments, similar to the HIT listing fee. This // operation fails if your account does not have enough funds to pay for both the // bonus and the fees. func (c *Client) SendBonus(ctx context.Context, params *SendBonusInput, optFns ...func(*Options)) (*SendBonusOutput, error) { if params == nil { params = &SendBonusInput{} } result, metadata, err := c.invokeOperation(ctx, "SendBonus", params, optFns, c.addOperationSendBonusMiddlewares) if err != nil { return nil, err } out := result.(*SendBonusOutput) out.ResultMetadata = metadata return out, nil } type SendBonusInput struct { // The ID of the assignment for which this bonus is paid. // // This member is required. AssignmentId *string // The Bonus amount is a US Dollar amount specified using a string (for example, // "5" represents $5.00 USD and "101.42" represents $101.42 USD). Do not include // currency symbols or currency codes. // // This member is required. BonusAmount *string // A message that explains the reason for the bonus payment. The Worker receiving // the bonus can see this message. // // This member is required. Reason *string // The ID of the Worker being paid the bonus. // // This member is required. WorkerId *string // A unique identifier for this request, which allows you to retry the call on // error without granting multiple bonuses. This is useful in cases such as network // timeouts where it is unclear whether or not the call succeeded on the server. If // the bonus already exists in the system from a previous call using the same // UniqueRequestToken, subsequent calls will return an error with a message // containing the request ID. UniqueRequestToken *string noSmithyDocumentSerde } type SendBonusOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationSendBonusMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpSendBonus{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpSendBonus{}, 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 = addOpSendBonusValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSendBonus(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_opSendBonus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "SendBonus", } }
154
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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/mturk/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The SendTestEventNotification operation causes Amazon Mechanical Turk to send a // notification message as if a HIT event occurred, according to the provided // notification specification. This allows you to test notifications without // setting up notifications for a real HIT type and trying to trigger them using // the website. When you call this operation, the service attempts to send the test // notification immediately. func (c *Client) SendTestEventNotification(ctx context.Context, params *SendTestEventNotificationInput, optFns ...func(*Options)) (*SendTestEventNotificationOutput, error) { if params == nil { params = &SendTestEventNotificationInput{} } result, metadata, err := c.invokeOperation(ctx, "SendTestEventNotification", params, optFns, c.addOperationSendTestEventNotificationMiddlewares) if err != nil { return nil, err } out := result.(*SendTestEventNotificationOutput) out.ResultMetadata = metadata return out, nil } type SendTestEventNotificationInput struct { // The notification specification to test. This value is identical to the value // you would provide to the UpdateNotificationSettings operation when you establish // the notification specification for a HIT type. // // This member is required. Notification *types.NotificationSpecification // The event to simulate to test the notification specification. This event is // included in the test message even if the notification specification does not // include the event type. The notification specification does not filter out the // test event. // // This member is required. TestEventType types.EventType noSmithyDocumentSerde } type SendTestEventNotificationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationSendTestEventNotificationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpSendTestEventNotification{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpSendTestEventNotification{}, 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 = addOpSendTestEventNotificationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSendTestEventNotification(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_opSendTestEventNotification(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "SendTestEventNotification", } }
136
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // The UpdateExpirationForHIT operation allows you update the expiration time of a // HIT. If you update it to a time in the past, the HIT will be immediately // expired. func (c *Client) UpdateExpirationForHIT(ctx context.Context, params *UpdateExpirationForHITInput, optFns ...func(*Options)) (*UpdateExpirationForHITOutput, error) { if params == nil { params = &UpdateExpirationForHITInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateExpirationForHIT", params, optFns, c.addOperationUpdateExpirationForHITMiddlewares) if err != nil { return nil, err } out := result.(*UpdateExpirationForHITOutput) out.ResultMetadata = metadata return out, nil } type UpdateExpirationForHITInput struct { // The date and time at which you want the HIT to expire // // This member is required. ExpireAt *time.Time // The HIT to update. // // This member is required. HITId *string noSmithyDocumentSerde } type UpdateExpirationForHITOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateExpirationForHITMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateExpirationForHIT{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateExpirationForHIT{}, 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 = addOpUpdateExpirationForHITValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateExpirationForHIT(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_opUpdateExpirationForHIT(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "UpdateExpirationForHIT", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The UpdateHITReviewStatus operation updates the status of a HIT. If the status // is Reviewable, this operation can update the status to Reviewing, or it can // revert a Reviewing HIT back to the Reviewable status. func (c *Client) UpdateHITReviewStatus(ctx context.Context, params *UpdateHITReviewStatusInput, optFns ...func(*Options)) (*UpdateHITReviewStatusOutput, error) { if params == nil { params = &UpdateHITReviewStatusInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateHITReviewStatus", params, optFns, c.addOperationUpdateHITReviewStatusMiddlewares) if err != nil { return nil, err } out := result.(*UpdateHITReviewStatusOutput) out.ResultMetadata = metadata return out, nil } type UpdateHITReviewStatusInput struct { // The ID of the HIT to update. // // This member is required. HITId *string // Specifies how to update the HIT status. Default is False . // - Setting this to false will only transition a HIT from Reviewable to // Reviewing // - Setting this to true will only transition a HIT from Reviewing to Reviewable Revert *bool noSmithyDocumentSerde } type UpdateHITReviewStatusOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateHITReviewStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateHITReviewStatus{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateHITReviewStatus{}, 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 = addOpUpdateHITReviewStatusValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateHITReviewStatus(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_opUpdateHITReviewStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "UpdateHITReviewStatus", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The UpdateHITTypeOfHIT operation allows you to change the HITType properties of // a HIT. This operation disassociates the HIT from its old HITType properties and // associates it with the new HITType properties. The HIT takes on the properties // of the new HITType in place of the old ones. func (c *Client) UpdateHITTypeOfHIT(ctx context.Context, params *UpdateHITTypeOfHITInput, optFns ...func(*Options)) (*UpdateHITTypeOfHITOutput, error) { if params == nil { params = &UpdateHITTypeOfHITInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateHITTypeOfHIT", params, optFns, c.addOperationUpdateHITTypeOfHITMiddlewares) if err != nil { return nil, err } out := result.(*UpdateHITTypeOfHITOutput) out.ResultMetadata = metadata return out, nil } type UpdateHITTypeOfHITInput struct { // The HIT to update. // // This member is required. HITId *string // The ID of the new HIT type. // // This member is required. HITTypeId *string noSmithyDocumentSerde } type UpdateHITTypeOfHITOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateHITTypeOfHITMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateHITTypeOfHIT{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateHITTypeOfHIT{}, 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 = addOpUpdateHITTypeOfHITValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateHITTypeOfHIT(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_opUpdateHITTypeOfHIT(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "UpdateHITTypeOfHIT", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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/mturk/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The UpdateNotificationSettings operation creates, updates, disables or // re-enables notifications for a HIT type. If you call the // UpdateNotificationSettings operation for a HIT type that already has a // notification specification, the operation replaces the old specification with a // new one. You can call the UpdateNotificationSettings operation to enable or // disable notifications for the HIT type, without having to modify the // notification specification itself by providing updates to the Active status // without specifying a new notification specification. To change the Active status // of a HIT type's notifications, the HIT type must already have a notification // specification, or one must be provided in the same call to // UpdateNotificationSettings . func (c *Client) UpdateNotificationSettings(ctx context.Context, params *UpdateNotificationSettingsInput, optFns ...func(*Options)) (*UpdateNotificationSettingsOutput, error) { if params == nil { params = &UpdateNotificationSettingsInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateNotificationSettings", params, optFns, c.addOperationUpdateNotificationSettingsMiddlewares) if err != nil { return nil, err } out := result.(*UpdateNotificationSettingsOutput) out.ResultMetadata = metadata return out, nil } type UpdateNotificationSettingsInput struct { // The ID of the HIT type whose notification specification is being updated. // // This member is required. HITTypeId *string // Specifies whether notifications are sent for HITs of this HIT type, according // to the notification specification. You must specify either the Notification // parameter or the Active parameter for the call to UpdateNotificationSettings to // succeed. Active *bool // The notification specification for the HIT type. Notification *types.NotificationSpecification noSmithyDocumentSerde } type UpdateNotificationSettingsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateNotificationSettingsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateNotificationSettings{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateNotificationSettings{}, 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 = addOpUpdateNotificationSettingsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateNotificationSettings(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_opUpdateNotificationSettings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "UpdateNotificationSettings", } }
140
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk 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/mturk/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The UpdateQualificationType operation modifies the attributes of an existing // Qualification type, which is represented by a QualificationType data structure. // Only the owner of a Qualification type can modify its attributes. Most // attributes of a Qualification type can be changed after the type has been // created. However, the Name and Keywords fields cannot be modified. The // RetryDelayInSeconds parameter can be modified or added to change the delay or to // enable retries, but RetryDelayInSeconds cannot be used to disable retries. You // can use this operation to update the test for a Qualification type. The test is // updated based on the values specified for the Test, TestDurationInSeconds and // AnswerKey parameters. All three parameters specify the updated test. If you are // updating the test for a type, you must specify the Test and // TestDurationInSeconds parameters. The AnswerKey parameter is optional; omitting // it specifies that the updated test does not have an answer key. If you omit the // Test parameter, the test for the Qualification type is unchanged. There is no // way to remove a test from a Qualification type that has one. If the type already // has a test, you cannot update it to be AutoGranted. If the Qualification type // does not have a test and one is provided by an update, the type will henceforth // have a test. If you want to update the test duration or answer key for an // existing test without changing the questions, you must specify a Test parameter // with the original questions, along with the updated values. If you provide an // updated Test but no AnswerKey, the new test will not have an answer key. // Requests for such Qualifications must be granted manually. You can also update // the AutoGranted and AutoGrantedValue attributes of the Qualification type. func (c *Client) UpdateQualificationType(ctx context.Context, params *UpdateQualificationTypeInput, optFns ...func(*Options)) (*UpdateQualificationTypeOutput, error) { if params == nil { params = &UpdateQualificationTypeInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateQualificationType", params, optFns, c.addOperationUpdateQualificationTypeMiddlewares) if err != nil { return nil, err } out := result.(*UpdateQualificationTypeOutput) out.ResultMetadata = metadata return out, nil } type UpdateQualificationTypeInput struct { // The ID of the Qualification type to update. // // This member is required. QualificationTypeId *string // The answers to the Qualification test specified in the Test parameter, in the // form of an AnswerKey data structure. AnswerKey *string // Specifies whether requests for the Qualification type are granted immediately, // without prompting the Worker with a Qualification test. Constraints: If the Test // parameter is specified, this parameter cannot be true. AutoGranted *bool // The Qualification value to use for automatically granted Qualifications. This // parameter is used only if the AutoGranted parameter is true. AutoGrantedValue *int32 // The new description of the Qualification type. Description *string // The new status of the Qualification type - Active | Inactive QualificationTypeStatus types.QualificationTypeStatus // The amount of time, in seconds, that Workers must wait after requesting a // Qualification of the specified Qualification type before they can retry the // Qualification request. It is not possible to disable retries for a Qualification // type after it has been created with retries enabled. If you want to disable // retries, you must dispose of the existing retry-enabled Qualification type using // DisposeQualificationType and then create a new Qualification type with retries // disabled using CreateQualificationType. RetryDelayInSeconds *int64 // The questions for the Qualification test a Worker must answer correctly to // obtain a Qualification of this type. If this parameter is specified, // TestDurationInSeconds must also be specified. Constraints: Must not be longer // than 65535 bytes. Must be a QuestionForm data structure. This parameter cannot // be specified if AutoGranted is true. Constraints: None. If not specified, the // Worker may request the Qualification without answering any questions. Test *string // The number of seconds the Worker has to complete the Qualification test, // starting from the time the Worker requests the Qualification. TestDurationInSeconds *int64 noSmithyDocumentSerde } type UpdateQualificationTypeOutput struct { // Contains a QualificationType data structure. QualificationType *types.QualificationType // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateQualificationTypeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateQualificationType{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateQualificationType{}, 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 = addOpUpdateQualificationTypeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateQualificationType(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_opUpdateQualificationType(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "mturk-requester", OperationName: "UpdateQualificationType", } }
187
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/mturk/types" smithy "github.com/aws/smithy-go" smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "strings" ) type awsAwsjson11_deserializeOpAcceptQualificationRequest struct { } func (*awsAwsjson11_deserializeOpAcceptQualificationRequest) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpAcceptQualificationRequest) 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, awsAwsjson11_deserializeOpErrorAcceptQualificationRequest(response, &metadata) } output := &AcceptQualificationRequestOutput{} 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 = awsAwsjson11_deserializeOpDocumentAcceptQualificationRequestOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorAcceptQualificationRequest(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpApproveAssignment struct { } func (*awsAwsjson11_deserializeOpApproveAssignment) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpApproveAssignment) 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, awsAwsjson11_deserializeOpErrorApproveAssignment(response, &metadata) } output := &ApproveAssignmentOutput{} 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 = awsAwsjson11_deserializeOpDocumentApproveAssignmentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorApproveAssignment(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpAssociateQualificationWithWorker struct { } func (*awsAwsjson11_deserializeOpAssociateQualificationWithWorker) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpAssociateQualificationWithWorker) 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, awsAwsjson11_deserializeOpErrorAssociateQualificationWithWorker(response, &metadata) } output := &AssociateQualificationWithWorkerOutput{} 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 = awsAwsjson11_deserializeOpDocumentAssociateQualificationWithWorkerOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorAssociateQualificationWithWorker(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCreateAdditionalAssignmentsForHIT struct { } func (*awsAwsjson11_deserializeOpCreateAdditionalAssignmentsForHIT) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateAdditionalAssignmentsForHIT) 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, awsAwsjson11_deserializeOpErrorCreateAdditionalAssignmentsForHIT(response, &metadata) } output := &CreateAdditionalAssignmentsForHITOutput{} 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 = awsAwsjson11_deserializeOpDocumentCreateAdditionalAssignmentsForHITOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorCreateAdditionalAssignmentsForHIT(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCreateHIT struct { } func (*awsAwsjson11_deserializeOpCreateHIT) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateHIT) 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, awsAwsjson11_deserializeOpErrorCreateHIT(response, &metadata) } output := &CreateHITOutput{} 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 = awsAwsjson11_deserializeOpDocumentCreateHITOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorCreateHIT(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCreateHITType struct { } func (*awsAwsjson11_deserializeOpCreateHITType) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateHITType) 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, awsAwsjson11_deserializeOpErrorCreateHITType(response, &metadata) } output := &CreateHITTypeOutput{} 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 = awsAwsjson11_deserializeOpDocumentCreateHITTypeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorCreateHITType(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCreateHITWithHITType struct { } func (*awsAwsjson11_deserializeOpCreateHITWithHITType) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateHITWithHITType) 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, awsAwsjson11_deserializeOpErrorCreateHITWithHITType(response, &metadata) } output := &CreateHITWithHITTypeOutput{} 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 = awsAwsjson11_deserializeOpDocumentCreateHITWithHITTypeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorCreateHITWithHITType(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCreateQualificationType struct { } func (*awsAwsjson11_deserializeOpCreateQualificationType) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateQualificationType) 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, awsAwsjson11_deserializeOpErrorCreateQualificationType(response, &metadata) } output := &CreateQualificationTypeOutput{} 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 = awsAwsjson11_deserializeOpDocumentCreateQualificationTypeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorCreateQualificationType(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCreateWorkerBlock struct { } func (*awsAwsjson11_deserializeOpCreateWorkerBlock) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateWorkerBlock) 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, awsAwsjson11_deserializeOpErrorCreateWorkerBlock(response, &metadata) } output := &CreateWorkerBlockOutput{} 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 = awsAwsjson11_deserializeOpDocumentCreateWorkerBlockOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorCreateWorkerBlock(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteHIT struct { } func (*awsAwsjson11_deserializeOpDeleteHIT) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteHIT) 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, awsAwsjson11_deserializeOpErrorDeleteHIT(response, &metadata) } output := &DeleteHITOutput{} 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 = awsAwsjson11_deserializeOpDocumentDeleteHITOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorDeleteHIT(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteQualificationType struct { } func (*awsAwsjson11_deserializeOpDeleteQualificationType) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteQualificationType) 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, awsAwsjson11_deserializeOpErrorDeleteQualificationType(response, &metadata) } output := &DeleteQualificationTypeOutput{} 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 = awsAwsjson11_deserializeOpDocumentDeleteQualificationTypeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorDeleteQualificationType(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteWorkerBlock struct { } func (*awsAwsjson11_deserializeOpDeleteWorkerBlock) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteWorkerBlock) 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, awsAwsjson11_deserializeOpErrorDeleteWorkerBlock(response, &metadata) } output := &DeleteWorkerBlockOutput{} 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 = awsAwsjson11_deserializeOpDocumentDeleteWorkerBlockOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorDeleteWorkerBlock(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDisassociateQualificationFromWorker struct { } func (*awsAwsjson11_deserializeOpDisassociateQualificationFromWorker) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDisassociateQualificationFromWorker) 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, awsAwsjson11_deserializeOpErrorDisassociateQualificationFromWorker(response, &metadata) } output := &DisassociateQualificationFromWorkerOutput{} 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 = awsAwsjson11_deserializeOpDocumentDisassociateQualificationFromWorkerOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorDisassociateQualificationFromWorker(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetAccountBalance struct { } func (*awsAwsjson11_deserializeOpGetAccountBalance) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetAccountBalance) 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, awsAwsjson11_deserializeOpErrorGetAccountBalance(response, &metadata) } output := &GetAccountBalanceOutput{} 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 = awsAwsjson11_deserializeOpDocumentGetAccountBalanceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorGetAccountBalance(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetAssignment struct { } func (*awsAwsjson11_deserializeOpGetAssignment) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetAssignment) 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, awsAwsjson11_deserializeOpErrorGetAssignment(response, &metadata) } output := &GetAssignmentOutput{} 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 = awsAwsjson11_deserializeOpDocumentGetAssignmentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorGetAssignment(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetFileUploadURL struct { } func (*awsAwsjson11_deserializeOpGetFileUploadURL) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetFileUploadURL) 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, awsAwsjson11_deserializeOpErrorGetFileUploadURL(response, &metadata) } output := &GetFileUploadURLOutput{} 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 = awsAwsjson11_deserializeOpDocumentGetFileUploadURLOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorGetFileUploadURL(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetHIT struct { } func (*awsAwsjson11_deserializeOpGetHIT) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetHIT) 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, awsAwsjson11_deserializeOpErrorGetHIT(response, &metadata) } output := &GetHITOutput{} 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 = awsAwsjson11_deserializeOpDocumentGetHITOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorGetHIT(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetQualificationScore struct { } func (*awsAwsjson11_deserializeOpGetQualificationScore) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetQualificationScore) 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, awsAwsjson11_deserializeOpErrorGetQualificationScore(response, &metadata) } output := &GetQualificationScoreOutput{} 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 = awsAwsjson11_deserializeOpDocumentGetQualificationScoreOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorGetQualificationScore(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetQualificationType struct { } func (*awsAwsjson11_deserializeOpGetQualificationType) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetQualificationType) 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, awsAwsjson11_deserializeOpErrorGetQualificationType(response, &metadata) } output := &GetQualificationTypeOutput{} 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 = awsAwsjson11_deserializeOpDocumentGetQualificationTypeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorGetQualificationType(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListAssignmentsForHIT struct { } func (*awsAwsjson11_deserializeOpListAssignmentsForHIT) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListAssignmentsForHIT) 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, awsAwsjson11_deserializeOpErrorListAssignmentsForHIT(response, &metadata) } output := &ListAssignmentsForHITOutput{} 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 = awsAwsjson11_deserializeOpDocumentListAssignmentsForHITOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorListAssignmentsForHIT(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListBonusPayments struct { } func (*awsAwsjson11_deserializeOpListBonusPayments) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListBonusPayments) 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, awsAwsjson11_deserializeOpErrorListBonusPayments(response, &metadata) } output := &ListBonusPaymentsOutput{} 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 = awsAwsjson11_deserializeOpDocumentListBonusPaymentsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorListBonusPayments(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListHITs struct { } func (*awsAwsjson11_deserializeOpListHITs) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListHITs) 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, awsAwsjson11_deserializeOpErrorListHITs(response, &metadata) } output := &ListHITsOutput{} 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 = awsAwsjson11_deserializeOpDocumentListHITsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorListHITs(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListHITsForQualificationType struct { } func (*awsAwsjson11_deserializeOpListHITsForQualificationType) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListHITsForQualificationType) 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, awsAwsjson11_deserializeOpErrorListHITsForQualificationType(response, &metadata) } output := &ListHITsForQualificationTypeOutput{} 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 = awsAwsjson11_deserializeOpDocumentListHITsForQualificationTypeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorListHITsForQualificationType(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListQualificationRequests struct { } func (*awsAwsjson11_deserializeOpListQualificationRequests) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListQualificationRequests) 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, awsAwsjson11_deserializeOpErrorListQualificationRequests(response, &metadata) } output := &ListQualificationRequestsOutput{} 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 = awsAwsjson11_deserializeOpDocumentListQualificationRequestsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorListQualificationRequests(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListQualificationTypes struct { } func (*awsAwsjson11_deserializeOpListQualificationTypes) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListQualificationTypes) 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, awsAwsjson11_deserializeOpErrorListQualificationTypes(response, &metadata) } output := &ListQualificationTypesOutput{} 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 = awsAwsjson11_deserializeOpDocumentListQualificationTypesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorListQualificationTypes(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListReviewableHITs struct { } func (*awsAwsjson11_deserializeOpListReviewableHITs) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListReviewableHITs) 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, awsAwsjson11_deserializeOpErrorListReviewableHITs(response, &metadata) } output := &ListReviewableHITsOutput{} 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 = awsAwsjson11_deserializeOpDocumentListReviewableHITsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorListReviewableHITs(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListReviewPolicyResultsForHIT struct { } func (*awsAwsjson11_deserializeOpListReviewPolicyResultsForHIT) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListReviewPolicyResultsForHIT) 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, awsAwsjson11_deserializeOpErrorListReviewPolicyResultsForHIT(response, &metadata) } output := &ListReviewPolicyResultsForHITOutput{} 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 = awsAwsjson11_deserializeOpDocumentListReviewPolicyResultsForHITOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorListReviewPolicyResultsForHIT(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListWorkerBlocks struct { } func (*awsAwsjson11_deserializeOpListWorkerBlocks) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListWorkerBlocks) 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, awsAwsjson11_deserializeOpErrorListWorkerBlocks(response, &metadata) } output := &ListWorkerBlocksOutput{} 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 = awsAwsjson11_deserializeOpDocumentListWorkerBlocksOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorListWorkerBlocks(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListWorkersWithQualificationType struct { } func (*awsAwsjson11_deserializeOpListWorkersWithQualificationType) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListWorkersWithQualificationType) 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, awsAwsjson11_deserializeOpErrorListWorkersWithQualificationType(response, &metadata) } output := &ListWorkersWithQualificationTypeOutput{} 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 = awsAwsjson11_deserializeOpDocumentListWorkersWithQualificationTypeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorListWorkersWithQualificationType(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpNotifyWorkers struct { } func (*awsAwsjson11_deserializeOpNotifyWorkers) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpNotifyWorkers) 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, awsAwsjson11_deserializeOpErrorNotifyWorkers(response, &metadata) } output := &NotifyWorkersOutput{} 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 = awsAwsjson11_deserializeOpDocumentNotifyWorkersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorNotifyWorkers(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpRejectAssignment struct { } func (*awsAwsjson11_deserializeOpRejectAssignment) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpRejectAssignment) 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, awsAwsjson11_deserializeOpErrorRejectAssignment(response, &metadata) } output := &RejectAssignmentOutput{} 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 = awsAwsjson11_deserializeOpDocumentRejectAssignmentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorRejectAssignment(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpRejectQualificationRequest struct { } func (*awsAwsjson11_deserializeOpRejectQualificationRequest) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpRejectQualificationRequest) 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, awsAwsjson11_deserializeOpErrorRejectQualificationRequest(response, &metadata) } output := &RejectQualificationRequestOutput{} 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 = awsAwsjson11_deserializeOpDocumentRejectQualificationRequestOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorRejectQualificationRequest(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpSendBonus struct { } func (*awsAwsjson11_deserializeOpSendBonus) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpSendBonus) 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, awsAwsjson11_deserializeOpErrorSendBonus(response, &metadata) } output := &SendBonusOutput{} 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 = awsAwsjson11_deserializeOpDocumentSendBonusOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorSendBonus(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpSendTestEventNotification struct { } func (*awsAwsjson11_deserializeOpSendTestEventNotification) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpSendTestEventNotification) 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, awsAwsjson11_deserializeOpErrorSendTestEventNotification(response, &metadata) } output := &SendTestEventNotificationOutput{} 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 = awsAwsjson11_deserializeOpDocumentSendTestEventNotificationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorSendTestEventNotification(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUpdateExpirationForHIT struct { } func (*awsAwsjson11_deserializeOpUpdateExpirationForHIT) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUpdateExpirationForHIT) 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, awsAwsjson11_deserializeOpErrorUpdateExpirationForHIT(response, &metadata) } output := &UpdateExpirationForHITOutput{} 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 = awsAwsjson11_deserializeOpDocumentUpdateExpirationForHITOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorUpdateExpirationForHIT(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUpdateHITReviewStatus struct { } func (*awsAwsjson11_deserializeOpUpdateHITReviewStatus) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUpdateHITReviewStatus) 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, awsAwsjson11_deserializeOpErrorUpdateHITReviewStatus(response, &metadata) } output := &UpdateHITReviewStatusOutput{} 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 = awsAwsjson11_deserializeOpDocumentUpdateHITReviewStatusOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorUpdateHITReviewStatus(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUpdateHITTypeOfHIT struct { } func (*awsAwsjson11_deserializeOpUpdateHITTypeOfHIT) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUpdateHITTypeOfHIT) 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, awsAwsjson11_deserializeOpErrorUpdateHITTypeOfHIT(response, &metadata) } output := &UpdateHITTypeOfHITOutput{} 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 = awsAwsjson11_deserializeOpDocumentUpdateHITTypeOfHITOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorUpdateHITTypeOfHIT(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUpdateNotificationSettings struct { } func (*awsAwsjson11_deserializeOpUpdateNotificationSettings) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUpdateNotificationSettings) 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, awsAwsjson11_deserializeOpErrorUpdateNotificationSettings(response, &metadata) } output := &UpdateNotificationSettingsOutput{} 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 = awsAwsjson11_deserializeOpDocumentUpdateNotificationSettingsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorUpdateNotificationSettings(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUpdateQualificationType struct { } func (*awsAwsjson11_deserializeOpUpdateQualificationType) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUpdateQualificationType) 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, awsAwsjson11_deserializeOpErrorUpdateQualificationType(response, &metadata) } output := &UpdateQualificationTypeOutput{} 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 = awsAwsjson11_deserializeOpDocumentUpdateQualificationTypeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorUpdateQualificationType(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("RequestError", errorCode): return awsAwsjson11_deserializeErrorRequestError(response, errorBody) case strings.EqualFold("ServiceFault", errorCode): return awsAwsjson11_deserializeErrorServiceFault(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsAwsjson11_deserializeErrorRequestError(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.RequestError{} err := awsAwsjson11_deserializeDocumentRequestError(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorServiceFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.ServiceFault{} err := awsAwsjson11_deserializeDocumentServiceFault(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeDocumentAssignment(v **types.Assignment, 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.Assignment if *v == nil { sv = &types.Assignment{} } else { sv = *v } for key, value := range shape { switch key { case "AcceptTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.AcceptTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Answer": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Answer = ptr.String(jtv) } case "ApprovalTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.ApprovalTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "AssignmentId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.AssignmentId = ptr.String(jtv) } case "AssignmentStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AssignmentStatus to be of type string, got %T instead", value) } sv.AssignmentStatus = types.AssignmentStatus(jtv) } case "AutoApprovalTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.AutoApprovalTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Deadline": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Deadline = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "HITId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.HITId = ptr.String(jtv) } case "RejectionTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.RejectionTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "RequesterFeedback": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequesterFeedback = ptr.String(jtv) } case "SubmitTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.SubmitTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "WorkerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CustomerId to be of type string, got %T instead", value) } sv.WorkerId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentAssignmentList(v *[]types.Assignment, 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.Assignment if *v == nil { cv = []types.Assignment{} } else { cv = *v } for _, value := range shape { var col types.Assignment destAddr := &col if err := awsAwsjson11_deserializeDocumentAssignment(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentBonusPayment(v **types.BonusPayment, 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.BonusPayment if *v == nil { sv = &types.BonusPayment{} } else { sv = *v } for key, value := range shape { switch key { case "AssignmentId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.AssignmentId = ptr.String(jtv) } case "BonusAmount": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CurrencyAmount to be of type string, got %T instead", value) } sv.BonusAmount = ptr.String(jtv) } case "GrantTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.GrantTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Reason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Reason = ptr.String(jtv) } case "WorkerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CustomerId to be of type string, got %T instead", value) } sv.WorkerId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentBonusPaymentList(v *[]types.BonusPayment, 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.BonusPayment if *v == nil { cv = []types.BonusPayment{} } else { cv = *v } for _, value := range shape { var col types.BonusPayment destAddr := &col if err := awsAwsjson11_deserializeDocumentBonusPayment(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentHIT(v **types.HIT, 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.HIT if *v == nil { sv = &types.HIT{} } else { sv = *v } for key, value := range shape { switch key { case "AssignmentDurationInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.AssignmentDurationInSeconds = ptr.Int64(i64) } case "AutoApprovalDelayInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.AutoApprovalDelayInSeconds = ptr.Int64(i64) } case "CreationTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "Expiration": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.Expiration = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "HITGroupId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.HITGroupId = ptr.String(jtv) } case "HITId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.HITId = ptr.String(jtv) } case "HITLayoutId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.HITLayoutId = ptr.String(jtv) } case "HITReviewStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HITReviewStatus to be of type string, got %T instead", value) } sv.HITReviewStatus = types.HITReviewStatus(jtv) } case "HITStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HITStatus to be of type string, got %T instead", value) } sv.HITStatus = types.HITStatus(jtv) } case "HITTypeId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.HITTypeId = ptr.String(jtv) } case "Keywords": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Keywords = ptr.String(jtv) } case "MaxAssignments": 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.MaxAssignments = ptr.Int32(int32(i64)) } case "NumberOfAssignmentsAvailable": 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.NumberOfAssignmentsAvailable = ptr.Int32(int32(i64)) } case "NumberOfAssignmentsCompleted": 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.NumberOfAssignmentsCompleted = ptr.Int32(int32(i64)) } case "NumberOfAssignmentsPending": 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.NumberOfAssignmentsPending = ptr.Int32(int32(i64)) } case "QualificationRequirements": if err := awsAwsjson11_deserializeDocumentQualificationRequirementList(&sv.QualificationRequirements, value); err != nil { return err } case "Question": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Question = ptr.String(jtv) } case "RequesterAnnotation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.RequesterAnnotation = ptr.String(jtv) } case "Reward": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CurrencyAmount to be of type string, got %T instead", value) } sv.Reward = ptr.String(jtv) } case "Title": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Title = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentHITList(v *[]types.HIT, 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.HIT if *v == nil { cv = []types.HIT{} } else { cv = *v } for _, value := range shape { var col types.HIT destAddr := &col if err := awsAwsjson11_deserializeDocumentHIT(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentIntegerList(v *[]int32, 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 []int32 if *v == nil { cv = []int32{} } else { cv = *v } for _, value := range shape { var col int32 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 } col = int32(i64) } cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentLocale(v **types.Locale, 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.Locale if *v == nil { sv = &types.Locale{} } else { sv = *v } for key, value := range shape { switch key { case "Country": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CountryParameters to be of type string, got %T instead", value) } sv.Country = ptr.String(jtv) } case "Subdivision": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CountryParameters to be of type string, got %T instead", value) } sv.Subdivision = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentLocaleList(v *[]types.Locale, 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.Locale if *v == nil { cv = []types.Locale{} } else { cv = *v } for _, value := range shape { var col types.Locale destAddr := &col if err := awsAwsjson11_deserializeDocumentLocale(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentNotifyWorkersFailureStatus(v **types.NotifyWorkersFailureStatus, 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.NotifyWorkersFailureStatus if *v == nil { sv = &types.NotifyWorkersFailureStatus{} } else { sv = *v } for key, value := range shape { switch key { case "NotifyWorkersFailureCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NotifyWorkersFailureCode to be of type string, got %T instead", value) } sv.NotifyWorkersFailureCode = types.NotifyWorkersFailureCode(jtv) } case "NotifyWorkersFailureMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.NotifyWorkersFailureMessage = ptr.String(jtv) } case "WorkerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CustomerId to be of type string, got %T instead", value) } sv.WorkerId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentNotifyWorkersFailureStatusList(v *[]types.NotifyWorkersFailureStatus, 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.NotifyWorkersFailureStatus if *v == nil { cv = []types.NotifyWorkersFailureStatus{} } else { cv = *v } for _, value := range shape { var col types.NotifyWorkersFailureStatus destAddr := &col if err := awsAwsjson11_deserializeDocumentNotifyWorkersFailureStatus(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentParameterMapEntry(v **types.ParameterMapEntry, 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.ParameterMapEntry if *v == nil { sv = &types.ParameterMapEntry{} } else { sv = *v } for key, value := range shape { switch key { case "Key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Key = ptr.String(jtv) } case "Values": if err := awsAwsjson11_deserializeDocumentStringList(&sv.Values, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentParameterMapEntryList(v *[]types.ParameterMapEntry, 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.ParameterMapEntry if *v == nil { cv = []types.ParameterMapEntry{} } else { cv = *v } for _, value := range shape { var col types.ParameterMapEntry destAddr := &col if err := awsAwsjson11_deserializeDocumentParameterMapEntry(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentPolicyParameter(v **types.PolicyParameter, 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.PolicyParameter if *v == nil { sv = &types.PolicyParameter{} } else { sv = *v } for key, value := range shape { switch key { case "Key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Key = ptr.String(jtv) } case "MapEntries": if err := awsAwsjson11_deserializeDocumentParameterMapEntryList(&sv.MapEntries, value); err != nil { return err } case "Values": if err := awsAwsjson11_deserializeDocumentStringList(&sv.Values, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentPolicyParameterList(v *[]types.PolicyParameter, 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.PolicyParameter if *v == nil { cv = []types.PolicyParameter{} } else { cv = *v } for _, value := range shape { var col types.PolicyParameter destAddr := &col if err := awsAwsjson11_deserializeDocumentPolicyParameter(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentQualification(v **types.Qualification, 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.Qualification if *v == nil { sv = &types.Qualification{} } else { sv = *v } for key, value := range shape { switch key { case "GrantTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.GrantTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "IntegerValue": 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.IntegerValue = ptr.Int32(int32(i64)) } case "LocaleValue": if err := awsAwsjson11_deserializeDocumentLocale(&sv.LocaleValue, value); err != nil { return err } case "QualificationTypeId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.QualificationTypeId = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected QualificationStatus to be of type string, got %T instead", value) } sv.Status = types.QualificationStatus(jtv) } case "WorkerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CustomerId to be of type string, got %T instead", value) } sv.WorkerId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentQualificationList(v *[]types.Qualification, 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.Qualification if *v == nil { cv = []types.Qualification{} } else { cv = *v } for _, value := range shape { var col types.Qualification destAddr := &col if err := awsAwsjson11_deserializeDocumentQualification(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentQualificationRequest(v **types.QualificationRequest, 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.QualificationRequest if *v == nil { sv = &types.QualificationRequest{} } else { sv = *v } for key, value := range shape { switch key { case "Answer": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Answer = ptr.String(jtv) } case "QualificationRequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.QualificationRequestId = ptr.String(jtv) } case "QualificationTypeId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.QualificationTypeId = ptr.String(jtv) } case "SubmitTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.SubmitTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Test": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Test = ptr.String(jtv) } case "WorkerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CustomerId to be of type string, got %T instead", value) } sv.WorkerId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentQualificationRequestList(v *[]types.QualificationRequest, 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.QualificationRequest if *v == nil { cv = []types.QualificationRequest{} } else { cv = *v } for _, value := range shape { var col types.QualificationRequest destAddr := &col if err := awsAwsjson11_deserializeDocumentQualificationRequest(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentQualificationRequirement(v **types.QualificationRequirement, 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.QualificationRequirement if *v == nil { sv = &types.QualificationRequirement{} } else { sv = *v } for key, value := range shape { switch key { case "ActionsGuarded": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected HITAccessActions to be of type string, got %T instead", value) } sv.ActionsGuarded = types.HITAccessActions(jtv) } case "Comparator": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Comparator to be of type string, got %T instead", value) } sv.Comparator = types.Comparator(jtv) } case "IntegerValues": if err := awsAwsjson11_deserializeDocumentIntegerList(&sv.IntegerValues, value); err != nil { return err } case "LocaleValues": if err := awsAwsjson11_deserializeDocumentLocaleList(&sv.LocaleValues, value); err != nil { return err } case "QualificationTypeId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.QualificationTypeId = ptr.String(jtv) } case "RequiredToPreview": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.RequiredToPreview = ptr.Bool(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentQualificationRequirementList(v *[]types.QualificationRequirement, 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.QualificationRequirement if *v == nil { cv = []types.QualificationRequirement{} } else { cv = *v } for _, value := range shape { var col types.QualificationRequirement destAddr := &col if err := awsAwsjson11_deserializeDocumentQualificationRequirement(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentQualificationType(v **types.QualificationType, 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.QualificationType if *v == nil { sv = &types.QualificationType{} } else { sv = *v } for key, value := range shape { switch key { case "AnswerKey": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.AnswerKey = ptr.String(jtv) } case "AutoGranted": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.AutoGranted = ptr.Bool(jtv) } case "AutoGrantedValue": 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.AutoGrantedValue = ptr.Int32(int32(i64)) } case "CreationTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "IsRequestable": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } sv.IsRequestable = ptr.Bool(jtv) } case "Keywords": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Keywords = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "QualificationTypeId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.QualificationTypeId = ptr.String(jtv) } case "QualificationTypeStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected QualificationTypeStatus to be of type string, got %T instead", value) } sv.QualificationTypeStatus = types.QualificationTypeStatus(jtv) } case "RetryDelayInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.RetryDelayInSeconds = ptr.Int64(i64) } case "Test": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Test = ptr.String(jtv) } case "TestDurationInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Long to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TestDurationInSeconds = ptr.Int64(i64) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentQualificationTypeList(v *[]types.QualificationType, 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.QualificationType if *v == nil { cv = []types.QualificationType{} } else { cv = *v } for _, value := range shape { var col types.QualificationType destAddr := &col if err := awsAwsjson11_deserializeDocumentQualificationType(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentRequestError(v **types.RequestError, 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.RequestError if *v == nil { sv = &types.RequestError{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "TurkErrorCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TurkErrorCode to be of type string, got %T instead", value) } sv.TurkErrorCode = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentReviewActionDetail(v **types.ReviewActionDetail, 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.ReviewActionDetail if *v == nil { sv = &types.ReviewActionDetail{} } else { sv = *v } for key, value := range shape { switch key { case "ActionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.ActionId = ptr.String(jtv) } case "ActionName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ActionName = ptr.String(jtv) } case "CompleteTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CompleteTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "ErrorCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.ErrorCode = ptr.String(jtv) } case "Result": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Result = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReviewActionStatus to be of type string, got %T instead", value) } sv.Status = types.ReviewActionStatus(jtv) } case "TargetId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.TargetId = ptr.String(jtv) } case "TargetType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.TargetType = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentReviewActionDetailList(v *[]types.ReviewActionDetail, 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.ReviewActionDetail if *v == nil { cv = []types.ReviewActionDetail{} } else { cv = *v } for _, value := range shape { var col types.ReviewActionDetail destAddr := &col if err := awsAwsjson11_deserializeDocumentReviewActionDetail(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentReviewPolicy(v **types.ReviewPolicy, 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.ReviewPolicy if *v == nil { sv = &types.ReviewPolicy{} } else { sv = *v } for key, value := range shape { switch key { case "Parameters": if err := awsAwsjson11_deserializeDocumentPolicyParameterList(&sv.Parameters, value); err != nil { return err } case "PolicyName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.PolicyName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentReviewReport(v **types.ReviewReport, 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.ReviewReport if *v == nil { sv = &types.ReviewReport{} } else { sv = *v } for key, value := range shape { switch key { case "ReviewActions": if err := awsAwsjson11_deserializeDocumentReviewActionDetailList(&sv.ReviewActions, value); err != nil { return err } case "ReviewResults": if err := awsAwsjson11_deserializeDocumentReviewResultDetailList(&sv.ReviewResults, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentReviewResultDetail(v **types.ReviewResultDetail, 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.ReviewResultDetail if *v == nil { sv = &types.ReviewResultDetail{} } else { sv = *v } for key, value := range shape { switch key { case "ActionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.ActionId = ptr.String(jtv) } case "Key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Key = ptr.String(jtv) } case "QuestionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.QuestionId = ptr.String(jtv) } case "SubjectId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.SubjectId = ptr.String(jtv) } case "SubjectType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.SubjectType = ptr.String(jtv) } case "Value": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentReviewResultDetailList(v *[]types.ReviewResultDetail, 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.ReviewResultDetail if *v == nil { cv = []types.ReviewResultDetail{} } else { cv = *v } for _, value := range shape { var col types.ReviewResultDetail destAddr := &col if err := awsAwsjson11_deserializeDocumentReviewResultDetail(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentServiceFault(v **types.ServiceFault, 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.ServiceFault if *v == nil { sv = &types.ServiceFault{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } case "TurkErrorCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TurkErrorCode to be of type string, got %T instead", value) } sv.TurkErrorCode = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentStringList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentWorkerBlock(v **types.WorkerBlock, 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.WorkerBlock if *v == nil { sv = &types.WorkerBlock{} } else { sv = *v } for key, value := range shape { switch key { case "Reason": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Reason = ptr.String(jtv) } case "WorkerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CustomerId to be of type string, got %T instead", value) } sv.WorkerId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentWorkerBlockList(v *[]types.WorkerBlock, 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.WorkerBlock if *v == nil { cv = []types.WorkerBlock{} } else { cv = *v } for _, value := range shape { var col types.WorkerBlock destAddr := &col if err := awsAwsjson11_deserializeDocumentWorkerBlock(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeOpDocumentAcceptQualificationRequestOutput(v **AcceptQualificationRequestOutput, 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 *AcceptQualificationRequestOutput if *v == nil { sv = &AcceptQualificationRequestOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentApproveAssignmentOutput(v **ApproveAssignmentOutput, 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 *ApproveAssignmentOutput if *v == nil { sv = &ApproveAssignmentOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentAssociateQualificationWithWorkerOutput(v **AssociateQualificationWithWorkerOutput, 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 *AssociateQualificationWithWorkerOutput if *v == nil { sv = &AssociateQualificationWithWorkerOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateAdditionalAssignmentsForHITOutput(v **CreateAdditionalAssignmentsForHITOutput, 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 *CreateAdditionalAssignmentsForHITOutput if *v == nil { sv = &CreateAdditionalAssignmentsForHITOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateHITOutput(v **CreateHITOutput, 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 *CreateHITOutput if *v == nil { sv = &CreateHITOutput{} } else { sv = *v } for key, value := range shape { switch key { case "HIT": if err := awsAwsjson11_deserializeDocumentHIT(&sv.HIT, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateHITTypeOutput(v **CreateHITTypeOutput, 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 *CreateHITTypeOutput if *v == nil { sv = &CreateHITTypeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "HITTypeId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.HITTypeId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateHITWithHITTypeOutput(v **CreateHITWithHITTypeOutput, 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 *CreateHITWithHITTypeOutput if *v == nil { sv = &CreateHITWithHITTypeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "HIT": if err := awsAwsjson11_deserializeDocumentHIT(&sv.HIT, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateQualificationTypeOutput(v **CreateQualificationTypeOutput, 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 *CreateQualificationTypeOutput if *v == nil { sv = &CreateQualificationTypeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "QualificationType": if err := awsAwsjson11_deserializeDocumentQualificationType(&sv.QualificationType, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateWorkerBlockOutput(v **CreateWorkerBlockOutput, 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 *CreateWorkerBlockOutput if *v == nil { sv = &CreateWorkerBlockOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDeleteHITOutput(v **DeleteHITOutput, 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 *DeleteHITOutput if *v == nil { sv = &DeleteHITOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDeleteQualificationTypeOutput(v **DeleteQualificationTypeOutput, 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 *DeleteQualificationTypeOutput if *v == nil { sv = &DeleteQualificationTypeOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDeleteWorkerBlockOutput(v **DeleteWorkerBlockOutput, 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 *DeleteWorkerBlockOutput if *v == nil { sv = &DeleteWorkerBlockOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDisassociateQualificationFromWorkerOutput(v **DisassociateQualificationFromWorkerOutput, 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 *DisassociateQualificationFromWorkerOutput if *v == nil { sv = &DisassociateQualificationFromWorkerOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetAccountBalanceOutput(v **GetAccountBalanceOutput, 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 *GetAccountBalanceOutput if *v == nil { sv = &GetAccountBalanceOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AvailableBalance": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CurrencyAmount to be of type string, got %T instead", value) } sv.AvailableBalance = ptr.String(jtv) } case "OnHoldBalance": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CurrencyAmount to be of type string, got %T instead", value) } sv.OnHoldBalance = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetAssignmentOutput(v **GetAssignmentOutput, 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 *GetAssignmentOutput if *v == nil { sv = &GetAssignmentOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Assignment": if err := awsAwsjson11_deserializeDocumentAssignment(&sv.Assignment, value); err != nil { return err } case "HIT": if err := awsAwsjson11_deserializeDocumentHIT(&sv.HIT, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetFileUploadURLOutput(v **GetFileUploadURLOutput, 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 *GetFileUploadURLOutput if *v == nil { sv = &GetFileUploadURLOutput{} } else { sv = *v } for key, value := range shape { switch key { case "FileUploadURL": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.FileUploadURL = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetHITOutput(v **GetHITOutput, 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 *GetHITOutput if *v == nil { sv = &GetHITOutput{} } else { sv = *v } for key, value := range shape { switch key { case "HIT": if err := awsAwsjson11_deserializeDocumentHIT(&sv.HIT, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetQualificationScoreOutput(v **GetQualificationScoreOutput, 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 *GetQualificationScoreOutput if *v == nil { sv = &GetQualificationScoreOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Qualification": if err := awsAwsjson11_deserializeDocumentQualification(&sv.Qualification, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetQualificationTypeOutput(v **GetQualificationTypeOutput, 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 *GetQualificationTypeOutput if *v == nil { sv = &GetQualificationTypeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "QualificationType": if err := awsAwsjson11_deserializeDocumentQualificationType(&sv.QualificationType, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListAssignmentsForHITOutput(v **ListAssignmentsForHITOutput, 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 *ListAssignmentsForHITOutput if *v == nil { sv = &ListAssignmentsForHITOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Assignments": if err := awsAwsjson11_deserializeDocumentAssignmentList(&sv.Assignments, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "NumResults": 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.NumResults = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListBonusPaymentsOutput(v **ListBonusPaymentsOutput, 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 *ListBonusPaymentsOutput if *v == nil { sv = &ListBonusPaymentsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "BonusPayments": if err := awsAwsjson11_deserializeDocumentBonusPaymentList(&sv.BonusPayments, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "NumResults": 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.NumResults = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListHITsForQualificationTypeOutput(v **ListHITsForQualificationTypeOutput, 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 *ListHITsForQualificationTypeOutput if *v == nil { sv = &ListHITsForQualificationTypeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "HITs": if err := awsAwsjson11_deserializeDocumentHITList(&sv.HITs, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "NumResults": 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.NumResults = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListHITsOutput(v **ListHITsOutput, 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 *ListHITsOutput if *v == nil { sv = &ListHITsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "HITs": if err := awsAwsjson11_deserializeDocumentHITList(&sv.HITs, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "NumResults": 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.NumResults = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListQualificationRequestsOutput(v **ListQualificationRequestsOutput, 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 *ListQualificationRequestsOutput if *v == nil { sv = &ListQualificationRequestsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "NumResults": 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.NumResults = ptr.Int32(int32(i64)) } case "QualificationRequests": if err := awsAwsjson11_deserializeDocumentQualificationRequestList(&sv.QualificationRequests, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListQualificationTypesOutput(v **ListQualificationTypesOutput, 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 *ListQualificationTypesOutput if *v == nil { sv = &ListQualificationTypesOutput{} } else { sv = *v } for key, value := range shape { switch key { case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "NumResults": 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.NumResults = ptr.Int32(int32(i64)) } case "QualificationTypes": if err := awsAwsjson11_deserializeDocumentQualificationTypeList(&sv.QualificationTypes, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListReviewableHITsOutput(v **ListReviewableHITsOutput, 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 *ListReviewableHITsOutput if *v == nil { sv = &ListReviewableHITsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "HITs": if err := awsAwsjson11_deserializeDocumentHITList(&sv.HITs, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "NumResults": 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.NumResults = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListReviewPolicyResultsForHITOutput(v **ListReviewPolicyResultsForHITOutput, 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 *ListReviewPolicyResultsForHITOutput if *v == nil { sv = &ListReviewPolicyResultsForHITOutput{} } else { sv = *v } for key, value := range shape { switch key { case "AssignmentReviewPolicy": if err := awsAwsjson11_deserializeDocumentReviewPolicy(&sv.AssignmentReviewPolicy, value); err != nil { return err } case "AssignmentReviewReport": if err := awsAwsjson11_deserializeDocumentReviewReport(&sv.AssignmentReviewReport, value); err != nil { return err } case "HITId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EntityId to be of type string, got %T instead", value) } sv.HITId = ptr.String(jtv) } case "HITReviewPolicy": if err := awsAwsjson11_deserializeDocumentReviewPolicy(&sv.HITReviewPolicy, value); err != nil { return err } case "HITReviewReport": if err := awsAwsjson11_deserializeDocumentReviewReport(&sv.HITReviewReport, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListWorkerBlocksOutput(v **ListWorkerBlocksOutput, 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 *ListWorkerBlocksOutput if *v == nil { sv = &ListWorkerBlocksOutput{} } else { sv = *v } for key, value := range shape { switch key { case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "NumResults": 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.NumResults = ptr.Int32(int32(i64)) } case "WorkerBlocks": if err := awsAwsjson11_deserializeDocumentWorkerBlockList(&sv.WorkerBlocks, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListWorkersWithQualificationTypeOutput(v **ListWorkersWithQualificationTypeOutput, 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 *ListWorkersWithQualificationTypeOutput if *v == nil { sv = &ListWorkersWithQualificationTypeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "NumResults": 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.NumResults = ptr.Int32(int32(i64)) } case "Qualifications": if err := awsAwsjson11_deserializeDocumentQualificationList(&sv.Qualifications, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentNotifyWorkersOutput(v **NotifyWorkersOutput, 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 *NotifyWorkersOutput if *v == nil { sv = &NotifyWorkersOutput{} } else { sv = *v } for key, value := range shape { switch key { case "NotifyWorkersFailureStatuses": if err := awsAwsjson11_deserializeDocumentNotifyWorkersFailureStatusList(&sv.NotifyWorkersFailureStatuses, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentRejectAssignmentOutput(v **RejectAssignmentOutput, 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 *RejectAssignmentOutput if *v == nil { sv = &RejectAssignmentOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentRejectQualificationRequestOutput(v **RejectQualificationRequestOutput, 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 *RejectQualificationRequestOutput if *v == nil { sv = &RejectQualificationRequestOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentSendBonusOutput(v **SendBonusOutput, 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 *SendBonusOutput if *v == nil { sv = &SendBonusOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentSendTestEventNotificationOutput(v **SendTestEventNotificationOutput, 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 *SendTestEventNotificationOutput if *v == nil { sv = &SendTestEventNotificationOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUpdateExpirationForHITOutput(v **UpdateExpirationForHITOutput, 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 *UpdateExpirationForHITOutput if *v == nil { sv = &UpdateExpirationForHITOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUpdateHITReviewStatusOutput(v **UpdateHITReviewStatusOutput, 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 *UpdateHITReviewStatusOutput if *v == nil { sv = &UpdateHITReviewStatusOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUpdateHITTypeOfHITOutput(v **UpdateHITTypeOfHITOutput, 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 *UpdateHITTypeOfHITOutput if *v == nil { sv = &UpdateHITTypeOfHITOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUpdateNotificationSettingsOutput(v **UpdateNotificationSettingsOutput, 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 *UpdateNotificationSettingsOutput if *v == nil { sv = &UpdateNotificationSettingsOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUpdateQualificationTypeOutput(v **UpdateQualificationTypeOutput, 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 *UpdateQualificationTypeOutput if *v == nil { sv = &UpdateQualificationTypeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "QualificationType": if err := awsAwsjson11_deserializeDocumentQualificationType(&sv.QualificationType, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil }
8,241
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package mturk provides the API client, operations, and parameter types for // Amazon Mechanical Turk. // // Amazon Mechanical Turk API Reference package mturk
8
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk import ( "context" "errors" "fmt" "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" internalendpoints "github.com/aws/aws-sdk-go-v2/service/mturk/internal/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "net/url" "strings" ) // EndpointResolverOptions is the service endpoint resolver options type EndpointResolverOptions = internalendpoints.Options // EndpointResolver interface for resolving service endpoints. type EndpointResolver interface { ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) } var _ EndpointResolver = &internalendpoints.Resolver{} // NewDefaultEndpointResolver constructs a new service endpoint resolver func NewDefaultEndpointResolver() *internalendpoints.Resolver { return internalendpoints.New() } // EndpointResolverFunc is a helper utility that wraps a function so it satisfies // the EndpointResolver interface. This is useful when you want to add additional // endpoint resolving logic, or stub out specific endpoints with custom values. type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { return fn(region, options) } func resolveDefaultEndpointConfiguration(o *Options) { if o.EndpointResolver != nil { return } o.EndpointResolver = NewDefaultEndpointResolver() } // EndpointResolverFromURL returns an EndpointResolver configured using the // provided endpoint url. By default, the resolved endpoint resolver uses the // client region as signing region, and the endpoint source is set to // EndpointSourceCustom.You can provide functional options to configure endpoint // values for the resolved endpoint. func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} for _, fn := range optFns { fn(&e) } return EndpointResolverFunc( func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { if len(e.SigningRegion) == 0 { e.SigningRegion = region } return e, nil }, ) } type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions } func (*ResolveEndpoint) ID() string { return "ResolveEndpoint" } func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } if m.Resolver == nil { return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") } eo := m.Options eo.Logger = middleware.GetLogger(ctx) var endpoint aws.Endpoint endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) if err != nil { return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) } req.URL, err = url.Parse(endpoint.URL) if err != nil { return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) } if len(awsmiddleware.GetSigningName(ctx)) == 0 { signingName := endpoint.SigningName if len(signingName) == 0 { signingName = "mturk-requester" } ctx = awsmiddleware.SetSigningName(ctx, signingName) } ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { return stack.Serialize.Insert(&ResolveEndpoint{ Resolver: o.EndpointResolver, Options: o.EndpointOptions, }, "OperationSerializer", middleware.Before) } func removeResolveEndpointMiddleware(stack *middleware.Stack) error { _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) return err } type wrappedEndpointResolver struct { awsResolver aws.EndpointResolverWithOptions resolver EndpointResolver } func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { if w.awsResolver == nil { goto fallback } endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options) if err == nil { return endpoint, nil } if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { return endpoint, err } fallback: if w.resolver == nil { return endpoint, fmt.Errorf("default endpoint resolver provided was nil") } return w.resolver.ResolveEndpoint(region, options) } type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { return a(service, region) } var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) // withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver. // If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided // fallbackResolver for resolution. // // fallbackResolver must not be nil func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver { var resolver aws.EndpointResolverWithOptions if awsResolverWithOptions != nil { resolver = awsResolverWithOptions } else if awsResolver != nil { resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) } return &wrappedEndpointResolver{ awsResolver: resolver, resolver: fallbackResolver, } } func finalizeClientEndpointResolverOptions(options *Options) { options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() if len(options.EndpointOptions.ResolvedRegion) == 0 { const fipsInfix = "-fips-" const fipsPrefix = "fips-" const fipsSuffix = "-fips" if strings.Contains(options.Region, fipsInfix) || strings.Contains(options.Region, fipsPrefix) || strings.Contains(options.Region, fipsSuffix) { options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled } } }
201
aws-sdk-go-v2
aws
Go
// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. package mturk // goModuleVersion is the tagged release for this module const goModuleVersion = "1.14.12"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/mturk/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "path" ) type awsAwsjson11_serializeOpAcceptQualificationRequest struct { } func (*awsAwsjson11_serializeOpAcceptQualificationRequest) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpAcceptQualificationRequest) 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.(*AcceptQualificationRequestInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.AcceptQualificationRequest") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentAcceptQualificationRequestInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpApproveAssignment struct { } func (*awsAwsjson11_serializeOpApproveAssignment) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpApproveAssignment) 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.(*ApproveAssignmentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.ApproveAssignment") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentApproveAssignmentInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpAssociateQualificationWithWorker struct { } func (*awsAwsjson11_serializeOpAssociateQualificationWithWorker) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpAssociateQualificationWithWorker) 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.(*AssociateQualificationWithWorkerInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.AssociateQualificationWithWorker") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentAssociateQualificationWithWorkerInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpCreateAdditionalAssignmentsForHIT struct { } func (*awsAwsjson11_serializeOpCreateAdditionalAssignmentsForHIT) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateAdditionalAssignmentsForHIT) 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.(*CreateAdditionalAssignmentsForHITInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.CreateAdditionalAssignmentsForHIT") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateAdditionalAssignmentsForHITInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpCreateHIT struct { } func (*awsAwsjson11_serializeOpCreateHIT) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateHIT) 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.(*CreateHITInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.CreateHIT") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateHITInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpCreateHITType struct { } func (*awsAwsjson11_serializeOpCreateHITType) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateHITType) 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.(*CreateHITTypeInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.CreateHITType") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateHITTypeInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpCreateHITWithHITType struct { } func (*awsAwsjson11_serializeOpCreateHITWithHITType) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateHITWithHITType) 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.(*CreateHITWithHITTypeInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.CreateHITWithHITType") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateHITWithHITTypeInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpCreateQualificationType struct { } func (*awsAwsjson11_serializeOpCreateQualificationType) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateQualificationType) 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.(*CreateQualificationTypeInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.CreateQualificationType") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateQualificationTypeInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpCreateWorkerBlock struct { } func (*awsAwsjson11_serializeOpCreateWorkerBlock) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateWorkerBlock) 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.(*CreateWorkerBlockInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.CreateWorkerBlock") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateWorkerBlockInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpDeleteHIT struct { } func (*awsAwsjson11_serializeOpDeleteHIT) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteHIT) 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.(*DeleteHITInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.DeleteHIT") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteHITInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpDeleteQualificationType struct { } func (*awsAwsjson11_serializeOpDeleteQualificationType) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteQualificationType) 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.(*DeleteQualificationTypeInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.DeleteQualificationType") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteQualificationTypeInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpDeleteWorkerBlock struct { } func (*awsAwsjson11_serializeOpDeleteWorkerBlock) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteWorkerBlock) 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.(*DeleteWorkerBlockInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.DeleteWorkerBlock") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteWorkerBlockInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpDisassociateQualificationFromWorker struct { } func (*awsAwsjson11_serializeOpDisassociateQualificationFromWorker) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDisassociateQualificationFromWorker) 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.(*DisassociateQualificationFromWorkerInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.DisassociateQualificationFromWorker") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDisassociateQualificationFromWorkerInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpGetAccountBalance struct { } func (*awsAwsjson11_serializeOpGetAccountBalance) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetAccountBalance) 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.(*GetAccountBalanceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.GetAccountBalance") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetAccountBalanceInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpGetAssignment struct { } func (*awsAwsjson11_serializeOpGetAssignment) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetAssignment) 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.(*GetAssignmentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.GetAssignment") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetAssignmentInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpGetFileUploadURL struct { } func (*awsAwsjson11_serializeOpGetFileUploadURL) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetFileUploadURL) 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.(*GetFileUploadURLInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.GetFileUploadURL") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetFileUploadURLInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpGetHIT struct { } func (*awsAwsjson11_serializeOpGetHIT) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetHIT) 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.(*GetHITInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.GetHIT") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetHITInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpGetQualificationScore struct { } func (*awsAwsjson11_serializeOpGetQualificationScore) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetQualificationScore) 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.(*GetQualificationScoreInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.GetQualificationScore") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetQualificationScoreInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpGetQualificationType struct { } func (*awsAwsjson11_serializeOpGetQualificationType) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetQualificationType) 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.(*GetQualificationTypeInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.GetQualificationType") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetQualificationTypeInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpListAssignmentsForHIT struct { } func (*awsAwsjson11_serializeOpListAssignmentsForHIT) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListAssignmentsForHIT) 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.(*ListAssignmentsForHITInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.ListAssignmentsForHIT") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListAssignmentsForHITInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpListBonusPayments struct { } func (*awsAwsjson11_serializeOpListBonusPayments) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListBonusPayments) 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.(*ListBonusPaymentsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.ListBonusPayments") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListBonusPaymentsInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpListHITs struct { } func (*awsAwsjson11_serializeOpListHITs) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListHITs) 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.(*ListHITsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.ListHITs") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListHITsInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpListHITsForQualificationType struct { } func (*awsAwsjson11_serializeOpListHITsForQualificationType) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListHITsForQualificationType) 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.(*ListHITsForQualificationTypeInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.ListHITsForQualificationType") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListHITsForQualificationTypeInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpListQualificationRequests struct { } func (*awsAwsjson11_serializeOpListQualificationRequests) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListQualificationRequests) 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.(*ListQualificationRequestsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.ListQualificationRequests") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListQualificationRequestsInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpListQualificationTypes struct { } func (*awsAwsjson11_serializeOpListQualificationTypes) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListQualificationTypes) 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.(*ListQualificationTypesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.ListQualificationTypes") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListQualificationTypesInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpListReviewableHITs struct { } func (*awsAwsjson11_serializeOpListReviewableHITs) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListReviewableHITs) 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.(*ListReviewableHITsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.ListReviewableHITs") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListReviewableHITsInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpListReviewPolicyResultsForHIT struct { } func (*awsAwsjson11_serializeOpListReviewPolicyResultsForHIT) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListReviewPolicyResultsForHIT) 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.(*ListReviewPolicyResultsForHITInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.ListReviewPolicyResultsForHIT") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListReviewPolicyResultsForHITInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpListWorkerBlocks struct { } func (*awsAwsjson11_serializeOpListWorkerBlocks) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListWorkerBlocks) 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.(*ListWorkerBlocksInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.ListWorkerBlocks") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListWorkerBlocksInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpListWorkersWithQualificationType struct { } func (*awsAwsjson11_serializeOpListWorkersWithQualificationType) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListWorkersWithQualificationType) 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.(*ListWorkersWithQualificationTypeInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.ListWorkersWithQualificationType") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListWorkersWithQualificationTypeInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpNotifyWorkers struct { } func (*awsAwsjson11_serializeOpNotifyWorkers) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpNotifyWorkers) 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.(*NotifyWorkersInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.NotifyWorkers") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentNotifyWorkersInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpRejectAssignment struct { } func (*awsAwsjson11_serializeOpRejectAssignment) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpRejectAssignment) 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.(*RejectAssignmentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.RejectAssignment") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentRejectAssignmentInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpRejectQualificationRequest struct { } func (*awsAwsjson11_serializeOpRejectQualificationRequest) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpRejectQualificationRequest) 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.(*RejectQualificationRequestInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.RejectQualificationRequest") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentRejectQualificationRequestInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpSendBonus struct { } func (*awsAwsjson11_serializeOpSendBonus) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpSendBonus) 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.(*SendBonusInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.SendBonus") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentSendBonusInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpSendTestEventNotification struct { } func (*awsAwsjson11_serializeOpSendTestEventNotification) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpSendTestEventNotification) 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.(*SendTestEventNotificationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.SendTestEventNotification") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentSendTestEventNotificationInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpUpdateExpirationForHIT struct { } func (*awsAwsjson11_serializeOpUpdateExpirationForHIT) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpUpdateExpirationForHIT) 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.(*UpdateExpirationForHITInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.UpdateExpirationForHIT") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentUpdateExpirationForHITInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpUpdateHITReviewStatus struct { } func (*awsAwsjson11_serializeOpUpdateHITReviewStatus) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpUpdateHITReviewStatus) 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.(*UpdateHITReviewStatusInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.UpdateHITReviewStatus") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentUpdateHITReviewStatusInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpUpdateHITTypeOfHIT struct { } func (*awsAwsjson11_serializeOpUpdateHITTypeOfHIT) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpUpdateHITTypeOfHIT) 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.(*UpdateHITTypeOfHITInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.UpdateHITTypeOfHIT") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentUpdateHITTypeOfHITInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpUpdateNotificationSettings struct { } func (*awsAwsjson11_serializeOpUpdateNotificationSettings) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpUpdateNotificationSettings) 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.(*UpdateNotificationSettingsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.UpdateNotificationSettings") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentUpdateNotificationSettingsInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpUpdateQualificationType struct { } func (*awsAwsjson11_serializeOpUpdateQualificationType) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpUpdateQualificationType) 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.(*UpdateQualificationTypeInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("MTurkRequesterServiceV20170117.UpdateQualificationType") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentUpdateQualificationTypeInput(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 = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsAwsjson11_serializeDocumentAssignmentStatusList(v []types.AssignmentStatus, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(string(v[i])) } return nil } func awsAwsjson11_serializeDocumentCustomerIdList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsAwsjson11_serializeDocumentEventTypeList(v []types.EventType, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(string(v[i])) } return nil } func awsAwsjson11_serializeDocumentHITLayoutParameter(v *types.HITLayoutParameter, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if v.Value != nil { ok := object.Key("Value") ok.String(*v.Value) } return nil } func awsAwsjson11_serializeDocumentHITLayoutParameterList(v []types.HITLayoutParameter, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentHITLayoutParameter(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentIntegerList(v []int32, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.Integer(v[i]) } return nil } func awsAwsjson11_serializeDocumentLocale(v *types.Locale, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Country != nil { ok := object.Key("Country") ok.String(*v.Country) } if v.Subdivision != nil { ok := object.Key("Subdivision") ok.String(*v.Subdivision) } return nil } func awsAwsjson11_serializeDocumentLocaleList(v []types.Locale, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentLocale(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentNotificationSpecification(v *types.NotificationSpecification, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Destination != nil { ok := object.Key("Destination") ok.String(*v.Destination) } if v.EventTypes != nil { ok := object.Key("EventTypes") if err := awsAwsjson11_serializeDocumentEventTypeList(v.EventTypes, ok); err != nil { return err } } if len(v.Transport) > 0 { ok := object.Key("Transport") ok.String(string(v.Transport)) } if v.Version != nil { ok := object.Key("Version") ok.String(*v.Version) } return nil } func awsAwsjson11_serializeDocumentParameterMapEntry(v *types.ParameterMapEntry, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Key != nil { ok := object.Key("Key") ok.String(*v.Key) } if v.Values != nil { ok := object.Key("Values") if err := awsAwsjson11_serializeDocumentStringList(v.Values, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentParameterMapEntryList(v []types.ParameterMapEntry, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentParameterMapEntry(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentPolicyParameter(v *types.PolicyParameter, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Key != nil { ok := object.Key("Key") ok.String(*v.Key) } if v.MapEntries != nil { ok := object.Key("MapEntries") if err := awsAwsjson11_serializeDocumentParameterMapEntryList(v.MapEntries, ok); err != nil { return err } } if v.Values != nil { ok := object.Key("Values") if err := awsAwsjson11_serializeDocumentStringList(v.Values, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentPolicyParameterList(v []types.PolicyParameter, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentPolicyParameter(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentQualificationRequirement(v *types.QualificationRequirement, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.ActionsGuarded) > 0 { ok := object.Key("ActionsGuarded") ok.String(string(v.ActionsGuarded)) } if len(v.Comparator) > 0 { ok := object.Key("Comparator") ok.String(string(v.Comparator)) } if v.IntegerValues != nil { ok := object.Key("IntegerValues") if err := awsAwsjson11_serializeDocumentIntegerList(v.IntegerValues, ok); err != nil { return err } } if v.LocaleValues != nil { ok := object.Key("LocaleValues") if err := awsAwsjson11_serializeDocumentLocaleList(v.LocaleValues, ok); err != nil { return err } } if v.QualificationTypeId != nil { ok := object.Key("QualificationTypeId") ok.String(*v.QualificationTypeId) } if v.RequiredToPreview != nil { ok := object.Key("RequiredToPreview") ok.Boolean(*v.RequiredToPreview) } return nil } func awsAwsjson11_serializeDocumentQualificationRequirementList(v []types.QualificationRequirement, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentQualificationRequirement(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentReviewPolicy(v *types.ReviewPolicy, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Parameters != nil { ok := object.Key("Parameters") if err := awsAwsjson11_serializeDocumentPolicyParameterList(v.Parameters, ok); err != nil { return err } } if v.PolicyName != nil { ok := object.Key("PolicyName") ok.String(*v.PolicyName) } return nil } func awsAwsjson11_serializeDocumentReviewPolicyLevelList(v []types.ReviewPolicyLevel, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(string(v[i])) } return nil } func awsAwsjson11_serializeDocumentStringList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsAwsjson11_serializeOpDocumentAcceptQualificationRequestInput(v *AcceptQualificationRequestInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.IntegerValue != nil { ok := object.Key("IntegerValue") ok.Integer(*v.IntegerValue) } if v.QualificationRequestId != nil { ok := object.Key("QualificationRequestId") ok.String(*v.QualificationRequestId) } return nil } func awsAwsjson11_serializeOpDocumentApproveAssignmentInput(v *ApproveAssignmentInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AssignmentId != nil { ok := object.Key("AssignmentId") ok.String(*v.AssignmentId) } if v.OverrideRejection != nil { ok := object.Key("OverrideRejection") ok.Boolean(*v.OverrideRejection) } if v.RequesterFeedback != nil { ok := object.Key("RequesterFeedback") ok.String(*v.RequesterFeedback) } return nil } func awsAwsjson11_serializeOpDocumentAssociateQualificationWithWorkerInput(v *AssociateQualificationWithWorkerInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.IntegerValue != nil { ok := object.Key("IntegerValue") ok.Integer(*v.IntegerValue) } if v.QualificationTypeId != nil { ok := object.Key("QualificationTypeId") ok.String(*v.QualificationTypeId) } if v.SendNotification != nil { ok := object.Key("SendNotification") ok.Boolean(*v.SendNotification) } if v.WorkerId != nil { ok := object.Key("WorkerId") ok.String(*v.WorkerId) } return nil } func awsAwsjson11_serializeOpDocumentCreateAdditionalAssignmentsForHITInput(v *CreateAdditionalAssignmentsForHITInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.HITId != nil { ok := object.Key("HITId") ok.String(*v.HITId) } if v.NumberOfAdditionalAssignments != nil { ok := object.Key("NumberOfAdditionalAssignments") ok.Integer(*v.NumberOfAdditionalAssignments) } if v.UniqueRequestToken != nil { ok := object.Key("UniqueRequestToken") ok.String(*v.UniqueRequestToken) } return nil } func awsAwsjson11_serializeOpDocumentCreateHITInput(v *CreateHITInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AssignmentDurationInSeconds != nil { ok := object.Key("AssignmentDurationInSeconds") ok.Long(*v.AssignmentDurationInSeconds) } if v.AssignmentReviewPolicy != nil { ok := object.Key("AssignmentReviewPolicy") if err := awsAwsjson11_serializeDocumentReviewPolicy(v.AssignmentReviewPolicy, ok); err != nil { return err } } if v.AutoApprovalDelayInSeconds != nil { ok := object.Key("AutoApprovalDelayInSeconds") ok.Long(*v.AutoApprovalDelayInSeconds) } if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) } if v.HITLayoutId != nil { ok := object.Key("HITLayoutId") ok.String(*v.HITLayoutId) } if v.HITLayoutParameters != nil { ok := object.Key("HITLayoutParameters") if err := awsAwsjson11_serializeDocumentHITLayoutParameterList(v.HITLayoutParameters, ok); err != nil { return err } } if v.HITReviewPolicy != nil { ok := object.Key("HITReviewPolicy") if err := awsAwsjson11_serializeDocumentReviewPolicy(v.HITReviewPolicy, ok); err != nil { return err } } if v.Keywords != nil { ok := object.Key("Keywords") ok.String(*v.Keywords) } if v.LifetimeInSeconds != nil { ok := object.Key("LifetimeInSeconds") ok.Long(*v.LifetimeInSeconds) } if v.MaxAssignments != nil { ok := object.Key("MaxAssignments") ok.Integer(*v.MaxAssignments) } if v.QualificationRequirements != nil { ok := object.Key("QualificationRequirements") if err := awsAwsjson11_serializeDocumentQualificationRequirementList(v.QualificationRequirements, ok); err != nil { return err } } if v.Question != nil { ok := object.Key("Question") ok.String(*v.Question) } if v.RequesterAnnotation != nil { ok := object.Key("RequesterAnnotation") ok.String(*v.RequesterAnnotation) } if v.Reward != nil { ok := object.Key("Reward") ok.String(*v.Reward) } if v.Title != nil { ok := object.Key("Title") ok.String(*v.Title) } if v.UniqueRequestToken != nil { ok := object.Key("UniqueRequestToken") ok.String(*v.UniqueRequestToken) } return nil } func awsAwsjson11_serializeOpDocumentCreateHITTypeInput(v *CreateHITTypeInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AssignmentDurationInSeconds != nil { ok := object.Key("AssignmentDurationInSeconds") ok.Long(*v.AssignmentDurationInSeconds) } if v.AutoApprovalDelayInSeconds != nil { ok := object.Key("AutoApprovalDelayInSeconds") ok.Long(*v.AutoApprovalDelayInSeconds) } if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) } if v.Keywords != nil { ok := object.Key("Keywords") ok.String(*v.Keywords) } if v.QualificationRequirements != nil { ok := object.Key("QualificationRequirements") if err := awsAwsjson11_serializeDocumentQualificationRequirementList(v.QualificationRequirements, ok); err != nil { return err } } if v.Reward != nil { ok := object.Key("Reward") ok.String(*v.Reward) } if v.Title != nil { ok := object.Key("Title") ok.String(*v.Title) } return nil } func awsAwsjson11_serializeOpDocumentCreateHITWithHITTypeInput(v *CreateHITWithHITTypeInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AssignmentReviewPolicy != nil { ok := object.Key("AssignmentReviewPolicy") if err := awsAwsjson11_serializeDocumentReviewPolicy(v.AssignmentReviewPolicy, ok); err != nil { return err } } if v.HITLayoutId != nil { ok := object.Key("HITLayoutId") ok.String(*v.HITLayoutId) } if v.HITLayoutParameters != nil { ok := object.Key("HITLayoutParameters") if err := awsAwsjson11_serializeDocumentHITLayoutParameterList(v.HITLayoutParameters, ok); err != nil { return err } } if v.HITReviewPolicy != nil { ok := object.Key("HITReviewPolicy") if err := awsAwsjson11_serializeDocumentReviewPolicy(v.HITReviewPolicy, ok); err != nil { return err } } if v.HITTypeId != nil { ok := object.Key("HITTypeId") ok.String(*v.HITTypeId) } if v.LifetimeInSeconds != nil { ok := object.Key("LifetimeInSeconds") ok.Long(*v.LifetimeInSeconds) } if v.MaxAssignments != nil { ok := object.Key("MaxAssignments") ok.Integer(*v.MaxAssignments) } if v.Question != nil { ok := object.Key("Question") ok.String(*v.Question) } if v.RequesterAnnotation != nil { ok := object.Key("RequesterAnnotation") ok.String(*v.RequesterAnnotation) } if v.UniqueRequestToken != nil { ok := object.Key("UniqueRequestToken") ok.String(*v.UniqueRequestToken) } return nil } func awsAwsjson11_serializeOpDocumentCreateQualificationTypeInput(v *CreateQualificationTypeInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AnswerKey != nil { ok := object.Key("AnswerKey") ok.String(*v.AnswerKey) } if v.AutoGranted != nil { ok := object.Key("AutoGranted") ok.Boolean(*v.AutoGranted) } if v.AutoGrantedValue != nil { ok := object.Key("AutoGrantedValue") ok.Integer(*v.AutoGrantedValue) } if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) } if v.Keywords != nil { ok := object.Key("Keywords") ok.String(*v.Keywords) } if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if len(v.QualificationTypeStatus) > 0 { ok := object.Key("QualificationTypeStatus") ok.String(string(v.QualificationTypeStatus)) } if v.RetryDelayInSeconds != nil { ok := object.Key("RetryDelayInSeconds") ok.Long(*v.RetryDelayInSeconds) } if v.Test != nil { ok := object.Key("Test") ok.String(*v.Test) } if v.TestDurationInSeconds != nil { ok := object.Key("TestDurationInSeconds") ok.Long(*v.TestDurationInSeconds) } return nil } func awsAwsjson11_serializeOpDocumentCreateWorkerBlockInput(v *CreateWorkerBlockInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Reason != nil { ok := object.Key("Reason") ok.String(*v.Reason) } if v.WorkerId != nil { ok := object.Key("WorkerId") ok.String(*v.WorkerId) } return nil } func awsAwsjson11_serializeOpDocumentDeleteHITInput(v *DeleteHITInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.HITId != nil { ok := object.Key("HITId") ok.String(*v.HITId) } return nil } func awsAwsjson11_serializeOpDocumentDeleteQualificationTypeInput(v *DeleteQualificationTypeInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.QualificationTypeId != nil { ok := object.Key("QualificationTypeId") ok.String(*v.QualificationTypeId) } return nil } func awsAwsjson11_serializeOpDocumentDeleteWorkerBlockInput(v *DeleteWorkerBlockInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Reason != nil { ok := object.Key("Reason") ok.String(*v.Reason) } if v.WorkerId != nil { ok := object.Key("WorkerId") ok.String(*v.WorkerId) } return nil } func awsAwsjson11_serializeOpDocumentDisassociateQualificationFromWorkerInput(v *DisassociateQualificationFromWorkerInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.QualificationTypeId != nil { ok := object.Key("QualificationTypeId") ok.String(*v.QualificationTypeId) } if v.Reason != nil { ok := object.Key("Reason") ok.String(*v.Reason) } if v.WorkerId != nil { ok := object.Key("WorkerId") ok.String(*v.WorkerId) } return nil } func awsAwsjson11_serializeOpDocumentGetAccountBalanceInput(v *GetAccountBalanceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() return nil } func awsAwsjson11_serializeOpDocumentGetAssignmentInput(v *GetAssignmentInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AssignmentId != nil { ok := object.Key("AssignmentId") ok.String(*v.AssignmentId) } return nil } func awsAwsjson11_serializeOpDocumentGetFileUploadURLInput(v *GetFileUploadURLInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AssignmentId != nil { ok := object.Key("AssignmentId") ok.String(*v.AssignmentId) } if v.QuestionIdentifier != nil { ok := object.Key("QuestionIdentifier") ok.String(*v.QuestionIdentifier) } return nil } func awsAwsjson11_serializeOpDocumentGetHITInput(v *GetHITInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.HITId != nil { ok := object.Key("HITId") ok.String(*v.HITId) } return nil } func awsAwsjson11_serializeOpDocumentGetQualificationScoreInput(v *GetQualificationScoreInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.QualificationTypeId != nil { ok := object.Key("QualificationTypeId") ok.String(*v.QualificationTypeId) } if v.WorkerId != nil { ok := object.Key("WorkerId") ok.String(*v.WorkerId) } return nil } func awsAwsjson11_serializeOpDocumentGetQualificationTypeInput(v *GetQualificationTypeInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.QualificationTypeId != nil { ok := object.Key("QualificationTypeId") ok.String(*v.QualificationTypeId) } return nil } func awsAwsjson11_serializeOpDocumentListAssignmentsForHITInput(v *ListAssignmentsForHITInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AssignmentStatuses != nil { ok := object.Key("AssignmentStatuses") if err := awsAwsjson11_serializeDocumentAssignmentStatusList(v.AssignmentStatuses, ok); err != nil { return err } } if v.HITId != nil { ok := object.Key("HITId") ok.String(*v.HITId) } 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 } func awsAwsjson11_serializeOpDocumentListBonusPaymentsInput(v *ListBonusPaymentsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AssignmentId != nil { ok := object.Key("AssignmentId") ok.String(*v.AssignmentId) } if v.HITId != nil { ok := object.Key("HITId") ok.String(*v.HITId) } 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 } func awsAwsjson11_serializeOpDocumentListHITsForQualificationTypeInput(v *ListHITsForQualificationTypeInput, 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) } if v.QualificationTypeId != nil { ok := object.Key("QualificationTypeId") ok.String(*v.QualificationTypeId) } return nil } func awsAwsjson11_serializeOpDocumentListHITsInput(v *ListHITsInput, 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 } func awsAwsjson11_serializeOpDocumentListQualificationRequestsInput(v *ListQualificationRequestsInput, 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) } if v.QualificationTypeId != nil { ok := object.Key("QualificationTypeId") ok.String(*v.QualificationTypeId) } return nil } func awsAwsjson11_serializeOpDocumentListQualificationTypesInput(v *ListQualificationTypesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != nil { ok := object.Key("MaxResults") ok.Integer(*v.MaxResults) } if v.MustBeOwnedByCaller != nil { ok := object.Key("MustBeOwnedByCaller") ok.Boolean(*v.MustBeOwnedByCaller) } if v.MustBeRequestable != nil { ok := object.Key("MustBeRequestable") ok.Boolean(*v.MustBeRequestable) } if v.NextToken != nil { ok := object.Key("NextToken") ok.String(*v.NextToken) } if v.Query != nil { ok := object.Key("Query") ok.String(*v.Query) } return nil } func awsAwsjson11_serializeOpDocumentListReviewableHITsInput(v *ListReviewableHITsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.HITTypeId != nil { ok := object.Key("HITTypeId") ok.String(*v.HITTypeId) } if v.MaxResults != nil { ok := object.Key("MaxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("NextToken") ok.String(*v.NextToken) } if len(v.Status) > 0 { ok := object.Key("Status") ok.String(string(v.Status)) } return nil } func awsAwsjson11_serializeOpDocumentListReviewPolicyResultsForHITInput(v *ListReviewPolicyResultsForHITInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.HITId != nil { ok := object.Key("HITId") ok.String(*v.HITId) } if v.MaxResults != nil { ok := object.Key("MaxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("NextToken") ok.String(*v.NextToken) } if v.PolicyLevels != nil { ok := object.Key("PolicyLevels") if err := awsAwsjson11_serializeDocumentReviewPolicyLevelList(v.PolicyLevels, ok); err != nil { return err } } if v.RetrieveActions != nil { ok := object.Key("RetrieveActions") ok.Boolean(*v.RetrieveActions) } if v.RetrieveResults != nil { ok := object.Key("RetrieveResults") ok.Boolean(*v.RetrieveResults) } return nil } func awsAwsjson11_serializeOpDocumentListWorkerBlocksInput(v *ListWorkerBlocksInput, 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 } func awsAwsjson11_serializeOpDocumentListWorkersWithQualificationTypeInput(v *ListWorkersWithQualificationTypeInput, 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) } if v.QualificationTypeId != nil { ok := object.Key("QualificationTypeId") ok.String(*v.QualificationTypeId) } if len(v.Status) > 0 { ok := object.Key("Status") ok.String(string(v.Status)) } return nil } func awsAwsjson11_serializeOpDocumentNotifyWorkersInput(v *NotifyWorkersInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MessageText != nil { ok := object.Key("MessageText") ok.String(*v.MessageText) } if v.Subject != nil { ok := object.Key("Subject") ok.String(*v.Subject) } if v.WorkerIds != nil { ok := object.Key("WorkerIds") if err := awsAwsjson11_serializeDocumentCustomerIdList(v.WorkerIds, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentRejectAssignmentInput(v *RejectAssignmentInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AssignmentId != nil { ok := object.Key("AssignmentId") ok.String(*v.AssignmentId) } if v.RequesterFeedback != nil { ok := object.Key("RequesterFeedback") ok.String(*v.RequesterFeedback) } return nil } func awsAwsjson11_serializeOpDocumentRejectQualificationRequestInput(v *RejectQualificationRequestInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.QualificationRequestId != nil { ok := object.Key("QualificationRequestId") ok.String(*v.QualificationRequestId) } if v.Reason != nil { ok := object.Key("Reason") ok.String(*v.Reason) } return nil } func awsAwsjson11_serializeOpDocumentSendBonusInput(v *SendBonusInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AssignmentId != nil { ok := object.Key("AssignmentId") ok.String(*v.AssignmentId) } if v.BonusAmount != nil { ok := object.Key("BonusAmount") ok.String(*v.BonusAmount) } if v.Reason != nil { ok := object.Key("Reason") ok.String(*v.Reason) } if v.UniqueRequestToken != nil { ok := object.Key("UniqueRequestToken") ok.String(*v.UniqueRequestToken) } if v.WorkerId != nil { ok := object.Key("WorkerId") ok.String(*v.WorkerId) } return nil } func awsAwsjson11_serializeOpDocumentSendTestEventNotificationInput(v *SendTestEventNotificationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Notification != nil { ok := object.Key("Notification") if err := awsAwsjson11_serializeDocumentNotificationSpecification(v.Notification, ok); err != nil { return err } } if len(v.TestEventType) > 0 { ok := object.Key("TestEventType") ok.String(string(v.TestEventType)) } return nil } func awsAwsjson11_serializeOpDocumentUpdateExpirationForHITInput(v *UpdateExpirationForHITInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ExpireAt != nil { ok := object.Key("ExpireAt") ok.Double(smithytime.FormatEpochSeconds(*v.ExpireAt)) } if v.HITId != nil { ok := object.Key("HITId") ok.String(*v.HITId) } return nil } func awsAwsjson11_serializeOpDocumentUpdateHITReviewStatusInput(v *UpdateHITReviewStatusInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.HITId != nil { ok := object.Key("HITId") ok.String(*v.HITId) } if v.Revert != nil { ok := object.Key("Revert") ok.Boolean(*v.Revert) } return nil } func awsAwsjson11_serializeOpDocumentUpdateHITTypeOfHITInput(v *UpdateHITTypeOfHITInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.HITId != nil { ok := object.Key("HITId") ok.String(*v.HITId) } if v.HITTypeId != nil { ok := object.Key("HITTypeId") ok.String(*v.HITTypeId) } return nil } func awsAwsjson11_serializeOpDocumentUpdateNotificationSettingsInput(v *UpdateNotificationSettingsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Active != nil { ok := object.Key("Active") ok.Boolean(*v.Active) } if v.HITTypeId != nil { ok := object.Key("HITTypeId") ok.String(*v.HITTypeId) } if v.Notification != nil { ok := object.Key("Notification") if err := awsAwsjson11_serializeDocumentNotificationSpecification(v.Notification, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentUpdateQualificationTypeInput(v *UpdateQualificationTypeInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AnswerKey != nil { ok := object.Key("AnswerKey") ok.String(*v.AnswerKey) } if v.AutoGranted != nil { ok := object.Key("AutoGranted") ok.Boolean(*v.AutoGranted) } if v.AutoGrantedValue != nil { ok := object.Key("AutoGrantedValue") ok.Integer(*v.AutoGrantedValue) } if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) } if v.QualificationTypeId != nil { ok := object.Key("QualificationTypeId") ok.String(*v.QualificationTypeId) } if len(v.QualificationTypeStatus) > 0 { ok := object.Key("QualificationTypeStatus") ok.String(string(v.QualificationTypeStatus)) } if v.RetryDelayInSeconds != nil { ok := object.Key("RetryDelayInSeconds") ok.Long(*v.RetryDelayInSeconds) } if v.Test != nil { ok := object.Key("Test") ok.String(*v.Test) } if v.TestDurationInSeconds != nil { ok := object.Key("TestDurationInSeconds") ok.Long(*v.TestDurationInSeconds) } return nil }
3,460
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mturk import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/mturk/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpAcceptQualificationRequest struct { } func (*validateOpAcceptQualificationRequest) ID() string { return "OperationInputValidation" } func (m *validateOpAcceptQualificationRequest) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*AcceptQualificationRequestInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpAcceptQualificationRequestInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpApproveAssignment struct { } func (*validateOpApproveAssignment) ID() string { return "OperationInputValidation" } func (m *validateOpApproveAssignment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ApproveAssignmentInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpApproveAssignmentInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpAssociateQualificationWithWorker struct { } func (*validateOpAssociateQualificationWithWorker) ID() string { return "OperationInputValidation" } func (m *validateOpAssociateQualificationWithWorker) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*AssociateQualificationWithWorkerInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpAssociateQualificationWithWorkerInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateAdditionalAssignmentsForHIT struct { } func (*validateOpCreateAdditionalAssignmentsForHIT) ID() string { return "OperationInputValidation" } func (m *validateOpCreateAdditionalAssignmentsForHIT) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateAdditionalAssignmentsForHITInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateAdditionalAssignmentsForHITInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateHIT struct { } func (*validateOpCreateHIT) ID() string { return "OperationInputValidation" } func (m *validateOpCreateHIT) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateHITInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateHITInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateHITType struct { } func (*validateOpCreateHITType) ID() string { return "OperationInputValidation" } func (m *validateOpCreateHITType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateHITTypeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateHITTypeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateHITWithHITType struct { } func (*validateOpCreateHITWithHITType) ID() string { return "OperationInputValidation" } func (m *validateOpCreateHITWithHITType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateHITWithHITTypeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateHITWithHITTypeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateQualificationType struct { } func (*validateOpCreateQualificationType) ID() string { return "OperationInputValidation" } func (m *validateOpCreateQualificationType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateQualificationTypeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateQualificationTypeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateWorkerBlock struct { } func (*validateOpCreateWorkerBlock) ID() string { return "OperationInputValidation" } func (m *validateOpCreateWorkerBlock) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateWorkerBlockInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateWorkerBlockInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteHIT struct { } func (*validateOpDeleteHIT) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteHIT) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteHITInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteHITInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteQualificationType struct { } func (*validateOpDeleteQualificationType) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteQualificationType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteQualificationTypeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteQualificationTypeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteWorkerBlock struct { } func (*validateOpDeleteWorkerBlock) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteWorkerBlock) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteWorkerBlockInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteWorkerBlockInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDisassociateQualificationFromWorker struct { } func (*validateOpDisassociateQualificationFromWorker) ID() string { return "OperationInputValidation" } func (m *validateOpDisassociateQualificationFromWorker) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DisassociateQualificationFromWorkerInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDisassociateQualificationFromWorkerInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetAssignment struct { } func (*validateOpGetAssignment) ID() string { return "OperationInputValidation" } func (m *validateOpGetAssignment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetAssignmentInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetAssignmentInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetFileUploadURL struct { } func (*validateOpGetFileUploadURL) ID() string { return "OperationInputValidation" } func (m *validateOpGetFileUploadURL) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetFileUploadURLInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetFileUploadURLInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetHIT struct { } func (*validateOpGetHIT) ID() string { return "OperationInputValidation" } func (m *validateOpGetHIT) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetHITInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetHITInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetQualificationScore struct { } func (*validateOpGetQualificationScore) ID() string { return "OperationInputValidation" } func (m *validateOpGetQualificationScore) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetQualificationScoreInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetQualificationScoreInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetQualificationType struct { } func (*validateOpGetQualificationType) ID() string { return "OperationInputValidation" } func (m *validateOpGetQualificationType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetQualificationTypeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetQualificationTypeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListAssignmentsForHIT struct { } func (*validateOpListAssignmentsForHIT) ID() string { return "OperationInputValidation" } func (m *validateOpListAssignmentsForHIT) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListAssignmentsForHITInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListAssignmentsForHITInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListHITsForQualificationType struct { } func (*validateOpListHITsForQualificationType) ID() string { return "OperationInputValidation" } func (m *validateOpListHITsForQualificationType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListHITsForQualificationTypeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListHITsForQualificationTypeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListQualificationTypes struct { } func (*validateOpListQualificationTypes) ID() string { return "OperationInputValidation" } func (m *validateOpListQualificationTypes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListQualificationTypesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListQualificationTypesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListReviewPolicyResultsForHIT struct { } func (*validateOpListReviewPolicyResultsForHIT) ID() string { return "OperationInputValidation" } func (m *validateOpListReviewPolicyResultsForHIT) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListReviewPolicyResultsForHITInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListReviewPolicyResultsForHITInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListWorkersWithQualificationType struct { } func (*validateOpListWorkersWithQualificationType) ID() string { return "OperationInputValidation" } func (m *validateOpListWorkersWithQualificationType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListWorkersWithQualificationTypeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListWorkersWithQualificationTypeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpNotifyWorkers struct { } func (*validateOpNotifyWorkers) ID() string { return "OperationInputValidation" } func (m *validateOpNotifyWorkers) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*NotifyWorkersInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpNotifyWorkersInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRejectAssignment struct { } func (*validateOpRejectAssignment) ID() string { return "OperationInputValidation" } func (m *validateOpRejectAssignment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RejectAssignmentInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRejectAssignmentInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRejectQualificationRequest struct { } func (*validateOpRejectQualificationRequest) ID() string { return "OperationInputValidation" } func (m *validateOpRejectQualificationRequest) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RejectQualificationRequestInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRejectQualificationRequestInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpSendBonus struct { } func (*validateOpSendBonus) ID() string { return "OperationInputValidation" } func (m *validateOpSendBonus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*SendBonusInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpSendBonusInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpSendTestEventNotification struct { } func (*validateOpSendTestEventNotification) ID() string { return "OperationInputValidation" } func (m *validateOpSendTestEventNotification) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*SendTestEventNotificationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpSendTestEventNotificationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateExpirationForHIT struct { } func (*validateOpUpdateExpirationForHIT) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateExpirationForHIT) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateExpirationForHITInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateExpirationForHITInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateHITReviewStatus struct { } func (*validateOpUpdateHITReviewStatus) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateHITReviewStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateHITReviewStatusInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateHITReviewStatusInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateHITTypeOfHIT struct { } func (*validateOpUpdateHITTypeOfHIT) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateHITTypeOfHIT) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateHITTypeOfHITInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateHITTypeOfHITInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateNotificationSettings struct { } func (*validateOpUpdateNotificationSettings) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateNotificationSettings) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateNotificationSettingsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateNotificationSettingsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateQualificationType struct { } func (*validateOpUpdateQualificationType) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateQualificationType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateQualificationTypeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateQualificationTypeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpAcceptQualificationRequestValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAcceptQualificationRequest{}, middleware.After) } func addOpApproveAssignmentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpApproveAssignment{}, middleware.After) } func addOpAssociateQualificationWithWorkerValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAssociateQualificationWithWorker{}, middleware.After) } func addOpCreateAdditionalAssignmentsForHITValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateAdditionalAssignmentsForHIT{}, middleware.After) } func addOpCreateHITValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateHIT{}, middleware.After) } func addOpCreateHITTypeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateHITType{}, middleware.After) } func addOpCreateHITWithHITTypeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateHITWithHITType{}, middleware.After) } func addOpCreateQualificationTypeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateQualificationType{}, middleware.After) } func addOpCreateWorkerBlockValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateWorkerBlock{}, middleware.After) } func addOpDeleteHITValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteHIT{}, middleware.After) } func addOpDeleteQualificationTypeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteQualificationType{}, middleware.After) } func addOpDeleteWorkerBlockValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteWorkerBlock{}, middleware.After) } func addOpDisassociateQualificationFromWorkerValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisassociateQualificationFromWorker{}, middleware.After) } func addOpGetAssignmentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetAssignment{}, middleware.After) } func addOpGetFileUploadURLValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetFileUploadURL{}, middleware.After) } func addOpGetHITValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetHIT{}, middleware.After) } func addOpGetQualificationScoreValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetQualificationScore{}, middleware.After) } func addOpGetQualificationTypeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetQualificationType{}, middleware.After) } func addOpListAssignmentsForHITValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListAssignmentsForHIT{}, middleware.After) } func addOpListHITsForQualificationTypeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListHITsForQualificationType{}, middleware.After) } func addOpListQualificationTypesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListQualificationTypes{}, middleware.After) } func addOpListReviewPolicyResultsForHITValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListReviewPolicyResultsForHIT{}, middleware.After) } func addOpListWorkersWithQualificationTypeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListWorkersWithQualificationType{}, middleware.After) } func addOpNotifyWorkersValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpNotifyWorkers{}, middleware.After) } func addOpRejectAssignmentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRejectAssignment{}, middleware.After) } func addOpRejectQualificationRequestValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRejectQualificationRequest{}, middleware.After) } func addOpSendBonusValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpSendBonus{}, middleware.After) } func addOpSendTestEventNotificationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpSendTestEventNotification{}, middleware.After) } func addOpUpdateExpirationForHITValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateExpirationForHIT{}, middleware.After) } func addOpUpdateHITReviewStatusValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateHITReviewStatus{}, middleware.After) } func addOpUpdateHITTypeOfHITValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateHITTypeOfHIT{}, middleware.After) } func addOpUpdateNotificationSettingsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateNotificationSettings{}, middleware.After) } func addOpUpdateQualificationTypeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateQualificationType{}, middleware.After) } func validateHITLayoutParameter(v *types.HITLayoutParameter) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "HITLayoutParameter"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.Value == nil { invalidParams.Add(smithy.NewErrParamRequired("Value")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateHITLayoutParameterList(v []types.HITLayoutParameter) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "HITLayoutParameterList"} for i := range v { if err := validateHITLayoutParameter(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateLocale(v *types.Locale) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Locale"} if v.Country == nil { invalidParams.Add(smithy.NewErrParamRequired("Country")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateLocaleList(v []types.Locale) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "LocaleList"} for i := range v { if err := validateLocale(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateNotificationSpecification(v *types.NotificationSpecification) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "NotificationSpecification"} if v.Destination == nil { invalidParams.Add(smithy.NewErrParamRequired("Destination")) } if len(v.Transport) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Transport")) } if v.Version == nil { invalidParams.Add(smithy.NewErrParamRequired("Version")) } if v.EventTypes == nil { invalidParams.Add(smithy.NewErrParamRequired("EventTypes")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateQualificationRequirement(v *types.QualificationRequirement) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "QualificationRequirement"} if v.QualificationTypeId == nil { invalidParams.Add(smithy.NewErrParamRequired("QualificationTypeId")) } if len(v.Comparator) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Comparator")) } if v.LocaleValues != nil { if err := validateLocaleList(v.LocaleValues); err != nil { invalidParams.AddNested("LocaleValues", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateQualificationRequirementList(v []types.QualificationRequirement) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "QualificationRequirementList"} for i := range v { if err := validateQualificationRequirement(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateReviewPolicy(v *types.ReviewPolicy) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ReviewPolicy"} if v.PolicyName == nil { invalidParams.Add(smithy.NewErrParamRequired("PolicyName")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpAcceptQualificationRequestInput(v *AcceptQualificationRequestInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AcceptQualificationRequestInput"} if v.QualificationRequestId == nil { invalidParams.Add(smithy.NewErrParamRequired("QualificationRequestId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpApproveAssignmentInput(v *ApproveAssignmentInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ApproveAssignmentInput"} if v.AssignmentId == nil { invalidParams.Add(smithy.NewErrParamRequired("AssignmentId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpAssociateQualificationWithWorkerInput(v *AssociateQualificationWithWorkerInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AssociateQualificationWithWorkerInput"} if v.QualificationTypeId == nil { invalidParams.Add(smithy.NewErrParamRequired("QualificationTypeId")) } if v.WorkerId == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkerId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateAdditionalAssignmentsForHITInput(v *CreateAdditionalAssignmentsForHITInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateAdditionalAssignmentsForHITInput"} if v.HITId == nil { invalidParams.Add(smithy.NewErrParamRequired("HITId")) } if v.NumberOfAdditionalAssignments == nil { invalidParams.Add(smithy.NewErrParamRequired("NumberOfAdditionalAssignments")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateHITInput(v *CreateHITInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateHITInput"} if v.LifetimeInSeconds == nil { invalidParams.Add(smithy.NewErrParamRequired("LifetimeInSeconds")) } if v.AssignmentDurationInSeconds == nil { invalidParams.Add(smithy.NewErrParamRequired("AssignmentDurationInSeconds")) } if v.Reward == nil { invalidParams.Add(smithy.NewErrParamRequired("Reward")) } if v.Title == nil { invalidParams.Add(smithy.NewErrParamRequired("Title")) } if v.Description == nil { invalidParams.Add(smithy.NewErrParamRequired("Description")) } if v.QualificationRequirements != nil { if err := validateQualificationRequirementList(v.QualificationRequirements); err != nil { invalidParams.AddNested("QualificationRequirements", err.(smithy.InvalidParamsError)) } } if v.AssignmentReviewPolicy != nil { if err := validateReviewPolicy(v.AssignmentReviewPolicy); err != nil { invalidParams.AddNested("AssignmentReviewPolicy", err.(smithy.InvalidParamsError)) } } if v.HITReviewPolicy != nil { if err := validateReviewPolicy(v.HITReviewPolicy); err != nil { invalidParams.AddNested("HITReviewPolicy", err.(smithy.InvalidParamsError)) } } if v.HITLayoutParameters != nil { if err := validateHITLayoutParameterList(v.HITLayoutParameters); err != nil { invalidParams.AddNested("HITLayoutParameters", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateHITTypeInput(v *CreateHITTypeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateHITTypeInput"} if v.AssignmentDurationInSeconds == nil { invalidParams.Add(smithy.NewErrParamRequired("AssignmentDurationInSeconds")) } if v.Reward == nil { invalidParams.Add(smithy.NewErrParamRequired("Reward")) } if v.Title == nil { invalidParams.Add(smithy.NewErrParamRequired("Title")) } if v.Description == nil { invalidParams.Add(smithy.NewErrParamRequired("Description")) } if v.QualificationRequirements != nil { if err := validateQualificationRequirementList(v.QualificationRequirements); err != nil { invalidParams.AddNested("QualificationRequirements", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateHITWithHITTypeInput(v *CreateHITWithHITTypeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateHITWithHITTypeInput"} if v.HITTypeId == nil { invalidParams.Add(smithy.NewErrParamRequired("HITTypeId")) } if v.LifetimeInSeconds == nil { invalidParams.Add(smithy.NewErrParamRequired("LifetimeInSeconds")) } if v.AssignmentReviewPolicy != nil { if err := validateReviewPolicy(v.AssignmentReviewPolicy); err != nil { invalidParams.AddNested("AssignmentReviewPolicy", err.(smithy.InvalidParamsError)) } } if v.HITReviewPolicy != nil { if err := validateReviewPolicy(v.HITReviewPolicy); err != nil { invalidParams.AddNested("HITReviewPolicy", err.(smithy.InvalidParamsError)) } } if v.HITLayoutParameters != nil { if err := validateHITLayoutParameterList(v.HITLayoutParameters); err != nil { invalidParams.AddNested("HITLayoutParameters", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateQualificationTypeInput(v *CreateQualificationTypeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateQualificationTypeInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.Description == nil { invalidParams.Add(smithy.NewErrParamRequired("Description")) } if len(v.QualificationTypeStatus) == 0 { invalidParams.Add(smithy.NewErrParamRequired("QualificationTypeStatus")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateWorkerBlockInput(v *CreateWorkerBlockInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateWorkerBlockInput"} if v.WorkerId == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkerId")) } if v.Reason == nil { invalidParams.Add(smithy.NewErrParamRequired("Reason")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteHITInput(v *DeleteHITInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteHITInput"} if v.HITId == nil { invalidParams.Add(smithy.NewErrParamRequired("HITId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteQualificationTypeInput(v *DeleteQualificationTypeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteQualificationTypeInput"} if v.QualificationTypeId == nil { invalidParams.Add(smithy.NewErrParamRequired("QualificationTypeId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteWorkerBlockInput(v *DeleteWorkerBlockInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteWorkerBlockInput"} if v.WorkerId == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkerId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDisassociateQualificationFromWorkerInput(v *DisassociateQualificationFromWorkerInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DisassociateQualificationFromWorkerInput"} if v.WorkerId == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkerId")) } if v.QualificationTypeId == nil { invalidParams.Add(smithy.NewErrParamRequired("QualificationTypeId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetAssignmentInput(v *GetAssignmentInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetAssignmentInput"} if v.AssignmentId == nil { invalidParams.Add(smithy.NewErrParamRequired("AssignmentId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetFileUploadURLInput(v *GetFileUploadURLInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetFileUploadURLInput"} if v.AssignmentId == nil { invalidParams.Add(smithy.NewErrParamRequired("AssignmentId")) } if v.QuestionIdentifier == nil { invalidParams.Add(smithy.NewErrParamRequired("QuestionIdentifier")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetHITInput(v *GetHITInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetHITInput"} if v.HITId == nil { invalidParams.Add(smithy.NewErrParamRequired("HITId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetQualificationScoreInput(v *GetQualificationScoreInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetQualificationScoreInput"} if v.QualificationTypeId == nil { invalidParams.Add(smithy.NewErrParamRequired("QualificationTypeId")) } if v.WorkerId == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkerId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetQualificationTypeInput(v *GetQualificationTypeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetQualificationTypeInput"} if v.QualificationTypeId == nil { invalidParams.Add(smithy.NewErrParamRequired("QualificationTypeId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListAssignmentsForHITInput(v *ListAssignmentsForHITInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListAssignmentsForHITInput"} if v.HITId == nil { invalidParams.Add(smithy.NewErrParamRequired("HITId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListHITsForQualificationTypeInput(v *ListHITsForQualificationTypeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListHITsForQualificationTypeInput"} if v.QualificationTypeId == nil { invalidParams.Add(smithy.NewErrParamRequired("QualificationTypeId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListQualificationTypesInput(v *ListQualificationTypesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListQualificationTypesInput"} if v.MustBeRequestable == nil { invalidParams.Add(smithy.NewErrParamRequired("MustBeRequestable")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListReviewPolicyResultsForHITInput(v *ListReviewPolicyResultsForHITInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListReviewPolicyResultsForHITInput"} if v.HITId == nil { invalidParams.Add(smithy.NewErrParamRequired("HITId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListWorkersWithQualificationTypeInput(v *ListWorkersWithQualificationTypeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListWorkersWithQualificationTypeInput"} if v.QualificationTypeId == nil { invalidParams.Add(smithy.NewErrParamRequired("QualificationTypeId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpNotifyWorkersInput(v *NotifyWorkersInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "NotifyWorkersInput"} if v.Subject == nil { invalidParams.Add(smithy.NewErrParamRequired("Subject")) } if v.MessageText == nil { invalidParams.Add(smithy.NewErrParamRequired("MessageText")) } if v.WorkerIds == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkerIds")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRejectAssignmentInput(v *RejectAssignmentInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RejectAssignmentInput"} if v.AssignmentId == nil { invalidParams.Add(smithy.NewErrParamRequired("AssignmentId")) } if v.RequesterFeedback == nil { invalidParams.Add(smithy.NewErrParamRequired("RequesterFeedback")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRejectQualificationRequestInput(v *RejectQualificationRequestInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RejectQualificationRequestInput"} if v.QualificationRequestId == nil { invalidParams.Add(smithy.NewErrParamRequired("QualificationRequestId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpSendBonusInput(v *SendBonusInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SendBonusInput"} if v.WorkerId == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkerId")) } if v.BonusAmount == nil { invalidParams.Add(smithy.NewErrParamRequired("BonusAmount")) } if v.AssignmentId == nil { invalidParams.Add(smithy.NewErrParamRequired("AssignmentId")) } if v.Reason == nil { invalidParams.Add(smithy.NewErrParamRequired("Reason")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpSendTestEventNotificationInput(v *SendTestEventNotificationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "SendTestEventNotificationInput"} if v.Notification == nil { invalidParams.Add(smithy.NewErrParamRequired("Notification")) } else if v.Notification != nil { if err := validateNotificationSpecification(v.Notification); err != nil { invalidParams.AddNested("Notification", err.(smithy.InvalidParamsError)) } } if len(v.TestEventType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("TestEventType")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateExpirationForHITInput(v *UpdateExpirationForHITInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateExpirationForHITInput"} if v.HITId == nil { invalidParams.Add(smithy.NewErrParamRequired("HITId")) } if v.ExpireAt == nil { invalidParams.Add(smithy.NewErrParamRequired("ExpireAt")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateHITReviewStatusInput(v *UpdateHITReviewStatusInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateHITReviewStatusInput"} if v.HITId == nil { invalidParams.Add(smithy.NewErrParamRequired("HITId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateHITTypeOfHITInput(v *UpdateHITTypeOfHITInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateHITTypeOfHITInput"} if v.HITId == nil { invalidParams.Add(smithy.NewErrParamRequired("HITId")) } if v.HITTypeId == nil { invalidParams.Add(smithy.NewErrParamRequired("HITTypeId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateNotificationSettingsInput(v *UpdateNotificationSettingsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateNotificationSettingsInput"} if v.HITTypeId == nil { invalidParams.Add(smithy.NewErrParamRequired("HITTypeId")) } if v.Notification != nil { if err := validateNotificationSpecification(v.Notification); err != nil { invalidParams.AddNested("Notification", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateQualificationTypeInput(v *UpdateQualificationTypeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateQualificationTypeInput"} if v.QualificationTypeId == nil { invalidParams.Add(smithy.NewErrParamRequired("QualificationTypeId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
1,569
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package endpoints import ( "github.com/aws/aws-sdk-go-v2/aws" endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" "github.com/aws/smithy-go/logging" "regexp" ) // Options is the endpoint resolver configuration options type Options struct { // Logger is a logging implementation that log events should be sent to. Logger logging.Logger // LogDeprecated indicates that deprecated endpoints should be logged to the // provided logger. LogDeprecated bool // ResolvedRegion is used to override the region to be resolved, rather then the // using the value passed to the ResolveEndpoint method. This value is used by the // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative // name. You must not set this value directly in your application. ResolvedRegion string // DisableHTTPS informs the resolver to return an endpoint that does not use the // HTTPS scheme. DisableHTTPS bool // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. UseDualStackEndpoint aws.DualStackEndpointState // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. UseFIPSEndpoint aws.FIPSEndpointState } func (o Options) GetResolvedRegion() string { return o.ResolvedRegion } func (o Options) GetDisableHTTPS() bool { return o.DisableHTTPS } func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { return o.UseDualStackEndpoint } func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { return o.UseFIPSEndpoint } func transformToSharedOptions(options Options) endpoints.Options { return endpoints.Options{ Logger: options.Logger, LogDeprecated: options.LogDeprecated, ResolvedRegion: options.ResolvedRegion, DisableHTTPS: options.DisableHTTPS, UseDualStackEndpoint: options.UseDualStackEndpoint, UseFIPSEndpoint: options.UseFIPSEndpoint, } } // Resolver MTurk endpoint resolver type Resolver struct { partitions endpoints.Partitions } // ResolveEndpoint resolves the service endpoint for the given region and options func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { if len(region) == 0 { return endpoint, &aws.MissingRegionError{} } opt := transformToSharedOptions(options) return r.partitions.ResolveEndpoint(region, opt) } // New returns a new Resolver func New() *Resolver { return &Resolver{ partitions: defaultPartitions, } } var partitionRegexp = struct { Aws *regexp.Regexp AwsCn *regexp.Regexp AwsIso *regexp.Regexp AwsIsoB *regexp.Regexp AwsIsoE *regexp.Regexp AwsIsoF *regexp.Regexp AwsUsGov *regexp.Regexp }{ Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), } var defaultPartitions = endpoints.Partitions{ { ID: "aws", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "mturk-requester.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "mturk-requester-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "mturk-requester-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mturk-requester.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "sandbox", }: endpoints.Endpoint{ Hostname: "mturk-requester-sandbox.us-east-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "mturk-requester.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "mturk-requester-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "mturk-requester-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mturk-requester.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsCn, IsRegionalized: true, }, { ID: "aws-iso", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "mturk-requester-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mturk-requester.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIso, IsRegionalized: true, }, { ID: "aws-iso-b", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "mturk-requester-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mturk-requester.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIsoB, IsRegionalized: true, }, { ID: "aws-iso-e", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "mturk-requester-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mturk-requester.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIsoE, IsRegionalized: true, }, { ID: "aws-iso-f", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "mturk-requester-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mturk-requester.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIsoF, IsRegionalized: true, }, { ID: "aws-us-gov", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "mturk-requester.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "mturk-requester-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "mturk-requester-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "mturk-requester.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, }, }
307
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package endpoints import ( "testing" ) func TestRegexCompile(t *testing.T) { _ = defaultPartitions }
12
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types type AssignmentStatus string // Enum values for AssignmentStatus const ( AssignmentStatusSubmitted AssignmentStatus = "Submitted" AssignmentStatusApproved AssignmentStatus = "Approved" AssignmentStatusRejected AssignmentStatus = "Rejected" ) // Values returns all known values for AssignmentStatus. 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 (AssignmentStatus) Values() []AssignmentStatus { return []AssignmentStatus{ "Submitted", "Approved", "Rejected", } } type Comparator string // Enum values for Comparator const ( ComparatorLessThan Comparator = "LessThan" ComparatorLessThanOrEqualTo Comparator = "LessThanOrEqualTo" ComparatorGreaterThan Comparator = "GreaterThan" ComparatorGreaterThanOrEqualTo Comparator = "GreaterThanOrEqualTo" ComparatorEqualTo Comparator = "EqualTo" ComparatorNotEqualTo Comparator = "NotEqualTo" ComparatorExists Comparator = "Exists" ComparatorDoesNotExist Comparator = "DoesNotExist" ComparatorIn Comparator = "In" ComparatorNotIn Comparator = "NotIn" ) // Values returns all known values for Comparator. 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 (Comparator) Values() []Comparator { return []Comparator{ "LessThan", "LessThanOrEqualTo", "GreaterThan", "GreaterThanOrEqualTo", "EqualTo", "NotEqualTo", "Exists", "DoesNotExist", "In", "NotIn", } } type EventType string // Enum values for EventType const ( EventTypeAssignmentAccepted EventType = "AssignmentAccepted" EventTypeAssignmentAbandoned EventType = "AssignmentAbandoned" EventTypeAssignmentReturned EventType = "AssignmentReturned" EventTypeAssignmentSubmitted EventType = "AssignmentSubmitted" EventTypeAssignmentRejected EventType = "AssignmentRejected" EventTypeAssignmentApproved EventType = "AssignmentApproved" EventTypeHITCreated EventType = "HITCreated" EventTypeHITExpired EventType = "HITExpired" EventTypeHITReviewable EventType = "HITReviewable" EventTypeHITExtended EventType = "HITExtended" EventTypeHITDisposed EventType = "HITDisposed" EventTypePing EventType = "Ping" ) // Values returns all known values for EventType. 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 (EventType) Values() []EventType { return []EventType{ "AssignmentAccepted", "AssignmentAbandoned", "AssignmentReturned", "AssignmentSubmitted", "AssignmentRejected", "AssignmentApproved", "HITCreated", "HITExpired", "HITReviewable", "HITExtended", "HITDisposed", "Ping", } } type HITAccessActions string // Enum values for HITAccessActions const ( HITAccessActionsAccept HITAccessActions = "Accept" HITAccessActionsPreviewAndAccept HITAccessActions = "PreviewAndAccept" HITAccessActionsDiscoverPreviewAndAccept HITAccessActions = "DiscoverPreviewAndAccept" ) // Values returns all known values for HITAccessActions. 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 (HITAccessActions) Values() []HITAccessActions { return []HITAccessActions{ "Accept", "PreviewAndAccept", "DiscoverPreviewAndAccept", } } type HITReviewStatus string // Enum values for HITReviewStatus const ( HITReviewStatusNotReviewed HITReviewStatus = "NotReviewed" HITReviewStatusMarkedForReview HITReviewStatus = "MarkedForReview" HITReviewStatusReviewedAppropriate HITReviewStatus = "ReviewedAppropriate" HITReviewStatusReviewedInappropriate HITReviewStatus = "ReviewedInappropriate" ) // Values returns all known values for HITReviewStatus. 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 (HITReviewStatus) Values() []HITReviewStatus { return []HITReviewStatus{ "NotReviewed", "MarkedForReview", "ReviewedAppropriate", "ReviewedInappropriate", } } type HITStatus string // Enum values for HITStatus const ( HITStatusAssignable HITStatus = "Assignable" HITStatusUnassignable HITStatus = "Unassignable" HITStatusReviewable HITStatus = "Reviewable" HITStatusReviewing HITStatus = "Reviewing" HITStatusDisposed HITStatus = "Disposed" ) // Values returns all known values for HITStatus. 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 (HITStatus) Values() []HITStatus { return []HITStatus{ "Assignable", "Unassignable", "Reviewable", "Reviewing", "Disposed", } } type NotificationTransport string // Enum values for NotificationTransport const ( NotificationTransportEmail NotificationTransport = "Email" NotificationTransportSqs NotificationTransport = "SQS" NotificationTransportSns NotificationTransport = "SNS" ) // Values returns all known values for NotificationTransport. 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 (NotificationTransport) Values() []NotificationTransport { return []NotificationTransport{ "Email", "SQS", "SNS", } } type NotifyWorkersFailureCode string // Enum values for NotifyWorkersFailureCode const ( NotifyWorkersFailureCodeSoftFailure NotifyWorkersFailureCode = "SoftFailure" NotifyWorkersFailureCodeHardFailure NotifyWorkersFailureCode = "HardFailure" ) // Values returns all known values for NotifyWorkersFailureCode. 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 (NotifyWorkersFailureCode) Values() []NotifyWorkersFailureCode { return []NotifyWorkersFailureCode{ "SoftFailure", "HardFailure", } } type QualificationStatus string // Enum values for QualificationStatus const ( QualificationStatusGranted QualificationStatus = "Granted" QualificationStatusRevoked QualificationStatus = "Revoked" ) // Values returns all known values for QualificationStatus. 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 (QualificationStatus) Values() []QualificationStatus { return []QualificationStatus{ "Granted", "Revoked", } } type QualificationTypeStatus string // Enum values for QualificationTypeStatus const ( QualificationTypeStatusActive QualificationTypeStatus = "Active" QualificationTypeStatusInactive QualificationTypeStatus = "Inactive" ) // Values returns all known values for QualificationTypeStatus. 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 (QualificationTypeStatus) Values() []QualificationTypeStatus { return []QualificationTypeStatus{ "Active", "Inactive", } } type ReviewableHITStatus string // Enum values for ReviewableHITStatus const ( ReviewableHITStatusReviewable ReviewableHITStatus = "Reviewable" ReviewableHITStatusReviewing ReviewableHITStatus = "Reviewing" ) // Values returns all known values for ReviewableHITStatus. 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 (ReviewableHITStatus) Values() []ReviewableHITStatus { return []ReviewableHITStatus{ "Reviewable", "Reviewing", } } type ReviewActionStatus string // Enum values for ReviewActionStatus const ( ReviewActionStatusIntended ReviewActionStatus = "Intended" ReviewActionStatusSucceeded ReviewActionStatus = "Succeeded" ReviewActionStatusFailed ReviewActionStatus = "Failed" ReviewActionStatusCancelled ReviewActionStatus = "Cancelled" ) // Values returns all known values for ReviewActionStatus. 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 (ReviewActionStatus) Values() []ReviewActionStatus { return []ReviewActionStatus{ "Intended", "Succeeded", "Failed", "Cancelled", } } type ReviewPolicyLevel string // Enum values for ReviewPolicyLevel const ( ReviewPolicyLevelAssignment ReviewPolicyLevel = "Assignment" ReviewPolicyLevelHit ReviewPolicyLevel = "HIT" ) // Values returns all known values for ReviewPolicyLevel. 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 (ReviewPolicyLevel) Values() []ReviewPolicyLevel { return []ReviewPolicyLevel{ "Assignment", "HIT", } }
294
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( "fmt" smithy "github.com/aws/smithy-go" ) // Your request is invalid. type RequestError struct { Message *string ErrorCodeOverride *string TurkErrorCode *string noSmithyDocumentSerde } func (e *RequestError) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *RequestError) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *RequestError) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "RequestError" } return *e.ErrorCodeOverride } func (e *RequestError) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Amazon Mechanical Turk is temporarily unable to process your request. Try your // call again. type ServiceFault struct { Message *string ErrorCodeOverride *string TurkErrorCode *string noSmithyDocumentSerde } func (e *ServiceFault) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ServiceFault) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ServiceFault) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ServiceFault" } return *e.ErrorCodeOverride } func (e *ServiceFault) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
66
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( smithydocument "github.com/aws/smithy-go/document" "time" ) // The Assignment data structure represents a single assignment of a HIT to a // Worker. The assignment tracks the Worker's efforts to complete the HIT, and // contains the results for later retrieval. type Assignment struct { // The date and time the Worker accepted the assignment. AcceptTime *time.Time // The Worker's answers submitted for the HIT contained in a QuestionFormAnswers // document, if the Worker provides an answer. If the Worker does not provide any // answers, Answer may contain a QuestionFormAnswers document, or Answer may be // empty. Answer *string // If the Worker has submitted results and the Requester has approved the results, // ApprovalTime is the date and time the Requester approved the results. This value // is omitted from the assignment if the Requester has not yet approved the // results. ApprovalTime *time.Time // A unique identifier for the assignment. AssignmentId *string // The status of the assignment. AssignmentStatus AssignmentStatus // If results have been submitted, AutoApprovalTime is the date and time the // results of the assignment results are considered Approved automatically if they // have not already been explicitly approved or rejected by the Requester. This // value is derived from the auto-approval delay specified by the Requester in the // HIT. This value is omitted from the assignment if the Worker has not yet // submitted results. AutoApprovalTime *time.Time // The date and time of the deadline for the assignment. This value is derived // from the deadline specification for the HIT and the date and time the Worker // accepted the HIT. Deadline *time.Time // The ID of the HIT. HITId *string // If the Worker has submitted results and the Requester has rejected the results, // RejectionTime is the date and time the Requester rejected the results. RejectionTime *time.Time // The feedback string included with the call to the ApproveAssignment operation // or the RejectAssignment operation, if the Requester approved or rejected the // assignment and specified feedback. RequesterFeedback *string // If the Worker has submitted results, SubmitTime is the date and time the // assignment was submitted. This value is omitted from the assignment if the // Worker has not yet submitted results. SubmitTime *time.Time // The ID of the Worker who accepted the HIT. WorkerId *string noSmithyDocumentSerde } // An object representing a Bonus payment paid to a Worker. type BonusPayment struct { // The ID of the assignment associated with this bonus payment. AssignmentId *string // A string representing a currency amount. BonusAmount *string // The date and time of when the bonus was granted. GrantTime *time.Time // The Reason text given when the bonus was granted, if any. Reason *string // The ID of the Worker to whom the bonus was paid. WorkerId *string noSmithyDocumentSerde } // The HIT data structure represents a single HIT, including all the information // necessary for a Worker to accept and complete the HIT. type HIT struct { // The length of time, in seconds, that a Worker has to complete the HIT after // accepting it. AssignmentDurationInSeconds *int64 // The amount of time, in seconds, after the Worker submits an assignment for the // HIT that the results are automatically approved by Amazon Mechanical Turk. This // is the amount of time the Requester has to reject an assignment submitted by a // Worker before the assignment is auto-approved and the Worker is paid. AutoApprovalDelayInSeconds *int64 // The date and time the HIT was created. CreationTime *time.Time // A general description of the HIT. Description *string // The date and time the HIT expires. Expiration *time.Time // The ID of the HIT Group of this HIT. HITGroupId *string // A unique identifier for the HIT. HITId *string // The ID of the HIT Layout of this HIT. HITLayoutId *string // Indicates the review status of the HIT. Valid Values are NotReviewed | // MarkedForReview | ReviewedAppropriate | ReviewedInappropriate. HITReviewStatus HITReviewStatus // The status of the HIT and its assignments. Valid Values are Assignable | // Unassignable | Reviewable | Reviewing | Disposed. HITStatus HITStatus // The ID of the HIT type of this HIT HITTypeId *string // One or more words or phrases that describe the HIT, separated by commas. Search // terms similar to the keywords of a HIT are more likely to have the HIT in the // search results. Keywords *string // The number of times the HIT can be accepted and completed before the HIT // becomes unavailable. MaxAssignments *int32 // The number of assignments for this HIT that are available for Workers to accept. NumberOfAssignmentsAvailable *int32 // The number of assignments for this HIT that have been approved or rejected. NumberOfAssignmentsCompleted *int32 // The number of assignments for this HIT that are being previewed or have been // accepted by Workers, but have not yet been submitted, returned, or abandoned. NumberOfAssignmentsPending *int32 // Conditions that a Worker's Qualifications must meet in order to accept the HIT. // A HIT can have between zero and ten Qualification requirements. All requirements // must be met in order for a Worker to accept the HIT. Additionally, other actions // can be restricted using the ActionsGuarded field on each // QualificationRequirement structure. QualificationRequirements []QualificationRequirement // The data the Worker completing the HIT uses produce the results. This is either // either a QuestionForm, HTMLQuestion or an ExternalQuestion data structure. Question *string // An arbitrary data field the Requester who created the HIT can use. This field // is visible only to the creator of the HIT. RequesterAnnotation *string // A string representing a currency amount. Reward *string // The title of the HIT. Title *string noSmithyDocumentSerde } // The HITLayoutParameter data structure defines parameter values used with a // HITLayout. A HITLayout is a reusable Amazon Mechanical Turk project template // used to provide Human Intelligence Task (HIT) question data for CreateHIT. type HITLayoutParameter struct { // The name of the parameter in the HITLayout. // // This member is required. Name *string // The value substituted for the parameter referenced in the HITLayout. // // This member is required. Value *string noSmithyDocumentSerde } // The Locale data structure represents a geographical region or location. type Locale struct { // The country of the locale. Must be a valid ISO 3166 country code. For example, // the code US refers to the United States of America. // // This member is required. Country *string // The state or subdivision of the locale. A valid ISO 3166-2 subdivision code. // For example, the code WA refers to the state of Washington. Subdivision *string noSmithyDocumentSerde } // The NotificationSpecification data structure describes a HIT event notification // for a HIT type. type NotificationSpecification struct { // The target for notification messages. The Destination’s format is determined by // the specified Transport: // - When Transport is Email, the Destination is your email address. // - When Transport is SQS, the Destination is your queue URL. // - When Transport is SNS, the Destination is the ARN of your topic. // // This member is required. Destination *string // The list of events that should cause notifications to be sent. Valid Values: // AssignmentAccepted | AssignmentAbandoned | AssignmentReturned | // AssignmentSubmitted | AssignmentRejected | AssignmentApproved | HITCreated | // HITExtended | HITDisposed | HITReviewable | HITExpired | Ping. The Ping event is // only valid for the SendTestEventNotification operation. // // This member is required. EventTypes []EventType // The method Amazon Mechanical Turk uses to send the notification. Valid Values: // Email | SQS | SNS. // // This member is required. Transport NotificationTransport // The version of the Notification API to use. Valid value is 2006-05-05. // // This member is required. Version *string noSmithyDocumentSerde } // When MTurk encounters an issue with notifying the Workers you specified, it // returns back this object with failure details. type NotifyWorkersFailureStatus struct { // Encoded value for the failure type. NotifyWorkersFailureCode NotifyWorkersFailureCode // A message detailing the reason the Worker could not be notified. NotifyWorkersFailureMessage *string // The ID of the Worker. WorkerId *string noSmithyDocumentSerde } // This data structure is the data type for the AnswerKey parameter of the // ScoreMyKnownAnswers/2011-09-01 Review Policy. type ParameterMapEntry struct { // The QuestionID from the HIT that is used to identify which question requires // Mechanical Turk to score as part of the ScoreMyKnownAnswers/2011-09-01 Review // Policy. Key *string // The list of answers to the question specified in the MapEntry Key element. The // Worker must match all values in order for the answer to be scored correctly. Values []string noSmithyDocumentSerde } // Name of the parameter from the Review policy. type PolicyParameter struct { // Name of the parameter from the list of Review Polices. Key *string // List of ParameterMapEntry objects. MapEntries []ParameterMapEntry // The list of values of the Parameter Values []string noSmithyDocumentSerde } // The Qualification data structure represents a Qualification assigned to a user, // including the Qualification type and the value (score). type Qualification struct { // The date and time the Qualification was granted to the Worker. If the Worker's // Qualification was revoked, and then re-granted based on a new Qualification // request, GrantTime is the date and time of the last call to the // AcceptQualificationRequest operation. GrantTime *time.Time // The value (score) of the Qualification, if the Qualification has an integer // value. IntegerValue *int32 // The Locale data structure represents a geographical region or location. LocaleValue *Locale // The ID of the Qualification type for the Qualification. QualificationTypeId *string // The status of the Qualification. Valid values are Granted | Revoked. Status QualificationStatus // The ID of the Worker who possesses the Qualification. WorkerId *string noSmithyDocumentSerde } // The QualificationRequest data structure represents a request a Worker has made // for a Qualification. type QualificationRequest struct { // The Worker's answers for the Qualification type's test contained in a // QuestionFormAnswers document, if the type has a test and the Worker has // submitted answers. If the Worker does not provide any answers, Answer may be // empty. Answer *string // The ID of the Qualification request, a unique identifier generated when the // request was submitted. QualificationRequestId *string // The ID of the Qualification type the Worker is requesting, as returned by the // CreateQualificationType operation. QualificationTypeId *string // The date and time the Qualification request had a status of Submitted. This is // either the time the Worker submitted answers for a Qualification test, or the // time the Worker requested the Qualification if the Qualification type does not // have a test. SubmitTime *time.Time // The contents of the Qualification test that was presented to the Worker, if the // type has a test and the Worker has submitted answers. This value is identical to // the QuestionForm associated with the Qualification type at the time the Worker // requests the Qualification. Test *string // The ID of the Worker requesting the Qualification. WorkerId *string noSmithyDocumentSerde } // The QualificationRequirement data structure describes a Qualification that a // Worker must have before the Worker is allowed to accept a HIT. A requirement may // optionally state that a Worker must have the Qualification in order to preview // the HIT, or see the HIT in search results. type QualificationRequirement struct { // The kind of comparison to make against a Qualification's value. You can compare // a Qualification's value to an IntegerValue to see if it is LessThan, // LessThanOrEqualTo, GreaterThan, GreaterThanOrEqualTo, EqualTo, or NotEqualTo the // IntegerValue. You can compare it to a LocaleValue to see if it is EqualTo, or // NotEqualTo the LocaleValue. You can check to see if the value is In or NotIn a // set of IntegerValue or LocaleValue values. Lastly, a Qualification requirement // can also test if a Qualification Exists or DoesNotExist in the user's profile, // regardless of its value. // // This member is required. Comparator Comparator // The ID of the Qualification type for the requirement. // // This member is required. QualificationTypeId *string // Setting this attribute prevents Workers whose Qualifications do not meet this // QualificationRequirement from taking the specified action. Valid arguments // include "Accept" (Worker cannot accept the HIT, but can preview the HIT and see // it in their search results), "PreviewAndAccept" (Worker cannot accept or preview // the HIT, but can see the HIT in their search results), and // "DiscoverPreviewAndAccept" (Worker cannot accept, preview, or see the HIT in // their search results). It's possible for you to create a HIT with multiple // QualificationRequirements (which can have different values for the ActionGuarded // attribute). In this case, the Worker is only permitted to perform an action when // they have met all QualificationRequirements guarding the action. The actions in // the order of least restrictive to most restrictive are Discover, Preview and // Accept. For example, if a Worker meets all QualificationRequirements that are // set to DiscoverPreviewAndAccept, but do not meet all requirements that are set // with PreviewAndAccept, then the Worker will be able to Discover, i.e. see the // HIT in their search result, but will not be able to Preview or Accept the HIT. // ActionsGuarded should not be used in combination with the RequiredToPreview // field. ActionsGuarded HITAccessActions // The integer value to compare against the Qualification's value. IntegerValue // must not be present if Comparator is Exists or DoesNotExist. IntegerValue can // only be used if the Qualification type has an integer value; it cannot be used // with the Worker_Locale QualificationType ID. When performing a set comparison by // using the In or the NotIn comparator, you can use up to 15 IntegerValue elements // in a QualificationRequirement data structure. IntegerValues []int32 // The locale value to compare against the Qualification's value. The local value // must be a valid ISO 3166 country code or supports ISO 3166-2 subdivisions. // LocaleValue can only be used with a Worker_Locale QualificationType ID. // LocaleValue can only be used with the EqualTo, NotEqualTo, In, and NotIn // comparators. You must only use a single LocaleValue element when using the // EqualTo or NotEqualTo comparators. When performing a set comparison by using the // In or the NotIn comparator, you can use up to 30 LocaleValue elements in a // QualificationRequirement data structure. LocaleValues []Locale // DEPRECATED: Use the ActionsGuarded field instead. If RequiredToPreview is true, // the question data for the HIT will not be shown when a Worker whose // Qualifications do not meet this requirement tries to preview the HIT. That is, a // Worker's Qualifications must meet all of the requirements for which // RequiredToPreview is true in order to preview the HIT. If a Worker meets all of // the requirements where RequiredToPreview is true (or if there are no such // requirements), but does not meet all of the requirements for the HIT, the Worker // will be allowed to preview the HIT's question data, but will not be allowed to // accept and complete the HIT. The default is false. This should not be used in // combination with the ActionsGuarded field. // // Deprecated: This member has been deprecated. RequiredToPreview *bool noSmithyDocumentSerde } // The QualificationType data structure represents a Qualification type, a // description of a property of a Worker that must match the requirements of a HIT // for the Worker to be able to accept the HIT. The type also describes how a // Worker can obtain a Qualification of that type, such as through a Qualification // test. type QualificationType struct { // The answers to the Qualification test specified in the Test parameter. AnswerKey *string // Specifies that requests for the Qualification type are granted immediately, // without prompting the Worker with a Qualification test. Valid values are True | // False. AutoGranted *bool // The Qualification integer value to use for automatically granted // Qualifications, if AutoGranted is true. This is 1 by default. AutoGrantedValue *int32 // The date and time the Qualification type was created. CreationTime *time.Time // A long description for the Qualification type. Description *string // Specifies whether the Qualification type is one that a user can request through // the Amazon Mechanical Turk web site, such as by taking a Qualification test. // This value is False for Qualifications assigned automatically by the system. // Valid values are True | False. IsRequestable *bool // One or more words or phrases that describe theQualification type, separated by // commas. The Keywords make the type easier to find using a search. Keywords *string // The name of the Qualification type. The type name is used to identify the type, // and to find the type using a Qualification type search. Name *string // A unique identifier for the Qualification type. A Qualification type is given a // Qualification type ID when you call the CreateQualificationType operation. QualificationTypeId *string // The status of the Qualification type. A Qualification type's status determines // if users can apply to receive a Qualification of this type, and if HITs can be // created with requirements based on this type. Valid values are Active | // Inactive. QualificationTypeStatus QualificationTypeStatus // The amount of time, in seconds, Workers must wait after taking the // Qualification test before they can take it again. Workers can take a // Qualification test multiple times if they were not granted the Qualification // from a previous attempt, or if the test offers a gradient score and they want a // better score. If not specified, retries are disabled and Workers can request a // Qualification only once. RetryDelayInSeconds *int64 // The questions for a Qualification test associated with this Qualification type // that a user can take to obtain a Qualification of this type. This parameter must // be specified if AnswerKey is present. A Qualification type cannot have both a // specified Test parameter and an AutoGranted value of true. Test *string // The amount of time, in seconds, given to a Worker to complete the Qualification // test, beginning from the time the Worker requests the Qualification. TestDurationInSeconds *int64 noSmithyDocumentSerde } // Both the AssignmentReviewReport and the HITReviewReport elements contains the // ReviewActionDetail data structure. This structure is returned multiple times for // each action specified in the Review Policy. type ReviewActionDetail struct { // The unique identifier for the action. ActionId *string // The nature of the action itself. The Review Policy is responsible for examining // the HIT and Assignments, emitting results, and deciding which other actions will // be necessary. ActionName *string // The date when the action was completed. CompleteTime *time.Time // Present only when the Results have a FAILED Status. ErrorCode *string // A description of the outcome of the review. Result *string // The current disposition of the action: INTENDED, SUCCEEDED, FAILED, or // CANCELLED. Status ReviewActionStatus // The specific HITId or AssignmentID targeted by the action. TargetId *string // The type of object in TargetId. TargetType *string noSmithyDocumentSerde } // HIT Review Policy data structures represent HIT review policies, which you // specify when you create a HIT. type ReviewPolicy struct { // Name of a Review Policy: SimplePlurality/2011-09-01 or // ScoreMyKnownAnswers/2011-09-01 // // This member is required. PolicyName *string // Name of the parameter from the Review policy. Parameters []PolicyParameter noSmithyDocumentSerde } // Contains both ReviewResult and ReviewAction elements for a particular HIT. type ReviewReport struct { // A list of ReviewAction objects for each action specified in the Review Policy. ReviewActions []ReviewActionDetail // A list of ReviewResults objects for each action specified in the Review Policy. ReviewResults []ReviewResultDetail noSmithyDocumentSerde } // This data structure is returned multiple times for each result specified in the // Review Policy. type ReviewResultDetail struct { // A unique identifier of the Review action result. ActionId *string // Key identifies the particular piece of reviewed information. Key *string // Specifies the QuestionId the result is describing. Depending on whether the // TargetType is a HIT or Assignment this results could specify multiple values. If // TargetType is HIT and QuestionId is absent, then the result describes results of // the HIT, including the HIT agreement score. If ObjectType is Assignment and // QuestionId is absent, then the result describes the Worker's performance on the // HIT. QuestionId *string // The HITID or AssignmentId about which this result was taken. Note that // HIT-level Review Policies will often emit results about both the HIT itself and // its Assignments, while Assignment-level review policies generally only emit // results about the Assignment itself. SubjectId *string // The type of the object from the SubjectId field. SubjectType *string // The values of Key provided by the review policies you have selected. Value *string noSmithyDocumentSerde } // The WorkerBlock data structure represents a Worker who has been blocked. It has // two elements: the WorkerId and the Reason for the block. type WorkerBlock struct { // A message explaining the reason the Worker was blocked. Reason *string // The ID of the Worker who accepted the HIT. WorkerId *string noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
618
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mwaa import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/defaults" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/retry" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" smithy "github.com/aws/smithy-go" smithydocument "github.com/aws/smithy-go/document" "github.com/aws/smithy-go/logging" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "net" "net/http" "time" ) const ServiceID = "MWAA" const ServiceAPIVersion = "2020-07-01" // Client provides the API client to make operations call for AmazonMWAA. type Client struct { options Options } // New returns an initialized Client based on the functional options. Provide // additional functional options to further configure the behavior of the client, // such as changing the client's endpoint or adding custom middleware behavior. func New(options Options, optFns ...func(*Options)) *Client { options = options.Copy() resolveDefaultLogger(&options) setResolvedDefaultsMode(&options) resolveRetryer(&options) resolveHTTPClient(&options) resolveHTTPSignerV4(&options) resolveDefaultEndpointConfiguration(&options) for _, fn := range optFns { fn(&options) } client := &Client{ options: options, } return client } type Options struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error // Configures the events that will be sent to the configured logger. ClientLogMode aws.ClientLogMode // The credentials object to use when signing requests. Credentials aws.CredentialsProvider // The configuration DefaultsMode that the SDK should use when constructing the // clients initial default settings. DefaultsMode aws.DefaultsMode // The endpoint options to be used when attempting to resolve an endpoint. EndpointOptions EndpointResolverOptions // The service endpoint resolver. EndpointResolver EndpointResolver // Signature Version 4 (SigV4) Signer HTTPSignerV4 HTTPSignerV4 // The logger writer interface to write logging messages to. Logger logging.Logger // The region to send requests to. (Required) Region string // RetryMaxAttempts specifies the maximum number attempts an API client will call // an operation that fails with a retryable error. A value of 0 is ignored, and // will not be used to configure the API client created default retryer, or modify // per operation call's retry max attempts. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. If specified in an operation call's functional // options with a value that is different than the constructed client's Options, // the Client's Retryer will be wrapped to use the operation's specific // RetryMaxAttempts value. RetryMaxAttempts int // RetryMode specifies the retry mode the API client will be created with, if // Retryer option is not also specified. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. Currently does not support per operation call // overrides, may in the future. RetryMode aws.RetryMode // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. The kind of // default retry created by the API client can be changed with the RetryMode // option. Retryer aws.Retryer // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You // should not populate this structure programmatically, or rely on the values here // within your applications. RuntimeEnvironment aws.RuntimeEnvironment // The initial DefaultsMode used when the client options were constructed. If the // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved // value was at that point in time. Currently does not support per operation call // overrides, may in the future. resolvedDefaultsMode aws.DefaultsMode // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. HTTPClient HTTPClient } // WithAPIOptions returns a functional option for setting the Client's APIOptions // option. func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { return func(o *Options) { o.APIOptions = append(o.APIOptions, optFns...) } } // WithEndpointResolver returns a functional option for setting the Client's // EndpointResolver option. func WithEndpointResolver(v EndpointResolver) func(*Options) { return func(o *Options) { o.EndpointResolver = v } } type HTTPClient interface { Do(*http.Request) (*http.Response, error) } // Copy creates a clone where the APIOptions list is deep copied. func (o Options) Copy() Options { to := o to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) copy(to.APIOptions, o.APIOptions) return to } func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { ctx = middleware.ClearStackValues(ctx) stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) options := c.options.Copy() for _, fn := range optFns { fn(&options) } finalizeRetryMaxAttemptOptions(&options, *c) finalizeClientEndpointResolverOptions(&options) for _, fn := range stackFns { if err := fn(stack, options); err != nil { return nil, metadata, err } } for _, fn := range options.APIOptions { if err := fn(stack); err != nil { return nil, metadata, err } } handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) result, metadata, err = handler.Handle(ctx, params) if err != nil { err = &smithy.OperationError{ ServiceID: ServiceID, OperationName: opID, Err: err, } } return result, metadata, err } type noSmithyDocumentSerde = smithydocument.NoSerde func resolveDefaultLogger(o *Options) { if o.Logger != nil { return } o.Logger = logging.Nop{} } func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { return middleware.AddSetLoggerMiddleware(stack, o.Logger) } func setResolvedDefaultsMode(o *Options) { if len(o.resolvedDefaultsMode) > 0 { return } var mode aws.DefaultsMode mode.SetFromString(string(o.DefaultsMode)) if mode == aws.DefaultsModeAuto { mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) } o.resolvedDefaultsMode = mode } // NewFromConfig returns a new client from the provided config. func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, DefaultsMode: cfg.DefaultsMode, RuntimeEnvironment: cfg.RuntimeEnvironment, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } resolveAWSRetryerProvider(cfg, &opts) resolveAWSRetryMaxAttempts(cfg, &opts) resolveAWSRetryMode(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) return New(opts, optFns...) } func resolveHTTPClient(o *Options) { var buildable *awshttp.BuildableClient if o.HTTPClient != nil { var ok bool buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) if !ok { return } } else { buildable = awshttp.NewBuildableClient() } modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { dialer.Timeout = dialerTimeout } }) buildable = buildable.WithTransportOptions(func(transport *http.Transport) { if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { transport.TLSHandshakeTimeout = tlsHandshakeTimeout } }) } o.HTTPClient = buildable } func resolveRetryer(o *Options) { if o.Retryer != nil { return } if len(o.RetryMode) == 0 { modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { o.RetryMode = modeConfig.RetryMode } } if len(o.RetryMode) == 0 { o.RetryMode = aws.RetryModeStandard } var standardOptions []func(*retry.StandardOptions) if v := o.RetryMaxAttempts; v != 0 { standardOptions = append(standardOptions, func(so *retry.StandardOptions) { so.MaxAttempts = v }) } switch o.RetryMode { case aws.RetryModeAdaptive: var adaptiveOptions []func(*retry.AdaptiveModeOptions) if len(standardOptions) != 0 { adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { ao.StandardOptions = append(ao.StandardOptions, standardOptions...) }) } o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) default: o.Retryer = retry.NewStandard(standardOptions...) } } func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { if cfg.Retryer == nil { return } o.Retryer = cfg.Retryer() } func resolveAWSRetryMode(cfg aws.Config, o *Options) { if len(cfg.RetryMode) == 0 { return } o.RetryMode = cfg.RetryMode } func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { if cfg.RetryMaxAttempts == 0 { return } o.RetryMaxAttempts = cfg.RetryMaxAttempts } func finalizeRetryMaxAttemptOptions(o *Options, client Client) { if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { return } o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) } func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { return } o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) } func addClientUserAgent(stack *middleware.Stack) error { return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "mwaa", goModuleVersion)(stack) } func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ CredentialsProvider: o.Credentials, Signer: o.HTTPSignerV4, LogSigning: o.ClientLogMode.IsSigning(), }) return stack.Finalize.Add(mw, middleware.After) } type HTTPSignerV4 interface { SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error } func resolveHTTPSignerV4(o *Options) { if o.HTTPSignerV4 != nil { return } o.HTTPSignerV4 = newDefaultV4Signer(*o) } func newDefaultV4Signer(o Options) *v4.Signer { return v4.NewSigner(func(so *v4.SignerOptions) { so.Logger = o.Logger so.LogSigning = o.ClientLogMode.IsSigning() }) } func addRetryMiddlewares(stack *middleware.Stack, o Options) error { mo := retry.AddRetryMiddlewaresOptions{ Retryer: o.Retryer, LogRetryAttempts: o.ClientLogMode.IsRetries(), } return retry.AddRetryMiddlewares(stack, mo) } // resolves dual-stack endpoint configuration func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseDualStackEndpoint = value } return nil } // resolves FIPS endpoint configuration func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseFIPSEndpoint = value } return nil } func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) } func addResponseErrorMiddleware(stack *middleware.Stack) error { return awshttp.AddResponseErrorMiddleware(stack) } func addRequestResponseLogging(stack *middleware.Stack, o Options) error { return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ LogRequest: o.ClientLogMode.IsRequest(), LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), LogResponse: o.ClientLogMode.IsResponse(), LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), }, middleware.After) }
434
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mwaa import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "io/ioutil" "net/http" "strings" "testing" ) func TestClient_resolveRetryOptions(t *testing.T) { nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { return &http.Response{ StatusCode: 200, Header: http.Header{}, Body: ioutil.NopCloser(strings.NewReader("")), }, nil }) cases := map[string]struct { defaultsMode aws.DefaultsMode retryer aws.Retryer retryMaxAttempts int opRetryMaxAttempts *int retryMode aws.RetryMode expectClientRetryMode aws.RetryMode expectClientMaxAttempts int expectOpMaxAttempts int }{ "defaults": { defaultsMode: aws.DefaultsModeStandard, expectClientRetryMode: aws.RetryModeStandard, expectClientMaxAttempts: 3, expectOpMaxAttempts: 3, }, "custom default retry": { retryMode: aws.RetryModeAdaptive, retryMaxAttempts: 10, expectClientRetryMode: aws.RetryModeAdaptive, expectClientMaxAttempts: 10, expectOpMaxAttempts: 10, }, "custom op max attempts": { retryMode: aws.RetryModeAdaptive, retryMaxAttempts: 10, opRetryMaxAttempts: aws.Int(2), expectClientRetryMode: aws.RetryModeAdaptive, expectClientMaxAttempts: 10, expectOpMaxAttempts: 2, }, "custom op no change max attempts": { retryMode: aws.RetryModeAdaptive, retryMaxAttempts: 10, opRetryMaxAttempts: aws.Int(10), expectClientRetryMode: aws.RetryModeAdaptive, expectClientMaxAttempts: 10, expectOpMaxAttempts: 10, }, "custom op 0 max attempts": { retryMode: aws.RetryModeAdaptive, retryMaxAttempts: 10, opRetryMaxAttempts: aws.Int(0), expectClientRetryMode: aws.RetryModeAdaptive, expectClientMaxAttempts: 10, expectOpMaxAttempts: 10, }, } for name, c := range cases { t.Run(name, func(t *testing.T) { client := NewFromConfig(aws.Config{ DefaultsMode: c.defaultsMode, Retryer: func() func() aws.Retryer { if c.retryer == nil { return nil } return func() aws.Retryer { return c.retryer } }(), HTTPClient: nopClient, RetryMaxAttempts: c.retryMaxAttempts, RetryMode: c.retryMode, }) if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { t.Errorf("expect %v retry mode, got %v", e, a) } if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { t.Errorf("expect %v max attempts, got %v", e, a) } _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, []func(*Options){ func(o *Options) { if c.opRetryMaxAttempts == nil { return } o.RetryMaxAttempts = *c.opRetryMaxAttempts }, }, func(s *middleware.Stack, o Options) error { s.Initialize.Clear() s.Serialize.Clear() s.Build.Clear() s.Finalize.Clear() s.Deserialize.Clear() if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { t.Errorf("expect %v op max attempts, got %v", e, a) } return nil }) if err != nil { t.Fatalf("expect no operation error, got %v", err) } }) } }
124
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mwaa import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a CLI token for the Airflow CLI. To learn more, see Creating an Apache // Airflow CLI token (https://docs.aws.amazon.com/mwaa/latest/userguide/call-mwaa-apis-cli.html) // . func (c *Client) CreateCliToken(ctx context.Context, params *CreateCliTokenInput, optFns ...func(*Options)) (*CreateCliTokenOutput, error) { if params == nil { params = &CreateCliTokenInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateCliToken", params, optFns, c.addOperationCreateCliTokenMiddlewares) if err != nil { return nil, err } out := result.(*CreateCliTokenOutput) out.ResultMetadata = metadata return out, nil } type CreateCliTokenInput struct { // The name of the Amazon MWAA environment. For example, MyMWAAEnvironment . // // This member is required. Name *string noSmithyDocumentSerde } type CreateCliTokenOutput struct { // An Airflow CLI login token. CliToken *string // The Airflow web server hostname for the environment. WebServerHostname *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateCliTokenMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateCliToken{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateCliToken{}, 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 = addEndpointPrefix_opCreateCliTokenMiddleware(stack); err != nil { return err } if err = addOpCreateCliTokenValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCliToken(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 } type endpointPrefix_opCreateCliTokenMiddleware struct { } func (*endpointPrefix_opCreateCliTokenMiddleware) ID() string { return "EndpointHostPrefix" } func (m *endpointPrefix_opCreateCliTokenMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } req.URL.Host = "env." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opCreateCliTokenMiddleware(stack *middleware.Stack) error { return stack.Serialize.Insert(&endpointPrefix_opCreateCliTokenMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opCreateCliToken(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "airflow", OperationName: "CreateCliToken", } }
160
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mwaa import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mwaa/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates an Amazon Managed Workflows for Apache Airflow (MWAA) environment. func (c *Client) CreateEnvironment(ctx context.Context, params *CreateEnvironmentInput, optFns ...func(*Options)) (*CreateEnvironmentOutput, error) { if params == nil { params = &CreateEnvironmentInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateEnvironment", params, optFns, c.addOperationCreateEnvironmentMiddlewares) if err != nil { return nil, err } out := result.(*CreateEnvironmentOutput) out.ResultMetadata = metadata return out, nil } // This section contains the Amazon Managed Workflows for Apache Airflow (MWAA) // API reference documentation to create an environment. For more information, see // Get started with Amazon Managed Workflows for Apache Airflow (https://docs.aws.amazon.com/mwaa/latest/userguide/get-started.html) // . type CreateEnvironmentInput struct { // The relative path to the DAGs folder on your Amazon S3 bucket. For example, dags // . For more information, see Adding or updating DAGs (https://docs.aws.amazon.com/mwaa/latest/userguide/configuring-dag-folder.html) // . // // This member is required. DagS3Path *string // The Amazon Resource Name (ARN) of the execution role for your environment. An // execution role is an Amazon Web Services Identity and Access Management (IAM) // role that grants MWAA permission to access Amazon Web Services services and // resources used by your environment. For example, // arn:aws:iam::123456789:role/my-execution-role . For more information, see // Amazon MWAA Execution role (https://docs.aws.amazon.com/mwaa/latest/userguide/mwaa-create-role.html) // . // // This member is required. ExecutionRoleArn *string // The name of the Amazon MWAA environment. For example, MyMWAAEnvironment . // // This member is required. Name *string // The VPC networking components used to secure and enable network traffic between // the Amazon Web Services resources for your environment. For more information, // see About networking on Amazon MWAA (https://docs.aws.amazon.com/mwaa/latest/userguide/networking-about.html) // . // // This member is required. NetworkConfiguration *types.NetworkConfiguration // The Amazon Resource Name (ARN) of the Amazon S3 bucket where your DAG code and // supporting files are stored. For example, // arn:aws:s3:::my-airflow-bucket-unique-name . For more information, see Create // an Amazon S3 bucket for Amazon MWAA (https://docs.aws.amazon.com/mwaa/latest/userguide/mwaa-s3-bucket.html) // . // // This member is required. SourceBucketArn *string // A list of key-value pairs containing the Apache Airflow configuration options // you want to attach to your environment. For more information, see Apache // Airflow configuration options (https://docs.aws.amazon.com/mwaa/latest/userguide/configuring-env-variables.html) // . AirflowConfigurationOptions map[string]string // The Apache Airflow version for your environment. If no value is specified, it // defaults to the latest version. Valid values: 1.10.12 , 2.0.2 , 2.2.2 , 2.4.3 , // and 2.5.1 . For more information, see Apache Airflow versions on Amazon Managed // Workflows for Apache Airflow (MWAA) (https://docs.aws.amazon.com/mwaa/latest/userguide/airflow-versions.html) // . AirflowVersion *string // The environment class type. Valid values: mw1.small , mw1.medium , mw1.large . // For more information, see Amazon MWAA environment class (https://docs.aws.amazon.com/mwaa/latest/userguide/environment-class.html) // . EnvironmentClass *string // The Amazon Web Services Key Management Service (KMS) key to encrypt the data in // your environment. You can use an Amazon Web Services owned CMK, or a Customer // managed CMK (advanced). For more information, see Create an Amazon MWAA // environment (https://docs.aws.amazon.com/mwaa/latest/userguide/create-environment.html) // . KmsKey *string // Defines the Apache Airflow logs to send to CloudWatch Logs. LoggingConfiguration *types.LoggingConfigurationInput // The maximum number of workers that you want to run in your environment. MWAA // scales the number of Apache Airflow workers up to the number you specify in the // MaxWorkers field. For example, 20 . When there are no more tasks running, and no // more in the queue, MWAA disposes of the extra workers leaving the one worker // that is included with your environment, or the number you specify in MinWorkers . MaxWorkers *int32 // The minimum number of workers that you want to run in your environment. MWAA // scales the number of Apache Airflow workers up to the number you specify in the // MaxWorkers field. When there are no more tasks running, and no more in the // queue, MWAA disposes of the extra workers leaving the worker count you specify // in the MinWorkers field. For example, 2 . MinWorkers *int32 // The version of the plugins.zip file on your Amazon S3 bucket. You must specify // a version each time a plugins.zip file is updated. For more information, see // How S3 Versioning works (https://docs.aws.amazon.com/AmazonS3/latest/userguide/versioning-workflows.html) // . PluginsS3ObjectVersion *string // The relative path to the plugins.zip file on your Amazon S3 bucket. For // example, plugins.zip . If specified, then the plugins.zip version is required. // For more information, see Installing custom plugins (https://docs.aws.amazon.com/mwaa/latest/userguide/configuring-dag-import-plugins.html) // . PluginsS3Path *string // The version of the requirements.txt file on your Amazon S3 bucket. You must // specify a version each time a requirements.txt file is updated. For more // information, see How S3 Versioning works (https://docs.aws.amazon.com/AmazonS3/latest/userguide/versioning-workflows.html) // . RequirementsS3ObjectVersion *string // The relative path to the requirements.txt file on your Amazon S3 bucket. For // example, requirements.txt . If specified, then a version is required. For more // information, see Installing Python dependencies (https://docs.aws.amazon.com/mwaa/latest/userguide/working-dags-dependencies.html) // . RequirementsS3Path *string // The number of Apache Airflow schedulers to run in your environment. Valid // values: // - v2 - Accepts between 2 to 5. Defaults to 2. // - v1 - Accepts 1. Schedulers *int32 // The version of the startup shell script in your Amazon S3 bucket. You must // specify the version ID (https://docs.aws.amazon.com/AmazonS3/latest/userguide/versioning-workflows.html) // that Amazon S3 assigns to the file every time you update the script. Version IDs // are Unicode, UTF-8 encoded, URL-ready, opaque strings that are no more than // 1,024 bytes long. The following is an example: // 3sL4kqtJlcpXroDTDmJ+rmSpXd3dIbrHY+MTRCxf3vjVBH40Nr8X8gdRQBpUMLUo For more // information, see Using a startup script (https://docs.aws.amazon.com/mwaa/latest/userguide/using-startup-script.html) // . StartupScriptS3ObjectVersion *string // The relative path to the startup shell script in your Amazon S3 bucket. For // example, s3://mwaa-environment/startup.sh . Amazon MWAA runs the script as your // environment starts, and before running the Apache Airflow process. You can use // this script to install dependencies, modify Apache Airflow configuration // options, and set environment variables. For more information, see Using a // startup script (https://docs.aws.amazon.com/mwaa/latest/userguide/using-startup-script.html) // . StartupScriptS3Path *string // The key-value tag pairs you want to associate to your environment. For example, // "Environment": "Staging" . For more information, see Tagging Amazon Web // Services resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) // . Tags map[string]string // The Apache Airflow Web server access mode. For more information, see Apache // Airflow access modes (https://docs.aws.amazon.com/mwaa/latest/userguide/configuring-networking.html) // . WebserverAccessMode types.WebserverAccessMode // The day and time of the week in Coordinated Universal Time (UTC) 24-hour // standard time to start weekly maintenance updates of your environment in the // following format: DAY:HH:MM . For example: TUE:03:30 . You can specify a start // time in 30 minute increments only. WeeklyMaintenanceWindowStart *string noSmithyDocumentSerde } type CreateEnvironmentOutput struct { // The Amazon Resource Name (ARN) returned in the response for the environment. Arn *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateEnvironmentMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateEnvironment{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateEnvironment{}, 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 = addEndpointPrefix_opCreateEnvironmentMiddleware(stack); err != nil { return err } if err = addOpCreateEnvironmentValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateEnvironment(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 } type endpointPrefix_opCreateEnvironmentMiddleware struct { } func (*endpointPrefix_opCreateEnvironmentMiddleware) ID() string { return "EndpointHostPrefix" } func (m *endpointPrefix_opCreateEnvironmentMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } req.URL.Host = "api." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opCreateEnvironmentMiddleware(stack *middleware.Stack) error { return stack.Serialize.Insert(&endpointPrefix_opCreateEnvironmentMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opCreateEnvironment(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "airflow", OperationName: "CreateEnvironment", } }
303
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mwaa import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a web login token for the Airflow Web UI. To learn more, see Creating // an Apache Airflow web login token (https://docs.aws.amazon.com/mwaa/latest/userguide/call-mwaa-apis-web.html) // . func (c *Client) CreateWebLoginToken(ctx context.Context, params *CreateWebLoginTokenInput, optFns ...func(*Options)) (*CreateWebLoginTokenOutput, error) { if params == nil { params = &CreateWebLoginTokenInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateWebLoginToken", params, optFns, c.addOperationCreateWebLoginTokenMiddlewares) if err != nil { return nil, err } out := result.(*CreateWebLoginTokenOutput) out.ResultMetadata = metadata return out, nil } type CreateWebLoginTokenInput struct { // The name of the Amazon MWAA environment. For example, MyMWAAEnvironment . // // This member is required. Name *string noSmithyDocumentSerde } type CreateWebLoginTokenOutput struct { // The Airflow web server hostname for the environment. WebServerHostname *string // An Airflow web server login token. WebToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateWebLoginTokenMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateWebLoginToken{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateWebLoginToken{}, 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 = addEndpointPrefix_opCreateWebLoginTokenMiddleware(stack); err != nil { return err } if err = addOpCreateWebLoginTokenValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateWebLoginToken(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 } type endpointPrefix_opCreateWebLoginTokenMiddleware struct { } func (*endpointPrefix_opCreateWebLoginTokenMiddleware) ID() string { return "EndpointHostPrefix" } func (m *endpointPrefix_opCreateWebLoginTokenMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } req.URL.Host = "env." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opCreateWebLoginTokenMiddleware(stack *middleware.Stack) error { return stack.Serialize.Insert(&endpointPrefix_opCreateWebLoginTokenMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opCreateWebLoginToken(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "airflow", OperationName: "CreateWebLoginToken", } }
160
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mwaa import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes an Amazon Managed Workflows for Apache Airflow (MWAA) environment. func (c *Client) DeleteEnvironment(ctx context.Context, params *DeleteEnvironmentInput, optFns ...func(*Options)) (*DeleteEnvironmentOutput, error) { if params == nil { params = &DeleteEnvironmentInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteEnvironment", params, optFns, c.addOperationDeleteEnvironmentMiddlewares) if err != nil { return nil, err } out := result.(*DeleteEnvironmentOutput) out.ResultMetadata = metadata return out, nil } type DeleteEnvironmentInput struct { // The name of the Amazon MWAA environment. For example, MyMWAAEnvironment . // // This member is required. Name *string noSmithyDocumentSerde } type DeleteEnvironmentOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteEnvironmentMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteEnvironment{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteEnvironment{}, 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 = addEndpointPrefix_opDeleteEnvironmentMiddleware(stack); err != nil { return err } if err = addOpDeleteEnvironmentValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteEnvironment(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 } type endpointPrefix_opDeleteEnvironmentMiddleware struct { } func (*endpointPrefix_opDeleteEnvironmentMiddleware) ID() string { return "EndpointHostPrefix" } func (m *endpointPrefix_opDeleteEnvironmentMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } req.URL.Host = "api." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opDeleteEnvironmentMiddleware(stack *middleware.Stack) error { return stack.Serialize.Insert(&endpointPrefix_opDeleteEnvironmentMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opDeleteEnvironment(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "airflow", OperationName: "DeleteEnvironment", } }
151
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mwaa import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mwaa/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Describes an Amazon Managed Workflows for Apache Airflow (MWAA) environment. func (c *Client) GetEnvironment(ctx context.Context, params *GetEnvironmentInput, optFns ...func(*Options)) (*GetEnvironmentOutput, error) { if params == nil { params = &GetEnvironmentInput{} } result, metadata, err := c.invokeOperation(ctx, "GetEnvironment", params, optFns, c.addOperationGetEnvironmentMiddlewares) if err != nil { return nil, err } out := result.(*GetEnvironmentOutput) out.ResultMetadata = metadata return out, nil } type GetEnvironmentInput struct { // The name of the Amazon MWAA environment. For example, MyMWAAEnvironment . // // This member is required. Name *string noSmithyDocumentSerde } type GetEnvironmentOutput struct { // An object containing all available details about the environment. Environment *types.Environment // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetEnvironmentMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetEnvironment{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetEnvironment{}, 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 = addEndpointPrefix_opGetEnvironmentMiddleware(stack); err != nil { return err } if err = addOpGetEnvironmentValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetEnvironment(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 } type endpointPrefix_opGetEnvironmentMiddleware struct { } func (*endpointPrefix_opGetEnvironmentMiddleware) ID() string { return "EndpointHostPrefix" } func (m *endpointPrefix_opGetEnvironmentMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } req.URL.Host = "api." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opGetEnvironmentMiddleware(stack *middleware.Stack) error { return stack.Serialize.Insert(&endpointPrefix_opGetEnvironmentMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opGetEnvironment(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "airflow", OperationName: "GetEnvironment", } }
156
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mwaa import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the Amazon Managed Workflows for Apache Airflow (MWAA) environments. func (c *Client) ListEnvironments(ctx context.Context, params *ListEnvironmentsInput, optFns ...func(*Options)) (*ListEnvironmentsOutput, error) { if params == nil { params = &ListEnvironmentsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListEnvironments", params, optFns, c.addOperationListEnvironmentsMiddlewares) if err != nil { return nil, err } out := result.(*ListEnvironmentsOutput) out.ResultMetadata = metadata return out, nil } type ListEnvironmentsInput struct { // The maximum number of results to retrieve per page. For example, 5 environments // per page. MaxResults *int32 // Retrieves the next page of the results. NextToken *string noSmithyDocumentSerde } type ListEnvironmentsOutput struct { // Returns a list of Amazon MWAA environments. // // This member is required. Environments []string // Retrieves the next page of the results. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListEnvironmentsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListEnvironments{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListEnvironments{}, 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 = addEndpointPrefix_opListEnvironmentsMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListEnvironments(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 } type endpointPrefix_opListEnvironmentsMiddleware struct { } func (*endpointPrefix_opListEnvironmentsMiddleware) ID() string { return "EndpointHostPrefix" } func (m *endpointPrefix_opListEnvironmentsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } req.URL.Host = "api." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opListEnvironmentsMiddleware(stack *middleware.Stack) error { return stack.Serialize.Insert(&endpointPrefix_opListEnvironmentsMiddleware{}, `OperationSerializer`, middleware.After) } // ListEnvironmentsAPIClient is a client that implements the ListEnvironments // operation. type ListEnvironmentsAPIClient interface { ListEnvironments(context.Context, *ListEnvironmentsInput, ...func(*Options)) (*ListEnvironmentsOutput, error) } var _ ListEnvironmentsAPIClient = (*Client)(nil) // ListEnvironmentsPaginatorOptions is the paginator options for ListEnvironments type ListEnvironmentsPaginatorOptions struct { // The maximum number of results to retrieve per page. For example, 5 environments // per page. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // ListEnvironmentsPaginator is a paginator for ListEnvironments type ListEnvironmentsPaginator struct { options ListEnvironmentsPaginatorOptions client ListEnvironmentsAPIClient params *ListEnvironmentsInput nextToken *string firstPage bool } // NewListEnvironmentsPaginator returns a new ListEnvironmentsPaginator func NewListEnvironmentsPaginator(client ListEnvironmentsAPIClient, params *ListEnvironmentsInput, optFns ...func(*ListEnvironmentsPaginatorOptions)) *ListEnvironmentsPaginator { if params == nil { params = &ListEnvironmentsInput{} } options := ListEnvironmentsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListEnvironmentsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListEnvironmentsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListEnvironments page. func (p *ListEnvironmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEnvironmentsOutput, 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.ListEnvironments(ctx, &params, 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_opListEnvironments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "airflow", OperationName: "ListEnvironments", } }
250
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mwaa import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the key-value tag pairs associated to the Amazon Managed Workflows for // Apache Airflow (MWAA) environment. For example, "Environment": "Staging" . func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { if params == nil { params = &ListTagsForResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) if err != nil { return nil, err } out := result.(*ListTagsForResourceOutput) out.ResultMetadata = metadata return out, nil } type ListTagsForResourceInput struct { // The Amazon Resource Name (ARN) of the Amazon MWAA environment. For example, // arn:aws:airflow:us-east-1:123456789012:environment/MyMWAAEnvironment . // // This member is required. ResourceArn *string noSmithyDocumentSerde } type ListTagsForResourceOutput struct { // The key-value tag pairs associated to your environment. For more information, // see Tagging Amazon Web Services resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) // . Tags map[string]string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, 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 = addEndpointPrefix_opListTagsForResourceMiddleware(stack); err != nil { return err } if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(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 } type endpointPrefix_opListTagsForResourceMiddleware struct { } func (*endpointPrefix_opListTagsForResourceMiddleware) ID() string { return "EndpointHostPrefix" } func (m *endpointPrefix_opListTagsForResourceMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } req.URL.Host = "api." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opListTagsForResourceMiddleware(stack *middleware.Stack) error { return stack.Serialize.Insert(&endpointPrefix_opListTagsForResourceMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "airflow", OperationName: "ListTagsForResource", } }
159
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mwaa import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mwaa/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Internal only. Publishes environment health metrics to Amazon CloudWatch. func (c *Client) PublishMetrics(ctx context.Context, params *PublishMetricsInput, optFns ...func(*Options)) (*PublishMetricsOutput, error) { if params == nil { params = &PublishMetricsInput{} } result, metadata, err := c.invokeOperation(ctx, "PublishMetrics", params, optFns, c.addOperationPublishMetricsMiddlewares) if err != nil { return nil, err } out := result.(*PublishMetricsOutput) out.ResultMetadata = metadata return out, nil } type PublishMetricsInput struct { // Internal only. The name of the environment. // // This member is required. EnvironmentName *string // Internal only. Publishes metrics to Amazon CloudWatch. To learn more about the // metrics published to Amazon CloudWatch, see Amazon MWAA performance metrics in // Amazon CloudWatch (https://docs.aws.amazon.com/mwaa/latest/userguide/cw-metrics.html) // . // // This member is required. MetricData []types.MetricDatum noSmithyDocumentSerde } type PublishMetricsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationPublishMetricsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpPublishMetrics{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPublishMetrics{}, 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 = addEndpointPrefix_opPublishMetricsMiddleware(stack); err != nil { return err } if err = addOpPublishMetricsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPublishMetrics(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 } type endpointPrefix_opPublishMetricsMiddleware struct { } func (*endpointPrefix_opPublishMetricsMiddleware) ID() string { return "EndpointHostPrefix" } func (m *endpointPrefix_opPublishMetricsMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } req.URL.Host = "ops." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opPublishMetricsMiddleware(stack *middleware.Stack) error { return stack.Serialize.Insert(&endpointPrefix_opPublishMetricsMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opPublishMetrics(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "airflow", OperationName: "PublishMetrics", } }
160
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mwaa import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Associates key-value tag pairs to your Amazon Managed Workflows for Apache // Airflow (MWAA) environment. func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { if params == nil { params = &TagResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) if err != nil { return nil, err } out := result.(*TagResourceOutput) out.ResultMetadata = metadata return out, nil } type TagResourceInput struct { // The Amazon Resource Name (ARN) of the Amazon MWAA environment. For example, // arn:aws:airflow:us-east-1:123456789012:environment/MyMWAAEnvironment . // // This member is required. ResourceArn *string // The key-value tag pairs you want to associate to your environment. For example, // "Environment": "Staging" . For more information, see Tagging Amazon Web // Services resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) // . // // This member is required. Tags map[string]string noSmithyDocumentSerde } type TagResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, 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 = addEndpointPrefix_opTagResourceMiddleware(stack); err != nil { return err } if err = addOpTagResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(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 } type endpointPrefix_opTagResourceMiddleware struct { } func (*endpointPrefix_opTagResourceMiddleware) ID() string { return "EndpointHostPrefix" } func (m *endpointPrefix_opTagResourceMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } req.URL.Host = "api." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opTagResourceMiddleware(stack *middleware.Stack) error { return stack.Serialize.Insert(&endpointPrefix_opTagResourceMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "airflow", OperationName: "TagResource", } }
161
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mwaa import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Removes key-value tag pairs associated to your Amazon Managed Workflows for // Apache Airflow (MWAA) environment. For example, "Environment": "Staging" . func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { if params == nil { params = &UntagResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) if err != nil { return nil, err } out := result.(*UntagResourceOutput) out.ResultMetadata = metadata return out, nil } type UntagResourceInput struct { // The Amazon Resource Name (ARN) of the Amazon MWAA environment. For example, // arn:aws:airflow:us-east-1:123456789012:environment/MyMWAAEnvironment . // // This member is required. ResourceArn *string // The key-value tag pair you want to remove. For example, "Environment": "Staging" // . // // This member is required. TagKeys []string noSmithyDocumentSerde } type UntagResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUntagResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, 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 = addEndpointPrefix_opUntagResourceMiddleware(stack); err != nil { return err } if err = addOpUntagResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(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 } type endpointPrefix_opUntagResourceMiddleware struct { } func (*endpointPrefix_opUntagResourceMiddleware) ID() string { return "EndpointHostPrefix" } func (m *endpointPrefix_opUntagResourceMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } req.URL.Host = "api." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opUntagResourceMiddleware(stack *middleware.Stack) error { return stack.Serialize.Insert(&endpointPrefix_opUntagResourceMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "airflow", OperationName: "UntagResource", } }
159
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mwaa import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/mwaa/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates an Amazon Managed Workflows for Apache Airflow (MWAA) environment. func (c *Client) UpdateEnvironment(ctx context.Context, params *UpdateEnvironmentInput, optFns ...func(*Options)) (*UpdateEnvironmentOutput, error) { if params == nil { params = &UpdateEnvironmentInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateEnvironment", params, optFns, c.addOperationUpdateEnvironmentMiddlewares) if err != nil { return nil, err } out := result.(*UpdateEnvironmentOutput) out.ResultMetadata = metadata return out, nil } type UpdateEnvironmentInput struct { // The name of your Amazon MWAA environment. For example, MyMWAAEnvironment . // // This member is required. Name *string // A list of key-value pairs containing the Apache Airflow configuration options // you want to attach to your environment. For more information, see Apache // Airflow configuration options (https://docs.aws.amazon.com/mwaa/latest/userguide/configuring-env-variables.html) // . AirflowConfigurationOptions map[string]string // The Apache Airflow version for your environment. To upgrade your environment, // specify a newer version of Apache Airflow supported by Amazon MWAA. Before you // upgrade an environment, make sure your requirements, DAGs, plugins, and other // resources used in your workflows are compatible with the new Apache Airflow // version. For more information about updating your resources, see Upgrading an // Amazon MWAA environment (https://docs.aws.amazon.com/mwaa/latest/userguide/upgrading-environment.html) // . Valid values: 1.10.12 , 2.0.2 , 2.2.2 , 2.4.3 , and 2.5.1 . AirflowVersion *string // The relative path to the DAGs folder on your Amazon S3 bucket. For example, dags // . For more information, see Adding or updating DAGs (https://docs.aws.amazon.com/mwaa/latest/userguide/configuring-dag-folder.html) // . DagS3Path *string // The environment class type. Valid values: mw1.small , mw1.medium , mw1.large . // For more information, see Amazon MWAA environment class (https://docs.aws.amazon.com/mwaa/latest/userguide/environment-class.html) // . EnvironmentClass *string // The Amazon Resource Name (ARN) of the execution role in IAM that allows MWAA to // access Amazon Web Services resources in your environment. For example, // arn:aws:iam::123456789:role/my-execution-role . For more information, see // Amazon MWAA Execution role (https://docs.aws.amazon.com/mwaa/latest/userguide/mwaa-create-role.html) // . ExecutionRoleArn *string // The Apache Airflow log types to send to CloudWatch Logs. LoggingConfiguration *types.LoggingConfigurationInput // The maximum number of workers that you want to run in your environment. MWAA // scales the number of Apache Airflow workers up to the number you specify in the // MaxWorkers field. For example, 20 . When there are no more tasks running, and no // more in the queue, MWAA disposes of the extra workers leaving the one worker // that is included with your environment, or the number you specify in MinWorkers . MaxWorkers *int32 // The minimum number of workers that you want to run in your environment. MWAA // scales the number of Apache Airflow workers up to the number you specify in the // MaxWorkers field. When there are no more tasks running, and no more in the // queue, MWAA disposes of the extra workers leaving the worker count you specify // in the MinWorkers field. For example, 2 . MinWorkers *int32 // The VPC networking components used to secure and enable network traffic between // the Amazon Web Services resources for your environment. For more information, // see About networking on Amazon MWAA (https://docs.aws.amazon.com/mwaa/latest/userguide/networking-about.html) // . NetworkConfiguration *types.UpdateNetworkConfigurationInput // The version of the plugins.zip file on your Amazon S3 bucket. You must specify // a version each time a plugins.zip file is updated. For more information, see // How S3 Versioning works (https://docs.aws.amazon.com/AmazonS3/latest/userguide/versioning-workflows.html) // . PluginsS3ObjectVersion *string // The relative path to the plugins.zip file on your Amazon S3 bucket. For // example, plugins.zip . If specified, then the plugins.zip version is required. // For more information, see Installing custom plugins (https://docs.aws.amazon.com/mwaa/latest/userguide/configuring-dag-import-plugins.html) // . PluginsS3Path *string // The version of the requirements.txt file on your Amazon S3 bucket. You must // specify a version each time a requirements.txt file is updated. For more // information, see How S3 Versioning works (https://docs.aws.amazon.com/AmazonS3/latest/userguide/versioning-workflows.html) // . RequirementsS3ObjectVersion *string // The relative path to the requirements.txt file on your Amazon S3 bucket. For // example, requirements.txt . If specified, then a file version is required. For // more information, see Installing Python dependencies (https://docs.aws.amazon.com/mwaa/latest/userguide/working-dags-dependencies.html) // . RequirementsS3Path *string // The number of Apache Airflow schedulers to run in your Amazon MWAA environment. Schedulers *int32 // The Amazon Resource Name (ARN) of the Amazon S3 bucket where your DAG code and // supporting files are stored. For example, // arn:aws:s3:::my-airflow-bucket-unique-name . For more information, see Create // an Amazon S3 bucket for Amazon MWAA (https://docs.aws.amazon.com/mwaa/latest/userguide/mwaa-s3-bucket.html) // . SourceBucketArn *string // The version of the startup shell script in your Amazon S3 bucket. You must // specify the version ID (https://docs.aws.amazon.com/AmazonS3/latest/userguide/versioning-workflows.html) // that Amazon S3 assigns to the file every time you update the script. Version IDs // are Unicode, UTF-8 encoded, URL-ready, opaque strings that are no more than // 1,024 bytes long. The following is an example: // 3sL4kqtJlcpXroDTDmJ+rmSpXd3dIbrHY+MTRCxf3vjVBH40Nr8X8gdRQBpUMLUo For more // information, see Using a startup script (https://docs.aws.amazon.com/mwaa/latest/userguide/using-startup-script.html) // . StartupScriptS3ObjectVersion *string // The relative path to the startup shell script in your Amazon S3 bucket. For // example, s3://mwaa-environment/startup.sh . Amazon MWAA runs the script as your // environment starts, and before running the Apache Airflow process. You can use // this script to install dependencies, modify Apache Airflow configuration // options, and set environment variables. For more information, see Using a // startup script (https://docs.aws.amazon.com/mwaa/latest/userguide/using-startup-script.html) // . StartupScriptS3Path *string // The Apache Airflow Web server access mode. For more information, see Apache // Airflow access modes (https://docs.aws.amazon.com/mwaa/latest/userguide/configuring-networking.html) // . WebserverAccessMode types.WebserverAccessMode // The day and time of the week in Coordinated Universal Time (UTC) 24-hour // standard time to start weekly maintenance updates of your environment in the // following format: DAY:HH:MM . For example: TUE:03:30 . You can specify a start // time in 30 minute increments only. WeeklyMaintenanceWindowStart *string noSmithyDocumentSerde } type UpdateEnvironmentOutput struct { // The Amazon Resource Name (ARN) of the Amazon MWAA environment. For example, // arn:aws:airflow:us-east-1:123456789012:environment/MyMWAAEnvironment . Arn *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateEnvironmentMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateEnvironment{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateEnvironment{}, 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 = addEndpointPrefix_opUpdateEnvironmentMiddleware(stack); err != nil { return err } if err = addOpUpdateEnvironmentValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateEnvironment(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 } type endpointPrefix_opUpdateEnvironmentMiddleware struct { } func (*endpointPrefix_opUpdateEnvironmentMiddleware) ID() string { return "EndpointHostPrefix" } func (m *endpointPrefix_opUpdateEnvironmentMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { if smithyhttp.GetHostnameImmutable(ctx) || smithyhttp.IsEndpointHostPrefixDisabled(ctx) { return next.HandleSerialize(ctx, in) } req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } req.URL.Host = "api." + req.URL.Host return next.HandleSerialize(ctx, in) } func addEndpointPrefix_opUpdateEnvironmentMiddleware(stack *middleware.Stack) error { return stack.Serialize.Insert(&endpointPrefix_opUpdateEnvironmentMiddleware{}, `OperationSerializer`, middleware.After) } func newServiceMetadataMiddleware_opUpdateEnvironment(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "airflow", OperationName: "UpdateEnvironment", } }
276
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mwaa import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/mwaa/types" smithy "github.com/aws/smithy-go" smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "strings" ) type awsRestjson1_deserializeOpCreateCliToken struct { } func (*awsRestjson1_deserializeOpCreateCliToken) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateCliToken) 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_deserializeOpErrorCreateCliToken(response, &metadata) } output := &CreateCliTokenOutput{} 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_deserializeOpDocumentCreateCliTokenOutput(&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_deserializeOpErrorCreateCliToken(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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateCliTokenOutput(v **CreateCliTokenOutput, 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 *CreateCliTokenOutput if *v == nil { sv = &CreateCliTokenOutput{} } else { sv = *v } for key, value := range shape { switch key { case "CliToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Token to be of type string, got %T instead", value) } sv.CliToken = ptr.String(jtv) } case "WebServerHostname": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Hostname to be of type string, got %T instead", value) } sv.WebServerHostname = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateEnvironment struct { } func (*awsRestjson1_deserializeOpCreateEnvironment) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateEnvironment) 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_deserializeOpErrorCreateEnvironment(response, &metadata) } output := &CreateEnvironmentOutput{} 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_deserializeOpDocumentCreateEnvironmentOutput(&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_deserializeOpErrorCreateEnvironment(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("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateEnvironmentOutput(v **CreateEnvironmentOutput, 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 *CreateEnvironmentOutput if *v == nil { sv = &CreateEnvironmentOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EnvironmentArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateWebLoginToken struct { } func (*awsRestjson1_deserializeOpCreateWebLoginToken) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateWebLoginToken) 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_deserializeOpErrorCreateWebLoginToken(response, &metadata) } output := &CreateWebLoginTokenOutput{} 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_deserializeOpDocumentCreateWebLoginTokenOutput(&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_deserializeOpErrorCreateWebLoginToken(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("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(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_deserializeOpDocumentCreateWebLoginTokenOutput(v **CreateWebLoginTokenOutput, 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 *CreateWebLoginTokenOutput if *v == nil { sv = &CreateWebLoginTokenOutput{} } else { sv = *v } for key, value := range shape { switch key { case "WebServerHostname": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Hostname to be of type string, got %T instead", value) } sv.WebServerHostname = ptr.String(jtv) } case "WebToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Token to be of type string, got %T instead", value) } sv.WebToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteEnvironment struct { } func (*awsRestjson1_deserializeOpDeleteEnvironment) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteEnvironment) 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_deserializeOpErrorDeleteEnvironment(response, &metadata) } output := &DeleteEnvironmentOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteEnvironment(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("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(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 } } type awsRestjson1_deserializeOpGetEnvironment struct { } func (*awsRestjson1_deserializeOpGetEnvironment) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetEnvironment) 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_deserializeOpErrorGetEnvironment(response, &metadata) } output := &GetEnvironmentOutput{} 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_deserializeOpDocumentGetEnvironmentOutput(&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_deserializeOpErrorGetEnvironment(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("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(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_deserializeOpDocumentGetEnvironmentOutput(v **GetEnvironmentOutput, 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 *GetEnvironmentOutput if *v == nil { sv = &GetEnvironmentOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Environment": if err := awsRestjson1_deserializeDocumentEnvironment(&sv.Environment, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListEnvironments struct { } func (*awsRestjson1_deserializeOpListEnvironments) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListEnvironments) 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_deserializeOpErrorListEnvironments(response, &metadata) } output := &ListEnvironmentsOutput{} 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_deserializeOpDocumentListEnvironmentsOutput(&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_deserializeOpErrorListEnvironments(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("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListEnvironmentsOutput(v **ListEnvironmentsOutput, 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 *ListEnvironmentsOutput if *v == nil { sv = &ListEnvironmentsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Environments": if err := awsRestjson1_deserializeDocumentEnvironmentList(&sv.Environments, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListTagsForResource struct { } func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListTagsForResource) 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_deserializeOpErrorListTagsForResource(response, &metadata) } output := &ListTagsForResourceOutput{} 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_deserializeOpDocumentListTagsForResourceOutput(&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_deserializeOpErrorListTagsForResource(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("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(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_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, 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 *ListTagsForResourceOutput if *v == nil { sv = &ListTagsForResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpPublishMetrics struct { } func (*awsRestjson1_deserializeOpPublishMetrics) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpPublishMetrics) 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_deserializeOpErrorPublishMetrics(response, &metadata) } output := &PublishMetricsOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorPublishMetrics(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("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpTagResource struct { } func (*awsRestjson1_deserializeOpTagResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpTagResource) 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_deserializeOpErrorTagResource(response, &metadata) } output := &TagResourceOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorTagResource(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("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(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 } } type awsRestjson1_deserializeOpUntagResource struct { } func (*awsRestjson1_deserializeOpUntagResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUntagResource) 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_deserializeOpErrorUntagResource(response, &metadata) } output := &UntagResourceOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorUntagResource(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("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(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 } } type awsRestjson1_deserializeOpUpdateEnvironment struct { } func (*awsRestjson1_deserializeOpUpdateEnvironment) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateEnvironment) 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_deserializeOpErrorUpdateEnvironment(response, &metadata) } output := &UpdateEnvironmentOutput{} 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_deserializeOpDocumentUpdateEnvironmentOutput(&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_deserializeOpErrorUpdateEnvironment(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("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(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_deserializeOpDocumentUpdateEnvironmentOutput(v **UpdateEnvironmentOutput, 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 *UpdateEnvironmentOutput if *v == nil { sv = &UpdateEnvironmentOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EnvironmentArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.AccessDeniedException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InternalServerException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ResourceNotFoundException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ValidationException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentValidationException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, 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.AccessDeniedException if *v == nil { sv = &types.AccessDeniedException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAirflowConfigurationOptions(v *map[string]string, 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 mv map[string]string if *v == nil { mv = map[string]string{} } else { mv = *v } for key, value := range shape { var parsedVal string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConfigValue to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentEnvironment(v **types.Environment, 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.Environment if *v == nil { sv = &types.Environment{} } else { sv = *v } for key, value := range shape { switch key { case "AirflowConfigurationOptions": if err := awsRestjson1_deserializeDocumentAirflowConfigurationOptions(&sv.AirflowConfigurationOptions, value); err != nil { return err } case "AirflowVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AirflowVersion to be of type string, got %T instead", value) } sv.AirflowVersion = ptr.String(jtv) } case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EnvironmentArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected CreatedAt to be a JSON Number, got %T instead", value) } } case "DagS3Path": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RelativePath to be of type string, got %T instead", value) } sv.DagS3Path = ptr.String(jtv) } case "EnvironmentClass": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EnvironmentClass to be of type string, got %T instead", value) } sv.EnvironmentClass = ptr.String(jtv) } case "ExecutionRoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IamRoleArn to be of type string, got %T instead", value) } sv.ExecutionRoleArn = ptr.String(jtv) } case "KmsKey": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected KmsKey to be of type string, got %T instead", value) } sv.KmsKey = ptr.String(jtv) } case "LastUpdate": if err := awsRestjson1_deserializeDocumentLastUpdate(&sv.LastUpdate, value); err != nil { return err } case "LoggingConfiguration": if err := awsRestjson1_deserializeDocumentLoggingConfiguration(&sv.LoggingConfiguration, value); err != nil { return err } case "MaxWorkers": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected MaxWorkers to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MaxWorkers = ptr.Int32(int32(i64)) } case "MinWorkers": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected MinWorkers to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.MinWorkers = ptr.Int32(int32(i64)) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EnvironmentName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "NetworkConfiguration": if err := awsRestjson1_deserializeDocumentNetworkConfiguration(&sv.NetworkConfiguration, value); err != nil { return err } case "PluginsS3ObjectVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3ObjectVersion to be of type string, got %T instead", value) } sv.PluginsS3ObjectVersion = ptr.String(jtv) } case "PluginsS3Path": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RelativePath to be of type string, got %T instead", value) } sv.PluginsS3Path = ptr.String(jtv) } case "RequirementsS3ObjectVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3ObjectVersion to be of type string, got %T instead", value) } sv.RequirementsS3ObjectVersion = ptr.String(jtv) } case "RequirementsS3Path": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RelativePath to be of type string, got %T instead", value) } sv.RequirementsS3Path = ptr.String(jtv) } case "Schedulers": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Schedulers to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Schedulers = ptr.Int32(int32(i64)) } case "ServiceRoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IamRoleArn to be of type string, got %T instead", value) } sv.ServiceRoleArn = ptr.String(jtv) } case "SourceBucketArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3BucketArn to be of type string, got %T instead", value) } sv.SourceBucketArn = ptr.String(jtv) } case "StartupScriptS3ObjectVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.StartupScriptS3ObjectVersion = ptr.String(jtv) } case "StartupScriptS3Path": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.StartupScriptS3Path = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EnvironmentStatus to be of type string, got %T instead", value) } sv.Status = types.EnvironmentStatus(jtv) } case "Tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } case "WebserverAccessMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WebserverAccessMode to be of type string, got %T instead", value) } sv.WebserverAccessMode = types.WebserverAccessMode(jtv) } case "WebserverUrl": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WebserverUrl to be of type string, got %T instead", value) } sv.WebserverUrl = ptr.String(jtv) } case "WeeklyMaintenanceWindowStart": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected WeeklyMaintenanceWindowStart to be of type string, got %T instead", value) } sv.WeeklyMaintenanceWindowStart = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEnvironmentList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EnvironmentName to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, 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.InternalServerException if *v == nil { sv = &types.InternalServerException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLastUpdate(v **types.LastUpdate, 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.LastUpdate if *v == nil { sv = &types.LastUpdate{} } else { sv = *v } for key, value := range shape { switch key { case "CreatedAt": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected UpdateCreatedAt to be a JSON Number, got %T instead", value) } } case "Error": if err := awsRestjson1_deserializeDocumentUpdateError(&sv.Error, value); err != nil { return err } case "Source": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UpdateSource to be of type string, got %T instead", value) } sv.Source = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UpdateStatus to be of type string, got %T instead", value) } sv.Status = types.UpdateStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLoggingConfiguration(v **types.LoggingConfiguration, 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.LoggingConfiguration if *v == nil { sv = &types.LoggingConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "DagProcessingLogs": if err := awsRestjson1_deserializeDocumentModuleLoggingConfiguration(&sv.DagProcessingLogs, value); err != nil { return err } case "SchedulerLogs": if err := awsRestjson1_deserializeDocumentModuleLoggingConfiguration(&sv.SchedulerLogs, value); err != nil { return err } case "TaskLogs": if err := awsRestjson1_deserializeDocumentModuleLoggingConfiguration(&sv.TaskLogs, value); err != nil { return err } case "WebserverLogs": if err := awsRestjson1_deserializeDocumentModuleLoggingConfiguration(&sv.WebserverLogs, value); err != nil { return err } case "WorkerLogs": if err := awsRestjson1_deserializeDocumentModuleLoggingConfiguration(&sv.WorkerLogs, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentModuleLoggingConfiguration(v **types.ModuleLoggingConfiguration, 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.ModuleLoggingConfiguration if *v == nil { sv = &types.ModuleLoggingConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "CloudWatchLogGroupArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CloudWatchLogGroupArn to be of type string, got %T instead", value) } sv.CloudWatchLogGroupArn = ptr.String(jtv) } case "Enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected LoggingEnabled to be of type *bool, got %T instead", value) } sv.Enabled = ptr.Bool(jtv) } case "LogLevel": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LoggingLevel to be of type string, got %T instead", value) } sv.LogLevel = types.LoggingLevel(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNetworkConfiguration(v **types.NetworkConfiguration, 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.NetworkConfiguration if *v == nil { sv = &types.NetworkConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "SecurityGroupIds": if err := awsRestjson1_deserializeDocumentSecurityGroupList(&sv.SecurityGroupIds, value); err != nil { return err } case "SubnetIds": if err := awsRestjson1_deserializeDocumentSubnetList(&sv.SubnetIds, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, 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.ResourceNotFoundException if *v == nil { sv = &types.ResourceNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSecurityGroupList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SecurityGroupId to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSubnetList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SubnetId to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, 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 mv map[string]string if *v == nil { mv = map[string]string{} } else { mv = *v } for key, value := range shape { var parsedVal string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentUpdateError(v **types.UpdateError, 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.UpdateError if *v == nil { sv = &types.UpdateError{} } else { sv = *v } for key, value := range shape { switch key { case "ErrorCode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) } sv.ErrorCode = ptr.String(jtv) } case "ErrorMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } sv.ErrorMessage = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, 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.ValidationException if *v == nil { sv = &types.ValidationException{} } else { sv = *v } for key, value := range shape { switch key { case "message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil }
2,519
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package mwaa provides the API client, operations, and parameter types for // AmazonMWAA. // // Amazon Managed Workflows for Apache Airflow This section contains the Amazon // Managed Workflows for Apache Airflow (MWAA) API reference documentation. For // more information, see What is Amazon MWAA? (https://docs.aws.amazon.com/mwaa/latest/userguide/what-is-mwaa.html) // . Endpoints // - api.airflow.{region}.amazonaws.com - This endpoint is used for environment // management. // - CreateEnvironment (https://docs.aws.amazon.com/mwaa/latest/API/API_CreateEnvironment.html) // - DeleteEnvironment (https://docs.aws.amazon.com/mwaa/latest/API/API_DeleteEnvironment.html) // - GetEnvironment (https://docs.aws.amazon.com/mwaa/latest/API/API_GetEnvironment.html) // - ListEnvironments (https://docs.aws.amazon.com/mwaa/latest/API/API_ListEnvironments.html) // - ListTagsForResource (https://docs.aws.amazon.com/mwaa/latest/API/API_ListTagsForResource.html) // - TagResource (https://docs.aws.amazon.com/mwaa/latest/API/API_TagResource.html) // - UntagResource (https://docs.aws.amazon.com/mwaa/latest/API/API_UntagResource.html) // - UpdateEnvironment (https://docs.aws.amazon.com/mwaa/latest/API/API_UpdateEnvironment.html) // - env.airflow.{region}.amazonaws.com - This endpoint is used to operate the // Airflow environment. // - CreateCliToken (https://docs.aws.amazon.com/mwaa/latest/API/API_CreateCliToken.html) // - CreateWebLoginToken (https://docs.aws.amazon.com/mwaa/latest/API/API_CreateWebLoginToken.html) // - ops.airflow.{region}.amazonaws.com - This endpoint is used to push // environment metrics that track environment health. // - PublishMetrics (https://docs.aws.amazon.com/mwaa/latest/API/API_PublishMetrics.html) // // Regions For a list of regions that Amazon MWAA supports, see Region availability (https://docs.aws.amazon.com/mwaa/latest/userguide/what-is-mwaa.html#regions-mwaa) // in the Amazon MWAA User Guide. package mwaa
31
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mwaa import ( "context" "errors" "fmt" "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" internalendpoints "github.com/aws/aws-sdk-go-v2/service/mwaa/internal/endpoints" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "net/url" "strings" ) // EndpointResolverOptions is the service endpoint resolver options type EndpointResolverOptions = internalendpoints.Options // EndpointResolver interface for resolving service endpoints. type EndpointResolver interface { ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) } var _ EndpointResolver = &internalendpoints.Resolver{} // NewDefaultEndpointResolver constructs a new service endpoint resolver func NewDefaultEndpointResolver() *internalendpoints.Resolver { return internalendpoints.New() } // EndpointResolverFunc is a helper utility that wraps a function so it satisfies // the EndpointResolver interface. This is useful when you want to add additional // endpoint resolving logic, or stub out specific endpoints with custom values. type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { return fn(region, options) } func resolveDefaultEndpointConfiguration(o *Options) { if o.EndpointResolver != nil { return } o.EndpointResolver = NewDefaultEndpointResolver() } // EndpointResolverFromURL returns an EndpointResolver configured using the // provided endpoint url. By default, the resolved endpoint resolver uses the // client region as signing region, and the endpoint source is set to // EndpointSourceCustom.You can provide functional options to configure endpoint // values for the resolved endpoint. func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} for _, fn := range optFns { fn(&e) } return EndpointResolverFunc( func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { if len(e.SigningRegion) == 0 { e.SigningRegion = region } return e, nil }, ) } type ResolveEndpoint struct { Resolver EndpointResolver Options EndpointResolverOptions } func (*ResolveEndpoint) ID() string { return "ResolveEndpoint" } func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { req, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) } if m.Resolver == nil { return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") } eo := m.Options eo.Logger = middleware.GetLogger(ctx) var endpoint aws.Endpoint endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) if err != nil { return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) } req.URL, err = url.Parse(endpoint.URL) if err != nil { return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) } if len(awsmiddleware.GetSigningName(ctx)) == 0 { signingName := endpoint.SigningName if len(signingName) == 0 { signingName = "airflow" } ctx = awsmiddleware.SetSigningName(ctx, signingName) } ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { return stack.Serialize.Insert(&ResolveEndpoint{ Resolver: o.EndpointResolver, Options: o.EndpointOptions, }, "OperationSerializer", middleware.Before) } func removeResolveEndpointMiddleware(stack *middleware.Stack) error { _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) return err } type wrappedEndpointResolver struct { awsResolver aws.EndpointResolverWithOptions resolver EndpointResolver } func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { if w.awsResolver == nil { goto fallback } endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options) if err == nil { return endpoint, nil } if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { return endpoint, err } fallback: if w.resolver == nil { return endpoint, fmt.Errorf("default endpoint resolver provided was nil") } return w.resolver.ResolveEndpoint(region, options) } type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { return a(service, region) } var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) // withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver. // If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided // fallbackResolver for resolution. // // fallbackResolver must not be nil func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver { var resolver aws.EndpointResolverWithOptions if awsResolverWithOptions != nil { resolver = awsResolverWithOptions } else if awsResolver != nil { resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) } return &wrappedEndpointResolver{ awsResolver: resolver, resolver: fallbackResolver, } } func finalizeClientEndpointResolverOptions(options *Options) { options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() if len(options.EndpointOptions.ResolvedRegion) == 0 { const fipsInfix = "-fips-" const fipsPrefix = "fips-" const fipsSuffix = "-fips" if strings.Contains(options.Region, fipsInfix) || strings.Contains(options.Region, fipsPrefix) || strings.Contains(options.Region, fipsSuffix) { options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled } } }
201
aws-sdk-go-v2
aws
Go
// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. package mwaa // goModuleVersion is the tagged release for this module const goModuleVersion = "1.16.2"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mwaa
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mwaa import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/mwaa/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "math" ) type awsRestjson1_serializeOpCreateCliToken struct { } func (*awsRestjson1_serializeOpCreateCliToken) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateCliToken) 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.(*CreateCliTokenInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/clitoken/{Name}") 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_serializeOpHttpBindingsCreateCliTokenInput(input, restEncoder); 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_serializeOpHttpBindingsCreateCliTokenInput(v *CreateCliTokenInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Name == nil || len(*v.Name) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} } if v.Name != nil { if err := encoder.SetURI("Name").String(*v.Name); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateEnvironment struct { } func (*awsRestjson1_serializeOpCreateEnvironment) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateEnvironment) 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.(*CreateEnvironmentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/environments/{Name}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PUT" 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_serializeOpHttpBindingsCreateEnvironmentInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateEnvironmentInput(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_serializeOpHttpBindingsCreateEnvironmentInput(v *CreateEnvironmentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Name == nil || len(*v.Name) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} } if v.Name != nil { if err := encoder.SetURI("Name").String(*v.Name); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentCreateEnvironmentInput(v *CreateEnvironmentInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AirflowConfigurationOptions != nil { ok := object.Key("AirflowConfigurationOptions") if err := awsRestjson1_serializeDocumentAirflowConfigurationOptions(v.AirflowConfigurationOptions, ok); err != nil { return err } } if v.AirflowVersion != nil { ok := object.Key("AirflowVersion") ok.String(*v.AirflowVersion) } if v.DagS3Path != nil { ok := object.Key("DagS3Path") ok.String(*v.DagS3Path) } if v.EnvironmentClass != nil { ok := object.Key("EnvironmentClass") ok.String(*v.EnvironmentClass) } if v.ExecutionRoleArn != nil { ok := object.Key("ExecutionRoleArn") ok.String(*v.ExecutionRoleArn) } if v.KmsKey != nil { ok := object.Key("KmsKey") ok.String(*v.KmsKey) } if v.LoggingConfiguration != nil { ok := object.Key("LoggingConfiguration") if err := awsRestjson1_serializeDocumentLoggingConfigurationInput(v.LoggingConfiguration, ok); err != nil { return err } } if v.MaxWorkers != nil { ok := object.Key("MaxWorkers") ok.Integer(*v.MaxWorkers) } if v.MinWorkers != nil { ok := object.Key("MinWorkers") ok.Integer(*v.MinWorkers) } if v.NetworkConfiguration != nil { ok := object.Key("NetworkConfiguration") if err := awsRestjson1_serializeDocumentNetworkConfiguration(v.NetworkConfiguration, ok); err != nil { return err } } if v.PluginsS3ObjectVersion != nil { ok := object.Key("PluginsS3ObjectVersion") ok.String(*v.PluginsS3ObjectVersion) } if v.PluginsS3Path != nil { ok := object.Key("PluginsS3Path") ok.String(*v.PluginsS3Path) } if v.RequirementsS3ObjectVersion != nil { ok := object.Key("RequirementsS3ObjectVersion") ok.String(*v.RequirementsS3ObjectVersion) } if v.RequirementsS3Path != nil { ok := object.Key("RequirementsS3Path") ok.String(*v.RequirementsS3Path) } if v.Schedulers != nil { ok := object.Key("Schedulers") ok.Integer(*v.Schedulers) } if v.SourceBucketArn != nil { ok := object.Key("SourceBucketArn") ok.String(*v.SourceBucketArn) } if v.StartupScriptS3ObjectVersion != nil { ok := object.Key("StartupScriptS3ObjectVersion") ok.String(*v.StartupScriptS3ObjectVersion) } if v.StartupScriptS3Path != nil { ok := object.Key("StartupScriptS3Path") ok.String(*v.StartupScriptS3Path) } if v.Tags != nil { ok := object.Key("Tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } if len(v.WebserverAccessMode) > 0 { ok := object.Key("WebserverAccessMode") ok.String(string(v.WebserverAccessMode)) } if v.WeeklyMaintenanceWindowStart != nil { ok := object.Key("WeeklyMaintenanceWindowStart") ok.String(*v.WeeklyMaintenanceWindowStart) } return nil } type awsRestjson1_serializeOpCreateWebLoginToken struct { } func (*awsRestjson1_serializeOpCreateWebLoginToken) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateWebLoginToken) 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.(*CreateWebLoginTokenInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/webtoken/{Name}") 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_serializeOpHttpBindingsCreateWebLoginTokenInput(input, restEncoder); 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_serializeOpHttpBindingsCreateWebLoginTokenInput(v *CreateWebLoginTokenInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Name == nil || len(*v.Name) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} } if v.Name != nil { if err := encoder.SetURI("Name").String(*v.Name); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteEnvironment struct { } func (*awsRestjson1_serializeOpDeleteEnvironment) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteEnvironment) 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.(*DeleteEnvironmentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/environments/{Name}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" 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_serializeOpHttpBindingsDeleteEnvironmentInput(input, restEncoder); 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_serializeOpHttpBindingsDeleteEnvironmentInput(v *DeleteEnvironmentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Name == nil || len(*v.Name) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} } if v.Name != nil { if err := encoder.SetURI("Name").String(*v.Name); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetEnvironment struct { } func (*awsRestjson1_serializeOpGetEnvironment) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetEnvironment) 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.(*GetEnvironmentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/environments/{Name}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" 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_serializeOpHttpBindingsGetEnvironmentInput(input, restEncoder); 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_serializeOpHttpBindingsGetEnvironmentInput(v *GetEnvironmentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Name == nil || len(*v.Name) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} } if v.Name != nil { if err := encoder.SetURI("Name").String(*v.Name); err != nil { return err } } return nil } type awsRestjson1_serializeOpListEnvironments struct { } func (*awsRestjson1_serializeOpListEnvironments) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListEnvironments) 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.(*ListEnvironmentsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/environments") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" 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_serializeOpHttpBindingsListEnvironmentsInput(input, restEncoder); 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_serializeOpHttpBindingsListEnvironmentsInput(v *ListEnvironmentsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MaxResults != nil { encoder.SetQuery("MaxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("NextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListTagsForResource struct { } func (*awsRestjson1_serializeOpListTagsForResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListTagsForResource) 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.(*ListTagsForResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/tags/{ResourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" 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_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); 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_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil { return err } } return nil } type awsRestjson1_serializeOpPublishMetrics struct { } func (*awsRestjson1_serializeOpPublishMetrics) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpPublishMetrics) 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.(*PublishMetricsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/metrics/environments/{EnvironmentName}") 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_serializeOpHttpBindingsPublishMetricsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentPublishMetricsInput(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_serializeOpHttpBindingsPublishMetricsInput(v *PublishMetricsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.EnvironmentName == nil || len(*v.EnvironmentName) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member EnvironmentName must not be empty")} } if v.EnvironmentName != nil { if err := encoder.SetURI("EnvironmentName").String(*v.EnvironmentName); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentPublishMetricsInput(v *PublishMetricsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MetricData != nil { ok := object.Key("MetricData") if err := awsRestjson1_serializeDocumentMetricData(v.MetricData, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpTagResource struct { } func (*awsRestjson1_serializeOpTagResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpTagResource) 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.(*TagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/tags/{ResourceArn}") 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_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentTagResourceInput(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_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Tags != nil { ok := object.Key("Tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUntagResource struct { } func (*awsRestjson1_serializeOpUntagResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUntagResource) 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.(*UntagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/tags/{ResourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" 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_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); 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_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil { return err } } if v.TagKeys != nil { for i := range v.TagKeys { encoder.AddQuery("tagKeys").String(v.TagKeys[i]) } } return nil } type awsRestjson1_serializeOpUpdateEnvironment struct { } func (*awsRestjson1_serializeOpUpdateEnvironment) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateEnvironment) 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.(*UpdateEnvironmentInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/environments/{Name}") 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} } if err := awsRestjson1_serializeOpHttpBindingsUpdateEnvironmentInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateEnvironmentInput(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_serializeOpHttpBindingsUpdateEnvironmentInput(v *UpdateEnvironmentInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Name == nil || len(*v.Name) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} } if v.Name != nil { if err := encoder.SetURI("Name").String(*v.Name); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateEnvironmentInput(v *UpdateEnvironmentInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AirflowConfigurationOptions != nil { ok := object.Key("AirflowConfigurationOptions") if err := awsRestjson1_serializeDocumentAirflowConfigurationOptions(v.AirflowConfigurationOptions, ok); err != nil { return err } } if v.AirflowVersion != nil { ok := object.Key("AirflowVersion") ok.String(*v.AirflowVersion) } if v.DagS3Path != nil { ok := object.Key("DagS3Path") ok.String(*v.DagS3Path) } if v.EnvironmentClass != nil { ok := object.Key("EnvironmentClass") ok.String(*v.EnvironmentClass) } if v.ExecutionRoleArn != nil { ok := object.Key("ExecutionRoleArn") ok.String(*v.ExecutionRoleArn) } if v.LoggingConfiguration != nil { ok := object.Key("LoggingConfiguration") if err := awsRestjson1_serializeDocumentLoggingConfigurationInput(v.LoggingConfiguration, ok); err != nil { return err } } if v.MaxWorkers != nil { ok := object.Key("MaxWorkers") ok.Integer(*v.MaxWorkers) } if v.MinWorkers != nil { ok := object.Key("MinWorkers") ok.Integer(*v.MinWorkers) } if v.NetworkConfiguration != nil { ok := object.Key("NetworkConfiguration") if err := awsRestjson1_serializeDocumentUpdateNetworkConfigurationInput(v.NetworkConfiguration, ok); err != nil { return err } } if v.PluginsS3ObjectVersion != nil { ok := object.Key("PluginsS3ObjectVersion") ok.String(*v.PluginsS3ObjectVersion) } if v.PluginsS3Path != nil { ok := object.Key("PluginsS3Path") ok.String(*v.PluginsS3Path) } if v.RequirementsS3ObjectVersion != nil { ok := object.Key("RequirementsS3ObjectVersion") ok.String(*v.RequirementsS3ObjectVersion) } if v.RequirementsS3Path != nil { ok := object.Key("RequirementsS3Path") ok.String(*v.RequirementsS3Path) } if v.Schedulers != nil { ok := object.Key("Schedulers") ok.Integer(*v.Schedulers) } if v.SourceBucketArn != nil { ok := object.Key("SourceBucketArn") ok.String(*v.SourceBucketArn) } if v.StartupScriptS3ObjectVersion != nil { ok := object.Key("StartupScriptS3ObjectVersion") ok.String(*v.StartupScriptS3ObjectVersion) } if v.StartupScriptS3Path != nil { ok := object.Key("StartupScriptS3Path") ok.String(*v.StartupScriptS3Path) } if len(v.WebserverAccessMode) > 0 { ok := object.Key("WebserverAccessMode") ok.String(string(v.WebserverAccessMode)) } if v.WeeklyMaintenanceWindowStart != nil { ok := object.Key("WeeklyMaintenanceWindowStart") ok.String(*v.WeeklyMaintenanceWindowStart) } return nil } func awsRestjson1_serializeDocumentAirflowConfigurationOptions(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() for key := range v { om := object.Key(key) om.String(v[key]) } return nil } func awsRestjson1_serializeDocumentDimension(v *types.Dimension, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if v.Value != nil { ok := object.Key("Value") ok.String(*v.Value) } return nil } func awsRestjson1_serializeDocumentDimensions(v []types.Dimension, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentDimension(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentLoggingConfigurationInput(v *types.LoggingConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DagProcessingLogs != nil { ok := object.Key("DagProcessingLogs") if err := awsRestjson1_serializeDocumentModuleLoggingConfigurationInput(v.DagProcessingLogs, ok); err != nil { return err } } if v.SchedulerLogs != nil { ok := object.Key("SchedulerLogs") if err := awsRestjson1_serializeDocumentModuleLoggingConfigurationInput(v.SchedulerLogs, ok); err != nil { return err } } if v.TaskLogs != nil { ok := object.Key("TaskLogs") if err := awsRestjson1_serializeDocumentModuleLoggingConfigurationInput(v.TaskLogs, ok); err != nil { return err } } if v.WebserverLogs != nil { ok := object.Key("WebserverLogs") if err := awsRestjson1_serializeDocumentModuleLoggingConfigurationInput(v.WebserverLogs, ok); err != nil { return err } } if v.WorkerLogs != nil { ok := object.Key("WorkerLogs") if err := awsRestjson1_serializeDocumentModuleLoggingConfigurationInput(v.WorkerLogs, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentMetricData(v []types.MetricDatum, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentMetricDatum(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentMetricDatum(v *types.MetricDatum, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Dimensions != nil { ok := object.Key("Dimensions") if err := awsRestjson1_serializeDocumentDimensions(v.Dimensions, ok); err != nil { return err } } if v.MetricName != nil { ok := object.Key("MetricName") ok.String(*v.MetricName) } if v.StatisticValues != nil { ok := object.Key("StatisticValues") if err := awsRestjson1_serializeDocumentStatisticSet(v.StatisticValues, ok); err != nil { return err } } if v.Timestamp != nil { ok := object.Key("Timestamp") ok.Double(smithytime.FormatEpochSeconds(*v.Timestamp)) } if len(v.Unit) > 0 { ok := object.Key("Unit") ok.String(string(v.Unit)) } if v.Value != nil { ok := object.Key("Value") switch { case math.IsNaN(*v.Value): ok.String("NaN") case math.IsInf(*v.Value, 1): ok.String("Infinity") case math.IsInf(*v.Value, -1): ok.String("-Infinity") default: ok.Double(*v.Value) } } return nil } func awsRestjson1_serializeDocumentModuleLoggingConfigurationInput(v *types.ModuleLoggingConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Enabled != nil { ok := object.Key("Enabled") ok.Boolean(*v.Enabled) } if len(v.LogLevel) > 0 { ok := object.Key("LogLevel") ok.String(string(v.LogLevel)) } return nil } func awsRestjson1_serializeDocumentNetworkConfiguration(v *types.NetworkConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SecurityGroupIds != nil { ok := object.Key("SecurityGroupIds") if err := awsRestjson1_serializeDocumentSecurityGroupList(v.SecurityGroupIds, ok); err != nil { return err } } if v.SubnetIds != nil { ok := object.Key("SubnetIds") if err := awsRestjson1_serializeDocumentSubnetList(v.SubnetIds, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentSecurityGroupList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentStatisticSet(v *types.StatisticSet, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Maximum != nil { ok := object.Key("Maximum") switch { case math.IsNaN(*v.Maximum): ok.String("NaN") case math.IsInf(*v.Maximum, 1): ok.String("Infinity") case math.IsInf(*v.Maximum, -1): ok.String("-Infinity") default: ok.Double(*v.Maximum) } } if v.Minimum != nil { ok := object.Key("Minimum") switch { case math.IsNaN(*v.Minimum): ok.String("NaN") case math.IsInf(*v.Minimum, 1): ok.String("Infinity") case math.IsInf(*v.Minimum, -1): ok.String("-Infinity") default: ok.Double(*v.Minimum) } } if v.SampleCount != nil { ok := object.Key("SampleCount") ok.Integer(*v.SampleCount) } if v.Sum != nil { ok := object.Key("Sum") switch { case math.IsNaN(*v.Sum): ok.String("NaN") case math.IsInf(*v.Sum, 1): ok.String("Infinity") case math.IsInf(*v.Sum, -1): ok.String("-Infinity") default: ok.Double(*v.Sum) } } return nil } func awsRestjson1_serializeDocumentSubnetList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() for key := range v { om := object.Key(key) om.String(v[key]) } return nil } func awsRestjson1_serializeDocumentUpdateNetworkConfigurationInput(v *types.UpdateNetworkConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SecurityGroupIds != nil { ok := object.Key("SecurityGroupIds") if err := awsRestjson1_serializeDocumentSecurityGroupList(v.SecurityGroupIds, ok); err != nil { return err } } return nil }
1,262
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package mwaa import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/mwaa/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpCreateCliToken struct { } func (*validateOpCreateCliToken) ID() string { return "OperationInputValidation" } func (m *validateOpCreateCliToken) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateCliTokenInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateCliTokenInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateEnvironment struct { } func (*validateOpCreateEnvironment) ID() string { return "OperationInputValidation" } func (m *validateOpCreateEnvironment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateEnvironmentInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateEnvironmentInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateWebLoginToken struct { } func (*validateOpCreateWebLoginToken) ID() string { return "OperationInputValidation" } func (m *validateOpCreateWebLoginToken) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateWebLoginTokenInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateWebLoginTokenInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteEnvironment struct { } func (*validateOpDeleteEnvironment) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteEnvironment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteEnvironmentInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteEnvironmentInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetEnvironment struct { } func (*validateOpGetEnvironment) ID() string { return "OperationInputValidation" } func (m *validateOpGetEnvironment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetEnvironmentInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetEnvironmentInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListTagsForResource struct { } func (*validateOpListTagsForResource) ID() string { return "OperationInputValidation" } func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListTagsForResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListTagsForResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpPublishMetrics struct { } func (*validateOpPublishMetrics) ID() string { return "OperationInputValidation" } func (m *validateOpPublishMetrics) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*PublishMetricsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpPublishMetricsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpTagResource struct { } func (*validateOpTagResource) ID() string { return "OperationInputValidation" } func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*TagResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpTagResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUntagResource struct { } func (*validateOpUntagResource) ID() string { return "OperationInputValidation" } func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UntagResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUntagResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateEnvironment struct { } func (*validateOpUpdateEnvironment) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateEnvironment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateEnvironmentInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateEnvironmentInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpCreateCliTokenValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateCliToken{}, middleware.After) } func addOpCreateEnvironmentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateEnvironment{}, middleware.After) } func addOpCreateWebLoginTokenValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateWebLoginToken{}, middleware.After) } func addOpDeleteEnvironmentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteEnvironment{}, middleware.After) } func addOpGetEnvironmentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetEnvironment{}, middleware.After) } func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } func addOpPublishMetricsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPublishMetrics{}, middleware.After) } func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } func addOpUpdateEnvironmentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateEnvironment{}, middleware.After) } func validateDimension(v *types.Dimension) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Dimension"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.Value == nil { invalidParams.Add(smithy.NewErrParamRequired("Value")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateDimensions(v []types.Dimension) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Dimensions"} for i := range v { if err := validateDimension(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateLoggingConfigurationInput(v *types.LoggingConfigurationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "LoggingConfigurationInput"} if v.DagProcessingLogs != nil { if err := validateModuleLoggingConfigurationInput(v.DagProcessingLogs); err != nil { invalidParams.AddNested("DagProcessingLogs", err.(smithy.InvalidParamsError)) } } if v.SchedulerLogs != nil { if err := validateModuleLoggingConfigurationInput(v.SchedulerLogs); err != nil { invalidParams.AddNested("SchedulerLogs", err.(smithy.InvalidParamsError)) } } if v.WebserverLogs != nil { if err := validateModuleLoggingConfigurationInput(v.WebserverLogs); err != nil { invalidParams.AddNested("WebserverLogs", err.(smithy.InvalidParamsError)) } } if v.WorkerLogs != nil { if err := validateModuleLoggingConfigurationInput(v.WorkerLogs); err != nil { invalidParams.AddNested("WorkerLogs", err.(smithy.InvalidParamsError)) } } if v.TaskLogs != nil { if err := validateModuleLoggingConfigurationInput(v.TaskLogs); err != nil { invalidParams.AddNested("TaskLogs", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateMetricData(v []types.MetricDatum) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "MetricData"} for i := range v { if err := validateMetricDatum(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateMetricDatum(v *types.MetricDatum) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "MetricDatum"} if v.MetricName == nil { invalidParams.Add(smithy.NewErrParamRequired("MetricName")) } if v.Timestamp == nil { invalidParams.Add(smithy.NewErrParamRequired("Timestamp")) } if v.Dimensions != nil { if err := validateDimensions(v.Dimensions); err != nil { invalidParams.AddNested("Dimensions", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateModuleLoggingConfigurationInput(v *types.ModuleLoggingConfigurationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ModuleLoggingConfigurationInput"} if v.Enabled == nil { invalidParams.Add(smithy.NewErrParamRequired("Enabled")) } if len(v.LogLevel) == 0 { invalidParams.Add(smithy.NewErrParamRequired("LogLevel")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateUpdateNetworkConfigurationInput(v *types.UpdateNetworkConfigurationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateNetworkConfigurationInput"} if v.SecurityGroupIds == nil { invalidParams.Add(smithy.NewErrParamRequired("SecurityGroupIds")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateCliTokenInput(v *CreateCliTokenInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateCliTokenInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateEnvironmentInput(v *CreateEnvironmentInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateEnvironmentInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.ExecutionRoleArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ExecutionRoleArn")) } if v.SourceBucketArn == nil { invalidParams.Add(smithy.NewErrParamRequired("SourceBucketArn")) } if v.DagS3Path == nil { invalidParams.Add(smithy.NewErrParamRequired("DagS3Path")) } if v.NetworkConfiguration == nil { invalidParams.Add(smithy.NewErrParamRequired("NetworkConfiguration")) } if v.LoggingConfiguration != nil { if err := validateLoggingConfigurationInput(v.LoggingConfiguration); err != nil { invalidParams.AddNested("LoggingConfiguration", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateWebLoginTokenInput(v *CreateWebLoginTokenInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateWebLoginTokenInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteEnvironmentInput(v *DeleteEnvironmentInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteEnvironmentInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetEnvironmentInput(v *GetEnvironmentInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetEnvironmentInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpPublishMetricsInput(v *PublishMetricsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PublishMetricsInput"} if v.EnvironmentName == nil { invalidParams.Add(smithy.NewErrParamRequired("EnvironmentName")) } if v.MetricData == nil { invalidParams.Add(smithy.NewErrParamRequired("MetricData")) } else if v.MetricData != nil { if err := validateMetricData(v.MetricData); err != nil { invalidParams.AddNested("MetricData", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if v.Tags == nil { invalidParams.Add(smithy.NewErrParamRequired("Tags")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUntagResourceInput(v *UntagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if v.TagKeys == nil { invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateEnvironmentInput(v *UpdateEnvironmentInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateEnvironmentInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.NetworkConfiguration != nil { if err := validateUpdateNetworkConfigurationInput(v.NetworkConfiguration); err != nil { invalidParams.AddNested("NetworkConfiguration", err.(smithy.InvalidParamsError)) } } if v.LoggingConfiguration != nil { if err := validateLoggingConfigurationInput(v.LoggingConfiguration); err != nil { invalidParams.AddNested("LoggingConfiguration", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
587
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package endpoints import ( "github.com/aws/aws-sdk-go-v2/aws" endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" "github.com/aws/smithy-go/logging" "regexp" ) // Options is the endpoint resolver configuration options type Options struct { // Logger is a logging implementation that log events should be sent to. Logger logging.Logger // LogDeprecated indicates that deprecated endpoints should be logged to the // provided logger. LogDeprecated bool // ResolvedRegion is used to override the region to be resolved, rather then the // using the value passed to the ResolveEndpoint method. This value is used by the // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative // name. You must not set this value directly in your application. ResolvedRegion string // DisableHTTPS informs the resolver to return an endpoint that does not use the // HTTPS scheme. DisableHTTPS bool // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. UseDualStackEndpoint aws.DualStackEndpointState // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. UseFIPSEndpoint aws.FIPSEndpointState } func (o Options) GetResolvedRegion() string { return o.ResolvedRegion } func (o Options) GetDisableHTTPS() bool { return o.DisableHTTPS } func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { return o.UseDualStackEndpoint } func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { return o.UseFIPSEndpoint } func transformToSharedOptions(options Options) endpoints.Options { return endpoints.Options{ Logger: options.Logger, LogDeprecated: options.LogDeprecated, ResolvedRegion: options.ResolvedRegion, DisableHTTPS: options.DisableHTTPS, UseDualStackEndpoint: options.UseDualStackEndpoint, UseFIPSEndpoint: options.UseFIPSEndpoint, } } // Resolver MWAA endpoint resolver type Resolver struct { partitions endpoints.Partitions } // ResolveEndpoint resolves the service endpoint for the given region and options func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { if len(region) == 0 { return endpoint, &aws.MissingRegionError{} } opt := transformToSharedOptions(options) return r.partitions.ResolveEndpoint(region, opt) } // New returns a new Resolver func New() *Resolver { return &Resolver{ partitions: defaultPartitions, } } var partitionRegexp = struct { Aws *regexp.Regexp AwsCn *regexp.Regexp AwsIso *regexp.Regexp AwsIsoB *regexp.Regexp AwsIsoE *regexp.Regexp AwsIsoF *regexp.Regexp AwsUsGov *regexp.Regexp }{ Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), } var defaultPartitions = endpoints.Partitions{ { ID: "aws", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "airflow.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "airflow-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "airflow-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "airflow.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "sa-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "airflow.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "airflow-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "airflow-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "airflow.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsCn, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "cn-north-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "cn-northwest-1", }: endpoints.Endpoint{}, }, }, { ID: "aws-iso", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "airflow-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "airflow.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIso, IsRegionalized: true, }, { ID: "aws-iso-b", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "airflow-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "airflow.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIsoB, IsRegionalized: true, }, { ID: "aws-iso-e", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "airflow-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "airflow.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIsoE, IsRegionalized: true, }, { ID: "aws-iso-f", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "airflow-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "airflow.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsIsoF, IsRegionalized: true, }, { ID: "aws-us-gov", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "airflow.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "airflow-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "airflow-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "airflow.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, }, }
352
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package endpoints import ( "testing" ) func TestRegexCompile(t *testing.T) { _ = defaultPartitions }
12
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types type EnvironmentStatus string // Enum values for EnvironmentStatus const ( EnvironmentStatusCreating EnvironmentStatus = "CREATING" EnvironmentStatusCreateFailed EnvironmentStatus = "CREATE_FAILED" EnvironmentStatusAvailable EnvironmentStatus = "AVAILABLE" EnvironmentStatusUpdating EnvironmentStatus = "UPDATING" EnvironmentStatusDeleting EnvironmentStatus = "DELETING" EnvironmentStatusDeleted EnvironmentStatus = "DELETED" EnvironmentStatusUnavailable EnvironmentStatus = "UNAVAILABLE" EnvironmentStatusUpdateFailed EnvironmentStatus = "UPDATE_FAILED" EnvironmentStatusRollingBack EnvironmentStatus = "ROLLING_BACK" EnvironmentStatusCreatingSnapshot EnvironmentStatus = "CREATING_SNAPSHOT" ) // Values returns all known values for EnvironmentStatus. 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 (EnvironmentStatus) Values() []EnvironmentStatus { return []EnvironmentStatus{ "CREATING", "CREATE_FAILED", "AVAILABLE", "UPDATING", "DELETING", "DELETED", "UNAVAILABLE", "UPDATE_FAILED", "ROLLING_BACK", "CREATING_SNAPSHOT", } } type LoggingLevel string // Enum values for LoggingLevel const ( LoggingLevelCritical LoggingLevel = "CRITICAL" LoggingLevelError LoggingLevel = "ERROR" LoggingLevelWarning LoggingLevel = "WARNING" LoggingLevelInfo LoggingLevel = "INFO" LoggingLevelDebug LoggingLevel = "DEBUG" ) // Values returns all known values for LoggingLevel. 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 (LoggingLevel) Values() []LoggingLevel { return []LoggingLevel{ "CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG", } } type Unit string // Enum values for Unit const ( UnitSeconds Unit = "Seconds" UnitMicroseconds Unit = "Microseconds" UnitMilliseconds Unit = "Milliseconds" UnitBytes Unit = "Bytes" UnitKilobytes Unit = "Kilobytes" UnitMegabytes Unit = "Megabytes" UnitGigabytes Unit = "Gigabytes" UnitTerabytes Unit = "Terabytes" UnitBits Unit = "Bits" UnitKilobits Unit = "Kilobits" UnitMegabits Unit = "Megabits" UnitGigabits Unit = "Gigabits" UnitTerabits Unit = "Terabits" UnitPercent Unit = "Percent" UnitCount Unit = "Count" UnitBytesPerSecond Unit = "Bytes/Second" UnitKilobytesPerSecond Unit = "Kilobytes/Second" UnitMegabytesPerSecond Unit = "Megabytes/Second" UnitGigabytesPerSecond Unit = "Gigabytes/Second" UnitTerabytesPerSecond Unit = "Terabytes/Second" UnitBitsPerSecond Unit = "Bits/Second" UnitKilobitsPerSecond Unit = "Kilobits/Second" UnitMegabitsPerSecond Unit = "Megabits/Second" UnitGigabitsPerSecond Unit = "Gigabits/Second" UnitTerabitsPerSecond Unit = "Terabits/Second" UnitCountPerSecond Unit = "Count/Second" UnitNone Unit = "None" ) // Values returns all known values for Unit. 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 (Unit) Values() []Unit { return []Unit{ "Seconds", "Microseconds", "Milliseconds", "Bytes", "Kilobytes", "Megabytes", "Gigabytes", "Terabytes", "Bits", "Kilobits", "Megabits", "Gigabits", "Terabits", "Percent", "Count", "Bytes/Second", "Kilobytes/Second", "Megabytes/Second", "Gigabytes/Second", "Terabytes/Second", "Bits/Second", "Kilobits/Second", "Megabits/Second", "Gigabits/Second", "Terabits/Second", "Count/Second", "None", } } type UpdateStatus string // Enum values for UpdateStatus const ( UpdateStatusSuccess UpdateStatus = "SUCCESS" UpdateStatusPending UpdateStatus = "PENDING" UpdateStatusFailed UpdateStatus = "FAILED" ) // Values returns all known values for UpdateStatus. 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 (UpdateStatus) Values() []UpdateStatus { return []UpdateStatus{ "SUCCESS", "PENDING", "FAILED", } } type WebserverAccessMode string // Enum values for WebserverAccessMode const ( WebserverAccessModePrivateOnly WebserverAccessMode = "PRIVATE_ONLY" WebserverAccessModePublicOnly WebserverAccessMode = "PUBLIC_ONLY" ) // Values returns all known values for WebserverAccessMode. 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 (WebserverAccessMode) Values() []WebserverAccessMode { return []WebserverAccessMode{ "PRIVATE_ONLY", "PUBLIC_ONLY", } }
168
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( "fmt" smithy "github.com/aws/smithy-go" ) // Access to the Apache Airflow Web UI or CLI has been denied due to insufficient // permissions. To learn more, see Accessing an Amazon MWAA environment (https://docs.aws.amazon.com/mwaa/latest/userguide/access-policies.html) // . type AccessDeniedException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *AccessDeniedException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *AccessDeniedException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *AccessDeniedException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AccessDeniedException" } return *e.ErrorCodeOverride } func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // InternalServerException: An internal error has occurred. type InternalServerException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InternalServerException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InternalServerException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InternalServerException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InternalServerException" } return *e.ErrorCodeOverride } func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // ResourceNotFoundException: The resource is not available. type ResourceNotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ResourceNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ResourceNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ResourceNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ResourceNotFoundException" } return *e.ErrorCodeOverride } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // ValidationException: The provided input is not valid. type ValidationException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ValidationException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ValidationException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ValidationException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ValidationException" } return *e.ErrorCodeOverride } func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
115
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( smithydocument "github.com/aws/smithy-go/document" "time" ) // Internal only. Represents the dimensions of a metric. To learn more about the // metrics published to Amazon CloudWatch, see Amazon MWAA performance metrics in // Amazon CloudWatch (https://docs.aws.amazon.com/mwaa/latest/userguide/cw-metrics.html) // . type Dimension struct { // Internal only. The name of the dimension. // // This member is required. Name *string // Internal only. The value of the dimension. // // This member is required. Value *string noSmithyDocumentSerde } // Describes an Amazon Managed Workflows for Apache Airflow (MWAA) environment. type Environment struct { // A list of key-value pairs containing the Apache Airflow configuration options // attached to your environment. For more information, see Apache Airflow // configuration options (https://docs.aws.amazon.com/mwaa/latest/userguide/configuring-env-variables.html) // . AirflowConfigurationOptions map[string]string // The Apache Airflow version on your environment. Valid values: 1.10.12 , 2.0.2 , // 2.2.2 , 2.4.3 , and 2.5.1 . AirflowVersion *string // The Amazon Resource Name (ARN) of the Amazon MWAA environment. Arn *string // The day and time the environment was created. CreatedAt *time.Time // The relative path to the DAGs folder in your Amazon S3 bucket. For example, // s3://mwaa-environment/dags . For more information, see Adding or updating DAGs (https://docs.aws.amazon.com/mwaa/latest/userguide/configuring-dag-folder.html) // . DagS3Path *string // The environment class type. Valid values: mw1.small , mw1.medium , mw1.large . // For more information, see Amazon MWAA environment class (https://docs.aws.amazon.com/mwaa/latest/userguide/environment-class.html) // . EnvironmentClass *string // The Amazon Resource Name (ARN) of the execution role in IAM that allows MWAA to // access Amazon Web Services resources in your environment. For example, // arn:aws:iam::123456789:role/my-execution-role . For more information, see // Amazon MWAA Execution role (https://docs.aws.amazon.com/mwaa/latest/userguide/mwaa-create-role.html) // . ExecutionRoleArn *string // The Amazon Web Services Key Management Service (KMS) encryption key used to // encrypt the data in your environment. KmsKey *string // The status of the last update on the environment. LastUpdate *LastUpdate // The Apache Airflow logs published to CloudWatch Logs. LoggingConfiguration *LoggingConfiguration // The maximum number of workers that run in your environment. For example, 20 . MaxWorkers *int32 // The minimum number of workers that run in your environment. For example, 2 . MinWorkers *int32 // The name of the Amazon MWAA environment. For example, MyMWAAEnvironment . Name *string // Describes the VPC networking components used to secure and enable network // traffic between the Amazon Web Services resources for your environment. For more // information, see About networking on Amazon MWAA (https://docs.aws.amazon.com/mwaa/latest/userguide/networking-about.html) // . NetworkConfiguration *NetworkConfiguration // The version of the plugins.zip file in your Amazon S3 bucket. You must specify // the version ID (https://docs.aws.amazon.com/AmazonS3/latest/userguide/versioning-workflows.html) // that Amazon S3 assigns to the file. Version IDs are Unicode, UTF-8 encoded, // URL-ready, opaque strings that are no more than 1,024 bytes long. The following // is an example: 3sL4kqtJlcpXroDTDmJ+rmSpXd3dIbrHY+MTRCxf3vjVBH40Nr8X8gdRQBpUMLUo // For more information, see Installing custom plugins (https://docs.aws.amazon.com/mwaa/latest/userguide/configuring-dag-import-plugins.html) // . PluginsS3ObjectVersion *string // The relative path to the file in your Amazon S3 bucket. For example, // s3://mwaa-environment/plugins.zip . For more information, see Installing custom // plugins (https://docs.aws.amazon.com/mwaa/latest/userguide/configuring-dag-import-plugins.html) // . PluginsS3Path *string // The version of the requirements.txt file on your Amazon S3 bucket. You must // specify the version ID (https://docs.aws.amazon.com/AmazonS3/latest/userguide/versioning-workflows.html) // that Amazon S3 assigns to the file. Version IDs are Unicode, UTF-8 encoded, // URL-ready, opaque strings that are no more than 1,024 bytes long. The following // is an example: 3sL4kqtJlcpXroDTDmJ+rmSpXd3dIbrHY+MTRCxf3vjVBH40Nr8X8gdRQBpUMLUo // For more information, see Installing Python dependencies (https://docs.aws.amazon.com/mwaa/latest/userguide/working-dags-dependencies.html) // . RequirementsS3ObjectVersion *string // The relative path to the requirements.txt file in your Amazon S3 bucket. For // example, s3://mwaa-environment/requirements.txt . For more information, see // Installing Python dependencies (https://docs.aws.amazon.com/mwaa/latest/userguide/working-dags-dependencies.html) // . RequirementsS3Path *string // The number of Apache Airflow schedulers that run in your Amazon MWAA // environment. Schedulers *int32 // The Amazon Resource Name (ARN) for the service-linked role of the environment. // For more information, see Amazon MWAA Service-linked role (https://docs.aws.amazon.com/mwaa/latest/userguide/mwaa-slr.html) // . ServiceRoleArn *string // The Amazon Resource Name (ARN) of the Amazon S3 bucket where your DAG code and // supporting files are stored. For example, // arn:aws:s3:::my-airflow-bucket-unique-name . For more information, see Create // an Amazon S3 bucket for Amazon MWAA (https://docs.aws.amazon.com/mwaa/latest/userguide/mwaa-s3-bucket.html) // . SourceBucketArn *string // The version of the startup shell script in your Amazon S3 bucket. You must // specify the version ID (https://docs.aws.amazon.com/AmazonS3/latest/userguide/versioning-workflows.html) // that Amazon S3 assigns to the file. Version IDs are Unicode, UTF-8 encoded, // URL-ready, opaque strings that are no more than 1,024 bytes long. The following // is an example: 3sL4kqtJlcpXroDTDmJ+rmSpXd3dIbrHY+MTRCxf3vjVBH40Nr8X8gdRQBpUMLUo // For more information, see Using a startup script (https://docs.aws.amazon.com/mwaa/latest/userguide/using-startup-script.html) // . StartupScriptS3ObjectVersion *string // The relative path to the startup shell script in your Amazon S3 bucket. For // example, s3://mwaa-environment/startup.sh . Amazon MWAA runs the script as your // environment starts, and before running the Apache Airflow process. You can use // this script to install dependencies, modify Apache Airflow configuration // options, and set environment variables. For more information, see Using a // startup script (https://docs.aws.amazon.com/mwaa/latest/userguide/using-startup-script.html) // . StartupScriptS3Path *string // The status of the Amazon MWAA environment. Valid values: // - CREATING - Indicates the request to create the environment is in progress. // - CREATING_SNAPSHOT - Indicates the request to update environment details, or // upgrade the environment version, is in progress and Amazon MWAA is creating a // storage volume snapshot of the Amazon RDS database cluster associated with the // environment. A database snapshot is a backup created at a specific point in // time. Amazon MWAA uses snapshots to recover environment metadata if the process // to update or upgrade an environment fails. // - CREATE_FAILED - Indicates the request to create the environment failed, and // the environment could not be created. // - AVAILABLE - Indicates the request was successful and the environment is // ready to use. // - UPDATING - Indicates the request to update the environment is in progress. // - ROLLING_BACK - Indicates the request to update environment details, or // upgrade the environment version, failed and Amazon MWAA is restoring the // environment using the latest storage volume snapshot. // - DELETING - Indicates the request to delete the environment is in progress. // - DELETED - Indicates the request to delete the environment is complete, and // the environment has been deleted. // - UNAVAILABLE - Indicates the request failed, but the environment was unable // to rollback and is not in a stable state. // - UPDATE_FAILED - Indicates the request to update the environment failed, and // the environment has rolled back successfully and is ready to use. // We recommend reviewing our troubleshooting guide for a list of common errors // and their solutions. For more information, see Amazon MWAA troubleshooting (https://docs.aws.amazon.com/mwaa/latest/userguide/troubleshooting.html) // . Status EnvironmentStatus // The key-value tag pairs associated to your environment. For example, // "Environment": "Staging" . For more information, see Tagging Amazon Web // Services resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) // . Tags map[string]string // The Apache Airflow Web server access mode. For more information, see Apache // Airflow access modes (https://docs.aws.amazon.com/mwaa/latest/userguide/configuring-networking.html) // . WebserverAccessMode WebserverAccessMode // The Apache Airflow Web server host name for the Amazon MWAA environment. For // more information, see Accessing the Apache Airflow UI (https://docs.aws.amazon.com/mwaa/latest/userguide/access-airflow-ui.html) // . WebserverUrl *string // The day and time of the week in Coordinated Universal Time (UTC) 24-hour // standard time that weekly maintenance updates are scheduled. For example: // TUE:03:30 . WeeklyMaintenanceWindowStart *string noSmithyDocumentSerde } // Describes the status of the last update on the environment, and any errors that // were encountered. type LastUpdate struct { // The day and time of the last update on the environment. CreatedAt *time.Time // The error that was encountered during the last update of the environment. Error *UpdateError // The source of the last update to the environment. Includes internal processes // by Amazon MWAA, such as an environment maintenance update. Source *string // The status of the last update on the environment. Status UpdateStatus noSmithyDocumentSerde } // Describes the Apache Airflow log types that are published to CloudWatch Logs. type LoggingConfiguration struct { // The Airflow DAG processing logs published to CloudWatch Logs and the log level. DagProcessingLogs *ModuleLoggingConfiguration // The Airflow scheduler logs published to CloudWatch Logs and the log level. SchedulerLogs *ModuleLoggingConfiguration // The Airflow task logs published to CloudWatch Logs and the log level. TaskLogs *ModuleLoggingConfiguration // The Airflow web server logs published to CloudWatch Logs and the log level. WebserverLogs *ModuleLoggingConfiguration // The Airflow worker logs published to CloudWatch Logs and the log level. WorkerLogs *ModuleLoggingConfiguration noSmithyDocumentSerde } // Defines the Apache Airflow log types to send to CloudWatch Logs. type LoggingConfigurationInput struct { // Publishes Airflow DAG processing logs to CloudWatch Logs. DagProcessingLogs *ModuleLoggingConfigurationInput // Publishes Airflow scheduler logs to CloudWatch Logs. SchedulerLogs *ModuleLoggingConfigurationInput // Publishes Airflow task logs to CloudWatch Logs. TaskLogs *ModuleLoggingConfigurationInput // Publishes Airflow web server logs to CloudWatch Logs. WebserverLogs *ModuleLoggingConfigurationInput // Publishes Airflow worker logs to CloudWatch Logs. WorkerLogs *ModuleLoggingConfigurationInput noSmithyDocumentSerde } // Internal only. Collects Apache Airflow metrics. To learn more about the metrics // published to Amazon CloudWatch, see Amazon MWAA performance metrics in Amazon // CloudWatch (https://docs.aws.amazon.com/mwaa/latest/userguide/cw-metrics.html) . type MetricDatum struct { // Internal only. The name of the metric. // // This member is required. MetricName *string // Internal only. The time the metric data was received. // // This member is required. Timestamp *time.Time // Internal only. The dimensions associated with the metric. Dimensions []Dimension // Internal only. The statistical values for the metric. StatisticValues *StatisticSet // Internal only. The unit used to store the metric. Unit Unit // Internal only. The value for the metric. Value *float64 noSmithyDocumentSerde } // Describes the Apache Airflow log details for the log type (e.g. // DagProcessingLogs ). type ModuleLoggingConfiguration struct { // The Amazon Resource Name (ARN) for the CloudWatch Logs group where the Apache // Airflow log type (e.g. DagProcessingLogs ) is published. For example, // arn:aws:logs:us-east-1:123456789012:log-group:airflow-MyMWAAEnvironment-MwaaEnvironment-DAGProcessing:* // . CloudWatchLogGroupArn *string // Indicates whether the Apache Airflow log type (e.g. DagProcessingLogs ) is // enabled. Enabled *bool // The Apache Airflow log level for the log type (e.g. DagProcessingLogs ). LogLevel LoggingLevel noSmithyDocumentSerde } // Enables the Apache Airflow log type (e.g. DagProcessingLogs ) and defines the // log level to send to CloudWatch Logs (e.g. INFO ). type ModuleLoggingConfigurationInput struct { // Indicates whether to enable the Apache Airflow log type (e.g. DagProcessingLogs // ). // // This member is required. Enabled *bool // Defines the Apache Airflow log level (e.g. INFO ) to send to CloudWatch Logs. // // This member is required. LogLevel LoggingLevel noSmithyDocumentSerde } // Describes the VPC networking components used to secure and enable network // traffic between the Amazon Web Services resources for your environment. For more // information, see About networking on Amazon MWAA (https://docs.aws.amazon.com/mwaa/latest/userguide/networking-about.html) // . type NetworkConfiguration struct { // A list of security group IDs. For more information, see Security in your VPC on // Amazon MWAA (https://docs.aws.amazon.com/mwaa/latest/userguide/vpc-security.html) // . SecurityGroupIds []string // A list of subnet IDs. For more information, see About networking on Amazon MWAA (https://docs.aws.amazon.com/mwaa/latest/userguide/networking-about.html) // . SubnetIds []string noSmithyDocumentSerde } // Internal only. Represents a set of statistics that describe a specific metric. // To learn more about the metrics published to Amazon CloudWatch, see Amazon MWAA // performance metrics in Amazon CloudWatch (https://docs.aws.amazon.com/mwaa/latest/userguide/cw-metrics.html) // . type StatisticSet struct { // Internal only. The maximum value of the sample set. Maximum *float64 // Internal only. The minimum value of the sample set. Minimum *float64 // Internal only. The number of samples used for the statistic set. SampleCount *int32 // Internal only. The sum of values for the sample set. Sum *float64 noSmithyDocumentSerde } // Describes the error(s) encountered with the last update of the environment. type UpdateError struct { // The error code that corresponds to the error with the last update. ErrorCode *string // The error message that corresponds to the error code. ErrorMessage *string noSmithyDocumentSerde } // Defines the VPC networking components used to secure and enable network traffic // between the Amazon Web Services resources for your environment. For more // information, see About networking on Amazon MWAA (https://docs.aws.amazon.com/mwaa/latest/userguide/networking-about.html) // . type UpdateNetworkConfigurationInput struct { // A list of security group IDs. A security group must be attached to the same VPC // as the subnets. For more information, see Security in your VPC on Amazon MWAA (https://docs.aws.amazon.com/mwaa/latest/userguide/vpc-security.html) // . // // This member is required. SecurityGroupIds []string noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
404
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/defaults" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/protocol/query" "github.com/aws/aws-sdk-go-v2/aws/retry" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" presignedurlcust "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url" smithy "github.com/aws/smithy-go" smithydocument "github.com/aws/smithy-go/document" "github.com/aws/smithy-go/logging" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "net" "net/http" "time" ) const ServiceID = "Neptune" const ServiceAPIVersion = "2014-10-31" // Client provides the API client to make operations call for Amazon Neptune. type Client struct { options Options } // New returns an initialized Client based on the functional options. Provide // additional functional options to further configure the behavior of the client, // such as changing the client's endpoint or adding custom middleware behavior. func New(options Options, optFns ...func(*Options)) *Client { options = options.Copy() resolveDefaultLogger(&options) setResolvedDefaultsMode(&options) resolveRetryer(&options) resolveHTTPClient(&options) resolveHTTPSignerV4(&options) resolveDefaultEndpointConfiguration(&options) for _, fn := range optFns { fn(&options) } client := &Client{ options: options, } return client } type Options struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error // Configures the events that will be sent to the configured logger. ClientLogMode aws.ClientLogMode // The credentials object to use when signing requests. Credentials aws.CredentialsProvider // The configuration DefaultsMode that the SDK should use when constructing the // clients initial default settings. DefaultsMode aws.DefaultsMode // The endpoint options to be used when attempting to resolve an endpoint. EndpointOptions EndpointResolverOptions // The service endpoint resolver. EndpointResolver EndpointResolver // Signature Version 4 (SigV4) Signer HTTPSignerV4 HTTPSignerV4 // The logger writer interface to write logging messages to. Logger logging.Logger // The region to send requests to. (Required) Region string // RetryMaxAttempts specifies the maximum number attempts an API client will call // an operation that fails with a retryable error. A value of 0 is ignored, and // will not be used to configure the API client created default retryer, or modify // per operation call's retry max attempts. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. If specified in an operation call's functional // options with a value that is different than the constructed client's Options, // the Client's Retryer will be wrapped to use the operation's specific // RetryMaxAttempts value. RetryMaxAttempts int // RetryMode specifies the retry mode the API client will be created with, if // Retryer option is not also specified. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. Currently does not support per operation call // overrides, may in the future. RetryMode aws.RetryMode // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. The kind of // default retry created by the API client can be changed with the RetryMode // option. Retryer aws.Retryer // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You // should not populate this structure programmatically, or rely on the values here // within your applications. RuntimeEnvironment aws.RuntimeEnvironment // The initial DefaultsMode used when the client options were constructed. If the // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved // value was at that point in time. Currently does not support per operation call // overrides, may in the future. resolvedDefaultsMode aws.DefaultsMode // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. HTTPClient HTTPClient } // WithAPIOptions returns a functional option for setting the Client's APIOptions // option. func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { return func(o *Options) { o.APIOptions = append(o.APIOptions, optFns...) } } // WithEndpointResolver returns a functional option for setting the Client's // EndpointResolver option. func WithEndpointResolver(v EndpointResolver) func(*Options) { return func(o *Options) { o.EndpointResolver = v } } type HTTPClient interface { Do(*http.Request) (*http.Response, error) } // Copy creates a clone where the APIOptions list is deep copied. func (o Options) Copy() Options { to := o to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) copy(to.APIOptions, o.APIOptions) return to } func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { ctx = middleware.ClearStackValues(ctx) stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) options := c.options.Copy() for _, fn := range optFns { fn(&options) } finalizeRetryMaxAttemptOptions(&options, *c) finalizeClientEndpointResolverOptions(&options) for _, fn := range stackFns { if err := fn(stack, options); err != nil { return nil, metadata, err } } for _, fn := range options.APIOptions { if err := fn(stack); err != nil { return nil, metadata, err } } handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) result, metadata, err = handler.Handle(ctx, params) if err != nil { err = &smithy.OperationError{ ServiceID: ServiceID, OperationName: opID, Err: err, } } return result, metadata, err } type noSmithyDocumentSerde = smithydocument.NoSerde func resolveDefaultLogger(o *Options) { if o.Logger != nil { return } o.Logger = logging.Nop{} } func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { return middleware.AddSetLoggerMiddleware(stack, o.Logger) } func setResolvedDefaultsMode(o *Options) { if len(o.resolvedDefaultsMode) > 0 { return } var mode aws.DefaultsMode mode.SetFromString(string(o.DefaultsMode)) if mode == aws.DefaultsModeAuto { mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) } o.resolvedDefaultsMode = mode } // NewFromConfig returns a new client from the provided config. func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, DefaultsMode: cfg.DefaultsMode, RuntimeEnvironment: cfg.RuntimeEnvironment, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } resolveAWSRetryerProvider(cfg, &opts) resolveAWSRetryMaxAttempts(cfg, &opts) resolveAWSRetryMode(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) return New(opts, optFns...) } func resolveHTTPClient(o *Options) { var buildable *awshttp.BuildableClient if o.HTTPClient != nil { var ok bool buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) if !ok { return } } else { buildable = awshttp.NewBuildableClient() } modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { dialer.Timeout = dialerTimeout } }) buildable = buildable.WithTransportOptions(func(transport *http.Transport) { if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { transport.TLSHandshakeTimeout = tlsHandshakeTimeout } }) } o.HTTPClient = buildable } func resolveRetryer(o *Options) { if o.Retryer != nil { return } if len(o.RetryMode) == 0 { modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { o.RetryMode = modeConfig.RetryMode } } if len(o.RetryMode) == 0 { o.RetryMode = aws.RetryModeStandard } var standardOptions []func(*retry.StandardOptions) if v := o.RetryMaxAttempts; v != 0 { standardOptions = append(standardOptions, func(so *retry.StandardOptions) { so.MaxAttempts = v }) } switch o.RetryMode { case aws.RetryModeAdaptive: var adaptiveOptions []func(*retry.AdaptiveModeOptions) if len(standardOptions) != 0 { adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { ao.StandardOptions = append(ao.StandardOptions, standardOptions...) }) } o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) default: o.Retryer = retry.NewStandard(standardOptions...) } } func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { if cfg.Retryer == nil { return } o.Retryer = cfg.Retryer() } func resolveAWSRetryMode(cfg aws.Config, o *Options) { if len(cfg.RetryMode) == 0 { return } o.RetryMode = cfg.RetryMode } func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { if cfg.RetryMaxAttempts == 0 { return } o.RetryMaxAttempts = cfg.RetryMaxAttempts } func finalizeRetryMaxAttemptOptions(o *Options, client Client) { if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { return } o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) } func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { return } o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) } func addClientUserAgent(stack *middleware.Stack) error { return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "neptune", goModuleVersion)(stack) } func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ CredentialsProvider: o.Credentials, Signer: o.HTTPSignerV4, LogSigning: o.ClientLogMode.IsSigning(), }) return stack.Finalize.Add(mw, middleware.After) } type HTTPSignerV4 interface { SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error } func resolveHTTPSignerV4(o *Options) { if o.HTTPSignerV4 != nil { return } o.HTTPSignerV4 = newDefaultV4Signer(*o) } func newDefaultV4Signer(o Options) *v4.Signer { return v4.NewSigner(func(so *v4.SignerOptions) { so.Logger = o.Logger so.LogSigning = o.ClientLogMode.IsSigning() }) } func addRetryMiddlewares(stack *middleware.Stack, o Options) error { mo := retry.AddRetryMiddlewaresOptions{ Retryer: o.Retryer, LogRetryAttempts: o.ClientLogMode.IsRetries(), } return retry.AddRetryMiddlewares(stack, mo) } // resolves dual-stack endpoint configuration func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseDualStackEndpoint = value } return nil } // resolves FIPS endpoint configuration func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseFIPSEndpoint = value } return nil } func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) } func addResponseErrorMiddleware(stack *middleware.Stack) error { return awshttp.AddResponseErrorMiddleware(stack) } // HTTPPresignerV4 represents presigner interface used by presign url client type HTTPPresignerV4 interface { PresignHTTP( ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions), ) (url string, signedHeader http.Header, err error) } // PresignOptions represents the presign client options type PresignOptions struct { // ClientOptions are list of functional options to mutate client options used by // the presign client. ClientOptions []func(*Options) // Presigner is the presigner used by the presign url client Presigner HTTPPresignerV4 } func (o PresignOptions) copy() PresignOptions { clientOptions := make([]func(*Options), len(o.ClientOptions)) copy(clientOptions, o.ClientOptions) o.ClientOptions = clientOptions return o } // WithPresignClientFromClientOptions is a helper utility to retrieve a function // that takes PresignOption as input func WithPresignClientFromClientOptions(optFns ...func(*Options)) func(*PresignOptions) { return withPresignClientFromClientOptions(optFns).options } type withPresignClientFromClientOptions []func(*Options) func (w withPresignClientFromClientOptions) options(o *PresignOptions) { o.ClientOptions = append(o.ClientOptions, w...) } // PresignClient represents the presign url client type PresignClient struct { client *Client options PresignOptions } // NewPresignClient generates a presign client using provided API Client and // presign options func NewPresignClient(c *Client, optFns ...func(*PresignOptions)) *PresignClient { var options PresignOptions for _, fn := range optFns { fn(&options) } if len(options.ClientOptions) != 0 { c = New(c.options, options.ClientOptions...) } if options.Presigner == nil { options.Presigner = newDefaultV4Signer(c.options) } return &PresignClient{ client: c, options: options, } } func withNopHTTPClientAPIOption(o *Options) { o.HTTPClient = smithyhttp.NopClient{} } type presignConverter PresignOptions func (c presignConverter) convertToPresignMiddleware(stack *middleware.Stack, options Options) (err error) { stack.Finalize.Clear() stack.Deserialize.Clear() stack.Build.Remove((*awsmiddleware.ClientRequestID)(nil).ID()) stack.Build.Remove("UserAgent") pmw := v4.NewPresignHTTPRequestMiddleware(v4.PresignHTTPRequestMiddlewareOptions{ CredentialsProvider: options.Credentials, Presigner: c.Presigner, LogSigning: options.ClientLogMode.IsSigning(), }) err = stack.Finalize.Add(pmw, middleware.After) if err != nil { return err } if err = smithyhttp.AddNoPayloadDefaultContentTypeRemover(stack); err != nil { return err } // convert request to a GET request err = query.AddAsGetRequestMiddleware(stack) if err != nil { return err } err = presignedurlcust.AddAsIsPresigingMiddleware(stack) if err != nil { return err } return nil } func addRequestResponseLogging(stack *middleware.Stack, o Options) error { return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ LogRequest: o.ClientLogMode.IsRequest(), LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), LogResponse: o.ClientLogMode.IsResponse(), LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), }, middleware.After) }
537
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "io/ioutil" "net/http" "strings" "testing" ) func TestClient_resolveRetryOptions(t *testing.T) { nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { return &http.Response{ StatusCode: 200, Header: http.Header{}, Body: ioutil.NopCloser(strings.NewReader("")), }, nil }) cases := map[string]struct { defaultsMode aws.DefaultsMode retryer aws.Retryer retryMaxAttempts int opRetryMaxAttempts *int retryMode aws.RetryMode expectClientRetryMode aws.RetryMode expectClientMaxAttempts int expectOpMaxAttempts int }{ "defaults": { defaultsMode: aws.DefaultsModeStandard, expectClientRetryMode: aws.RetryModeStandard, expectClientMaxAttempts: 3, expectOpMaxAttempts: 3, }, "custom default retry": { retryMode: aws.RetryModeAdaptive, retryMaxAttempts: 10, expectClientRetryMode: aws.RetryModeAdaptive, expectClientMaxAttempts: 10, expectOpMaxAttempts: 10, }, "custom op max attempts": { retryMode: aws.RetryModeAdaptive, retryMaxAttempts: 10, opRetryMaxAttempts: aws.Int(2), expectClientRetryMode: aws.RetryModeAdaptive, expectClientMaxAttempts: 10, expectOpMaxAttempts: 2, }, "custom op no change max attempts": { retryMode: aws.RetryModeAdaptive, retryMaxAttempts: 10, opRetryMaxAttempts: aws.Int(10), expectClientRetryMode: aws.RetryModeAdaptive, expectClientMaxAttempts: 10, expectOpMaxAttempts: 10, }, "custom op 0 max attempts": { retryMode: aws.RetryModeAdaptive, retryMaxAttempts: 10, opRetryMaxAttempts: aws.Int(0), expectClientRetryMode: aws.RetryModeAdaptive, expectClientMaxAttempts: 10, expectOpMaxAttempts: 10, }, } for name, c := range cases { t.Run(name, func(t *testing.T) { client := NewFromConfig(aws.Config{ DefaultsMode: c.defaultsMode, Retryer: func() func() aws.Retryer { if c.retryer == nil { return nil } return func() aws.Retryer { return c.retryer } }(), HTTPClient: nopClient, RetryMaxAttempts: c.retryMaxAttempts, RetryMode: c.retryMode, }) if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { t.Errorf("expect %v retry mode, got %v", e, a) } if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { t.Errorf("expect %v max attempts, got %v", e, a) } _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, []func(*Options){ func(o *Options) { if c.opRetryMaxAttempts == nil { return } o.RetryMaxAttempts = *c.opRetryMaxAttempts }, }, func(s *middleware.Stack, o Options) error { s.Initialize.Clear() s.Serialize.Clear() s.Build.Clear() s.Finalize.Clear() s.Deserialize.Clear() if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { t.Errorf("expect %v op max attempts, got %v", e, a) } return nil }) if err != nil { t.Fatalf("expect no operation error, got %v", err) } }) } }
124
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Associates an Identity and Access Management (IAM) role with an Neptune DB // cluster. func (c *Client) AddRoleToDBCluster(ctx context.Context, params *AddRoleToDBClusterInput, optFns ...func(*Options)) (*AddRoleToDBClusterOutput, error) { if params == nil { params = &AddRoleToDBClusterInput{} } result, metadata, err := c.invokeOperation(ctx, "AddRoleToDBCluster", params, optFns, c.addOperationAddRoleToDBClusterMiddlewares) if err != nil { return nil, err } out := result.(*AddRoleToDBClusterOutput) out.ResultMetadata = metadata return out, nil } type AddRoleToDBClusterInput struct { // The name of the DB cluster to associate the IAM role with. // // This member is required. DBClusterIdentifier *string // The Amazon Resource Name (ARN) of the IAM role to associate with the Neptune DB // cluster, for example arn:aws:iam::123456789012:role/NeptuneAccessRole . // // This member is required. RoleArn *string // The name of the feature for the Neptune DB cluster that the IAM role is to be // associated with. For the list of supported feature names, see DBEngineVersion . FeatureName *string noSmithyDocumentSerde } type AddRoleToDBClusterOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAddRoleToDBClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpAddRoleToDBCluster{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpAddRoleToDBCluster{}, 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 = addOpAddRoleToDBClusterValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddRoleToDBCluster(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_opAddRoleToDBCluster(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "AddRoleToDBCluster", } }
131
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune 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/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Adds a source identifier to an existing event notification subscription. func (c *Client) AddSourceIdentifierToSubscription(ctx context.Context, params *AddSourceIdentifierToSubscriptionInput, optFns ...func(*Options)) (*AddSourceIdentifierToSubscriptionOutput, error) { if params == nil { params = &AddSourceIdentifierToSubscriptionInput{} } result, metadata, err := c.invokeOperation(ctx, "AddSourceIdentifierToSubscription", params, optFns, c.addOperationAddSourceIdentifierToSubscriptionMiddlewares) if err != nil { return nil, err } out := result.(*AddSourceIdentifierToSubscriptionOutput) out.ResultMetadata = metadata return out, nil } type AddSourceIdentifierToSubscriptionInput struct { // The identifier of the event source to be added. Constraints: // - If the source type is a DB instance, then a DBInstanceIdentifier must be // supplied. // - If the source type is a DB security group, a DBSecurityGroupName must be // supplied. // - If the source type is a DB parameter group, a DBParameterGroupName must be // supplied. // - If the source type is a DB snapshot, a DBSnapshotIdentifier must be // supplied. // // This member is required. SourceIdentifier *string // The name of the event notification subscription you want to add a source // identifier to. // // This member is required. SubscriptionName *string noSmithyDocumentSerde } type AddSourceIdentifierToSubscriptionOutput struct { // Contains the results of a successful invocation of the // DescribeEventSubscriptions action. EventSubscription *types.EventSubscription // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAddSourceIdentifierToSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpAddSourceIdentifierToSubscription{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpAddSourceIdentifierToSubscription{}, 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 = addOpAddSourceIdentifierToSubscriptionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddSourceIdentifierToSubscription(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_opAddSourceIdentifierToSubscription(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "AddSourceIdentifierToSubscription", } }
140
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune 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/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Adds metadata tags to an Amazon Neptune resource. These tags can also be used // with cost allocation reporting to track cost associated with Amazon Neptune // resources, or used in a Condition statement in an IAM policy for Amazon Neptune. func (c *Client) AddTagsToResource(ctx context.Context, params *AddTagsToResourceInput, optFns ...func(*Options)) (*AddTagsToResourceOutput, error) { if params == nil { params = &AddTagsToResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "AddTagsToResource", params, optFns, c.addOperationAddTagsToResourceMiddlewares) if err != nil { return nil, err } out := result.(*AddTagsToResourceOutput) out.ResultMetadata = metadata return out, nil } type AddTagsToResourceInput struct { // The Amazon Neptune resource that the tags are added to. This value is an Amazon // Resource Name (ARN). For information about creating an ARN, see Constructing an // Amazon Resource Name (ARN) (https://docs.aws.amazon.com/neptune/latest/UserGuide/tagging.ARN.html#tagging.ARN.Constructing) // . // // This member is required. ResourceName *string // The tags to be assigned to the Amazon Neptune resource. // // This member is required. Tags []types.Tag noSmithyDocumentSerde } type AddTagsToResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAddTagsToResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpAddTagsToResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpAddTagsToResource{}, 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 = addOpAddTagsToResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddTagsToResource(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_opAddTagsToResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "AddTagsToResource", } }
131
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune 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/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Applies a pending maintenance action to a resource (for example, to a DB // instance). func (c *Client) ApplyPendingMaintenanceAction(ctx context.Context, params *ApplyPendingMaintenanceActionInput, optFns ...func(*Options)) (*ApplyPendingMaintenanceActionOutput, error) { if params == nil { params = &ApplyPendingMaintenanceActionInput{} } result, metadata, err := c.invokeOperation(ctx, "ApplyPendingMaintenanceAction", params, optFns, c.addOperationApplyPendingMaintenanceActionMiddlewares) if err != nil { return nil, err } out := result.(*ApplyPendingMaintenanceActionOutput) out.ResultMetadata = metadata return out, nil } type ApplyPendingMaintenanceActionInput struct { // The pending maintenance action to apply to this resource. Valid values: // system-update , db-upgrade // // This member is required. ApplyAction *string // A value that specifies the type of opt-in request, or undoes an opt-in request. // An opt-in request of type immediate can't be undone. Valid values: // - immediate - Apply the maintenance action immediately. // - next-maintenance - Apply the maintenance action during the next maintenance // window for the resource. // - undo-opt-in - Cancel any existing next-maintenance opt-in requests. // // This member is required. OptInType *string // The Amazon Resource Name (ARN) of the resource that the pending maintenance // action applies to. For information about creating an ARN, see Constructing an // Amazon Resource Name (ARN) (https://docs.aws.amazon.com/neptune/latest/UserGuide/tagging.ARN.html#tagging.ARN.Constructing) // . // // This member is required. ResourceIdentifier *string noSmithyDocumentSerde } type ApplyPendingMaintenanceActionOutput struct { // Describes the pending maintenance actions for a resource. ResourcePendingMaintenanceActions *types.ResourcePendingMaintenanceActions // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationApplyPendingMaintenanceActionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpApplyPendingMaintenanceAction{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpApplyPendingMaintenanceAction{}, 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 = addOpApplyPendingMaintenanceActionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opApplyPendingMaintenanceAction(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_opApplyPendingMaintenanceAction(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "ApplyPendingMaintenanceAction", } }
145
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune 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/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Copies the specified DB cluster parameter group. func (c *Client) CopyDBClusterParameterGroup(ctx context.Context, params *CopyDBClusterParameterGroupInput, optFns ...func(*Options)) (*CopyDBClusterParameterGroupOutput, error) { if params == nil { params = &CopyDBClusterParameterGroupInput{} } result, metadata, err := c.invokeOperation(ctx, "CopyDBClusterParameterGroup", params, optFns, c.addOperationCopyDBClusterParameterGroupMiddlewares) if err != nil { return nil, err } out := result.(*CopyDBClusterParameterGroupOutput) out.ResultMetadata = metadata return out, nil } type CopyDBClusterParameterGroupInput struct { // The identifier or Amazon Resource Name (ARN) for the source DB cluster // parameter group. For information about creating an ARN, see Constructing an // Amazon Resource Name (ARN) (https://docs.aws.amazon.com/neptune/latest/UserGuide/tagging.ARN.html#tagging.ARN.Constructing) // . Constraints: // - Must specify a valid DB cluster parameter group. // - If the source DB cluster parameter group is in the same Amazon Region as // the copy, specify a valid DB parameter group identifier, for example // my-db-cluster-param-group , or a valid ARN. // - If the source DB parameter group is in a different Amazon Region than the // copy, specify a valid DB cluster parameter group ARN, for example // arn:aws:rds:us-east-1:123456789012:cluster-pg:custom-cluster-group1 . // // This member is required. SourceDBClusterParameterGroupIdentifier *string // A description for the copied DB cluster parameter group. // // This member is required. TargetDBClusterParameterGroupDescription *string // The identifier for the copied DB cluster parameter group. Constraints: // - Cannot be null, empty, or blank // - Must contain from 1 to 255 letters, numbers, or hyphens // - First character must be a letter // - Cannot end with a hyphen or contain two consecutive hyphens // Example: my-cluster-param-group1 // // This member is required. TargetDBClusterParameterGroupIdentifier *string // The tags to be assigned to the copied DB cluster parameter group. Tags []types.Tag noSmithyDocumentSerde } type CopyDBClusterParameterGroupOutput struct { // Contains the details of an Amazon Neptune DB cluster parameter group. This data // type is used as a response element in the DescribeDBClusterParameterGroups // action. DBClusterParameterGroup *types.DBClusterParameterGroup // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCopyDBClusterParameterGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpCopyDBClusterParameterGroup{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCopyDBClusterParameterGroup{}, 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 = addOpCopyDBClusterParameterGroupValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCopyDBClusterParameterGroup(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_opCopyDBClusterParameterGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "CopyDBClusterParameterGroup", } }
155
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" presignedurlcust "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url" "github.com/aws/aws-sdk-go-v2/service/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Copies a snapshot of a DB cluster. To copy a DB cluster snapshot from a shared // manual DB cluster snapshot, SourceDBClusterSnapshotIdentifier must be the // Amazon Resource Name (ARN) of the shared DB cluster snapshot. func (c *Client) CopyDBClusterSnapshot(ctx context.Context, params *CopyDBClusterSnapshotInput, optFns ...func(*Options)) (*CopyDBClusterSnapshotOutput, error) { if params == nil { params = &CopyDBClusterSnapshotInput{} } result, metadata, err := c.invokeOperation(ctx, "CopyDBClusterSnapshot", params, optFns, c.addOperationCopyDBClusterSnapshotMiddlewares) if err != nil { return nil, err } out := result.(*CopyDBClusterSnapshotOutput) out.ResultMetadata = metadata return out, nil } type CopyDBClusterSnapshotInput struct { // The identifier of the DB cluster snapshot to copy. This parameter is not // case-sensitive. Constraints: // - Must specify a valid system snapshot in the "available" state. // - Specify a valid DB snapshot identifier. // Example: my-cluster-snapshot1 // // This member is required. SourceDBClusterSnapshotIdentifier *string // The identifier of the new DB cluster snapshot to create from the source DB // cluster snapshot. This parameter is not case-sensitive. Constraints: // - Must contain from 1 to 63 letters, numbers, or hyphens. // - First character must be a letter. // - Cannot end with a hyphen or contain two consecutive hyphens. // Example: my-cluster-snapshot2 // // This member is required. TargetDBClusterSnapshotIdentifier *string // True to copy all tags from the source DB cluster snapshot to the target DB // cluster snapshot, and otherwise false. The default is false. CopyTags *bool // The Amazon Amazon KMS key ID for an encrypted DB cluster snapshot. The KMS key // ID is the Amazon Resource Name (ARN), KMS key identifier, or the KMS key alias // for the KMS encryption key. If you copy an encrypted DB cluster snapshot from // your Amazon account, you can specify a value for KmsKeyId to encrypt the copy // with a new KMS encryption key. If you don't specify a value for KmsKeyId , then // the copy of the DB cluster snapshot is encrypted with the same KMS key as the // source DB cluster snapshot. If you copy an encrypted DB cluster snapshot that is // shared from another Amazon account, then you must specify a value for KmsKeyId . // KMS encryption keys are specific to the Amazon Region that they are created in, // and you can't use encryption keys from one Amazon Region in another Amazon // Region. You cannot encrypt an unencrypted DB cluster snapshot when you copy it. // If you try to copy an unencrypted DB cluster snapshot and specify a value for // the KmsKeyId parameter, an error is returned. KmsKeyId *string // Not currently supported. PreSignedUrl *string // The AWS region the resource is in. The presigned URL will be created with this // region, if the PresignURL member is empty set. SourceRegion *string // The tags to assign to the new DB cluster snapshot copy. Tags []types.Tag // Used by the SDK's PresignURL autofill customization to specify the region the // of the client's request. destinationRegion *string noSmithyDocumentSerde } type CopyDBClusterSnapshotOutput struct { // Contains the details for an Amazon Neptune DB cluster snapshot This data type // is used as a response element in the DescribeDBClusterSnapshots action. DBClusterSnapshot *types.DBClusterSnapshot // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCopyDBClusterSnapshotMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpCopyDBClusterSnapshot{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCopyDBClusterSnapshot{}, 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 = addCopyDBClusterSnapshotPresignURLMiddleware(stack, options); err != nil { return err } if err = addOpCopyDBClusterSnapshotValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCopyDBClusterSnapshot(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 copyCopyDBClusterSnapshotInputForPresign(params interface{}) (interface{}, error) { input, ok := params.(*CopyDBClusterSnapshotInput) if !ok { return nil, fmt.Errorf("expect *CopyDBClusterSnapshotInput type, got %T", params) } cpy := *input return &cpy, nil } func getCopyDBClusterSnapshotPreSignedUrl(params interface{}) (string, bool, error) { input, ok := params.(*CopyDBClusterSnapshotInput) if !ok { return ``, false, fmt.Errorf("expect *CopyDBClusterSnapshotInput type, got %T", params) } if input.PreSignedUrl == nil || len(*input.PreSignedUrl) == 0 { return ``, false, nil } return *input.PreSignedUrl, true, nil } func getCopyDBClusterSnapshotSourceRegion(params interface{}) (string, bool, error) { input, ok := params.(*CopyDBClusterSnapshotInput) if !ok { return ``, false, fmt.Errorf("expect *CopyDBClusterSnapshotInput type, got %T", params) } if input.SourceRegion == nil || len(*input.SourceRegion) == 0 { return ``, false, nil } return *input.SourceRegion, true, nil } func setCopyDBClusterSnapshotPreSignedUrl(params interface{}, value string) error { input, ok := params.(*CopyDBClusterSnapshotInput) if !ok { return fmt.Errorf("expect *CopyDBClusterSnapshotInput type, got %T", params) } input.PreSignedUrl = &value return nil } func setCopyDBClusterSnapshotdestinationRegion(params interface{}, value string) error { input, ok := params.(*CopyDBClusterSnapshotInput) if !ok { return fmt.Errorf("expect *CopyDBClusterSnapshotInput type, got %T", params) } input.destinationRegion = &value return nil } func addCopyDBClusterSnapshotPresignURLMiddleware(stack *middleware.Stack, options Options) error { return presignedurlcust.AddMiddleware(stack, presignedurlcust.Options{ Accessor: presignedurlcust.ParameterAccessor{ GetPresignedURL: getCopyDBClusterSnapshotPreSignedUrl, GetSourceRegion: getCopyDBClusterSnapshotSourceRegion, CopyInput: copyCopyDBClusterSnapshotInputForPresign, SetDestinationRegion: setCopyDBClusterSnapshotdestinationRegion, SetPresignedURL: setCopyDBClusterSnapshotPreSignedUrl, }, Presigner: &presignAutoFillCopyDBClusterSnapshotClient{client: NewPresignClient(New(options))}, }) } type presignAutoFillCopyDBClusterSnapshotClient struct { client *PresignClient } // PresignURL is a middleware accessor that satisfies URLPresigner interface. func (c *presignAutoFillCopyDBClusterSnapshotClient) PresignURL(ctx context.Context, srcRegion string, params interface{}) (*v4.PresignedHTTPRequest, error) { input, ok := params.(*CopyDBClusterSnapshotInput) if !ok { return nil, fmt.Errorf("expect *CopyDBClusterSnapshotInput type, got %T", params) } optFn := func(o *Options) { o.Region = srcRegion o.APIOptions = append(o.APIOptions, presignedurlcust.RemoveMiddleware) } presignOptFn := WithPresignClientFromClientOptions(optFn) return c.client.PresignCopyDBClusterSnapshot(ctx, input, presignOptFn) } func newServiceMetadataMiddleware_opCopyDBClusterSnapshot(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "CopyDBClusterSnapshot", } } // PresignCopyDBClusterSnapshot is used to generate a presigned HTTP Request which // contains presigned URL, signed headers and HTTP method used. func (c *PresignClient) PresignCopyDBClusterSnapshot(ctx context.Context, params *CopyDBClusterSnapshotInput, optFns ...func(*PresignOptions)) (*v4.PresignedHTTPRequest, error) { if params == nil { params = &CopyDBClusterSnapshotInput{} } options := c.options.copy() for _, fn := range optFns { fn(&options) } clientOptFns := append(options.ClientOptions, withNopHTTPClientAPIOption) result, _, err := c.client.invokeOperation(ctx, "CopyDBClusterSnapshot", params, clientOptFns, c.client.addOperationCopyDBClusterSnapshotMiddlewares, presignConverter(options).convertToPresignMiddleware, ) if err != nil { return nil, err } out := result.(*v4.PresignedHTTPRequest) return out, nil }
283
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/awstesting/unit" presignedurlcust "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "net/http" "strings" "testing" ) func TestClientCopyDBClusterSnapshot_presignURLCustomization(t *testing.T) { cases := map[string]struct { Input *CopyDBClusterSnapshotInput ClientRegion string ExpectPresignedURL string ExpectPresignedURLDestinationRegion string ExpectRequestURL string ExpectErr string }{ "have presigned URL no auto fill": { Input: &CopyDBClusterSnapshotInput{ PreSignedUrl: aws.String("https://example.aws/signed-url"), }, ClientRegion: "mock-region", ExpectPresignedURL: "https://example.aws/signed-url", ExpectRequestURL: "https://service.mock-region.amazonaws.com/", }, "no source region no auto fill": { Input: &CopyDBClusterSnapshotInput{}, ClientRegion: "mock-region", ExpectRequestURL: "https://service.mock-region.amazonaws.com/", }, "auto fill presign URL matching region": { Input: &CopyDBClusterSnapshotInput{ SourceRegion: aws.String("mock-region"), }, ClientRegion: "mock-region", ExpectPresignedURL: "https://service.mock-region.amazonaws.com/", ExpectPresignedURLDestinationRegion: "DestinationRegion=mock-region", ExpectRequestURL: "https://service.mock-region.amazonaws.com/", }, "auto fill presign URL different region": { Input: &CopyDBClusterSnapshotInput{ SourceRegion: aws.String("mock-other-region"), }, ClientRegion: "mock-region", ExpectPresignedURL: "https://service.mock-other-region.amazonaws.com/", ExpectPresignedURLDestinationRegion: "DestinationRegion=mock-region", ExpectRequestURL: "https://service.mock-region.amazonaws.com/", }, } for name, c := range cases { t.Run(name, func(t *testing.T) { client := New(Options{ Region: c.ClientRegion, Credentials: unit.StubCredentialsProvider{}, HTTPClient: smithyhttp.ClientDoFunc(func(r *http.Request) (*http.Response, error) { if e, a := c.ExpectRequestURL, r.URL.String(); !strings.HasPrefix(a, e) { t.Errorf("expect presigned URL to contain %v, got %v", e, a) } return smithyhttp.NopClient{}.Do(r) }), EndpointResolver: EndpointResolverFunc( func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { return aws.Endpoint{ URL: "https://service." + region + ".amazonaws.com", SigningRegion: c.ClientRegion, }, nil }), }) _, err := client.CopyDBClusterSnapshot(context.Background(), c.Input, func(o *Options) { o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) (err error) { _, err = stack.Initialize.Remove("OperationInputValidation") if err != nil { return err } return stack.Serialize.Add(middleware.SerializeMiddlewareFunc(t.Name(), func( ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, ) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CopyDBClusterSnapshotInput) if !ok { t.Fatalf("expect CopyDBClusterSnapshotInput, got %T", in.Parameters) } // Switch based on if presign flow or not if presignedurlcust.GetIsPresigning(ctx) { // Presign Flow if v := input.PreSignedUrl; v != nil { t.Errorf("expect no presigned URL, got %v", *v) } if input.destinationRegion == nil { t.Fatalf("expect destination region to be set") } if e, a := c.ClientRegion, *input.destinationRegion; e != a { t.Errorf("expect %v destination region, got %v", e, a) } } else { // Operation flow if v := input.destinationRegion; v != nil { t.Errorf("expect no destination region, got %v", *v) } if len(c.ExpectPresignedURL) != 0 { if input.PreSignedUrl == nil { t.Fatalf("expect presigned URL, got none") } if e, a := c.ExpectPresignedURL, *input.PreSignedUrl; !strings.HasPrefix(a, e) { t.Errorf("expect presigned URL to contain %v, got %v", e, a) } if e, a := c.ExpectPresignedURLDestinationRegion, *input.PreSignedUrl; !strings.Contains(a, e) { t.Errorf("expect presigned URL destination region to contain %v, got %v", e, a) } return next.HandleSerialize(ctx, in) } if v := input.PreSignedUrl; v != nil { t.Errorf("expect no presigned url, got %v", *v) } } return next.HandleSerialize(ctx, in) }, ), middleware.After) }) }, ) if len(c.ExpectErr) != 0 { if err == nil { t.Fatalf("expect error, got none") } if e, a := c.ExpectErr, err.Error(); !strings.Contains(a, e) { t.Fatalf("expect error to contain %v, got %v", e, a) } return } if err != nil { t.Fatalf("expect no error, got %v", err) } }) } }
160
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune 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/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Copies the specified DB parameter group. func (c *Client) CopyDBParameterGroup(ctx context.Context, params *CopyDBParameterGroupInput, optFns ...func(*Options)) (*CopyDBParameterGroupOutput, error) { if params == nil { params = &CopyDBParameterGroupInput{} } result, metadata, err := c.invokeOperation(ctx, "CopyDBParameterGroup", params, optFns, c.addOperationCopyDBParameterGroupMiddlewares) if err != nil { return nil, err } out := result.(*CopyDBParameterGroupOutput) out.ResultMetadata = metadata return out, nil } type CopyDBParameterGroupInput struct { // The identifier or ARN for the source DB parameter group. For information about // creating an ARN, see Constructing an Amazon Resource Name (ARN) (https://docs.aws.amazon.com/neptune/latest/UserGuide/tagging.ARN.html#tagging.ARN.Constructing) // . Constraints: // - Must specify a valid DB parameter group. // - Must specify a valid DB parameter group identifier, for example // my-db-param-group , or a valid ARN. // // This member is required. SourceDBParameterGroupIdentifier *string // A description for the copied DB parameter group. // // This member is required. TargetDBParameterGroupDescription *string // The identifier for the copied DB parameter group. Constraints: // - Cannot be null, empty, or blank. // - Must contain from 1 to 255 letters, numbers, or hyphens. // - First character must be a letter. // - Cannot end with a hyphen or contain two consecutive hyphens. // Example: my-db-parameter-group // // This member is required. TargetDBParameterGroupIdentifier *string // The tags to be assigned to the copied DB parameter group. Tags []types.Tag noSmithyDocumentSerde } type CopyDBParameterGroupOutput struct { // Contains the details of an Amazon Neptune DB parameter group. This data type is // used as a response element in the DescribeDBParameterGroups action. DBParameterGroup *types.DBParameterGroup // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCopyDBParameterGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpCopyDBParameterGroup{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCopyDBParameterGroup{}, 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 = addOpCopyDBParameterGroupValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCopyDBParameterGroup(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_opCopyDBParameterGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "CopyDBParameterGroup", } }
149
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" presignedurlcust "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url" "github.com/aws/aws-sdk-go-v2/service/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a new Amazon Neptune DB cluster. You can use the // ReplicationSourceIdentifier parameter to create the DB cluster as a Read Replica // of another DB cluster or Amazon Neptune DB instance. Note that when you create a // new cluster using CreateDBCluster directly, deletion protection is disabled by // default (when you create a new production cluster in the console, deletion // protection is enabled by default). You can only delete a DB cluster if its // DeletionProtection field is set to false . func (c *Client) CreateDBCluster(ctx context.Context, params *CreateDBClusterInput, optFns ...func(*Options)) (*CreateDBClusterOutput, error) { if params == nil { params = &CreateDBClusterInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateDBCluster", params, optFns, c.addOperationCreateDBClusterMiddlewares) if err != nil { return nil, err } out := result.(*CreateDBClusterOutput) out.ResultMetadata = metadata return out, nil } type CreateDBClusterInput struct { // The DB cluster identifier. This parameter is stored as a lowercase string. // Constraints: // - Must contain from 1 to 63 letters, numbers, or hyphens. // - First character must be a letter. // - Cannot end with a hyphen or contain two consecutive hyphens. // Example: my-cluster1 // // This member is required. DBClusterIdentifier *string // The name of the database engine to be used for this DB cluster. Valid Values: // neptune // // This member is required. Engine *string // A list of EC2 Availability Zones that instances in the DB cluster can be // created in. AvailabilityZones []string // The number of days for which automated backups are retained. You must specify a // minimum value of 1. Default: 1 Constraints: // - Must be a value from 1 to 35 BackupRetentionPeriod *int32 // (Not supported by Neptune) CharacterSetName *string // If set to true , tags are copied to any snapshot of the DB cluster that is // created. CopyTagsToSnapshot *bool // The name of the DB cluster parameter group to associate with this DB cluster. // If this argument is omitted, the default is used. Constraints: // - If supplied, must match the name of an existing DBClusterParameterGroup. DBClusterParameterGroupName *string // A DB subnet group to associate with this DB cluster. Constraints: Must match // the name of an existing DBSubnetGroup. Must not be default. Example: // mySubnetgroup DBSubnetGroupName *string // The name for your database of up to 64 alpha-numeric characters. If you do not // provide a name, Amazon Neptune will not create a database in the DB cluster you // are creating. DatabaseName *string // A value that indicates whether the DB cluster has deletion protection enabled. // The database can't be deleted when deletion protection is enabled. By default, // deletion protection is enabled. DeletionProtection *bool // The list of log types that need to be enabled for exporting to CloudWatch Logs. EnableCloudwatchLogsExports []string // If set to true , enables Amazon Identity and Access Management (IAM) // authentication for the entire DB cluster (this cannot be set at an instance // level). Default: false . EnableIAMDatabaseAuthentication *bool // The version number of the database engine to use for the new DB cluster. // Example: 1.0.2.1 EngineVersion *string // The ID of the Neptune global database to which this new DB cluster should be // added. GlobalClusterIdentifier *string // The Amazon KMS key identifier for an encrypted DB cluster. The KMS key // identifier is the Amazon Resource Name (ARN) for the KMS encryption key. If you // are creating a DB cluster with the same Amazon account that owns the KMS // encryption key used to encrypt the new DB cluster, then you can use the KMS key // alias instead of the ARN for the KMS encryption key. If an encryption key is not // specified in KmsKeyId : // - If ReplicationSourceIdentifier identifies an encrypted source, then Amazon // Neptune will use the encryption key used to encrypt the source. Otherwise, // Amazon Neptune will use your default encryption key. // - If the StorageEncrypted parameter is true and ReplicationSourceIdentifier is // not specified, then Amazon Neptune will use your default encryption key. // Amazon KMS creates the default encryption key for your Amazon account. Your // Amazon account has a different default encryption key for each Amazon Region. If // you create a Read Replica of an encrypted DB cluster in another Amazon Region, // you must set KmsKeyId to a KMS key ID that is valid in the destination Amazon // Region. This key is used to encrypt the Read Replica in that Amazon Region. KmsKeyId *string // Not supported by Neptune. MasterUserPassword *string // Not supported by Neptune. MasterUsername *string // (Not supported by Neptune) OptionGroupName *string // The port number on which the instances in the DB cluster accept connections. // Default: 8182 Port *int32 // This parameter is not currently supported. PreSignedUrl *string // The daily time range during which automated backups are created if automated // backups are enabled using the BackupRetentionPeriod parameter. The default is a // 30-minute window selected at random from an 8-hour block of time for each Amazon // Region. To see the time blocks available, see Adjusting the Preferred // Maintenance Window (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html) // in the Amazon Neptune User Guide. Constraints: // - Must be in the format hh24:mi-hh24:mi . // - Must be in Universal Coordinated Time (UTC). // - Must not conflict with the preferred maintenance window. // - Must be at least 30 minutes. PreferredBackupWindow *string // The weekly time range during which system maintenance can occur, in Universal // Coordinated Time (UTC). Format: ddd:hh24:mi-ddd:hh24:mi The default is a // 30-minute window selected at random from an 8-hour block of time for each Amazon // Region, occurring on a random day of the week. To see the time blocks available, // see Adjusting the Preferred Maintenance Window (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html) // in the Amazon Neptune User Guide. Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun. // Constraints: Minimum 30-minute window. PreferredMaintenanceWindow *string // The Amazon Resource Name (ARN) of the source DB instance or DB cluster if this // DB cluster is created as a Read Replica. ReplicationSourceIdentifier *string // Contains the scaling configuration of a Neptune Serverless DB cluster. For more // information, see Using Amazon Neptune Serverless (https://docs.aws.amazon.com/neptune/latest/userguide/neptune-serverless-using.html) // in the Amazon Neptune User Guide. ServerlessV2ScalingConfiguration *types.ServerlessV2ScalingConfiguration // The AWS region the resource is in. The presigned URL will be created with this // region, if the PresignURL member is empty set. SourceRegion *string // Specifies whether the DB cluster is encrypted. StorageEncrypted *bool // The tags to assign to the new DB cluster. Tags []types.Tag // A list of EC2 VPC security groups to associate with this DB cluster. VpcSecurityGroupIds []string // Used by the SDK's PresignURL autofill customization to specify the region the // of the client's request. destinationRegion *string noSmithyDocumentSerde } type CreateDBClusterOutput struct { // Contains the details of an Amazon Neptune DB cluster. This data type is used as // a response element in the DescribeDBClusters action. DBCluster *types.DBCluster // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateDBClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateDBCluster{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateDBCluster{}, 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 = addCreateDBClusterPresignURLMiddleware(stack, options); err != nil { return err } if err = addOpCreateDBClusterValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDBCluster(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 copyCreateDBClusterInputForPresign(params interface{}) (interface{}, error) { input, ok := params.(*CreateDBClusterInput) if !ok { return nil, fmt.Errorf("expect *CreateDBClusterInput type, got %T", params) } cpy := *input return &cpy, nil } func getCreateDBClusterPreSignedUrl(params interface{}) (string, bool, error) { input, ok := params.(*CreateDBClusterInput) if !ok { return ``, false, fmt.Errorf("expect *CreateDBClusterInput type, got %T", params) } if input.PreSignedUrl == nil || len(*input.PreSignedUrl) == 0 { return ``, false, nil } return *input.PreSignedUrl, true, nil } func getCreateDBClusterSourceRegion(params interface{}) (string, bool, error) { input, ok := params.(*CreateDBClusterInput) if !ok { return ``, false, fmt.Errorf("expect *CreateDBClusterInput type, got %T", params) } if input.SourceRegion == nil || len(*input.SourceRegion) == 0 { return ``, false, nil } return *input.SourceRegion, true, nil } func setCreateDBClusterPreSignedUrl(params interface{}, value string) error { input, ok := params.(*CreateDBClusterInput) if !ok { return fmt.Errorf("expect *CreateDBClusterInput type, got %T", params) } input.PreSignedUrl = &value return nil } func setCreateDBClusterdestinationRegion(params interface{}, value string) error { input, ok := params.(*CreateDBClusterInput) if !ok { return fmt.Errorf("expect *CreateDBClusterInput type, got %T", params) } input.destinationRegion = &value return nil } func addCreateDBClusterPresignURLMiddleware(stack *middleware.Stack, options Options) error { return presignedurlcust.AddMiddleware(stack, presignedurlcust.Options{ Accessor: presignedurlcust.ParameterAccessor{ GetPresignedURL: getCreateDBClusterPreSignedUrl, GetSourceRegion: getCreateDBClusterSourceRegion, CopyInput: copyCreateDBClusterInputForPresign, SetDestinationRegion: setCreateDBClusterdestinationRegion, SetPresignedURL: setCreateDBClusterPreSignedUrl, }, Presigner: &presignAutoFillCreateDBClusterClient{client: NewPresignClient(New(options))}, }) } type presignAutoFillCreateDBClusterClient struct { client *PresignClient } // PresignURL is a middleware accessor that satisfies URLPresigner interface. func (c *presignAutoFillCreateDBClusterClient) PresignURL(ctx context.Context, srcRegion string, params interface{}) (*v4.PresignedHTTPRequest, error) { input, ok := params.(*CreateDBClusterInput) if !ok { return nil, fmt.Errorf("expect *CreateDBClusterInput type, got %T", params) } optFn := func(o *Options) { o.Region = srcRegion o.APIOptions = append(o.APIOptions, presignedurlcust.RemoveMiddleware) } presignOptFn := WithPresignClientFromClientOptions(optFn) return c.client.PresignCreateDBCluster(ctx, input, presignOptFn) } func newServiceMetadataMiddleware_opCreateDBCluster(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "CreateDBCluster", } } // PresignCreateDBCluster is used to generate a presigned HTTP Request which // contains presigned URL, signed headers and HTTP method used. func (c *PresignClient) PresignCreateDBCluster(ctx context.Context, params *CreateDBClusterInput, optFns ...func(*PresignOptions)) (*v4.PresignedHTTPRequest, error) { if params == nil { params = &CreateDBClusterInput{} } options := c.options.copy() for _, fn := range optFns { fn(&options) } clientOptFns := append(options.ClientOptions, withNopHTTPClientAPIOption) result, _, err := c.client.invokeOperation(ctx, "CreateDBCluster", params, clientOptFns, c.client.addOperationCreateDBClusterMiddlewares, presignConverter(options).convertToPresignMiddleware, ) if err != nil { return nil, err } out := result.(*v4.PresignedHTTPRequest) return out, nil }
384
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune 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/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a new custom endpoint and associates it with an Amazon Neptune DB // cluster. func (c *Client) CreateDBClusterEndpoint(ctx context.Context, params *CreateDBClusterEndpointInput, optFns ...func(*Options)) (*CreateDBClusterEndpointOutput, error) { if params == nil { params = &CreateDBClusterEndpointInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateDBClusterEndpoint", params, optFns, c.addOperationCreateDBClusterEndpointMiddlewares) if err != nil { return nil, err } out := result.(*CreateDBClusterEndpointOutput) out.ResultMetadata = metadata return out, nil } type CreateDBClusterEndpointInput struct { // The identifier to use for the new endpoint. This parameter is stored as a // lowercase string. // // This member is required. DBClusterEndpointIdentifier *string // The DB cluster identifier of the DB cluster associated with the endpoint. This // parameter is stored as a lowercase string. // // This member is required. DBClusterIdentifier *string // The type of the endpoint. One of: READER , WRITER , ANY . // // This member is required. EndpointType *string // List of DB instance identifiers that aren't part of the custom endpoint group. // All other eligible instances are reachable through the custom endpoint. Only // relevant if the list of static members is empty. ExcludedMembers []string // List of DB instance identifiers that are part of the custom endpoint group. StaticMembers []string // The tags to be assigned to the Amazon Neptune resource. Tags []types.Tag noSmithyDocumentSerde } // This data type represents the information you need to connect to an Amazon // Neptune DB cluster. This data type is used as a response element in the // following actions: // - CreateDBClusterEndpoint // - DescribeDBClusterEndpoints // - ModifyDBClusterEndpoint // - DeleteDBClusterEndpoint // // For the data structure that represents Amazon Neptune DB instance endpoints, // see Endpoint . type CreateDBClusterEndpointOutput struct { // The type associated with a custom endpoint. One of: READER , WRITER , ANY . CustomEndpointType *string // The Amazon Resource Name (ARN) for the endpoint. DBClusterEndpointArn *string // The identifier associated with the endpoint. This parameter is stored as a // lowercase string. DBClusterEndpointIdentifier *string // A unique system-generated identifier for an endpoint. It remains the same for // the whole life of the endpoint. DBClusterEndpointResourceIdentifier *string // The DB cluster identifier of the DB cluster associated with the endpoint. This // parameter is stored as a lowercase string. DBClusterIdentifier *string // The DNS address of the endpoint. Endpoint *string // The type of the endpoint. One of: READER , WRITER , CUSTOM . EndpointType *string // List of DB instance identifiers that aren't part of the custom endpoint group. // All other eligible instances are reachable through the custom endpoint. Only // relevant if the list of static members is empty. ExcludedMembers []string // List of DB instance identifiers that are part of the custom endpoint group. StaticMembers []string // The current status of the endpoint. One of: creating , available , deleting , // inactive , modifying . The inactive state applies to an endpoint that cannot be // used for a certain kind of cluster, such as a writer endpoint for a read-only // secondary cluster in a global database. Status *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateDBClusterEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateDBClusterEndpoint{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateDBClusterEndpoint{}, 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 = addOpCreateDBClusterEndpointValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDBClusterEndpoint(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_opCreateDBClusterEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "CreateDBClusterEndpoint", } }
194
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune 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/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a new DB cluster parameter group. Parameters in a DB cluster parameter // group apply to all of the instances in a DB cluster. A DB cluster parameter // group is initially created with the default parameters for the database engine // used by instances in the DB cluster. To provide custom values for any of the // parameters, you must modify the group after creating it using // ModifyDBClusterParameterGroup . Once you've created a DB cluster parameter // group, you need to associate it with your DB cluster using ModifyDBCluster . // When you associate a new DB cluster parameter group with a running DB cluster, // you need to reboot the DB instances in the DB cluster without failover for the // new DB cluster parameter group and associated settings to take effect. After you // create a DB cluster parameter group, you should wait at least 5 minutes before // creating your first DB cluster that uses that DB cluster parameter group as the // default parameter group. This allows Amazon Neptune to fully complete the create // action before the DB cluster parameter group is used as the default for a new DB // cluster. This is especially important for parameters that are critical when // creating the default database for a DB cluster, such as the character set for // the default database defined by the character_set_database parameter. You can // use the Parameter Groups option of the Amazon Neptune console (https://console.aws.amazon.com/rds/) // or the DescribeDBClusterParameters command to verify that your DB cluster // parameter group has been created or modified. func (c *Client) CreateDBClusterParameterGroup(ctx context.Context, params *CreateDBClusterParameterGroupInput, optFns ...func(*Options)) (*CreateDBClusterParameterGroupOutput, error) { if params == nil { params = &CreateDBClusterParameterGroupInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateDBClusterParameterGroup", params, optFns, c.addOperationCreateDBClusterParameterGroupMiddlewares) if err != nil { return nil, err } out := result.(*CreateDBClusterParameterGroupOutput) out.ResultMetadata = metadata return out, nil } type CreateDBClusterParameterGroupInput struct { // The name of the DB cluster parameter group. Constraints: // - Must match the name of an existing DBClusterParameterGroup. // This value is stored as a lowercase string. // // This member is required. DBClusterParameterGroupName *string // The DB cluster parameter group family name. A DB cluster parameter group can be // associated with one and only one DB cluster parameter group family, and can be // applied only to a DB cluster running a database engine and engine version // compatible with that DB cluster parameter group family. // // This member is required. DBParameterGroupFamily *string // The description for the DB cluster parameter group. // // This member is required. Description *string // The tags to be assigned to the new DB cluster parameter group. Tags []types.Tag noSmithyDocumentSerde } type CreateDBClusterParameterGroupOutput struct { // Contains the details of an Amazon Neptune DB cluster parameter group. This data // type is used as a response element in the DescribeDBClusterParameterGroups // action. DBClusterParameterGroup *types.DBClusterParameterGroup // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateDBClusterParameterGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateDBClusterParameterGroup{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateDBClusterParameterGroup{}, 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 = addOpCreateDBClusterParameterGroupValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDBClusterParameterGroup(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_opCreateDBClusterParameterGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "CreateDBClusterParameterGroup", } }
164
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune 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/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a snapshot of a DB cluster. func (c *Client) CreateDBClusterSnapshot(ctx context.Context, params *CreateDBClusterSnapshotInput, optFns ...func(*Options)) (*CreateDBClusterSnapshotOutput, error) { if params == nil { params = &CreateDBClusterSnapshotInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateDBClusterSnapshot", params, optFns, c.addOperationCreateDBClusterSnapshotMiddlewares) if err != nil { return nil, err } out := result.(*CreateDBClusterSnapshotOutput) out.ResultMetadata = metadata return out, nil } type CreateDBClusterSnapshotInput struct { // The identifier of the DB cluster to create a snapshot for. This parameter is // not case-sensitive. Constraints: // - Must match the identifier of an existing DBCluster. // Example: my-cluster1 // // This member is required. DBClusterIdentifier *string // The identifier of the DB cluster snapshot. This parameter is stored as a // lowercase string. Constraints: // - Must contain from 1 to 63 letters, numbers, or hyphens. // - First character must be a letter. // - Cannot end with a hyphen or contain two consecutive hyphens. // Example: my-cluster1-snapshot1 // // This member is required. DBClusterSnapshotIdentifier *string // The tags to be assigned to the DB cluster snapshot. Tags []types.Tag noSmithyDocumentSerde } type CreateDBClusterSnapshotOutput struct { // Contains the details for an Amazon Neptune DB cluster snapshot This data type // is used as a response element in the DescribeDBClusterSnapshots action. DBClusterSnapshot *types.DBClusterSnapshot // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateDBClusterSnapshotMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateDBClusterSnapshot{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateDBClusterSnapshot{}, 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 = addOpCreateDBClusterSnapshotValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDBClusterSnapshot(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_opCreateDBClusterSnapshot(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "CreateDBClusterSnapshot", } }
142
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/awstesting/unit" presignedurlcust "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "net/http" "strings" "testing" ) func TestClientCreateDBCluster_presignURLCustomization(t *testing.T) { cases := map[string]struct { Input *CreateDBClusterInput ClientRegion string ExpectPresignedURL string ExpectPresignedURLDestinationRegion string ExpectRequestURL string ExpectErr string }{ "have presigned URL no auto fill": { Input: &CreateDBClusterInput{ PreSignedUrl: aws.String("https://example.aws/signed-url"), }, ClientRegion: "mock-region", ExpectPresignedURL: "https://example.aws/signed-url", ExpectRequestURL: "https://service.mock-region.amazonaws.com/", }, "no source region no auto fill": { Input: &CreateDBClusterInput{}, ClientRegion: "mock-region", ExpectRequestURL: "https://service.mock-region.amazonaws.com/", }, "auto fill presign URL matching region": { Input: &CreateDBClusterInput{ SourceRegion: aws.String("mock-region"), }, ClientRegion: "mock-region", ExpectPresignedURL: "https://service.mock-region.amazonaws.com/", ExpectPresignedURLDestinationRegion: "DestinationRegion=mock-region", ExpectRequestURL: "https://service.mock-region.amazonaws.com/", }, "auto fill presign URL different region": { Input: &CreateDBClusterInput{ SourceRegion: aws.String("mock-other-region"), }, ClientRegion: "mock-region", ExpectPresignedURL: "https://service.mock-other-region.amazonaws.com/", ExpectPresignedURLDestinationRegion: "DestinationRegion=mock-region", ExpectRequestURL: "https://service.mock-region.amazonaws.com/", }, } for name, c := range cases { t.Run(name, func(t *testing.T) { client := New(Options{ Region: c.ClientRegion, Credentials: unit.StubCredentialsProvider{}, HTTPClient: smithyhttp.ClientDoFunc(func(r *http.Request) (*http.Response, error) { if e, a := c.ExpectRequestURL, r.URL.String(); !strings.HasPrefix(a, e) { t.Errorf("expect presigned URL to contain %v, got %v", e, a) } return smithyhttp.NopClient{}.Do(r) }), EndpointResolver: EndpointResolverFunc( func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { return aws.Endpoint{ URL: "https://service." + region + ".amazonaws.com", SigningRegion: c.ClientRegion, }, nil }), }) _, err := client.CreateDBCluster(context.Background(), c.Input, func(o *Options) { o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) (err error) { _, err = stack.Initialize.Remove("OperationInputValidation") if err != nil { return err } return stack.Serialize.Add(middleware.SerializeMiddlewareFunc(t.Name(), func( ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, ) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateDBClusterInput) if !ok { t.Fatalf("expect CreateDBClusterInput, got %T", in.Parameters) } // Switch based on if presign flow or not if presignedurlcust.GetIsPresigning(ctx) { // Presign Flow if v := input.PreSignedUrl; v != nil { t.Errorf("expect no presigned URL, got %v", *v) } if input.destinationRegion == nil { t.Fatalf("expect destination region to be set") } if e, a := c.ClientRegion, *input.destinationRegion; e != a { t.Errorf("expect %v destination region, got %v", e, a) } } else { // Operation flow if v := input.destinationRegion; v != nil { t.Errorf("expect no destination region, got %v", *v) } if len(c.ExpectPresignedURL) != 0 { if input.PreSignedUrl == nil { t.Fatalf("expect presigned URL, got none") } if e, a := c.ExpectPresignedURL, *input.PreSignedUrl; !strings.HasPrefix(a, e) { t.Errorf("expect presigned URL to contain %v, got %v", e, a) } if e, a := c.ExpectPresignedURLDestinationRegion, *input.PreSignedUrl; !strings.Contains(a, e) { t.Errorf("expect presigned URL destination region to contain %v, got %v", e, a) } return next.HandleSerialize(ctx, in) } if v := input.PreSignedUrl; v != nil { t.Errorf("expect no presigned url, got %v", *v) } } return next.HandleSerialize(ctx, in) }, ), middleware.After) }) }, ) if len(c.ExpectErr) != 0 { if err == nil { t.Fatalf("expect error, got none") } if e, a := c.ExpectErr, err.Error(); !strings.Contains(a, e) { t.Fatalf("expect error to contain %v, got %v", e, a) } return } if err != nil { t.Fatalf("expect no error, got %v", err) } }) } }
160
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune 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/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a new DB instance. func (c *Client) CreateDBInstance(ctx context.Context, params *CreateDBInstanceInput, optFns ...func(*Options)) (*CreateDBInstanceOutput, error) { if params == nil { params = &CreateDBInstanceInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateDBInstance", params, optFns, c.addOperationCreateDBInstanceMiddlewares) if err != nil { return nil, err } out := result.(*CreateDBInstanceOutput) out.ResultMetadata = metadata return out, nil } type CreateDBInstanceInput struct { // The identifier of the DB cluster that the instance will belong to. For // information on creating a DB cluster, see CreateDBCluster . Type: String // // This member is required. DBClusterIdentifier *string // The compute and memory capacity of the DB instance, for example, db.m4.large . // Not all DB instance classes are available in all Amazon Regions. // // This member is required. DBInstanceClass *string // The DB instance identifier. This parameter is stored as a lowercase string. // Constraints: // - Must contain from 1 to 63 letters, numbers, or hyphens. // - First character must be a letter. // - Cannot end with a hyphen or contain two consecutive hyphens. // Example: mydbinstance // // This member is required. DBInstanceIdentifier *string // The name of the database engine to be used for this instance. Valid Values: // neptune // // This member is required. Engine *string // Not supported by Neptune. AllocatedStorage *int32 // Indicates that minor engine upgrades are applied automatically to the DB // instance during the maintenance window. Default: true AutoMinorVersionUpgrade *bool // The EC2 Availability Zone that the DB instance is created in Default: A random, // system-chosen Availability Zone in the endpoint's Amazon Region. Example: // us-east-1d Constraint: The AvailabilityZone parameter can't be specified if the // MultiAZ parameter is set to true . The specified Availability Zone must be in // the same Amazon Region as the current endpoint. AvailabilityZone *string // The number of days for which automated backups are retained. Not applicable. // The retention period for automated backups is managed by the DB cluster. For // more information, see CreateDBCluster . Default: 1 Constraints: // - Must be a value from 0 to 35 // - Cannot be set to 0 if the DB instance is a source to Read Replicas BackupRetentionPeriod *int32 // (Not supported by Neptune) CharacterSetName *string // True to copy all tags from the DB instance to snapshots of the DB instance, and // otherwise false. The default is false. CopyTagsToSnapshot *bool // Not supported. DBName *string // The name of the DB parameter group to associate with this DB instance. If this // argument is omitted, the default DBParameterGroup for the specified engine is // used. Constraints: // - Must be 1 to 255 letters, numbers, or hyphens. // - First character must be a letter // - Cannot end with a hyphen or contain two consecutive hyphens DBParameterGroupName *string // A list of DB security groups to associate with this DB instance. Default: The // default DB security group for the database engine. DBSecurityGroups []string // A DB subnet group to associate with this DB instance. If there is no DB subnet // group, then it is a non-VPC DB instance. DBSubnetGroupName *string // A value that indicates whether the DB instance has deletion protection enabled. // The database can't be deleted when deletion protection is enabled. By default, // deletion protection is disabled. See Deleting a DB Instance (https://docs.aws.amazon.com/neptune/latest/userguide/manage-console-instances-delete.html) // . DB instances in a DB cluster can be deleted even when deletion protection is // enabled in their parent DB cluster. DeletionProtection *bool // Specify the Active Directory Domain to create the instance in. Domain *string // Specify the name of the IAM role to be used when making API calls to the // Directory Service. DomainIAMRoleName *string // The list of log types that need to be enabled for exporting to CloudWatch Logs. EnableCloudwatchLogsExports []string // Not supported by Neptune (ignored). EnableIAMDatabaseAuthentication *bool // (Not supported by Neptune) EnablePerformanceInsights *bool // The version number of the database engine to use. Currently, setting this // parameter has no effect. EngineVersion *string // The amount of Provisioned IOPS (input/output operations per second) to be // initially allocated for the DB instance. Iops *int32 // The Amazon KMS key identifier for an encrypted DB instance. The KMS key // identifier is the Amazon Resource Name (ARN) for the KMS encryption key. If you // are creating a DB instance with the same Amazon account that owns the KMS // encryption key used to encrypt the new DB instance, then you can use the KMS key // alias instead of the ARN for the KM encryption key. Not applicable. The KMS key // identifier is managed by the DB cluster. For more information, see // CreateDBCluster . If the StorageEncrypted parameter is true, and you do not // specify a value for the KmsKeyId parameter, then Amazon Neptune will use your // default encryption key. Amazon KMS creates the default encryption key for your // Amazon account. Your Amazon account has a different default encryption key for // each Amazon Region. KmsKeyId *string // License model information for this DB instance. Valid values: license-included // | bring-your-own-license | general-public-license LicenseModel *string // Not supported by Neptune. MasterUserPassword *string // Not supported by Neptune. MasterUsername *string // The interval, in seconds, between points when Enhanced Monitoring metrics are // collected for the DB instance. To disable collecting Enhanced Monitoring // metrics, specify 0. The default is 0. If MonitoringRoleArn is specified, then // you must also set MonitoringInterval to a value other than 0. Valid Values: 0, // 1, 5, 10, 15, 30, 60 MonitoringInterval *int32 // The ARN for the IAM role that permits Neptune to send enhanced monitoring // metrics to Amazon CloudWatch Logs. For example, // arn:aws:iam:123456789012:role/emaccess . If MonitoringInterval is set to a // value other than 0, then you must supply a MonitoringRoleArn value. MonitoringRoleArn *string // Specifies if the DB instance is a Multi-AZ deployment. You can't set the // AvailabilityZone parameter if the MultiAZ parameter is set to true. MultiAZ *bool // (Not supported by Neptune) OptionGroupName *string // (Not supported by Neptune) PerformanceInsightsKMSKeyId *string // The port number on which the database accepts connections. Not applicable. The // port is managed by the DB cluster. For more information, see CreateDBCluster . // Default: 8182 Type: Integer Port *int32 // The daily time range during which automated backups are created. Not // applicable. The daily time range for creating automated backups is managed by // the DB cluster. For more information, see CreateDBCluster . PreferredBackupWindow *string // The time range each week during which system maintenance can occur, in // Universal Coordinated Time (UTC). Format: ddd:hh24:mi-ddd:hh24:mi The default // is a 30-minute window selected at random from an 8-hour block of time for each // Amazon Region, occurring on a random day of the week. Valid Days: Mon, Tue, Wed, // Thu, Fri, Sat, Sun. Constraints: Minimum 30-minute window. PreferredMaintenanceWindow *string // A value that specifies the order in which an Read Replica is promoted to the // primary instance after a failure of the existing primary instance. Default: 1 // Valid Values: 0 - 15 PromotionTier *int32 // This flag should no longer be used. // // Deprecated: This member has been deprecated. PubliclyAccessible *bool // Specifies whether the DB instance is encrypted. Not applicable. The encryption // for DB instances is managed by the DB cluster. For more information, see // CreateDBCluster . Default: false StorageEncrypted *bool // Specifies the storage type to be associated with the DB instance. Not // applicable. Storage is managed by the DB Cluster. StorageType *string // The tags to assign to the new instance. Tags []types.Tag // The ARN from the key store with which to associate the instance for TDE // encryption. TdeCredentialArn *string // The password for the given ARN from the key store in order to access the device. TdeCredentialPassword *string // The time zone of the DB instance. Timezone *string // A list of EC2 VPC security groups to associate with this DB instance. Not // applicable. The associated list of EC2 VPC security groups is managed by the DB // cluster. For more information, see CreateDBCluster . Default: The default EC2 // VPC security group for the DB subnet group's VPC. VpcSecurityGroupIds []string noSmithyDocumentSerde } type CreateDBInstanceOutput struct { // Contains the details of an Amazon Neptune DB instance. This data type is used // as a response element in the DescribeDBInstances action. DBInstance *types.DBInstance // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateDBInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateDBInstance{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateDBInstance{}, 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 = addOpCreateDBInstanceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDBInstance(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_opCreateDBInstance(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "CreateDBInstance", } }
328
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune 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/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a new DB parameter group. A DB parameter group is initially created // with the default parameters for the database engine used by the DB instance. To // provide custom values for any of the parameters, you must modify the group after // creating it using ModifyDBParameterGroup. Once you've created a DB parameter // group, you need to associate it with your DB instance using ModifyDBInstance. // When you associate a new DB parameter group with a running DB instance, you need // to reboot the DB instance without failover for the new DB parameter group and // associated settings to take effect. After you create a DB parameter group, you // should wait at least 5 minutes before creating your first DB instance that uses // that DB parameter group as the default parameter group. This allows Amazon // Neptune to fully complete the create action before the parameter group is used // as the default for a new DB instance. This is especially important for // parameters that are critical when creating the default database for a DB // instance, such as the character set for the default database defined by the // character_set_database parameter. You can use the Parameter Groups option of the // Amazon Neptune console or the DescribeDBParameters command to verify that your // DB parameter group has been created or modified. func (c *Client) CreateDBParameterGroup(ctx context.Context, params *CreateDBParameterGroupInput, optFns ...func(*Options)) (*CreateDBParameterGroupOutput, error) { if params == nil { params = &CreateDBParameterGroupInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateDBParameterGroup", params, optFns, c.addOperationCreateDBParameterGroupMiddlewares) if err != nil { return nil, err } out := result.(*CreateDBParameterGroupOutput) out.ResultMetadata = metadata return out, nil } type CreateDBParameterGroupInput struct { // The DB parameter group family name. A DB parameter group can be associated with // one and only one DB parameter group family, and can be applied only to a DB // instance running a database engine and engine version compatible with that DB // parameter group family. // // This member is required. DBParameterGroupFamily *string // The name of the DB parameter group. Constraints: // - Must be 1 to 255 letters, numbers, or hyphens. // - First character must be a letter // - Cannot end with a hyphen or contain two consecutive hyphens // This value is stored as a lowercase string. // // This member is required. DBParameterGroupName *string // The description for the DB parameter group. // // This member is required. Description *string // The tags to be assigned to the new DB parameter group. Tags []types.Tag noSmithyDocumentSerde } type CreateDBParameterGroupOutput struct { // Contains the details of an Amazon Neptune DB parameter group. This data type is // used as a response element in the DescribeDBParameterGroups action. DBParameterGroup *types.DBParameterGroup // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateDBParameterGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateDBParameterGroup{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateDBParameterGroup{}, 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 = addOpCreateDBParameterGroupValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDBParameterGroup(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_opCreateDBParameterGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "CreateDBParameterGroup", } }
162
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune 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/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a new DB subnet group. DB subnet groups must contain at least one // subnet in at least two AZs in the Amazon Region. func (c *Client) CreateDBSubnetGroup(ctx context.Context, params *CreateDBSubnetGroupInput, optFns ...func(*Options)) (*CreateDBSubnetGroupOutput, error) { if params == nil { params = &CreateDBSubnetGroupInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateDBSubnetGroup", params, optFns, c.addOperationCreateDBSubnetGroupMiddlewares) if err != nil { return nil, err } out := result.(*CreateDBSubnetGroupOutput) out.ResultMetadata = metadata return out, nil } type CreateDBSubnetGroupInput struct { // The description for the DB subnet group. // // This member is required. DBSubnetGroupDescription *string // The name for the DB subnet group. This value is stored as a lowercase string. // Constraints: Must contain no more than 255 letters, numbers, periods, // underscores, spaces, or hyphens. Must not be default. Example: mySubnetgroup // // This member is required. DBSubnetGroupName *string // The EC2 Subnet IDs for the DB subnet group. // // This member is required. SubnetIds []string // The tags to be assigned to the new DB subnet group. Tags []types.Tag noSmithyDocumentSerde } type CreateDBSubnetGroupOutput struct { // Contains the details of an Amazon Neptune DB subnet group. This data type is // used as a response element in the DescribeDBSubnetGroups action. DBSubnetGroup *types.DBSubnetGroup // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateDBSubnetGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateDBSubnetGroup{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateDBSubnetGroup{}, 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 = addOpCreateDBSubnetGroupValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDBSubnetGroup(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_opCreateDBSubnetGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "CreateDBSubnetGroup", } }
142
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune 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/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates an event notification subscription. This action requires a topic ARN // (Amazon Resource Name) created by either the Neptune console, the SNS console, // or the SNS API. To obtain an ARN with SNS, you must create a topic in Amazon SNS // and subscribe to the topic. The ARN is displayed in the SNS console. You can // specify the type of source (SourceType) you want to be notified of, provide a // list of Neptune sources (SourceIds) that triggers the events, and provide a list // of event categories (EventCategories) for events you want to be notified of. For // example, you can specify SourceType = db-instance, SourceIds = mydbinstance1, // mydbinstance2 and EventCategories = Availability, Backup. If you specify both // the SourceType and SourceIds, such as SourceType = db-instance and // SourceIdentifier = myDBInstance1, you are notified of all the db-instance events // for the specified source. If you specify a SourceType but do not specify a // SourceIdentifier, you receive notice of the events for that source type for all // your Neptune sources. If you do not specify either the SourceType nor the // SourceIdentifier, you are notified of events generated from all Neptune sources // belonging to your customer account. func (c *Client) CreateEventSubscription(ctx context.Context, params *CreateEventSubscriptionInput, optFns ...func(*Options)) (*CreateEventSubscriptionOutput, error) { if params == nil { params = &CreateEventSubscriptionInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateEventSubscription", params, optFns, c.addOperationCreateEventSubscriptionMiddlewares) if err != nil { return nil, err } out := result.(*CreateEventSubscriptionOutput) out.ResultMetadata = metadata return out, nil } type CreateEventSubscriptionInput struct { // The Amazon Resource Name (ARN) of the SNS topic created for event notification. // The ARN is created by Amazon SNS when you create a topic and subscribe to it. // // This member is required. SnsTopicArn *string // The name of the subscription. Constraints: The name must be less than 255 // characters. // // This member is required. SubscriptionName *string // A Boolean value; set to true to activate the subscription, set to false to // create the subscription but not active it. Enabled *bool // A list of event categories for a SourceType that you want to subscribe to. You // can see a list of the categories for a given SourceType by using the // DescribeEventCategories action. EventCategories []string // The list of identifiers of the event sources for which events are returned. If // not specified, then all sources are included in the response. An identifier must // begin with a letter and must contain only ASCII letters, digits, and hyphens; it // can't end with a hyphen or contain two consecutive hyphens. Constraints: // - If SourceIds are supplied, SourceType must also be provided. // - If the source type is a DB instance, then a DBInstanceIdentifier must be // supplied. // - If the source type is a DB security group, a DBSecurityGroupName must be // supplied. // - If the source type is a DB parameter group, a DBParameterGroupName must be // supplied. // - If the source type is a DB snapshot, a DBSnapshotIdentifier must be // supplied. SourceIds []string // The type of source that is generating the events. For example, if you want to // be notified of events generated by a DB instance, you would set this parameter // to db-instance. if this value is not specified, all events are returned. Valid // values: db-instance | db-cluster | db-parameter-group | db-security-group | // db-snapshot | db-cluster-snapshot SourceType *string // The tags to be applied to the new event subscription. Tags []types.Tag noSmithyDocumentSerde } type CreateEventSubscriptionOutput struct { // Contains the results of a successful invocation of the // DescribeEventSubscriptions action. EventSubscription *types.EventSubscription // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateEventSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateEventSubscription{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateEventSubscription{}, 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 = addOpCreateEventSubscriptionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateEventSubscription(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_opCreateEventSubscription(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "CreateEventSubscription", } }
182
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune 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/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a Neptune global database spread across multiple Amazon Regions. The // global database contains a single primary cluster with read-write capability, // and read-only secondary clusters that receive data from the primary cluster // through high-speed replication performed by the Neptune storage subsystem. You // can create a global database that is initially empty, and then add a primary // cluster and secondary clusters to it, or you can specify an existing Neptune // cluster during the create operation to become the primary cluster of the global // database. func (c *Client) CreateGlobalCluster(ctx context.Context, params *CreateGlobalClusterInput, optFns ...func(*Options)) (*CreateGlobalClusterOutput, error) { if params == nil { params = &CreateGlobalClusterInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateGlobalCluster", params, optFns, c.addOperationCreateGlobalClusterMiddlewares) if err != nil { return nil, err } out := result.(*CreateGlobalClusterOutput) out.ResultMetadata = metadata return out, nil } type CreateGlobalClusterInput struct { // The cluster identifier of the new global database cluster. // // This member is required. GlobalClusterIdentifier *string // The deletion protection setting for the new global database. The global // database can't be deleted when deletion protection is enabled. DeletionProtection *bool // The name of the database engine to be used in the global database. Valid // values: neptune Engine *string // The Neptune engine version to be used by the global database. Valid values: // 1.2.0.0 or above. EngineVersion *string // (Optional) The Amazon Resource Name (ARN) of an existing Neptune DB cluster to // use as the primary cluster of the new global database. SourceDBClusterIdentifier *string // The storage encryption setting for the new global database cluster. StorageEncrypted *bool noSmithyDocumentSerde } type CreateGlobalClusterOutput struct { // Contains the details of an Amazon Neptune global database. This data type is // used as a response element for the CreateGlobalCluster , DescribeGlobalClusters // , ModifyGlobalCluster , DeleteGlobalCluster , FailoverGlobalCluster , and // RemoveFromGlobalCluster actions. GlobalCluster *types.GlobalCluster // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateGlobalClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateGlobalCluster{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateGlobalCluster{}, 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 = addOpCreateGlobalClusterValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateGlobalCluster(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_opCreateGlobalCluster(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "CreateGlobalCluster", } }
154
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune 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/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The DeleteDBCluster action deletes a previously provisioned DB cluster. When // you delete a DB cluster, all automated backups for that DB cluster are deleted // and can't be recovered. Manual DB cluster snapshots of the specified DB cluster // are not deleted. Note that the DB Cluster cannot be deleted if deletion // protection is enabled. To delete it, you must first set its DeletionProtection // field to False . func (c *Client) DeleteDBCluster(ctx context.Context, params *DeleteDBClusterInput, optFns ...func(*Options)) (*DeleteDBClusterOutput, error) { if params == nil { params = &DeleteDBClusterInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteDBCluster", params, optFns, c.addOperationDeleteDBClusterMiddlewares) if err != nil { return nil, err } out := result.(*DeleteDBClusterOutput) out.ResultMetadata = metadata return out, nil } type DeleteDBClusterInput struct { // The DB cluster identifier for the DB cluster to be deleted. This parameter // isn't case-sensitive. Constraints: // - Must match an existing DBClusterIdentifier. // // This member is required. DBClusterIdentifier *string // The DB cluster snapshot identifier of the new DB cluster snapshot created when // SkipFinalSnapshot is set to false . Specifying this parameter and also setting // the SkipFinalShapshot parameter to true results in an error. Constraints: // - Must be 1 to 255 letters, numbers, or hyphens. // - First character must be a letter // - Cannot end with a hyphen or contain two consecutive hyphens FinalDBSnapshotIdentifier *string // Determines whether a final DB cluster snapshot is created before the DB cluster // is deleted. If true is specified, no DB cluster snapshot is created. If false // is specified, a DB cluster snapshot is created before the DB cluster is deleted. // You must specify a FinalDBSnapshotIdentifier parameter if SkipFinalSnapshot is // false . Default: false SkipFinalSnapshot bool noSmithyDocumentSerde } type DeleteDBClusterOutput struct { // Contains the details of an Amazon Neptune DB cluster. This data type is used as // a response element in the DescribeDBClusters action. DBCluster *types.DBCluster // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteDBClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteDBCluster{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteDBCluster{}, 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 = addOpDeleteDBClusterValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDBCluster(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_opDeleteDBCluster(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DeleteDBCluster", } }
148
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes a custom endpoint and removes it from an Amazon Neptune DB cluster. func (c *Client) DeleteDBClusterEndpoint(ctx context.Context, params *DeleteDBClusterEndpointInput, optFns ...func(*Options)) (*DeleteDBClusterEndpointOutput, error) { if params == nil { params = &DeleteDBClusterEndpointInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteDBClusterEndpoint", params, optFns, c.addOperationDeleteDBClusterEndpointMiddlewares) if err != nil { return nil, err } out := result.(*DeleteDBClusterEndpointOutput) out.ResultMetadata = metadata return out, nil } type DeleteDBClusterEndpointInput struct { // The identifier associated with the custom endpoint. This parameter is stored as // a lowercase string. // // This member is required. DBClusterEndpointIdentifier *string noSmithyDocumentSerde } // This data type represents the information you need to connect to an Amazon // Neptune DB cluster. This data type is used as a response element in the // following actions: // - CreateDBClusterEndpoint // - DescribeDBClusterEndpoints // - ModifyDBClusterEndpoint // - DeleteDBClusterEndpoint // // For the data structure that represents Amazon RDS DB instance endpoints, see // Endpoint . type DeleteDBClusterEndpointOutput struct { // The type associated with a custom endpoint. One of: READER , WRITER , ANY . CustomEndpointType *string // The Amazon Resource Name (ARN) for the endpoint. DBClusterEndpointArn *string // The identifier associated with the endpoint. This parameter is stored as a // lowercase string. DBClusterEndpointIdentifier *string // A unique system-generated identifier for an endpoint. It remains the same for // the whole life of the endpoint. DBClusterEndpointResourceIdentifier *string // The DB cluster identifier of the DB cluster associated with the endpoint. This // parameter is stored as a lowercase string. DBClusterIdentifier *string // The DNS address of the endpoint. Endpoint *string // The type of the endpoint. One of: READER , WRITER , CUSTOM . EndpointType *string // List of DB instance identifiers that aren't part of the custom endpoint group. // All other eligible instances are reachable through the custom endpoint. Only // relevant if the list of static members is empty. ExcludedMembers []string // List of DB instance identifiers that are part of the custom endpoint group. StaticMembers []string // The current status of the endpoint. One of: creating , available , deleting , // inactive , modifying . The inactive state applies to an endpoint that cannot be // used for a certain kind of cluster, such as a writer endpoint for a read-only // secondary cluster in a global database. Status *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteDBClusterEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteDBClusterEndpoint{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteDBClusterEndpoint{}, 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 = addOpDeleteDBClusterEndpointValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDBClusterEndpoint(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_opDeleteDBClusterEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DeleteDBClusterEndpoint", } }
170
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes a specified DB cluster parameter group. The DB cluster parameter group // to be deleted can't be associated with any DB clusters. func (c *Client) DeleteDBClusterParameterGroup(ctx context.Context, params *DeleteDBClusterParameterGroupInput, optFns ...func(*Options)) (*DeleteDBClusterParameterGroupOutput, error) { if params == nil { params = &DeleteDBClusterParameterGroupInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteDBClusterParameterGroup", params, optFns, c.addOperationDeleteDBClusterParameterGroupMiddlewares) if err != nil { return nil, err } out := result.(*DeleteDBClusterParameterGroupOutput) out.ResultMetadata = metadata return out, nil } type DeleteDBClusterParameterGroupInput struct { // The name of the DB cluster parameter group. Constraints: // - Must be the name of an existing DB cluster parameter group. // - You can't delete a default DB cluster parameter group. // - Cannot be associated with any DB clusters. // // This member is required. DBClusterParameterGroupName *string noSmithyDocumentSerde } type DeleteDBClusterParameterGroupOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteDBClusterParameterGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteDBClusterParameterGroup{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteDBClusterParameterGroup{}, 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 = addOpDeleteDBClusterParameterGroupValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDBClusterParameterGroup(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_opDeleteDBClusterParameterGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DeleteDBClusterParameterGroup", } }
124
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune 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/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes a DB cluster snapshot. If the snapshot is being copied, the copy // operation is terminated. The DB cluster snapshot must be in the available state // to be deleted. func (c *Client) DeleteDBClusterSnapshot(ctx context.Context, params *DeleteDBClusterSnapshotInput, optFns ...func(*Options)) (*DeleteDBClusterSnapshotOutput, error) { if params == nil { params = &DeleteDBClusterSnapshotInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteDBClusterSnapshot", params, optFns, c.addOperationDeleteDBClusterSnapshotMiddlewares) if err != nil { return nil, err } out := result.(*DeleteDBClusterSnapshotOutput) out.ResultMetadata = metadata return out, nil } type DeleteDBClusterSnapshotInput struct { // The identifier of the DB cluster snapshot to delete. Constraints: Must be the // name of an existing DB cluster snapshot in the available state. // // This member is required. DBClusterSnapshotIdentifier *string noSmithyDocumentSerde } type DeleteDBClusterSnapshotOutput struct { // Contains the details for an Amazon Neptune DB cluster snapshot This data type // is used as a response element in the DescribeDBClusterSnapshots action. DBClusterSnapshot *types.DBClusterSnapshot // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteDBClusterSnapshotMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteDBClusterSnapshot{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteDBClusterSnapshot{}, 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 = addOpDeleteDBClusterSnapshotValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDBClusterSnapshot(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_opDeleteDBClusterSnapshot(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DeleteDBClusterSnapshot", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune 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/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // The DeleteDBInstance action deletes a previously provisioned DB instance. When // you delete a DB instance, all automated backups for that instance are deleted // and can't be recovered. Manual DB snapshots of the DB instance to be deleted by // DeleteDBInstance are not deleted. If you request a final DB snapshot the status // of the Amazon Neptune DB instance is deleting until the DB snapshot is created. // The API action DescribeDBInstance is used to monitor the status of this // operation. The action can't be canceled or reverted once submitted. Note that // when a DB instance is in a failure state and has a status of failed , // incompatible-restore , or incompatible-network , you can only delete it when the // SkipFinalSnapshot parameter is set to true . You can't delete a DB instance if // it is the only instance in the DB cluster, or if it has deletion protection // enabled. func (c *Client) DeleteDBInstance(ctx context.Context, params *DeleteDBInstanceInput, optFns ...func(*Options)) (*DeleteDBInstanceOutput, error) { if params == nil { params = &DeleteDBInstanceInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteDBInstance", params, optFns, c.addOperationDeleteDBInstanceMiddlewares) if err != nil { return nil, err } out := result.(*DeleteDBInstanceOutput) out.ResultMetadata = metadata return out, nil } type DeleteDBInstanceInput struct { // The DB instance identifier for the DB instance to be deleted. This parameter // isn't case-sensitive. Constraints: // - Must match the name of an existing DB instance. // // This member is required. DBInstanceIdentifier *string // The DBSnapshotIdentifier of the new DBSnapshot created when SkipFinalSnapshot // is set to false . Specifying this parameter and also setting the // SkipFinalShapshot parameter to true results in an error. Constraints: // - Must be 1 to 255 letters or numbers. // - First character must be a letter // - Cannot end with a hyphen or contain two consecutive hyphens // - Cannot be specified when deleting a Read Replica. FinalDBSnapshotIdentifier *string // Determines whether a final DB snapshot is created before the DB instance is // deleted. If true is specified, no DBSnapshot is created. If false is specified, // a DB snapshot is created before the DB instance is deleted. Note that when a DB // instance is in a failure state and has a status of 'failed', // 'incompatible-restore', or 'incompatible-network', it can only be deleted when // the SkipFinalSnapshot parameter is set to "true". Specify true when deleting a // Read Replica. The FinalDBSnapshotIdentifier parameter must be specified if // SkipFinalSnapshot is false . Default: false SkipFinalSnapshot bool noSmithyDocumentSerde } type DeleteDBInstanceOutput struct { // Contains the details of an Amazon Neptune DB instance. This data type is used // as a response element in the DescribeDBInstances action. DBInstance *types.DBInstance // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteDBInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteDBInstance{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteDBInstance{}, 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 = addOpDeleteDBInstanceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDBInstance(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_opDeleteDBInstance(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DeleteDBInstance", } }
158
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes a specified DBParameterGroup. The DBParameterGroup to be deleted can't // be associated with any DB instances. func (c *Client) DeleteDBParameterGroup(ctx context.Context, params *DeleteDBParameterGroupInput, optFns ...func(*Options)) (*DeleteDBParameterGroupOutput, error) { if params == nil { params = &DeleteDBParameterGroupInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteDBParameterGroup", params, optFns, c.addOperationDeleteDBParameterGroupMiddlewares) if err != nil { return nil, err } out := result.(*DeleteDBParameterGroupOutput) out.ResultMetadata = metadata return out, nil } type DeleteDBParameterGroupInput struct { // The name of the DB parameter group. Constraints: // - Must be the name of an existing DB parameter group // - You can't delete a default DB parameter group // - Cannot be associated with any DB instances // // This member is required. DBParameterGroupName *string noSmithyDocumentSerde } type DeleteDBParameterGroupOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteDBParameterGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteDBParameterGroup{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteDBParameterGroup{}, 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 = addOpDeleteDBParameterGroupValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDBParameterGroup(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_opDeleteDBParameterGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DeleteDBParameterGroup", } }
124
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes a DB subnet group. The specified database subnet group must not be // associated with any DB instances. func (c *Client) DeleteDBSubnetGroup(ctx context.Context, params *DeleteDBSubnetGroupInput, optFns ...func(*Options)) (*DeleteDBSubnetGroupOutput, error) { if params == nil { params = &DeleteDBSubnetGroupInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteDBSubnetGroup", params, optFns, c.addOperationDeleteDBSubnetGroupMiddlewares) if err != nil { return nil, err } out := result.(*DeleteDBSubnetGroupOutput) out.ResultMetadata = metadata return out, nil } type DeleteDBSubnetGroupInput struct { // The name of the database subnet group to delete. You can't delete the default // subnet group. Constraints: Constraints: Must match the name of an existing // DBSubnetGroup. Must not be default. Example: mySubnetgroup // // This member is required. DBSubnetGroupName *string noSmithyDocumentSerde } type DeleteDBSubnetGroupOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteDBSubnetGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteDBSubnetGroup{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteDBSubnetGroup{}, 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 = addOpDeleteDBSubnetGroupValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDBSubnetGroup(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_opDeleteDBSubnetGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DeleteDBSubnetGroup", } }
123
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune 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/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes an event notification subscription. func (c *Client) DeleteEventSubscription(ctx context.Context, params *DeleteEventSubscriptionInput, optFns ...func(*Options)) (*DeleteEventSubscriptionOutput, error) { if params == nil { params = &DeleteEventSubscriptionInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteEventSubscription", params, optFns, c.addOperationDeleteEventSubscriptionMiddlewares) if err != nil { return nil, err } out := result.(*DeleteEventSubscriptionOutput) out.ResultMetadata = metadata return out, nil } type DeleteEventSubscriptionInput struct { // The name of the event notification subscription you want to delete. // // This member is required. SubscriptionName *string noSmithyDocumentSerde } type DeleteEventSubscriptionOutput struct { // Contains the results of a successful invocation of the // DescribeEventSubscriptions action. EventSubscription *types.EventSubscription // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteEventSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteEventSubscription{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteEventSubscription{}, 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 = addOpDeleteEventSubscriptionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteEventSubscription(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_opDeleteEventSubscription(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DeleteEventSubscription", } }
126
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune 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/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes a global database. The primary and all secondary clusters must already // be detached or deleted first. func (c *Client) DeleteGlobalCluster(ctx context.Context, params *DeleteGlobalClusterInput, optFns ...func(*Options)) (*DeleteGlobalClusterOutput, error) { if params == nil { params = &DeleteGlobalClusterInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteGlobalCluster", params, optFns, c.addOperationDeleteGlobalClusterMiddlewares) if err != nil { return nil, err } out := result.(*DeleteGlobalClusterOutput) out.ResultMetadata = metadata return out, nil } type DeleteGlobalClusterInput struct { // The cluster identifier of the global database cluster being deleted. // // This member is required. GlobalClusterIdentifier *string noSmithyDocumentSerde } type DeleteGlobalClusterOutput struct { // Contains the details of an Amazon Neptune global database. This data type is // used as a response element for the CreateGlobalCluster , DescribeGlobalClusters // , ModifyGlobalCluster , DeleteGlobalCluster , FailoverGlobalCluster , and // RemoveFromGlobalCluster actions. GlobalCluster *types.GlobalCluster // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteGlobalClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDeleteGlobalCluster{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDeleteGlobalCluster{}, 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 = addOpDeleteGlobalClusterValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteGlobalCluster(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_opDeleteGlobalCluster(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DeleteGlobalCluster", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns information about endpoints for an Amazon Neptune DB cluster. This // operation can also return information for Amazon RDS clusters and Amazon DocDB // clusters. func (c *Client) DescribeDBClusterEndpoints(ctx context.Context, params *DescribeDBClusterEndpointsInput, optFns ...func(*Options)) (*DescribeDBClusterEndpointsOutput, error) { if params == nil { params = &DescribeDBClusterEndpointsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeDBClusterEndpoints", params, optFns, c.addOperationDescribeDBClusterEndpointsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeDBClusterEndpointsOutput) out.ResultMetadata = metadata return out, nil } type DescribeDBClusterEndpointsInput struct { // The identifier of the endpoint to describe. This parameter is stored as a // lowercase string. DBClusterEndpointIdentifier *string // The DB cluster identifier of the DB cluster associated with the endpoint. This // parameter is stored as a lowercase string. DBClusterIdentifier *string // A set of name-value pairs that define which endpoints to include in the output. // The filters are specified as name-value pairs, in the format // Name=endpoint_type,Values=endpoint_type1,endpoint_type2,... . Name can be one // of: db-cluster-endpoint-type , db-cluster-endpoint-custom-type , // db-cluster-endpoint-id , db-cluster-endpoint-status . Values for the // db-cluster-endpoint-type filter can be one or more of: reader , writer , custom // . Values for the db-cluster-endpoint-custom-type filter can be one or more of: // reader , any . Values for the db-cluster-endpoint-status filter can be one or // more of: available , creating , deleting , inactive , modifying . Filters []types.Filter // An optional pagination token provided by a previous DescribeDBClusterEndpoints // request. If this parameter is specified, the response includes only records // beyond the marker, up to the value specified by MaxRecords . Marker *string // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so you can retrieve the remaining results. Default: 100 // Constraints: Minimum 20, maximum 100. MaxRecords *int32 noSmithyDocumentSerde } type DescribeDBClusterEndpointsOutput struct { // Contains the details of the endpoints associated with the cluster and matching // any filter conditions. DBClusterEndpoints []types.DBClusterEndpoint // An optional pagination token provided by a previous DescribeDBClusterEndpoints // request. If this parameter is specified, the response includes only records // beyond the marker, up to the value specified by MaxRecords . Marker *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeDBClusterEndpointsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBClusterEndpoints{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBClusterEndpoints{}, 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 = addOpDescribeDBClusterEndpointsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBClusterEndpoints(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 } // DescribeDBClusterEndpointsAPIClient is a client that implements the // DescribeDBClusterEndpoints operation. type DescribeDBClusterEndpointsAPIClient interface { DescribeDBClusterEndpoints(context.Context, *DescribeDBClusterEndpointsInput, ...func(*Options)) (*DescribeDBClusterEndpointsOutput, error) } var _ DescribeDBClusterEndpointsAPIClient = (*Client)(nil) // DescribeDBClusterEndpointsPaginatorOptions is the paginator options for // DescribeDBClusterEndpoints type DescribeDBClusterEndpointsPaginatorOptions struct { // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so you can retrieve the remaining results. Default: 100 // Constraints: Minimum 20, maximum 100. 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 } // DescribeDBClusterEndpointsPaginator is a paginator for // DescribeDBClusterEndpoints type DescribeDBClusterEndpointsPaginator struct { options DescribeDBClusterEndpointsPaginatorOptions client DescribeDBClusterEndpointsAPIClient params *DescribeDBClusterEndpointsInput nextToken *string firstPage bool } // NewDescribeDBClusterEndpointsPaginator returns a new // DescribeDBClusterEndpointsPaginator func NewDescribeDBClusterEndpointsPaginator(client DescribeDBClusterEndpointsAPIClient, params *DescribeDBClusterEndpointsInput, optFns ...func(*DescribeDBClusterEndpointsPaginatorOptions)) *DescribeDBClusterEndpointsPaginator { if params == nil { params = &DescribeDBClusterEndpointsInput{} } options := DescribeDBClusterEndpointsPaginatorOptions{} if params.MaxRecords != nil { options.Limit = *params.MaxRecords } for _, fn := range optFns { fn(&options) } return &DescribeDBClusterEndpointsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.Marker, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeDBClusterEndpointsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeDBClusterEndpoints page. func (p *DescribeDBClusterEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClusterEndpointsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.Marker = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxRecords = limit result, err := p.client.DescribeDBClusterEndpoints(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.Marker if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeDBClusterEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DescribeDBClusterEndpoints", } }
255
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of DBClusterParameterGroup descriptions. If a // DBClusterParameterGroupName parameter is specified, the list will contain only // the description of the specified DB cluster parameter group. func (c *Client) DescribeDBClusterParameterGroups(ctx context.Context, params *DescribeDBClusterParameterGroupsInput, optFns ...func(*Options)) (*DescribeDBClusterParameterGroupsOutput, error) { if params == nil { params = &DescribeDBClusterParameterGroupsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeDBClusterParameterGroups", params, optFns, c.addOperationDescribeDBClusterParameterGroupsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeDBClusterParameterGroupsOutput) out.ResultMetadata = metadata return out, nil } type DescribeDBClusterParameterGroupsInput struct { // The name of a specific DB cluster parameter group to return details for. // Constraints: // - If supplied, must match the name of an existing DBClusterParameterGroup. DBClusterParameterGroupName *string // This parameter is not currently supported. Filters []types.Filter // An optional pagination token provided by a previous // DescribeDBClusterParameterGroups request. If this parameter is specified, the // response includes only records beyond the marker, up to the value specified by // MaxRecords . Marker *string // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so that the remaining results can be retrieved. // Default: 100 Constraints: Minimum 20, maximum 100. MaxRecords *int32 noSmithyDocumentSerde } type DescribeDBClusterParameterGroupsOutput struct { // A list of DB cluster parameter groups. DBClusterParameterGroups []types.DBClusterParameterGroup // An optional pagination token provided by a previous // DescribeDBClusterParameterGroups request. If this parameter is specified, the // response includes only records beyond the marker, up to the value specified by // MaxRecords . Marker *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeDBClusterParameterGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBClusterParameterGroups{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBClusterParameterGroups{}, 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 = addOpDescribeDBClusterParameterGroupsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBClusterParameterGroups(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 } // DescribeDBClusterParameterGroupsAPIClient is a client that implements the // DescribeDBClusterParameterGroups operation. type DescribeDBClusterParameterGroupsAPIClient interface { DescribeDBClusterParameterGroups(context.Context, *DescribeDBClusterParameterGroupsInput, ...func(*Options)) (*DescribeDBClusterParameterGroupsOutput, error) } var _ DescribeDBClusterParameterGroupsAPIClient = (*Client)(nil) // DescribeDBClusterParameterGroupsPaginatorOptions is the paginator options for // DescribeDBClusterParameterGroups type DescribeDBClusterParameterGroupsPaginatorOptions struct { // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so that the remaining results can be retrieved. // Default: 100 Constraints: Minimum 20, maximum 100. 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 } // DescribeDBClusterParameterGroupsPaginator is a paginator for // DescribeDBClusterParameterGroups type DescribeDBClusterParameterGroupsPaginator struct { options DescribeDBClusterParameterGroupsPaginatorOptions client DescribeDBClusterParameterGroupsAPIClient params *DescribeDBClusterParameterGroupsInput nextToken *string firstPage bool } // NewDescribeDBClusterParameterGroupsPaginator returns a new // DescribeDBClusterParameterGroupsPaginator func NewDescribeDBClusterParameterGroupsPaginator(client DescribeDBClusterParameterGroupsAPIClient, params *DescribeDBClusterParameterGroupsInput, optFns ...func(*DescribeDBClusterParameterGroupsPaginatorOptions)) *DescribeDBClusterParameterGroupsPaginator { if params == nil { params = &DescribeDBClusterParameterGroupsInput{} } options := DescribeDBClusterParameterGroupsPaginatorOptions{} if params.MaxRecords != nil { options.Limit = *params.MaxRecords } for _, fn := range optFns { fn(&options) } return &DescribeDBClusterParameterGroupsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.Marker, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeDBClusterParameterGroupsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeDBClusterParameterGroups page. func (p *DescribeDBClusterParameterGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClusterParameterGroupsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.Marker = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxRecords = limit result, err := p.client.DescribeDBClusterParameterGroups(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.Marker if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeDBClusterParameterGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DescribeDBClusterParameterGroups", } }
245
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns the detailed parameter list for a particular DB cluster parameter group. func (c *Client) DescribeDBClusterParameters(ctx context.Context, params *DescribeDBClusterParametersInput, optFns ...func(*Options)) (*DescribeDBClusterParametersOutput, error) { if params == nil { params = &DescribeDBClusterParametersInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeDBClusterParameters", params, optFns, c.addOperationDescribeDBClusterParametersMiddlewares) if err != nil { return nil, err } out := result.(*DescribeDBClusterParametersOutput) out.ResultMetadata = metadata return out, nil } type DescribeDBClusterParametersInput struct { // The name of a specific DB cluster parameter group to return parameter details // for. Constraints: // - If supplied, must match the name of an existing DBClusterParameterGroup. // // This member is required. DBClusterParameterGroupName *string // This parameter is not currently supported. Filters []types.Filter // An optional pagination token provided by a previous DescribeDBClusterParameters // request. If this parameter is specified, the response includes only records // beyond the marker, up to the value specified by MaxRecords . Marker *string // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so that the remaining results can be retrieved. // Default: 100 Constraints: Minimum 20, maximum 100. MaxRecords *int32 // A value that indicates to return only parameters for a specific source. // Parameter sources can be engine , service , or customer . Source *string noSmithyDocumentSerde } type DescribeDBClusterParametersOutput struct { // An optional pagination token provided by a previous DescribeDBClusterParameters // request. If this parameter is specified, the response includes only records // beyond the marker, up to the value specified by MaxRecords . Marker *string // Provides a list of parameters for the DB cluster parameter group. Parameters []types.Parameter // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeDBClusterParametersMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBClusterParameters{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBClusterParameters{}, 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 = addOpDescribeDBClusterParametersValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBClusterParameters(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 } // DescribeDBClusterParametersAPIClient is a client that implements the // DescribeDBClusterParameters operation. type DescribeDBClusterParametersAPIClient interface { DescribeDBClusterParameters(context.Context, *DescribeDBClusterParametersInput, ...func(*Options)) (*DescribeDBClusterParametersOutput, error) } var _ DescribeDBClusterParametersAPIClient = (*Client)(nil) // DescribeDBClusterParametersPaginatorOptions is the paginator options for // DescribeDBClusterParameters type DescribeDBClusterParametersPaginatorOptions struct { // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so that the remaining results can be retrieved. // Default: 100 Constraints: Minimum 20, maximum 100. 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 } // DescribeDBClusterParametersPaginator is a paginator for // DescribeDBClusterParameters type DescribeDBClusterParametersPaginator struct { options DescribeDBClusterParametersPaginatorOptions client DescribeDBClusterParametersAPIClient params *DescribeDBClusterParametersInput nextToken *string firstPage bool } // NewDescribeDBClusterParametersPaginator returns a new // DescribeDBClusterParametersPaginator func NewDescribeDBClusterParametersPaginator(client DescribeDBClusterParametersAPIClient, params *DescribeDBClusterParametersInput, optFns ...func(*DescribeDBClusterParametersPaginatorOptions)) *DescribeDBClusterParametersPaginator { if params == nil { params = &DescribeDBClusterParametersInput{} } options := DescribeDBClusterParametersPaginatorOptions{} if params.MaxRecords != nil { options.Limit = *params.MaxRecords } for _, fn := range optFns { fn(&options) } return &DescribeDBClusterParametersPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.Marker, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeDBClusterParametersPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeDBClusterParameters page. func (p *DescribeDBClusterParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClusterParametersOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.Marker = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxRecords = limit result, err := p.client.DescribeDBClusterParameters(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.Marker if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeDBClusterParameters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DescribeDBClusterParameters", } }
247
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns information about provisioned DB clusters, and supports pagination. // This operation can also return information for Amazon RDS clusters and Amazon // DocDB clusters. func (c *Client) DescribeDBClusters(ctx context.Context, params *DescribeDBClustersInput, optFns ...func(*Options)) (*DescribeDBClustersOutput, error) { if params == nil { params = &DescribeDBClustersInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeDBClusters", params, optFns, c.addOperationDescribeDBClustersMiddlewares) if err != nil { return nil, err } out := result.(*DescribeDBClustersOutput) out.ResultMetadata = metadata return out, nil } type DescribeDBClustersInput struct { // The user-supplied DB cluster identifier. If this parameter is specified, // information from only the specific DB cluster is returned. This parameter isn't // case-sensitive. Constraints: // - If supplied, must match an existing DBClusterIdentifier. DBClusterIdentifier *string // A filter that specifies one or more DB clusters to describe. Supported filters: // - db-cluster-id - Accepts DB cluster identifiers and DB cluster Amazon // Resource Names (ARNs). The results list will only include information about the // DB clusters identified by these ARNs. // - engine - Accepts an engine name (such as neptune ), and restricts the // results list to DB clusters created by that engine. // For example, to invoke this API from the Amazon CLI and filter so that only // Neptune DB clusters are returned, you could use the following command: Filters []types.Filter // An optional pagination token provided by a previous DescribeDBClusters request. // If this parameter is specified, the response includes only records beyond the // marker, up to the value specified by MaxRecords . Marker *string // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so that the remaining results can be retrieved. // Default: 100 Constraints: Minimum 20, maximum 100. MaxRecords *int32 noSmithyDocumentSerde } type DescribeDBClustersOutput struct { // Contains a list of DB clusters for the user. DBClusters []types.DBCluster // A pagination token that can be used in a subsequent DescribeDBClusters request. Marker *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeDBClustersMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBClusters{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBClusters{}, 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 = addOpDescribeDBClustersValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBClusters(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 } // DescribeDBClustersAPIClient is a client that implements the DescribeDBClusters // operation. type DescribeDBClustersAPIClient interface { DescribeDBClusters(context.Context, *DescribeDBClustersInput, ...func(*Options)) (*DescribeDBClustersOutput, error) } var _ DescribeDBClustersAPIClient = (*Client)(nil) // DescribeDBClustersPaginatorOptions is the paginator options for // DescribeDBClusters type DescribeDBClustersPaginatorOptions struct { // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so that the remaining results can be retrieved. // Default: 100 Constraints: Minimum 20, maximum 100. 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 } // DescribeDBClustersPaginator is a paginator for DescribeDBClusters type DescribeDBClustersPaginator struct { options DescribeDBClustersPaginatorOptions client DescribeDBClustersAPIClient params *DescribeDBClustersInput nextToken *string firstPage bool } // NewDescribeDBClustersPaginator returns a new DescribeDBClustersPaginator func NewDescribeDBClustersPaginator(client DescribeDBClustersAPIClient, params *DescribeDBClustersInput, optFns ...func(*DescribeDBClustersPaginatorOptions)) *DescribeDBClustersPaginator { if params == nil { params = &DescribeDBClustersInput{} } options := DescribeDBClustersPaginatorOptions{} if params.MaxRecords != nil { options.Limit = *params.MaxRecords } for _, fn := range optFns { fn(&options) } return &DescribeDBClustersPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.Marker, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeDBClustersPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeDBClusters page. func (p *DescribeDBClustersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClustersOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.Marker = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxRecords = limit result, err := p.client.DescribeDBClusters(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.Marker if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeDBClusters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DescribeDBClusters", } }
247
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune 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/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of DB cluster snapshot attribute names and values for a manual // DB cluster snapshot. When sharing snapshots with other Amazon accounts, // DescribeDBClusterSnapshotAttributes returns the restore attribute and a list of // IDs for the Amazon accounts that are authorized to copy or restore the manual DB // cluster snapshot. If all is included in the list of values for the restore // attribute, then the manual DB cluster snapshot is public and can be copied or // restored by all Amazon accounts. To add or remove access for an Amazon account // to copy or restore a manual DB cluster snapshot, or to make the manual DB // cluster snapshot public or private, use the ModifyDBClusterSnapshotAttribute // API action. func (c *Client) DescribeDBClusterSnapshotAttributes(ctx context.Context, params *DescribeDBClusterSnapshotAttributesInput, optFns ...func(*Options)) (*DescribeDBClusterSnapshotAttributesOutput, error) { if params == nil { params = &DescribeDBClusterSnapshotAttributesInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeDBClusterSnapshotAttributes", params, optFns, c.addOperationDescribeDBClusterSnapshotAttributesMiddlewares) if err != nil { return nil, err } out := result.(*DescribeDBClusterSnapshotAttributesOutput) out.ResultMetadata = metadata return out, nil } type DescribeDBClusterSnapshotAttributesInput struct { // The identifier for the DB cluster snapshot to describe the attributes for. // // This member is required. DBClusterSnapshotIdentifier *string noSmithyDocumentSerde } type DescribeDBClusterSnapshotAttributesOutput struct { // Contains the results of a successful call to the // DescribeDBClusterSnapshotAttributes API action. Manual DB cluster snapshot // attributes are used to authorize other Amazon accounts to copy or restore a // manual DB cluster snapshot. For more information, see the // ModifyDBClusterSnapshotAttribute API action. DBClusterSnapshotAttributesResult *types.DBClusterSnapshotAttributesResult // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeDBClusterSnapshotAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBClusterSnapshotAttributes{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBClusterSnapshotAttributes{}, 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 = addOpDescribeDBClusterSnapshotAttributesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBClusterSnapshotAttributes(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_opDescribeDBClusterSnapshotAttributes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DescribeDBClusterSnapshotAttributes", } }
138
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns information about DB cluster snapshots. This API action supports // pagination. func (c *Client) DescribeDBClusterSnapshots(ctx context.Context, params *DescribeDBClusterSnapshotsInput, optFns ...func(*Options)) (*DescribeDBClusterSnapshotsOutput, error) { if params == nil { params = &DescribeDBClusterSnapshotsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeDBClusterSnapshots", params, optFns, c.addOperationDescribeDBClusterSnapshotsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeDBClusterSnapshotsOutput) out.ResultMetadata = metadata return out, nil } type DescribeDBClusterSnapshotsInput struct { // The ID of the DB cluster to retrieve the list of DB cluster snapshots for. This // parameter can't be used in conjunction with the DBClusterSnapshotIdentifier // parameter. This parameter is not case-sensitive. Constraints: // - If supplied, must match the identifier of an existing DBCluster. DBClusterIdentifier *string // A specific DB cluster snapshot identifier to describe. This parameter can't be // used in conjunction with the DBClusterIdentifier parameter. This value is // stored as a lowercase string. Constraints: // - If supplied, must match the identifier of an existing DBClusterSnapshot. // - If this identifier is for an automated snapshot, the SnapshotType parameter // must also be specified. DBClusterSnapshotIdentifier *string // This parameter is not currently supported. Filters []types.Filter // True to include manual DB cluster snapshots that are public and can be copied // or restored by any Amazon account, and otherwise false. The default is false . // The default is false. You can share a manual DB cluster snapshot as public by // using the ModifyDBClusterSnapshotAttribute API action. IncludePublic bool // True to include shared manual DB cluster snapshots from other Amazon accounts // that this Amazon account has been given permission to copy or restore, and // otherwise false. The default is false . You can give an Amazon account // permission to restore a manual DB cluster snapshot from another Amazon account // by the ModifyDBClusterSnapshotAttribute API action. IncludeShared bool // An optional pagination token provided by a previous DescribeDBClusterSnapshots // request. If this parameter is specified, the response includes only records // beyond the marker, up to the value specified by MaxRecords . Marker *string // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so that the remaining results can be retrieved. // Default: 100 Constraints: Minimum 20, maximum 100. MaxRecords *int32 // The type of DB cluster snapshots to be returned. You can specify one of the // following values: // - automated - Return all DB cluster snapshots that have been automatically // taken by Amazon Neptune for my Amazon account. // - manual - Return all DB cluster snapshots that have been taken by my Amazon // account. // - shared - Return all manual DB cluster snapshots that have been shared to my // Amazon account. // - public - Return all DB cluster snapshots that have been marked as public. // If you don't specify a SnapshotType value, then both automated and manual DB // cluster snapshots are returned. You can include shared DB cluster snapshots with // these results by setting the IncludeShared parameter to true . You can include // public DB cluster snapshots with these results by setting the IncludePublic // parameter to true . The IncludeShared and IncludePublic parameters don't apply // for SnapshotType values of manual or automated . The IncludePublic parameter // doesn't apply when SnapshotType is set to shared . The IncludeShared parameter // doesn't apply when SnapshotType is set to public . SnapshotType *string noSmithyDocumentSerde } type DescribeDBClusterSnapshotsOutput struct { // Provides a list of DB cluster snapshots for the user. DBClusterSnapshots []types.DBClusterSnapshot // An optional pagination token provided by a previous DescribeDBClusterSnapshots // request. If this parameter is specified, the response includes only records // beyond the marker, up to the value specified by MaxRecords . Marker *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeDBClusterSnapshotsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBClusterSnapshots{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBClusterSnapshots{}, 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 = addOpDescribeDBClusterSnapshotsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBClusterSnapshots(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 } // DescribeDBClusterSnapshotsAPIClient is a client that implements the // DescribeDBClusterSnapshots operation. type DescribeDBClusterSnapshotsAPIClient interface { DescribeDBClusterSnapshots(context.Context, *DescribeDBClusterSnapshotsInput, ...func(*Options)) (*DescribeDBClusterSnapshotsOutput, error) } var _ DescribeDBClusterSnapshotsAPIClient = (*Client)(nil) // DescribeDBClusterSnapshotsPaginatorOptions is the paginator options for // DescribeDBClusterSnapshots type DescribeDBClusterSnapshotsPaginatorOptions struct { // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so that the remaining results can be retrieved. // Default: 100 Constraints: Minimum 20, maximum 100. 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 } // DescribeDBClusterSnapshotsPaginator is a paginator for // DescribeDBClusterSnapshots type DescribeDBClusterSnapshotsPaginator struct { options DescribeDBClusterSnapshotsPaginatorOptions client DescribeDBClusterSnapshotsAPIClient params *DescribeDBClusterSnapshotsInput nextToken *string firstPage bool } // NewDescribeDBClusterSnapshotsPaginator returns a new // DescribeDBClusterSnapshotsPaginator func NewDescribeDBClusterSnapshotsPaginator(client DescribeDBClusterSnapshotsAPIClient, params *DescribeDBClusterSnapshotsInput, optFns ...func(*DescribeDBClusterSnapshotsPaginatorOptions)) *DescribeDBClusterSnapshotsPaginator { if params == nil { params = &DescribeDBClusterSnapshotsInput{} } options := DescribeDBClusterSnapshotsPaginatorOptions{} if params.MaxRecords != nil { options.Limit = *params.MaxRecords } for _, fn := range optFns { fn(&options) } return &DescribeDBClusterSnapshotsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.Marker, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeDBClusterSnapshotsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeDBClusterSnapshots page. func (p *DescribeDBClusterSnapshotsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClusterSnapshotsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.Marker = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxRecords = limit result, err := p.client.DescribeDBClusterSnapshots(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.Marker if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeDBClusterSnapshots(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DescribeDBClusterSnapshots", } }
283
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of the available DB engines. func (c *Client) DescribeDBEngineVersions(ctx context.Context, params *DescribeDBEngineVersionsInput, optFns ...func(*Options)) (*DescribeDBEngineVersionsOutput, error) { if params == nil { params = &DescribeDBEngineVersionsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeDBEngineVersions", params, optFns, c.addOperationDescribeDBEngineVersionsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeDBEngineVersionsOutput) out.ResultMetadata = metadata return out, nil } type DescribeDBEngineVersionsInput struct { // The name of a specific DB parameter group family to return details for. // Constraints: // - If supplied, must match an existing DBParameterGroupFamily. DBParameterGroupFamily *string // Indicates that only the default version of the specified engine or engine and // major version combination is returned. DefaultOnly bool // The database engine to return. Engine *string // The database engine version to return. Example: 5.1.49 EngineVersion *string // Not currently supported. Filters []types.Filter // If this parameter is specified and the requested engine supports the // CharacterSetName parameter for CreateDBInstance , the response includes a list // of supported character sets for each engine version. ListSupportedCharacterSets *bool // If this parameter is specified and the requested engine supports the TimeZone // parameter for CreateDBInstance , the response includes a list of supported time // zones for each engine version. ListSupportedTimezones *bool // An optional pagination token provided by a previous request. If this parameter // is specified, the response includes only records beyond the marker, up to the // value specified by MaxRecords . Marker *string // The maximum number of records to include in the response. If more than the // MaxRecords value is available, a pagination token called a marker is included in // the response so that the following results can be retrieved. Default: 100 // Constraints: Minimum 20, maximum 100. MaxRecords *int32 noSmithyDocumentSerde } type DescribeDBEngineVersionsOutput struct { // A list of DBEngineVersion elements. DBEngineVersions []types.DBEngineVersion // An optional pagination token provided by a previous request. If this parameter // is specified, the response includes only records beyond the marker, up to the // value specified by MaxRecords . Marker *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeDBEngineVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBEngineVersions{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBEngineVersions{}, 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 = addOpDescribeDBEngineVersionsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBEngineVersions(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 } // DescribeDBEngineVersionsAPIClient is a client that implements the // DescribeDBEngineVersions operation. type DescribeDBEngineVersionsAPIClient interface { DescribeDBEngineVersions(context.Context, *DescribeDBEngineVersionsInput, ...func(*Options)) (*DescribeDBEngineVersionsOutput, error) } var _ DescribeDBEngineVersionsAPIClient = (*Client)(nil) // DescribeDBEngineVersionsPaginatorOptions is the paginator options for // DescribeDBEngineVersions type DescribeDBEngineVersionsPaginatorOptions struct { // The maximum number of records to include in the response. If more than the // MaxRecords value is available, a pagination token called a marker is included in // the response so that the following results can be retrieved. Default: 100 // Constraints: Minimum 20, maximum 100. 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 } // DescribeDBEngineVersionsPaginator is a paginator for DescribeDBEngineVersions type DescribeDBEngineVersionsPaginator struct { options DescribeDBEngineVersionsPaginatorOptions client DescribeDBEngineVersionsAPIClient params *DescribeDBEngineVersionsInput nextToken *string firstPage bool } // NewDescribeDBEngineVersionsPaginator returns a new // DescribeDBEngineVersionsPaginator func NewDescribeDBEngineVersionsPaginator(client DescribeDBEngineVersionsAPIClient, params *DescribeDBEngineVersionsInput, optFns ...func(*DescribeDBEngineVersionsPaginatorOptions)) *DescribeDBEngineVersionsPaginator { if params == nil { params = &DescribeDBEngineVersionsInput{} } options := DescribeDBEngineVersionsPaginatorOptions{} if params.MaxRecords != nil { options.Limit = *params.MaxRecords } for _, fn := range optFns { fn(&options) } return &DescribeDBEngineVersionsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.Marker, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeDBEngineVersionsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeDBEngineVersions page. func (p *DescribeDBEngineVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBEngineVersionsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.Marker = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxRecords = limit result, err := p.client.DescribeDBEngineVersions(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.Marker if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeDBEngineVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DescribeDBEngineVersions", } }
260
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune import ( "context" "errors" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptune/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" smithywaiter "github.com/aws/smithy-go/waiter" "github.com/jmespath/go-jmespath" "time" ) // Returns information about provisioned instances, and supports pagination. This // operation can also return information for Amazon RDS instances and Amazon DocDB // instances. func (c *Client) DescribeDBInstances(ctx context.Context, params *DescribeDBInstancesInput, optFns ...func(*Options)) (*DescribeDBInstancesOutput, error) { if params == nil { params = &DescribeDBInstancesInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeDBInstances", params, optFns, c.addOperationDescribeDBInstancesMiddlewares) if err != nil { return nil, err } out := result.(*DescribeDBInstancesOutput) out.ResultMetadata = metadata return out, nil } type DescribeDBInstancesInput struct { // The user-supplied instance identifier. If this parameter is specified, // information from only the specific DB instance is returned. This parameter isn't // case-sensitive. Constraints: // - If supplied, must match the identifier of an existing DBInstance. DBInstanceIdentifier *string // A filter that specifies one or more DB instances to describe. Supported // filters: // - db-cluster-id - Accepts DB cluster identifiers and DB cluster Amazon // Resource Names (ARNs). The results list will only include information about the // DB instances associated with the DB clusters identified by these ARNs. // - engine - Accepts an engine name (such as neptune ), and restricts the // results list to DB instances created by that engine. // For example, to invoke this API from the Amazon CLI and filter so that only // Neptune DB instances are returned, you could use the following command: Filters []types.Filter // An optional pagination token provided by a previous DescribeDBInstances // request. If this parameter is specified, the response includes only records // beyond the marker, up to the value specified by MaxRecords . Marker *string // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so that the remaining results can be retrieved. // Default: 100 Constraints: Minimum 20, maximum 100. MaxRecords *int32 noSmithyDocumentSerde } type DescribeDBInstancesOutput struct { // A list of DBInstance instances. DBInstances []types.DBInstance // An optional pagination token provided by a previous request. If this parameter // is specified, the response includes only records beyond the marker, up to the // value specified by MaxRecords . Marker *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeDBInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBInstances{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBInstances{}, 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 = addOpDescribeDBInstancesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBInstances(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 } // DescribeDBInstancesAPIClient is a client that implements the // DescribeDBInstances operation. type DescribeDBInstancesAPIClient interface { DescribeDBInstances(context.Context, *DescribeDBInstancesInput, ...func(*Options)) (*DescribeDBInstancesOutput, error) } var _ DescribeDBInstancesAPIClient = (*Client)(nil) // DescribeDBInstancesPaginatorOptions is the paginator options for // DescribeDBInstances type DescribeDBInstancesPaginatorOptions struct { // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so that the remaining results can be retrieved. // Default: 100 Constraints: Minimum 20, maximum 100. 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 } // DescribeDBInstancesPaginator is a paginator for DescribeDBInstances type DescribeDBInstancesPaginator struct { options DescribeDBInstancesPaginatorOptions client DescribeDBInstancesAPIClient params *DescribeDBInstancesInput nextToken *string firstPage bool } // NewDescribeDBInstancesPaginator returns a new DescribeDBInstancesPaginator func NewDescribeDBInstancesPaginator(client DescribeDBInstancesAPIClient, params *DescribeDBInstancesInput, optFns ...func(*DescribeDBInstancesPaginatorOptions)) *DescribeDBInstancesPaginator { if params == nil { params = &DescribeDBInstancesInput{} } options := DescribeDBInstancesPaginatorOptions{} if params.MaxRecords != nil { options.Limit = *params.MaxRecords } for _, fn := range optFns { fn(&options) } return &DescribeDBInstancesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.Marker, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeDBInstancesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeDBInstances page. func (p *DescribeDBInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBInstancesOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.Marker = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxRecords = limit result, err := p.client.DescribeDBInstances(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.Marker if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } // DBInstanceAvailableWaiterOptions are waiter options for // DBInstanceAvailableWaiter type DBInstanceAvailableWaiterOptions struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error // MinDelay is the minimum amount of time to delay between retries. If unset, // DBInstanceAvailableWaiter will use default minimum delay of 30 seconds. Note // that MinDelay must resolve to a value lesser than or equal to the MaxDelay. MinDelay time.Duration // MaxDelay is the maximum amount of time to delay between retries. If unset or // set to zero, DBInstanceAvailableWaiter will use default max delay of 120 // seconds. Note that MaxDelay must resolve to value greater than or equal to the // MinDelay. MaxDelay time.Duration // LogWaitAttempts is used to enable logging for waiter retry attempts LogWaitAttempts bool // Retryable is function that can be used to override the service defined // waiter-behavior based on operation output, or returned error. This function is // used by the waiter to decide if a state is retryable or a terminal state. By // default service-modeled logic will populate this option. This option can thus be // used to define a custom waiter state with fall-back to service-modeled waiter // state mutators.The function returns an error in case of a failure state. In case // of retry state, this function returns a bool value of true and nil error, while // in case of success it returns a bool value of false and nil error. Retryable func(context.Context, *DescribeDBInstancesInput, *DescribeDBInstancesOutput, error) (bool, error) } // DBInstanceAvailableWaiter defines the waiters for DBInstanceAvailable type DBInstanceAvailableWaiter struct { client DescribeDBInstancesAPIClient options DBInstanceAvailableWaiterOptions } // NewDBInstanceAvailableWaiter constructs a DBInstanceAvailableWaiter. func NewDBInstanceAvailableWaiter(client DescribeDBInstancesAPIClient, optFns ...func(*DBInstanceAvailableWaiterOptions)) *DBInstanceAvailableWaiter { options := DBInstanceAvailableWaiterOptions{} options.MinDelay = 30 * time.Second options.MaxDelay = 120 * time.Second options.Retryable = dBInstanceAvailableStateRetryable for _, fn := range optFns { fn(&options) } return &DBInstanceAvailableWaiter{ client: client, options: options, } } // Wait calls the waiter function for DBInstanceAvailable waiter. The maxWaitDur // is the maximum wait duration the waiter will wait. The maxWaitDur is required // and must be greater than zero. func (w *DBInstanceAvailableWaiter) Wait(ctx context.Context, params *DescribeDBInstancesInput, maxWaitDur time.Duration, optFns ...func(*DBInstanceAvailableWaiterOptions)) error { _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) return err } // WaitForOutput calls the waiter function for DBInstanceAvailable waiter and // returns the output of the successful operation. The maxWaitDur is the maximum // wait duration the waiter will wait. The maxWaitDur is required and must be // greater than zero. func (w *DBInstanceAvailableWaiter) WaitForOutput(ctx context.Context, params *DescribeDBInstancesInput, maxWaitDur time.Duration, optFns ...func(*DBInstanceAvailableWaiterOptions)) (*DescribeDBInstancesOutput, error) { if maxWaitDur <= 0 { return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") } options := w.options for _, fn := range optFns { fn(&options) } if options.MaxDelay <= 0 { options.MaxDelay = 120 * time.Second } if options.MinDelay > options.MaxDelay { return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) } ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) defer cancelFn() logger := smithywaiter.Logger{} remainingTime := maxWaitDur var attempt int64 for { attempt++ apiOptions := options.APIOptions start := time.Now() if options.LogWaitAttempts { logger.Attempt = attempt apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) apiOptions = append(apiOptions, logger.AddLogger) } out, err := w.client.DescribeDBInstances(ctx, params, func(o *Options) { o.APIOptions = append(o.APIOptions, apiOptions...) }) retryable, err := options.Retryable(ctx, params, out, err) if err != nil { return nil, err } if !retryable { return out, nil } remainingTime -= time.Since(start) if remainingTime < options.MinDelay || remainingTime <= 0 { break } // compute exponential backoff between waiter retries delay, err := smithywaiter.ComputeDelay( attempt, options.MinDelay, options.MaxDelay, remainingTime, ) if err != nil { return nil, fmt.Errorf("error computing waiter delay, %w", err) } remainingTime -= delay // sleep for the delay amount before invoking a request if err := smithytime.SleepWithContext(ctx, delay); err != nil { return nil, fmt.Errorf("request cancelled while waiting, %w", err) } } return nil, fmt.Errorf("exceeded max wait time for DBInstanceAvailable waiter") } func dBInstanceAvailableStateRetryable(ctx context.Context, input *DescribeDBInstancesInput, output *DescribeDBInstancesOutput, err error) (bool, error) { if err == nil { pathValue, err := jmespath.Search("DBInstances[].DBInstanceStatus", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "available" var match = true listOfValues, ok := pathValue.([]interface{}) if !ok { return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) } if len(listOfValues) == 0 { match = false } for _, v := range listOfValues { value, ok := v.(*string) if !ok { return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) } if string(*value) != expectedValue { match = false } } if match { return false, nil } } if err == nil { pathValue, err := jmespath.Search("DBInstances[].DBInstanceStatus", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "deleted" listOfValues, ok := pathValue.([]interface{}) if !ok { return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) } for _, v := range listOfValues { value, ok := v.(*string) if !ok { return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) } if string(*value) == expectedValue { return false, fmt.Errorf("waiter state transitioned to Failure") } } } if err == nil { pathValue, err := jmespath.Search("DBInstances[].DBInstanceStatus", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "deleting" listOfValues, ok := pathValue.([]interface{}) if !ok { return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) } for _, v := range listOfValues { value, ok := v.(*string) if !ok { return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) } if string(*value) == expectedValue { return false, fmt.Errorf("waiter state transitioned to Failure") } } } if err == nil { pathValue, err := jmespath.Search("DBInstances[].DBInstanceStatus", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "failed" listOfValues, ok := pathValue.([]interface{}) if !ok { return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) } for _, v := range listOfValues { value, ok := v.(*string) if !ok { return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) } if string(*value) == expectedValue { return false, fmt.Errorf("waiter state transitioned to Failure") } } } if err == nil { pathValue, err := jmespath.Search("DBInstances[].DBInstanceStatus", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "incompatible-restore" listOfValues, ok := pathValue.([]interface{}) if !ok { return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) } for _, v := range listOfValues { value, ok := v.(*string) if !ok { return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) } if string(*value) == expectedValue { return false, fmt.Errorf("waiter state transitioned to Failure") } } } if err == nil { pathValue, err := jmespath.Search("DBInstances[].DBInstanceStatus", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "incompatible-parameters" listOfValues, ok := pathValue.([]interface{}) if !ok { return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) } for _, v := range listOfValues { value, ok := v.(*string) if !ok { return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) } if string(*value) == expectedValue { return false, fmt.Errorf("waiter state transitioned to Failure") } } } return true, nil } // DBInstanceDeletedWaiterOptions are waiter options for DBInstanceDeletedWaiter type DBInstanceDeletedWaiterOptions struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error // MinDelay is the minimum amount of time to delay between retries. If unset, // DBInstanceDeletedWaiter will use default minimum delay of 30 seconds. Note that // MinDelay must resolve to a value lesser than or equal to the MaxDelay. MinDelay time.Duration // MaxDelay is the maximum amount of time to delay between retries. If unset or // set to zero, DBInstanceDeletedWaiter will use default max delay of 120 seconds. // Note that MaxDelay must resolve to value greater than or equal to the MinDelay. MaxDelay time.Duration // LogWaitAttempts is used to enable logging for waiter retry attempts LogWaitAttempts bool // Retryable is function that can be used to override the service defined // waiter-behavior based on operation output, or returned error. This function is // used by the waiter to decide if a state is retryable or a terminal state. By // default service-modeled logic will populate this option. This option can thus be // used to define a custom waiter state with fall-back to service-modeled waiter // state mutators.The function returns an error in case of a failure state. In case // of retry state, this function returns a bool value of true and nil error, while // in case of success it returns a bool value of false and nil error. Retryable func(context.Context, *DescribeDBInstancesInput, *DescribeDBInstancesOutput, error) (bool, error) } // DBInstanceDeletedWaiter defines the waiters for DBInstanceDeleted type DBInstanceDeletedWaiter struct { client DescribeDBInstancesAPIClient options DBInstanceDeletedWaiterOptions } // NewDBInstanceDeletedWaiter constructs a DBInstanceDeletedWaiter. func NewDBInstanceDeletedWaiter(client DescribeDBInstancesAPIClient, optFns ...func(*DBInstanceDeletedWaiterOptions)) *DBInstanceDeletedWaiter { options := DBInstanceDeletedWaiterOptions{} options.MinDelay = 30 * time.Second options.MaxDelay = 120 * time.Second options.Retryable = dBInstanceDeletedStateRetryable for _, fn := range optFns { fn(&options) } return &DBInstanceDeletedWaiter{ client: client, options: options, } } // Wait calls the waiter function for DBInstanceDeleted waiter. The maxWaitDur is // the maximum wait duration the waiter will wait. The maxWaitDur is required and // must be greater than zero. func (w *DBInstanceDeletedWaiter) Wait(ctx context.Context, params *DescribeDBInstancesInput, maxWaitDur time.Duration, optFns ...func(*DBInstanceDeletedWaiterOptions)) error { _, err := w.WaitForOutput(ctx, params, maxWaitDur, optFns...) return err } // WaitForOutput calls the waiter function for DBInstanceDeleted waiter and // returns the output of the successful operation. The maxWaitDur is the maximum // wait duration the waiter will wait. The maxWaitDur is required and must be // greater than zero. func (w *DBInstanceDeletedWaiter) WaitForOutput(ctx context.Context, params *DescribeDBInstancesInput, maxWaitDur time.Duration, optFns ...func(*DBInstanceDeletedWaiterOptions)) (*DescribeDBInstancesOutput, error) { if maxWaitDur <= 0 { return nil, fmt.Errorf("maximum wait time for waiter must be greater than zero") } options := w.options for _, fn := range optFns { fn(&options) } if options.MaxDelay <= 0 { options.MaxDelay = 120 * time.Second } if options.MinDelay > options.MaxDelay { return nil, fmt.Errorf("minimum waiter delay %v must be lesser than or equal to maximum waiter delay of %v.", options.MinDelay, options.MaxDelay) } ctx, cancelFn := context.WithTimeout(ctx, maxWaitDur) defer cancelFn() logger := smithywaiter.Logger{} remainingTime := maxWaitDur var attempt int64 for { attempt++ apiOptions := options.APIOptions start := time.Now() if options.LogWaitAttempts { logger.Attempt = attempt apiOptions = append([]func(*middleware.Stack) error{}, options.APIOptions...) apiOptions = append(apiOptions, logger.AddLogger) } out, err := w.client.DescribeDBInstances(ctx, params, func(o *Options) { o.APIOptions = append(o.APIOptions, apiOptions...) }) retryable, err := options.Retryable(ctx, params, out, err) if err != nil { return nil, err } if !retryable { return out, nil } remainingTime -= time.Since(start) if remainingTime < options.MinDelay || remainingTime <= 0 { break } // compute exponential backoff between waiter retries delay, err := smithywaiter.ComputeDelay( attempt, options.MinDelay, options.MaxDelay, remainingTime, ) if err != nil { return nil, fmt.Errorf("error computing waiter delay, %w", err) } remainingTime -= delay // sleep for the delay amount before invoking a request if err := smithytime.SleepWithContext(ctx, delay); err != nil { return nil, fmt.Errorf("request cancelled while waiting, %w", err) } } return nil, fmt.Errorf("exceeded max wait time for DBInstanceDeleted waiter") } func dBInstanceDeletedStateRetryable(ctx context.Context, input *DescribeDBInstancesInput, output *DescribeDBInstancesOutput, err error) (bool, error) { if err == nil { pathValue, err := jmespath.Search("DBInstances[].DBInstanceStatus", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "deleted" var match = true listOfValues, ok := pathValue.([]interface{}) if !ok { return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) } if len(listOfValues) == 0 { match = false } for _, v := range listOfValues { value, ok := v.(*string) if !ok { return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) } if string(*value) != expectedValue { match = false } } if match { return false, nil } } if err != nil { var apiErr smithy.APIError ok := errors.As(err, &apiErr) if !ok { return false, fmt.Errorf("expected err to be of type smithy.APIError, got %w", err) } if "DBInstanceNotFound" == apiErr.ErrorCode() { return false, nil } } if err == nil { pathValue, err := jmespath.Search("DBInstances[].DBInstanceStatus", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "creating" listOfValues, ok := pathValue.([]interface{}) if !ok { return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) } for _, v := range listOfValues { value, ok := v.(*string) if !ok { return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) } if string(*value) == expectedValue { return false, fmt.Errorf("waiter state transitioned to Failure") } } } if err == nil { pathValue, err := jmespath.Search("DBInstances[].DBInstanceStatus", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "modifying" listOfValues, ok := pathValue.([]interface{}) if !ok { return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) } for _, v := range listOfValues { value, ok := v.(*string) if !ok { return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) } if string(*value) == expectedValue { return false, fmt.Errorf("waiter state transitioned to Failure") } } } if err == nil { pathValue, err := jmespath.Search("DBInstances[].DBInstanceStatus", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "rebooting" listOfValues, ok := pathValue.([]interface{}) if !ok { return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) } for _, v := range listOfValues { value, ok := v.(*string) if !ok { return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) } if string(*value) == expectedValue { return false, fmt.Errorf("waiter state transitioned to Failure") } } } if err == nil { pathValue, err := jmespath.Search("DBInstances[].DBInstanceStatus", output) if err != nil { return false, fmt.Errorf("error evaluating waiter state: %w", err) } expectedValue := "resetting-master-credentials" listOfValues, ok := pathValue.([]interface{}) if !ok { return false, fmt.Errorf("waiter comparator expected list got %T", pathValue) } for _, v := range listOfValues { value, ok := v.(*string) if !ok { return false, fmt.Errorf("waiter comparator expected *string value, got %T", pathValue) } if string(*value) == expectedValue { return false, fmt.Errorf("waiter state transitioned to Failure") } } } return true, nil } func newServiceMetadataMiddleware_opDescribeDBInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DescribeDBInstances", } }
836
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of DBParameterGroup descriptions. If a DBParameterGroupName is // specified, the list will contain only the description of the specified DB // parameter group. func (c *Client) DescribeDBParameterGroups(ctx context.Context, params *DescribeDBParameterGroupsInput, optFns ...func(*Options)) (*DescribeDBParameterGroupsOutput, error) { if params == nil { params = &DescribeDBParameterGroupsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeDBParameterGroups", params, optFns, c.addOperationDescribeDBParameterGroupsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeDBParameterGroupsOutput) out.ResultMetadata = metadata return out, nil } type DescribeDBParameterGroupsInput struct { // The name of a specific DB parameter group to return details for. Constraints: // - If supplied, must match the name of an existing DBClusterParameterGroup. DBParameterGroupName *string // This parameter is not currently supported. Filters []types.Filter // An optional pagination token provided by a previous DescribeDBParameterGroups // request. If this parameter is specified, the response includes only records // beyond the marker, up to the value specified by MaxRecords . Marker *string // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so that the remaining results can be retrieved. // Default: 100 Constraints: Minimum 20, maximum 100. MaxRecords *int32 noSmithyDocumentSerde } type DescribeDBParameterGroupsOutput struct { // A list of DBParameterGroup instances. DBParameterGroups []types.DBParameterGroup // An optional pagination token provided by a previous request. If this parameter // is specified, the response includes only records beyond the marker, up to the // value specified by MaxRecords . Marker *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeDBParameterGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBParameterGroups{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBParameterGroups{}, 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 = addOpDescribeDBParameterGroupsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBParameterGroups(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 } // DescribeDBParameterGroupsAPIClient is a client that implements the // DescribeDBParameterGroups operation. type DescribeDBParameterGroupsAPIClient interface { DescribeDBParameterGroups(context.Context, *DescribeDBParameterGroupsInput, ...func(*Options)) (*DescribeDBParameterGroupsOutput, error) } var _ DescribeDBParameterGroupsAPIClient = (*Client)(nil) // DescribeDBParameterGroupsPaginatorOptions is the paginator options for // DescribeDBParameterGroups type DescribeDBParameterGroupsPaginatorOptions struct { // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so that the remaining results can be retrieved. // Default: 100 Constraints: Minimum 20, maximum 100. 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 } // DescribeDBParameterGroupsPaginator is a paginator for DescribeDBParameterGroups type DescribeDBParameterGroupsPaginator struct { options DescribeDBParameterGroupsPaginatorOptions client DescribeDBParameterGroupsAPIClient params *DescribeDBParameterGroupsInput nextToken *string firstPage bool } // NewDescribeDBParameterGroupsPaginator returns a new // DescribeDBParameterGroupsPaginator func NewDescribeDBParameterGroupsPaginator(client DescribeDBParameterGroupsAPIClient, params *DescribeDBParameterGroupsInput, optFns ...func(*DescribeDBParameterGroupsPaginatorOptions)) *DescribeDBParameterGroupsPaginator { if params == nil { params = &DescribeDBParameterGroupsInput{} } options := DescribeDBParameterGroupsPaginatorOptions{} if params.MaxRecords != nil { options.Limit = *params.MaxRecords } for _, fn := range optFns { fn(&options) } return &DescribeDBParameterGroupsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.Marker, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeDBParameterGroupsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeDBParameterGroups page. func (p *DescribeDBParameterGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBParameterGroupsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.Marker = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxRecords = limit result, err := p.client.DescribeDBParameterGroups(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.Marker if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeDBParameterGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DescribeDBParameterGroups", } }
241
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns the detailed parameter list for a particular DB parameter group. func (c *Client) DescribeDBParameters(ctx context.Context, params *DescribeDBParametersInput, optFns ...func(*Options)) (*DescribeDBParametersOutput, error) { if params == nil { params = &DescribeDBParametersInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeDBParameters", params, optFns, c.addOperationDescribeDBParametersMiddlewares) if err != nil { return nil, err } out := result.(*DescribeDBParametersOutput) out.ResultMetadata = metadata return out, nil } type DescribeDBParametersInput struct { // The name of a specific DB parameter group to return details for. Constraints: // - If supplied, must match the name of an existing DBParameterGroup. // // This member is required. DBParameterGroupName *string // This parameter is not currently supported. Filters []types.Filter // An optional pagination token provided by a previous DescribeDBParameters // request. If this parameter is specified, the response includes only records // beyond the marker, up to the value specified by MaxRecords . Marker *string // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so that the remaining results can be retrieved. // Default: 100 Constraints: Minimum 20, maximum 100. MaxRecords *int32 // The parameter types to return. Default: All parameter types returned Valid // Values: user | system | engine-default Source *string noSmithyDocumentSerde } type DescribeDBParametersOutput struct { // An optional pagination token provided by a previous request. If this parameter // is specified, the response includes only records beyond the marker, up to the // value specified by MaxRecords . Marker *string // A list of Parameter values. Parameters []types.Parameter // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeDBParametersMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBParameters{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBParameters{}, 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 = addOpDescribeDBParametersValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBParameters(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 } // DescribeDBParametersAPIClient is a client that implements the // DescribeDBParameters operation. type DescribeDBParametersAPIClient interface { DescribeDBParameters(context.Context, *DescribeDBParametersInput, ...func(*Options)) (*DescribeDBParametersOutput, error) } var _ DescribeDBParametersAPIClient = (*Client)(nil) // DescribeDBParametersPaginatorOptions is the paginator options for // DescribeDBParameters type DescribeDBParametersPaginatorOptions struct { // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so that the remaining results can be retrieved. // Default: 100 Constraints: Minimum 20, maximum 100. 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 } // DescribeDBParametersPaginator is a paginator for DescribeDBParameters type DescribeDBParametersPaginator struct { options DescribeDBParametersPaginatorOptions client DescribeDBParametersAPIClient params *DescribeDBParametersInput nextToken *string firstPage bool } // NewDescribeDBParametersPaginator returns a new DescribeDBParametersPaginator func NewDescribeDBParametersPaginator(client DescribeDBParametersAPIClient, params *DescribeDBParametersInput, optFns ...func(*DescribeDBParametersPaginatorOptions)) *DescribeDBParametersPaginator { if params == nil { params = &DescribeDBParametersInput{} } options := DescribeDBParametersPaginatorOptions{} if params.MaxRecords != nil { options.Limit = *params.MaxRecords } for _, fn := range optFns { fn(&options) } return &DescribeDBParametersPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.Marker, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeDBParametersPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeDBParameters page. func (p *DescribeDBParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBParametersOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.Marker = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxRecords = limit result, err := p.client.DescribeDBParameters(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.Marker if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeDBParameters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DescribeDBParameters", } }
244
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of DBSubnetGroup descriptions. If a DBSubnetGroupName is // specified, the list will contain only the descriptions of the specified // DBSubnetGroup. For an overview of CIDR ranges, go to the Wikipedia Tutorial (http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) // . func (c *Client) DescribeDBSubnetGroups(ctx context.Context, params *DescribeDBSubnetGroupsInput, optFns ...func(*Options)) (*DescribeDBSubnetGroupsOutput, error) { if params == nil { params = &DescribeDBSubnetGroupsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeDBSubnetGroups", params, optFns, c.addOperationDescribeDBSubnetGroupsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeDBSubnetGroupsOutput) out.ResultMetadata = metadata return out, nil } type DescribeDBSubnetGroupsInput struct { // The name of the DB subnet group to return details for. DBSubnetGroupName *string // This parameter is not currently supported. Filters []types.Filter // An optional pagination token provided by a previous DescribeDBSubnetGroups // request. If this parameter is specified, the response includes only records // beyond the marker, up to the value specified by MaxRecords . Marker *string // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so that the remaining results can be retrieved. // Default: 100 Constraints: Minimum 20, maximum 100. MaxRecords *int32 noSmithyDocumentSerde } type DescribeDBSubnetGroupsOutput struct { // A list of DBSubnetGroup instances. DBSubnetGroups []types.DBSubnetGroup // An optional pagination token provided by a previous request. If this parameter // is specified, the response includes only records beyond the marker, up to the // value specified by MaxRecords . Marker *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeDBSubnetGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeDBSubnetGroups{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeDBSubnetGroups{}, 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 = addOpDescribeDBSubnetGroupsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDBSubnetGroups(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 } // DescribeDBSubnetGroupsAPIClient is a client that implements the // DescribeDBSubnetGroups operation. type DescribeDBSubnetGroupsAPIClient interface { DescribeDBSubnetGroups(context.Context, *DescribeDBSubnetGroupsInput, ...func(*Options)) (*DescribeDBSubnetGroupsOutput, error) } var _ DescribeDBSubnetGroupsAPIClient = (*Client)(nil) // DescribeDBSubnetGroupsPaginatorOptions is the paginator options for // DescribeDBSubnetGroups type DescribeDBSubnetGroupsPaginatorOptions struct { // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so that the remaining results can be retrieved. // Default: 100 Constraints: Minimum 20, maximum 100. 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 } // DescribeDBSubnetGroupsPaginator is a paginator for DescribeDBSubnetGroups type DescribeDBSubnetGroupsPaginator struct { options DescribeDBSubnetGroupsPaginatorOptions client DescribeDBSubnetGroupsAPIClient params *DescribeDBSubnetGroupsInput nextToken *string firstPage bool } // NewDescribeDBSubnetGroupsPaginator returns a new DescribeDBSubnetGroupsPaginator func NewDescribeDBSubnetGroupsPaginator(client DescribeDBSubnetGroupsAPIClient, params *DescribeDBSubnetGroupsInput, optFns ...func(*DescribeDBSubnetGroupsPaginatorOptions)) *DescribeDBSubnetGroupsPaginator { if params == nil { params = &DescribeDBSubnetGroupsInput{} } options := DescribeDBSubnetGroupsPaginatorOptions{} if params.MaxRecords != nil { options.Limit = *params.MaxRecords } for _, fn := range optFns { fn(&options) } return &DescribeDBSubnetGroupsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.Marker, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeDBSubnetGroupsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeDBSubnetGroups page. func (p *DescribeDBSubnetGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBSubnetGroupsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.Marker = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxRecords = limit result, err := p.client.DescribeDBSubnetGroups(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.Marker if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeDBSubnetGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DescribeDBSubnetGroups", } }
240
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune 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/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns the default engine and system parameter information for the cluster // database engine. func (c *Client) DescribeEngineDefaultClusterParameters(ctx context.Context, params *DescribeEngineDefaultClusterParametersInput, optFns ...func(*Options)) (*DescribeEngineDefaultClusterParametersOutput, error) { if params == nil { params = &DescribeEngineDefaultClusterParametersInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeEngineDefaultClusterParameters", params, optFns, c.addOperationDescribeEngineDefaultClusterParametersMiddlewares) if err != nil { return nil, err } out := result.(*DescribeEngineDefaultClusterParametersOutput) out.ResultMetadata = metadata return out, nil } type DescribeEngineDefaultClusterParametersInput struct { // The name of the DB cluster parameter group family to return engine parameter // information for. // // This member is required. DBParameterGroupFamily *string // This parameter is not currently supported. Filters []types.Filter // An optional pagination token provided by a previous // DescribeEngineDefaultClusterParameters request. If this parameter is specified, // the response includes only records beyond the marker, up to the value specified // by MaxRecords . Marker *string // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so that the remaining results can be retrieved. // Default: 100 Constraints: Minimum 20, maximum 100. MaxRecords *int32 noSmithyDocumentSerde } type DescribeEngineDefaultClusterParametersOutput struct { // Contains the result of a successful invocation of the // DescribeEngineDefaultParameters action. EngineDefaults *types.EngineDefaults // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeEngineDefaultClusterParametersMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeEngineDefaultClusterParameters{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeEngineDefaultClusterParameters{}, 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 = addOpDescribeEngineDefaultClusterParametersValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeEngineDefaultClusterParameters(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_opDescribeEngineDefaultClusterParameters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DescribeEngineDefaultClusterParameters", } }
143
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns the default engine and system parameter information for the specified // database engine. func (c *Client) DescribeEngineDefaultParameters(ctx context.Context, params *DescribeEngineDefaultParametersInput, optFns ...func(*Options)) (*DescribeEngineDefaultParametersOutput, error) { if params == nil { params = &DescribeEngineDefaultParametersInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeEngineDefaultParameters", params, optFns, c.addOperationDescribeEngineDefaultParametersMiddlewares) if err != nil { return nil, err } out := result.(*DescribeEngineDefaultParametersOutput) out.ResultMetadata = metadata return out, nil } type DescribeEngineDefaultParametersInput struct { // The name of the DB parameter group family. // // This member is required. DBParameterGroupFamily *string // Not currently supported. Filters []types.Filter // An optional pagination token provided by a previous // DescribeEngineDefaultParameters request. If this parameter is specified, the // response includes only records beyond the marker, up to the value specified by // MaxRecords . Marker *string // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so that the remaining results can be retrieved. // Default: 100 Constraints: Minimum 20, maximum 100. MaxRecords *int32 noSmithyDocumentSerde } type DescribeEngineDefaultParametersOutput struct { // Contains the result of a successful invocation of the // DescribeEngineDefaultParameters action. EngineDefaults *types.EngineDefaults // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeEngineDefaultParametersMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeEngineDefaultParameters{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeEngineDefaultParameters{}, 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 = addOpDescribeEngineDefaultParametersValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeEngineDefaultParameters(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 } // DescribeEngineDefaultParametersAPIClient is a client that implements the // DescribeEngineDefaultParameters operation. type DescribeEngineDefaultParametersAPIClient interface { DescribeEngineDefaultParameters(context.Context, *DescribeEngineDefaultParametersInput, ...func(*Options)) (*DescribeEngineDefaultParametersOutput, error) } var _ DescribeEngineDefaultParametersAPIClient = (*Client)(nil) // DescribeEngineDefaultParametersPaginatorOptions is the paginator options for // DescribeEngineDefaultParameters type DescribeEngineDefaultParametersPaginatorOptions struct { // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so that the remaining results can be retrieved. // Default: 100 Constraints: Minimum 20, maximum 100. 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 } // DescribeEngineDefaultParametersPaginator is a paginator for // DescribeEngineDefaultParameters type DescribeEngineDefaultParametersPaginator struct { options DescribeEngineDefaultParametersPaginatorOptions client DescribeEngineDefaultParametersAPIClient params *DescribeEngineDefaultParametersInput nextToken *string firstPage bool } // NewDescribeEngineDefaultParametersPaginator returns a new // DescribeEngineDefaultParametersPaginator func NewDescribeEngineDefaultParametersPaginator(client DescribeEngineDefaultParametersAPIClient, params *DescribeEngineDefaultParametersInput, optFns ...func(*DescribeEngineDefaultParametersPaginatorOptions)) *DescribeEngineDefaultParametersPaginator { if params == nil { params = &DescribeEngineDefaultParametersInput{} } options := DescribeEngineDefaultParametersPaginatorOptions{} if params.MaxRecords != nil { options.Limit = *params.MaxRecords } for _, fn := range optFns { fn(&options) } return &DescribeEngineDefaultParametersPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.Marker, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeEngineDefaultParametersPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeEngineDefaultParameters page. func (p *DescribeEngineDefaultParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEngineDefaultParametersOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.Marker = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxRecords = limit result, err := p.client.DescribeEngineDefaultParameters(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = nil if result.EngineDefaults != nil { p.nextToken = result.EngineDefaults.Marker } if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeEngineDefaultParameters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DescribeEngineDefaultParameters", } }
242
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune 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/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Displays a list of categories for all event source types, or, if specified, for // a specified source type. func (c *Client) DescribeEventCategories(ctx context.Context, params *DescribeEventCategoriesInput, optFns ...func(*Options)) (*DescribeEventCategoriesOutput, error) { if params == nil { params = &DescribeEventCategoriesInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeEventCategories", params, optFns, c.addOperationDescribeEventCategoriesMiddlewares) if err != nil { return nil, err } out := result.(*DescribeEventCategoriesOutput) out.ResultMetadata = metadata return out, nil } type DescribeEventCategoriesInput struct { // This parameter is not currently supported. Filters []types.Filter // The type of source that is generating the events. Valid values: db-instance | // db-parameter-group | db-security-group | db-snapshot SourceType *string noSmithyDocumentSerde } type DescribeEventCategoriesOutput struct { // A list of EventCategoriesMap data types. EventCategoriesMapList []types.EventCategoriesMap // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeEventCategoriesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeEventCategories{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeEventCategories{}, 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 = addOpDescribeEventCategoriesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeEventCategories(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_opDescribeEventCategories(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DescribeEventCategories", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Returns events related to DB instances, DB security groups, DB snapshots, and // DB parameter groups for the past 14 days. Events specific to a particular DB // instance, DB security group, database snapshot, or DB parameter group can be // obtained by providing the name as a parameter. By default, the past hour of // events are returned. func (c *Client) DescribeEvents(ctx context.Context, params *DescribeEventsInput, optFns ...func(*Options)) (*DescribeEventsOutput, error) { if params == nil { params = &DescribeEventsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeEvents", params, optFns, c.addOperationDescribeEventsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeEventsOutput) out.ResultMetadata = metadata return out, nil } type DescribeEventsInput struct { // The number of minutes to retrieve events for. Default: 60 Duration *int32 // The end of the time interval for which to retrieve events, specified in ISO // 8601 format. For more information about ISO 8601, go to the ISO8601 Wikipedia // page. (http://en.wikipedia.org/wiki/ISO_8601) Example: 2009-07-08T18:00Z EndTime *time.Time // A list of event categories that trigger notifications for a event notification // subscription. EventCategories []string // This parameter is not currently supported. Filters []types.Filter // An optional pagination token provided by a previous DescribeEvents request. If // this parameter is specified, the response includes only records beyond the // marker, up to the value specified by MaxRecords . Marker *string // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so that the remaining results can be retrieved. // Default: 100 Constraints: Minimum 20, maximum 100. MaxRecords *int32 // The identifier of the event source for which events are returned. If not // specified, then all sources are included in the response. Constraints: // - If SourceIdentifier is supplied, SourceType must also be provided. // - If the source type is DBInstance , then a DBInstanceIdentifier must be // supplied. // - If the source type is DBSecurityGroup , a DBSecurityGroupName must be // supplied. // - If the source type is DBParameterGroup , a DBParameterGroupName must be // supplied. // - If the source type is DBSnapshot , a DBSnapshotIdentifier must be supplied. // - Cannot end with a hyphen or contain two consecutive hyphens. SourceIdentifier *string // The event source to retrieve events for. If no value is specified, all events // are returned. SourceType types.SourceType // The beginning of the time interval to retrieve events for, specified in ISO // 8601 format. For more information about ISO 8601, go to the ISO8601 Wikipedia // page. (http://en.wikipedia.org/wiki/ISO_8601) Example: 2009-07-08T18:00Z StartTime *time.Time noSmithyDocumentSerde } type DescribeEventsOutput struct { // A list of Event instances. Events []types.Event // An optional pagination token provided by a previous Events request. If this // parameter is specified, the response includes only records beyond the marker, up // to the value specified by MaxRecords . Marker *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeEventsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeEvents{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeEvents{}, 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 = addOpDescribeEventsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeEvents(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 } // DescribeEventsAPIClient is a client that implements the DescribeEvents // operation. type DescribeEventsAPIClient interface { DescribeEvents(context.Context, *DescribeEventsInput, ...func(*Options)) (*DescribeEventsOutput, error) } var _ DescribeEventsAPIClient = (*Client)(nil) // DescribeEventsPaginatorOptions is the paginator options for DescribeEvents type DescribeEventsPaginatorOptions struct { // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so that the remaining results can be retrieved. // Default: 100 Constraints: Minimum 20, maximum 100. 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 } // DescribeEventsPaginator is a paginator for DescribeEvents type DescribeEventsPaginator struct { options DescribeEventsPaginatorOptions client DescribeEventsAPIClient params *DescribeEventsInput nextToken *string firstPage bool } // NewDescribeEventsPaginator returns a new DescribeEventsPaginator func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { if params == nil { params = &DescribeEventsInput{} } options := DescribeEventsPaginatorOptions{} if params.MaxRecords != nil { options.Limit = *params.MaxRecords } for _, fn := range optFns { fn(&options) } return &DescribeEventsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.Marker, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeEventsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeEvents page. func (p *DescribeEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.Marker = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxRecords = limit result, err := p.client.DescribeEvents(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.Marker if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DescribeEvents", } }
272
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists all the subscription descriptions for a customer account. The description // for a subscription includes SubscriptionName, SNSTopicARN, CustomerID, // SourceType, SourceID, CreationTime, and Status. If you specify a // SubscriptionName, lists the description for that subscription. func (c *Client) DescribeEventSubscriptions(ctx context.Context, params *DescribeEventSubscriptionsInput, optFns ...func(*Options)) (*DescribeEventSubscriptionsOutput, error) { if params == nil { params = &DescribeEventSubscriptionsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeEventSubscriptions", params, optFns, c.addOperationDescribeEventSubscriptionsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeEventSubscriptionsOutput) out.ResultMetadata = metadata return out, nil } type DescribeEventSubscriptionsInput struct { // This parameter is not currently supported. Filters []types.Filter // An optional pagination token provided by a previous // DescribeOrderableDBInstanceOptions request. If this parameter is specified, the // response includes only records beyond the marker, up to the value specified by // MaxRecords . Marker *string // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so that the remaining results can be retrieved. // Default: 100 Constraints: Minimum 20, maximum 100. MaxRecords *int32 // The name of the event notification subscription you want to describe. SubscriptionName *string noSmithyDocumentSerde } type DescribeEventSubscriptionsOutput struct { // A list of EventSubscriptions data types. EventSubscriptionsList []types.EventSubscription // An optional pagination token provided by a previous // DescribeOrderableDBInstanceOptions request. If this parameter is specified, the // response includes only records beyond the marker, up to the value specified by // MaxRecords . Marker *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeEventSubscriptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeEventSubscriptions{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeEventSubscriptions{}, 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 = addOpDescribeEventSubscriptionsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeEventSubscriptions(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 } // DescribeEventSubscriptionsAPIClient is a client that implements the // DescribeEventSubscriptions operation. type DescribeEventSubscriptionsAPIClient interface { DescribeEventSubscriptions(context.Context, *DescribeEventSubscriptionsInput, ...func(*Options)) (*DescribeEventSubscriptionsOutput, error) } var _ DescribeEventSubscriptionsAPIClient = (*Client)(nil) // DescribeEventSubscriptionsPaginatorOptions is the paginator options for // DescribeEventSubscriptions type DescribeEventSubscriptionsPaginatorOptions struct { // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so that the remaining results can be retrieved. // Default: 100 Constraints: Minimum 20, maximum 100. 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 } // DescribeEventSubscriptionsPaginator is a paginator for // DescribeEventSubscriptions type DescribeEventSubscriptionsPaginator struct { options DescribeEventSubscriptionsPaginatorOptions client DescribeEventSubscriptionsAPIClient params *DescribeEventSubscriptionsInput nextToken *string firstPage bool } // NewDescribeEventSubscriptionsPaginator returns a new // DescribeEventSubscriptionsPaginator func NewDescribeEventSubscriptionsPaginator(client DescribeEventSubscriptionsAPIClient, params *DescribeEventSubscriptionsInput, optFns ...func(*DescribeEventSubscriptionsPaginatorOptions)) *DescribeEventSubscriptionsPaginator { if params == nil { params = &DescribeEventSubscriptionsInput{} } options := DescribeEventSubscriptionsPaginatorOptions{} if params.MaxRecords != nil { options.Limit = *params.MaxRecords } for _, fn := range optFns { fn(&options) } return &DescribeEventSubscriptionsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.Marker, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeEventSubscriptionsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeEventSubscriptions page. func (p *DescribeEventSubscriptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventSubscriptionsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.Marker = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxRecords = limit result, err := p.client.DescribeEventSubscriptions(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.Marker if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeEventSubscriptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DescribeEventSubscriptions", } }
244
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns information about Neptune global database clusters. This API supports // pagination. func (c *Client) DescribeGlobalClusters(ctx context.Context, params *DescribeGlobalClustersInput, optFns ...func(*Options)) (*DescribeGlobalClustersOutput, error) { if params == nil { params = &DescribeGlobalClustersInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeGlobalClusters", params, optFns, c.addOperationDescribeGlobalClustersMiddlewares) if err != nil { return nil, err } out := result.(*DescribeGlobalClustersOutput) out.ResultMetadata = metadata return out, nil } type DescribeGlobalClustersInput struct { // The user-supplied DB cluster identifier. If this parameter is specified, only // information about the specified DB cluster is returned. This parameter is not // case-sensitive. Constraints: If supplied, must match an existing DB cluster // identifier. GlobalClusterIdentifier *string // (Optional) A pagination token returned by a previous call to // DescribeGlobalClusters . If this parameter is specified, the response will only // include records beyond the marker, up to the number specified by MaxRecords . Marker *string // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination marker token is included in // the response that you can use to retrieve the remaining results. Default: 100 // Constraints: Minimum 20, maximum 100. MaxRecords *int32 noSmithyDocumentSerde } type DescribeGlobalClustersOutput struct { // The list of global clusters and instances returned by this request. GlobalClusters []types.GlobalCluster // A pagination token. If this parameter is returned in the response, more records // are available, which can be retrieved by one or more additional calls to // DescribeGlobalClusters . Marker *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeGlobalClustersMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeGlobalClusters{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeGlobalClusters{}, 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 = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeGlobalClusters(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 } // DescribeGlobalClustersAPIClient is a client that implements the // DescribeGlobalClusters operation. type DescribeGlobalClustersAPIClient interface { DescribeGlobalClusters(context.Context, *DescribeGlobalClustersInput, ...func(*Options)) (*DescribeGlobalClustersOutput, error) } var _ DescribeGlobalClustersAPIClient = (*Client)(nil) // DescribeGlobalClustersPaginatorOptions is the paginator options for // DescribeGlobalClusters type DescribeGlobalClustersPaginatorOptions struct { // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination marker token is included in // the response that you can use to retrieve the remaining results. Default: 100 // Constraints: Minimum 20, maximum 100. 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 } // DescribeGlobalClustersPaginator is a paginator for DescribeGlobalClusters type DescribeGlobalClustersPaginator struct { options DescribeGlobalClustersPaginatorOptions client DescribeGlobalClustersAPIClient params *DescribeGlobalClustersInput nextToken *string firstPage bool } // NewDescribeGlobalClustersPaginator returns a new DescribeGlobalClustersPaginator func NewDescribeGlobalClustersPaginator(client DescribeGlobalClustersAPIClient, params *DescribeGlobalClustersInput, optFns ...func(*DescribeGlobalClustersPaginatorOptions)) *DescribeGlobalClustersPaginator { if params == nil { params = &DescribeGlobalClustersInput{} } options := DescribeGlobalClustersPaginatorOptions{} if params.MaxRecords != nil { options.Limit = *params.MaxRecords } for _, fn := range optFns { fn(&options) } return &DescribeGlobalClustersPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.Marker, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeGlobalClustersPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeGlobalClusters page. func (p *DescribeGlobalClustersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeGlobalClustersOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.Marker = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxRecords = limit result, err := p.client.DescribeGlobalClusters(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.Marker if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeGlobalClusters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DescribeGlobalClusters", } }
235
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of orderable DB instance options for the specified engine. func (c *Client) DescribeOrderableDBInstanceOptions(ctx context.Context, params *DescribeOrderableDBInstanceOptionsInput, optFns ...func(*Options)) (*DescribeOrderableDBInstanceOptionsOutput, error) { if params == nil { params = &DescribeOrderableDBInstanceOptionsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeOrderableDBInstanceOptions", params, optFns, c.addOperationDescribeOrderableDBInstanceOptionsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeOrderableDBInstanceOptionsOutput) out.ResultMetadata = metadata return out, nil } type DescribeOrderableDBInstanceOptionsInput struct { // The name of the engine to retrieve DB instance options for. // // This member is required. Engine *string // The DB instance class filter value. Specify this parameter to show only the // available offerings matching the specified DB instance class. DBInstanceClass *string // The engine version filter value. Specify this parameter to show only the // available offerings matching the specified engine version. EngineVersion *string // This parameter is not currently supported. Filters []types.Filter // The license model filter value. Specify this parameter to show only the // available offerings matching the specified license model. LicenseModel *string // An optional pagination token provided by a previous // DescribeOrderableDBInstanceOptions request. If this parameter is specified, the // response includes only records beyond the marker, up to the value specified by // MaxRecords . Marker *string // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so that the remaining results can be retrieved. // Default: 100 Constraints: Minimum 20, maximum 100. MaxRecords *int32 // The VPC filter value. Specify this parameter to show only the available VPC or // non-VPC offerings. Vpc *bool noSmithyDocumentSerde } type DescribeOrderableDBInstanceOptionsOutput struct { // An optional pagination token provided by a previous OrderableDBInstanceOptions // request. If this parameter is specified, the response includes only records // beyond the marker, up to the value specified by MaxRecords . Marker *string // An OrderableDBInstanceOption structure containing information about orderable // options for the DB instance. OrderableDBInstanceOptions []types.OrderableDBInstanceOption // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeOrderableDBInstanceOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeOrderableDBInstanceOptions{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeOrderableDBInstanceOptions{}, 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 = addOpDescribeOrderableDBInstanceOptionsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeOrderableDBInstanceOptions(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 } // DescribeOrderableDBInstanceOptionsAPIClient is a client that implements the // DescribeOrderableDBInstanceOptions operation. type DescribeOrderableDBInstanceOptionsAPIClient interface { DescribeOrderableDBInstanceOptions(context.Context, *DescribeOrderableDBInstanceOptionsInput, ...func(*Options)) (*DescribeOrderableDBInstanceOptionsOutput, error) } var _ DescribeOrderableDBInstanceOptionsAPIClient = (*Client)(nil) // DescribeOrderableDBInstanceOptionsPaginatorOptions is the paginator options for // DescribeOrderableDBInstanceOptions type DescribeOrderableDBInstanceOptionsPaginatorOptions struct { // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so that the remaining results can be retrieved. // Default: 100 Constraints: Minimum 20, maximum 100. 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 } // DescribeOrderableDBInstanceOptionsPaginator is a paginator for // DescribeOrderableDBInstanceOptions type DescribeOrderableDBInstanceOptionsPaginator struct { options DescribeOrderableDBInstanceOptionsPaginatorOptions client DescribeOrderableDBInstanceOptionsAPIClient params *DescribeOrderableDBInstanceOptionsInput nextToken *string firstPage bool } // NewDescribeOrderableDBInstanceOptionsPaginator returns a new // DescribeOrderableDBInstanceOptionsPaginator func NewDescribeOrderableDBInstanceOptionsPaginator(client DescribeOrderableDBInstanceOptionsAPIClient, params *DescribeOrderableDBInstanceOptionsInput, optFns ...func(*DescribeOrderableDBInstanceOptionsPaginatorOptions)) *DescribeOrderableDBInstanceOptionsPaginator { if params == nil { params = &DescribeOrderableDBInstanceOptionsInput{} } options := DescribeOrderableDBInstanceOptionsPaginatorOptions{} if params.MaxRecords != nil { options.Limit = *params.MaxRecords } for _, fn := range optFns { fn(&options) } return &DescribeOrderableDBInstanceOptionsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.Marker, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeOrderableDBInstanceOptionsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeOrderableDBInstanceOptions page. func (p *DescribeOrderableDBInstanceOptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeOrderableDBInstanceOptionsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.Marker = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxRecords = limit result, err := p.client.DescribeOrderableDBInstanceOptions(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.Marker if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeOrderableDBInstanceOptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DescribeOrderableDBInstanceOptions", } }
259
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of resources (for example, DB instances) that have at least one // pending maintenance action. func (c *Client) DescribePendingMaintenanceActions(ctx context.Context, params *DescribePendingMaintenanceActionsInput, optFns ...func(*Options)) (*DescribePendingMaintenanceActionsOutput, error) { if params == nil { params = &DescribePendingMaintenanceActionsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribePendingMaintenanceActions", params, optFns, c.addOperationDescribePendingMaintenanceActionsMiddlewares) if err != nil { return nil, err } out := result.(*DescribePendingMaintenanceActionsOutput) out.ResultMetadata = metadata return out, nil } type DescribePendingMaintenanceActionsInput struct { // A filter that specifies one or more resources to return pending maintenance // actions for. Supported filters: // - db-cluster-id - Accepts DB cluster identifiers and DB cluster Amazon // Resource Names (ARNs). The results list will only include pending maintenance // actions for the DB clusters identified by these ARNs. // - db-instance-id - Accepts DB instance identifiers and DB instance ARNs. The // results list will only include pending maintenance actions for the DB instances // identified by these ARNs. Filters []types.Filter // An optional pagination token provided by a previous // DescribePendingMaintenanceActions request. If this parameter is specified, the // response includes only records beyond the marker, up to a number of records // specified by MaxRecords . Marker *string // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so that the remaining results can be retrieved. // Default: 100 Constraints: Minimum 20, maximum 100. MaxRecords *int32 // The ARN of a resource to return pending maintenance actions for. ResourceIdentifier *string noSmithyDocumentSerde } type DescribePendingMaintenanceActionsOutput struct { // An optional pagination token provided by a previous // DescribePendingMaintenanceActions request. If this parameter is specified, the // response includes only records beyond the marker, up to a number of records // specified by MaxRecords . Marker *string // A list of the pending maintenance actions for the resource. PendingMaintenanceActions []types.ResourcePendingMaintenanceActions // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribePendingMaintenanceActionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribePendingMaintenanceActions{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribePendingMaintenanceActions{}, 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 = addOpDescribePendingMaintenanceActionsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribePendingMaintenanceActions(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 } // DescribePendingMaintenanceActionsAPIClient is a client that implements the // DescribePendingMaintenanceActions operation. type DescribePendingMaintenanceActionsAPIClient interface { DescribePendingMaintenanceActions(context.Context, *DescribePendingMaintenanceActionsInput, ...func(*Options)) (*DescribePendingMaintenanceActionsOutput, error) } var _ DescribePendingMaintenanceActionsAPIClient = (*Client)(nil) // DescribePendingMaintenanceActionsPaginatorOptions is the paginator options for // DescribePendingMaintenanceActions type DescribePendingMaintenanceActionsPaginatorOptions struct { // The maximum number of records to include in the response. If more records exist // than the specified MaxRecords value, a pagination token called a marker is // included in the response so that the remaining results can be retrieved. // Default: 100 Constraints: Minimum 20, maximum 100. 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 } // DescribePendingMaintenanceActionsPaginator is a paginator for // DescribePendingMaintenanceActions type DescribePendingMaintenanceActionsPaginator struct { options DescribePendingMaintenanceActionsPaginatorOptions client DescribePendingMaintenanceActionsAPIClient params *DescribePendingMaintenanceActionsInput nextToken *string firstPage bool } // NewDescribePendingMaintenanceActionsPaginator returns a new // DescribePendingMaintenanceActionsPaginator func NewDescribePendingMaintenanceActionsPaginator(client DescribePendingMaintenanceActionsAPIClient, params *DescribePendingMaintenanceActionsInput, optFns ...func(*DescribePendingMaintenanceActionsPaginatorOptions)) *DescribePendingMaintenanceActionsPaginator { if params == nil { params = &DescribePendingMaintenanceActionsInput{} } options := DescribePendingMaintenanceActionsPaginatorOptions{} if params.MaxRecords != nil { options.Limit = *params.MaxRecords } for _, fn := range optFns { fn(&options) } return &DescribePendingMaintenanceActionsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.Marker, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribePendingMaintenanceActionsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribePendingMaintenanceActions page. func (p *DescribePendingMaintenanceActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePendingMaintenanceActionsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.Marker = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxRecords = limit result, err := p.client.DescribePendingMaintenanceActions(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.Marker if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribePendingMaintenanceActions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DescribePendingMaintenanceActions", } }
249
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune 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/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // You can call DescribeValidDBInstanceModifications to learn what modifications // you can make to your DB instance. You can use this information when you call // ModifyDBInstance . func (c *Client) DescribeValidDBInstanceModifications(ctx context.Context, params *DescribeValidDBInstanceModificationsInput, optFns ...func(*Options)) (*DescribeValidDBInstanceModificationsOutput, error) { if params == nil { params = &DescribeValidDBInstanceModificationsInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeValidDBInstanceModifications", params, optFns, c.addOperationDescribeValidDBInstanceModificationsMiddlewares) if err != nil { return nil, err } out := result.(*DescribeValidDBInstanceModificationsOutput) out.ResultMetadata = metadata return out, nil } type DescribeValidDBInstanceModificationsInput struct { // The customer identifier or the ARN of your DB instance. // // This member is required. DBInstanceIdentifier *string noSmithyDocumentSerde } type DescribeValidDBInstanceModificationsOutput struct { // Information about valid modifications that you can make to your DB instance. // Contains the result of a successful call to the // DescribeValidDBInstanceModifications action. You can use this information when // you call ModifyDBInstance . ValidDBInstanceModificationsMessage *types.ValidDBInstanceModificationsMessage // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeValidDBInstanceModificationsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpDescribeValidDBInstanceModifications{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpDescribeValidDBInstanceModifications{}, 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 = addOpDescribeValidDBInstanceModificationsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeValidDBInstanceModifications(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_opDescribeValidDBInstanceModifications(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "DescribeValidDBInstanceModifications", } }
130
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune 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/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Forces a failover for a DB cluster. A failover for a DB cluster promotes one of // the Read Replicas (read-only instances) in the DB cluster to be the primary // instance (the cluster writer). Amazon Neptune will automatically fail over to a // Read Replica, if one exists, when the primary instance fails. You can force a // failover when you want to simulate a failure of a primary instance for testing. // Because each instance in a DB cluster has its own endpoint address, you will // need to clean up and re-establish any existing connections that use those // endpoint addresses when the failover is complete. func (c *Client) FailoverDBCluster(ctx context.Context, params *FailoverDBClusterInput, optFns ...func(*Options)) (*FailoverDBClusterOutput, error) { if params == nil { params = &FailoverDBClusterInput{} } result, metadata, err := c.invokeOperation(ctx, "FailoverDBCluster", params, optFns, c.addOperationFailoverDBClusterMiddlewares) if err != nil { return nil, err } out := result.(*FailoverDBClusterOutput) out.ResultMetadata = metadata return out, nil } type FailoverDBClusterInput struct { // A DB cluster identifier to force a failover for. This parameter is not // case-sensitive. Constraints: // - Must match the identifier of an existing DBCluster. DBClusterIdentifier *string // The name of the instance to promote to the primary instance. You must specify // the instance identifier for an Read Replica in the DB cluster. For example, // mydbcluster-replica1 . TargetDBInstanceIdentifier *string noSmithyDocumentSerde } type FailoverDBClusterOutput struct { // Contains the details of an Amazon Neptune DB cluster. This data type is used as // a response element in the DescribeDBClusters action. DBCluster *types.DBCluster // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationFailoverDBClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpFailoverDBCluster{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpFailoverDBCluster{}, 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 = stack.Initialize.Add(newServiceMetadataMiddleware_opFailoverDBCluster(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_opFailoverDBCluster(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "FailoverDBCluster", } }
135
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune 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/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Initiates the failover process for a Neptune global database. A failover for a // Neptune global database promotes one of secondary read-only DB clusters to be // the primary DB cluster and demotes the primary DB cluster to being a secondary // (read-only) DB cluster. In other words, the role of the current primary DB // cluster and the selected target secondary DB cluster are switched. The selected // secondary DB cluster assumes full read/write capabilities for the Neptune global // database. This action applies only to Neptune global databases. This action is // only intended for use on healthy Neptune global databases with healthy Neptune // DB clusters and no region-wide outages, to test disaster recovery scenarios or // to reconfigure the global database topology. func (c *Client) FailoverGlobalCluster(ctx context.Context, params *FailoverGlobalClusterInput, optFns ...func(*Options)) (*FailoverGlobalClusterOutput, error) { if params == nil { params = &FailoverGlobalClusterInput{} } result, metadata, err := c.invokeOperation(ctx, "FailoverGlobalCluster", params, optFns, c.addOperationFailoverGlobalClusterMiddlewares) if err != nil { return nil, err } out := result.(*FailoverGlobalClusterOutput) out.ResultMetadata = metadata return out, nil } type FailoverGlobalClusterInput struct { // Identifier of the Neptune global database that should be failed over. The // identifier is the unique key assigned by the user when the Neptune global // database was created. In other words, it's the name of the global database that // you want to fail over. Constraints: Must match the identifier of an existing // Neptune global database. // // This member is required. GlobalClusterIdentifier *string // The Amazon Resource Name (ARN) of the secondary Neptune DB cluster that you // want to promote to primary for the global database. // // This member is required. TargetDbClusterIdentifier *string noSmithyDocumentSerde } type FailoverGlobalClusterOutput struct { // Contains the details of an Amazon Neptune global database. This data type is // used as a response element for the CreateGlobalCluster , DescribeGlobalClusters // , ModifyGlobalCluster , DeleteGlobalCluster , FailoverGlobalCluster , and // RemoveFromGlobalCluster actions. GlobalCluster *types.GlobalCluster // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationFailoverGlobalClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpFailoverGlobalCluster{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpFailoverGlobalCluster{}, 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 = addOpFailoverGlobalClusterValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opFailoverGlobalCluster(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_opFailoverGlobalCluster(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "FailoverGlobalCluster", } }
147
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package neptune 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/neptune/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists all tags on an Amazon Neptune resource. func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { if params == nil { params = &ListTagsForResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) if err != nil { return nil, err } out := result.(*ListTagsForResourceOutput) out.ResultMetadata = metadata return out, nil } type ListTagsForResourceInput struct { // The Amazon Neptune resource with tags to be listed. This value is an Amazon // Resource Name (ARN). For information about creating an ARN, see Constructing an // Amazon Resource Name (ARN) (https://docs.aws.amazon.com/neptune/latest/UserGuide/tagging.ARN.html#tagging.ARN.Constructing) // . // // This member is required. ResourceName *string // This parameter is not currently supported. Filters []types.Filter noSmithyDocumentSerde } type ListTagsForResourceOutput struct { // List of tags returned by the ListTagsForResource operation. TagList []types.Tag // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsquery_serializeOpListTagsForResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsquery_deserializeOpListTagsForResource{}, 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 = addOpListTagsForResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(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_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "rds", OperationName: "ListTagsForResource", } }
131