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 kafka 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" ) // A list of brokers that a client application can use to bootstrap. func (c *Client) GetBootstrapBrokers(ctx context.Context, params *GetBootstrapBrokersInput, optFns ...func(*Options)) (*GetBootstrapBrokersOutput, error) { if params == nil { params = &GetBootstrapBrokersInput{} } result, metadata, err := c.invokeOperation(ctx, "GetBootstrapBrokers", params, optFns, c.addOperationGetBootstrapBrokersMiddlewares) if err != nil { return nil, err } out := result.(*GetBootstrapBrokersOutput) out.ResultMetadata = metadata return out, nil } type GetBootstrapBrokersInput struct { // The Amazon Resource Name (ARN) that uniquely identifies the cluster. // // This member is required. ClusterArn *string noSmithyDocumentSerde } type GetBootstrapBrokersOutput struct { // A string containing one or more hostname:port pairs. BootstrapBrokerString *string // A string that contains one or more DNS names (or IP addresses) and SASL IAM // port pairs. BootstrapBrokerStringPublicSaslIam *string // A string containing one or more DNS names (or IP) and Sasl Scram port pairs. BootstrapBrokerStringPublicSaslScram *string // A string containing one or more DNS names (or IP) and TLS port pairs. BootstrapBrokerStringPublicTls *string // A string that contains one or more DNS names (or IP addresses) and SASL IAM // port pairs. BootstrapBrokerStringSaslIam *string // A string containing one or more DNS names (or IP) and Sasl Scram port pairs. BootstrapBrokerStringSaslScram *string // A string containing one or more DNS names (or IP) and TLS port pairs. BootstrapBrokerStringTls *string // A string containing one or more DNS names (or IP) and SASL/IAM port pairs for // VPC connectivity. BootstrapBrokerStringVpcConnectivitySaslIam *string // A string containing one or more DNS names (or IP) and SASL/SCRAM port pairs for // VPC connectivity. BootstrapBrokerStringVpcConnectivitySaslScram *string // A string containing one or more DNS names (or IP) and TLS port pairs for VPC // connectivity. BootstrapBrokerStringVpcConnectivityTls *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetBootstrapBrokersMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetBootstrapBrokers{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetBootstrapBrokers{}, 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 = addOpGetBootstrapBrokersValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetBootstrapBrokers(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_opGetBootstrapBrokers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafka", OperationName: "GetBootstrapBrokers", } }
156
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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" ) // Get the MSK cluster policy specified by the Amazon Resource Name (ARN) in the // request. func (c *Client) GetClusterPolicy(ctx context.Context, params *GetClusterPolicyInput, optFns ...func(*Options)) (*GetClusterPolicyOutput, error) { if params == nil { params = &GetClusterPolicyInput{} } result, metadata, err := c.invokeOperation(ctx, "GetClusterPolicy", params, optFns, c.addOperationGetClusterPolicyMiddlewares) if err != nil { return nil, err } out := result.(*GetClusterPolicyOutput) out.ResultMetadata = metadata return out, nil } type GetClusterPolicyInput struct { // The Amazon Resource Name (ARN) of the cluster. // // This member is required. ClusterArn *string noSmithyDocumentSerde } type GetClusterPolicyOutput struct { // The version of cluster policy. CurrentVersion *string // The cluster policy. Policy *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetClusterPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetClusterPolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetClusterPolicy{}, 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 = addOpGetClusterPolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetClusterPolicy(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_opGetClusterPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafka", OperationName: "GetClusterPolicy", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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/kafka/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Gets the Apache Kafka versions to which you can update the MSK cluster. func (c *Client) GetCompatibleKafkaVersions(ctx context.Context, params *GetCompatibleKafkaVersionsInput, optFns ...func(*Options)) (*GetCompatibleKafkaVersionsOutput, error) { if params == nil { params = &GetCompatibleKafkaVersionsInput{} } result, metadata, err := c.invokeOperation(ctx, "GetCompatibleKafkaVersions", params, optFns, c.addOperationGetCompatibleKafkaVersionsMiddlewares) if err != nil { return nil, err } out := result.(*GetCompatibleKafkaVersionsOutput) out.ResultMetadata = metadata return out, nil } type GetCompatibleKafkaVersionsInput struct { // The Amazon Resource Name (ARN) of the cluster check. ClusterArn *string noSmithyDocumentSerde } type GetCompatibleKafkaVersionsOutput struct { // A list of CompatibleKafkaVersion objects. CompatibleKafkaVersions []types.CompatibleKafkaVersion // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetCompatibleKafkaVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpGetCompatibleKafkaVersions{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetCompatibleKafkaVersions{}, 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_opGetCompatibleKafkaVersions(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_opGetCompatibleKafkaVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafka", OperationName: "GetCompatibleKafkaVersions", } }
120
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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/kafka/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of all the VPC connections in this Region. func (c *Client) ListClientVpcConnections(ctx context.Context, params *ListClientVpcConnectionsInput, optFns ...func(*Options)) (*ListClientVpcConnectionsOutput, error) { if params == nil { params = &ListClientVpcConnectionsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListClientVpcConnections", params, optFns, c.addOperationListClientVpcConnectionsMiddlewares) if err != nil { return nil, err } out := result.(*ListClientVpcConnectionsOutput) out.ResultMetadata = metadata return out, nil } type ListClientVpcConnectionsInput struct { // The Amazon Resource Name (ARN) of the cluster. // // This member is required. ClusterArn *string // The maximum number of results to return in the response. If there are more // results, the response includes a NextToken parameter. MaxResults int32 // The paginated results marker. When the result of the operation is truncated, // the call returns NextToken in the response. To get the next batch, provide this // token in your next request. NextToken *string noSmithyDocumentSerde } type ListClientVpcConnectionsOutput struct { // List of client VPC connections. ClientVpcConnections []types.ClientVpcConnection // The paginated results marker. When the result of a ListClientVpcConnections // operation is truncated, the call returns NextToken in the response. To get // another batch of configurations, provide this token in your next request. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListClientVpcConnectionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListClientVpcConnections{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListClientVpcConnections{}, 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 = addOpListClientVpcConnectionsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListClientVpcConnections(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 } // ListClientVpcConnectionsAPIClient is a client that implements the // ListClientVpcConnections operation. type ListClientVpcConnectionsAPIClient interface { ListClientVpcConnections(context.Context, *ListClientVpcConnectionsInput, ...func(*Options)) (*ListClientVpcConnectionsOutput, error) } var _ ListClientVpcConnectionsAPIClient = (*Client)(nil) // ListClientVpcConnectionsPaginatorOptions is the paginator options for // ListClientVpcConnections type ListClientVpcConnectionsPaginatorOptions struct { // The maximum number of results to return in the response. If there are more // results, the response includes a NextToken parameter. 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 } // ListClientVpcConnectionsPaginator is a paginator for ListClientVpcConnections type ListClientVpcConnectionsPaginator struct { options ListClientVpcConnectionsPaginatorOptions client ListClientVpcConnectionsAPIClient params *ListClientVpcConnectionsInput nextToken *string firstPage bool } // NewListClientVpcConnectionsPaginator returns a new // ListClientVpcConnectionsPaginator func NewListClientVpcConnectionsPaginator(client ListClientVpcConnectionsAPIClient, params *ListClientVpcConnectionsInput, optFns ...func(*ListClientVpcConnectionsPaginatorOptions)) *ListClientVpcConnectionsPaginator { if params == nil { params = &ListClientVpcConnectionsInput{} } options := ListClientVpcConnectionsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListClientVpcConnectionsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListClientVpcConnectionsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListClientVpcConnections page. func (p *ListClientVpcConnectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListClientVpcConnectionsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListClientVpcConnections(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_opListClientVpcConnections(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafka", OperationName: "ListClientVpcConnections", } }
229
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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/kafka/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of all the operations that have been performed on the specified // MSK cluster. func (c *Client) ListClusterOperations(ctx context.Context, params *ListClusterOperationsInput, optFns ...func(*Options)) (*ListClusterOperationsOutput, error) { if params == nil { params = &ListClusterOperationsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListClusterOperations", params, optFns, c.addOperationListClusterOperationsMiddlewares) if err != nil { return nil, err } out := result.(*ListClusterOperationsOutput) out.ResultMetadata = metadata return out, nil } type ListClusterOperationsInput struct { // The Amazon Resource Name (ARN) that uniquely identifies the cluster. // // This member is required. ClusterArn *string // The maximum number of results to return in the response. If there are more // results, the response includes a NextToken parameter. MaxResults int32 // The paginated results marker. When the result of the operation is truncated, // the call returns NextToken in the response. To get the next batch, provide this // token in your next request. NextToken *string noSmithyDocumentSerde } type ListClusterOperationsOutput struct { // An array of cluster operation information objects. ClusterOperationInfoList []types.ClusterOperationInfo // If the response of ListClusterOperations is truncated, it returns a NextToken // in the response. This Nexttoken should be sent in the subsequent request to // ListClusterOperations. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListClusterOperationsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListClusterOperations{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListClusterOperations{}, 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 = addOpListClusterOperationsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListClusterOperations(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 } // ListClusterOperationsAPIClient is a client that implements the // ListClusterOperations operation. type ListClusterOperationsAPIClient interface { ListClusterOperations(context.Context, *ListClusterOperationsInput, ...func(*Options)) (*ListClusterOperationsOutput, error) } var _ ListClusterOperationsAPIClient = (*Client)(nil) // ListClusterOperationsPaginatorOptions is the paginator options for // ListClusterOperations type ListClusterOperationsPaginatorOptions struct { // The maximum number of results to return in the response. If there are more // results, the response includes a NextToken parameter. 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 } // ListClusterOperationsPaginator is a paginator for ListClusterOperations type ListClusterOperationsPaginator struct { options ListClusterOperationsPaginatorOptions client ListClusterOperationsAPIClient params *ListClusterOperationsInput nextToken *string firstPage bool } // NewListClusterOperationsPaginator returns a new ListClusterOperationsPaginator func NewListClusterOperationsPaginator(client ListClusterOperationsAPIClient, params *ListClusterOperationsInput, optFns ...func(*ListClusterOperationsPaginatorOptions)) *ListClusterOperationsPaginator { if params == nil { params = &ListClusterOperationsInput{} } options := ListClusterOperationsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListClusterOperationsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListClusterOperationsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListClusterOperations page. func (p *ListClusterOperationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListClusterOperationsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListClusterOperations(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_opListClusterOperations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafka", OperationName: "ListClusterOperations", } }
229
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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/kafka/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of all the MSK clusters in the current Region. func (c *Client) ListClusters(ctx context.Context, params *ListClustersInput, optFns ...func(*Options)) (*ListClustersOutput, error) { if params == nil { params = &ListClustersInput{} } result, metadata, err := c.invokeOperation(ctx, "ListClusters", params, optFns, c.addOperationListClustersMiddlewares) if err != nil { return nil, err } out := result.(*ListClustersOutput) out.ResultMetadata = metadata return out, nil } type ListClustersInput struct { // Specify a prefix of the name of the clusters that you want to list. The service // lists all the clusters whose names start with this prefix. ClusterNameFilter *string // The maximum number of results to return in the response. If there are more // results, the response includes a NextToken parameter. MaxResults int32 // The paginated results marker. When the result of the operation is truncated, // the call returns NextToken in the response. To get the next batch, provide this // token in your next request. NextToken *string noSmithyDocumentSerde } type ListClustersOutput struct { // Information on each of the MSK clusters in the response. ClusterInfoList []types.ClusterInfo // The paginated results marker. When the result of a ListClusters operation is // truncated, the call returns NextToken in the response. To get another batch of // clusters, provide this token in your next request. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListClustersMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListClusters{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListClusters{}, 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_opListClusters(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 } // ListClustersAPIClient is a client that implements the ListClusters operation. type ListClustersAPIClient interface { ListClusters(context.Context, *ListClustersInput, ...func(*Options)) (*ListClustersOutput, error) } var _ ListClustersAPIClient = (*Client)(nil) // ListClustersPaginatorOptions is the paginator options for ListClusters type ListClustersPaginatorOptions struct { // The maximum number of results to return in the response. If there are more // results, the response includes a NextToken parameter. 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 } // ListClustersPaginator is a paginator for ListClusters type ListClustersPaginator struct { options ListClustersPaginatorOptions client ListClustersAPIClient params *ListClustersInput nextToken *string firstPage bool } // NewListClustersPaginator returns a new ListClustersPaginator func NewListClustersPaginator(client ListClustersAPIClient, params *ListClustersInput, optFns ...func(*ListClustersPaginatorOptions)) *ListClustersPaginator { if params == nil { params = &ListClustersInput{} } options := ListClustersPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListClustersPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListClustersPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListClusters page. func (p *ListClustersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListClustersOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListClusters(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_opListClusters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafka", OperationName: "ListClusters", } }
222
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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/kafka/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of all the MSK clusters in the current Region. func (c *Client) ListClustersV2(ctx context.Context, params *ListClustersV2Input, optFns ...func(*Options)) (*ListClustersV2Output, error) { if params == nil { params = &ListClustersV2Input{} } result, metadata, err := c.invokeOperation(ctx, "ListClustersV2", params, optFns, c.addOperationListClustersV2Middlewares) if err != nil { return nil, err } out := result.(*ListClustersV2Output) out.ResultMetadata = metadata return out, nil } type ListClustersV2Input struct { // Specify a prefix of the names of the clusters that you want to list. The // service lists all the clusters whose names start with this prefix. ClusterNameFilter *string // Specify either PROVISIONED or SERVERLESS. ClusterTypeFilter *string // The maximum number of results to return in the response. If there are more // results, the response includes a NextToken parameter. MaxResults int32 // The paginated results marker. When the result of the operation is truncated, // the call returns NextToken in the response. To get the next batch, provide this // token in your next request. NextToken *string noSmithyDocumentSerde } type ListClustersV2Output struct { // Information on each of the MSK clusters in the response. ClusterInfoList []types.Cluster // The paginated results marker. When the result of a ListClusters operation is // truncated, the call returns NextToken in the response. To get another batch of // clusters, provide this token in your next request. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListClustersV2Middlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListClustersV2{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListClustersV2{}, 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_opListClustersV2(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 } // ListClustersV2APIClient is a client that implements the ListClustersV2 // operation. type ListClustersV2APIClient interface { ListClustersV2(context.Context, *ListClustersV2Input, ...func(*Options)) (*ListClustersV2Output, error) } var _ ListClustersV2APIClient = (*Client)(nil) // ListClustersV2PaginatorOptions is the paginator options for ListClustersV2 type ListClustersV2PaginatorOptions struct { // The maximum number of results to return in the response. If there are more // results, the response includes a NextToken parameter. 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 } // ListClustersV2Paginator is a paginator for ListClustersV2 type ListClustersV2Paginator struct { options ListClustersV2PaginatorOptions client ListClustersV2APIClient params *ListClustersV2Input nextToken *string firstPage bool } // NewListClustersV2Paginator returns a new ListClustersV2Paginator func NewListClustersV2Paginator(client ListClustersV2APIClient, params *ListClustersV2Input, optFns ...func(*ListClustersV2PaginatorOptions)) *ListClustersV2Paginator { if params == nil { params = &ListClustersV2Input{} } options := ListClustersV2PaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListClustersV2Paginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListClustersV2Paginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListClustersV2 page. func (p *ListClustersV2Paginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListClustersV2Output, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListClustersV2(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_opListClustersV2(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafka", OperationName: "ListClustersV2", } }
226
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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/kafka/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of all the MSK configurations in this Region. func (c *Client) ListConfigurationRevisions(ctx context.Context, params *ListConfigurationRevisionsInput, optFns ...func(*Options)) (*ListConfigurationRevisionsOutput, error) { if params == nil { params = &ListConfigurationRevisionsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListConfigurationRevisions", params, optFns, c.addOperationListConfigurationRevisionsMiddlewares) if err != nil { return nil, err } out := result.(*ListConfigurationRevisionsOutput) out.ResultMetadata = metadata return out, nil } type ListConfigurationRevisionsInput struct { // The Amazon Resource Name (ARN) that uniquely identifies an MSK configuration // and all of its revisions. // // This member is required. Arn *string // The maximum number of results to return in the response. If there are more // results, the response includes a NextToken parameter. MaxResults int32 // The paginated results marker. When the result of the operation is truncated, // the call returns NextToken in the response. To get the next batch, provide this // token in your next request. NextToken *string noSmithyDocumentSerde } type ListConfigurationRevisionsOutput struct { // Paginated results marker. NextToken *string // List of ConfigurationRevision objects. Revisions []types.ConfigurationRevision // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListConfigurationRevisionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListConfigurationRevisions{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListConfigurationRevisions{}, 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 = addOpListConfigurationRevisionsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListConfigurationRevisions(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 } // ListConfigurationRevisionsAPIClient is a client that implements the // ListConfigurationRevisions operation. type ListConfigurationRevisionsAPIClient interface { ListConfigurationRevisions(context.Context, *ListConfigurationRevisionsInput, ...func(*Options)) (*ListConfigurationRevisionsOutput, error) } var _ ListConfigurationRevisionsAPIClient = (*Client)(nil) // ListConfigurationRevisionsPaginatorOptions is the paginator options for // ListConfigurationRevisions type ListConfigurationRevisionsPaginatorOptions struct { // The maximum number of results to return in the response. If there are more // results, the response includes a NextToken parameter. 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 } // ListConfigurationRevisionsPaginator is a paginator for // ListConfigurationRevisions type ListConfigurationRevisionsPaginator struct { options ListConfigurationRevisionsPaginatorOptions client ListConfigurationRevisionsAPIClient params *ListConfigurationRevisionsInput nextToken *string firstPage bool } // NewListConfigurationRevisionsPaginator returns a new // ListConfigurationRevisionsPaginator func NewListConfigurationRevisionsPaginator(client ListConfigurationRevisionsAPIClient, params *ListConfigurationRevisionsInput, optFns ...func(*ListConfigurationRevisionsPaginatorOptions)) *ListConfigurationRevisionsPaginator { if params == nil { params = &ListConfigurationRevisionsInput{} } options := ListConfigurationRevisionsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListConfigurationRevisionsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListConfigurationRevisionsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListConfigurationRevisions page. func (p *ListConfigurationRevisionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConfigurationRevisionsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListConfigurationRevisions(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_opListConfigurationRevisions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafka", OperationName: "ListConfigurationRevisions", } }
229
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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/kafka/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of all the MSK configurations in this Region. func (c *Client) ListConfigurations(ctx context.Context, params *ListConfigurationsInput, optFns ...func(*Options)) (*ListConfigurationsOutput, error) { if params == nil { params = &ListConfigurationsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListConfigurations", params, optFns, c.addOperationListConfigurationsMiddlewares) if err != nil { return nil, err } out := result.(*ListConfigurationsOutput) out.ResultMetadata = metadata return out, nil } type ListConfigurationsInput struct { // The maximum number of results to return in the response. If there are more // results, the response includes a NextToken parameter. MaxResults int32 // The paginated results marker. When the result of the operation is truncated, // the call returns NextToken in the response. To get the next batch, provide this // token in your next request. NextToken *string noSmithyDocumentSerde } type ListConfigurationsOutput struct { // An array of MSK configurations. Configurations []types.Configuration // The paginated results marker. When the result of a ListConfigurations operation // is truncated, the call returns NextToken in the response. To get another batch // of configurations, provide this token in your next request. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListConfigurationsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListConfigurations{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListConfigurations{}, 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_opListConfigurations(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 } // ListConfigurationsAPIClient is a client that implements the ListConfigurations // operation. type ListConfigurationsAPIClient interface { ListConfigurations(context.Context, *ListConfigurationsInput, ...func(*Options)) (*ListConfigurationsOutput, error) } var _ ListConfigurationsAPIClient = (*Client)(nil) // ListConfigurationsPaginatorOptions is the paginator options for // ListConfigurations type ListConfigurationsPaginatorOptions struct { // The maximum number of results to return in the response. If there are more // results, the response includes a NextToken parameter. 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 } // ListConfigurationsPaginator is a paginator for ListConfigurations type ListConfigurationsPaginator struct { options ListConfigurationsPaginatorOptions client ListConfigurationsAPIClient params *ListConfigurationsInput nextToken *string firstPage bool } // NewListConfigurationsPaginator returns a new ListConfigurationsPaginator func NewListConfigurationsPaginator(client ListConfigurationsAPIClient, params *ListConfigurationsInput, optFns ...func(*ListConfigurationsPaginatorOptions)) *ListConfigurationsPaginator { if params == nil { params = &ListConfigurationsInput{} } options := ListConfigurationsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListConfigurationsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListConfigurationsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListConfigurations page. func (p *ListConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConfigurationsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListConfigurations(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_opListConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafka", OperationName: "ListConfigurations", } }
220
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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/kafka/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of Apache Kafka versions. func (c *Client) ListKafkaVersions(ctx context.Context, params *ListKafkaVersionsInput, optFns ...func(*Options)) (*ListKafkaVersionsOutput, error) { if params == nil { params = &ListKafkaVersionsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListKafkaVersions", params, optFns, c.addOperationListKafkaVersionsMiddlewares) if err != nil { return nil, err } out := result.(*ListKafkaVersionsOutput) out.ResultMetadata = metadata return out, nil } type ListKafkaVersionsInput struct { // The maximum number of results to return in the response. If there are more // results, the response includes a NextToken parameter. MaxResults int32 // The paginated results marker. When the result of the operation is truncated, // the call returns NextToken in the response. To get the next batch, provide this // token in your next request. NextToken *string noSmithyDocumentSerde } type ListKafkaVersionsOutput struct { KafkaVersions []types.KafkaVersion NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListKafkaVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListKafkaVersions{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListKafkaVersions{}, 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_opListKafkaVersions(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 } // ListKafkaVersionsAPIClient is a client that implements the ListKafkaVersions // operation. type ListKafkaVersionsAPIClient interface { ListKafkaVersions(context.Context, *ListKafkaVersionsInput, ...func(*Options)) (*ListKafkaVersionsOutput, error) } var _ ListKafkaVersionsAPIClient = (*Client)(nil) // ListKafkaVersionsPaginatorOptions is the paginator options for ListKafkaVersions type ListKafkaVersionsPaginatorOptions struct { // The maximum number of results to return in the response. If there are more // results, the response includes a NextToken parameter. 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 } // ListKafkaVersionsPaginator is a paginator for ListKafkaVersions type ListKafkaVersionsPaginator struct { options ListKafkaVersionsPaginatorOptions client ListKafkaVersionsAPIClient params *ListKafkaVersionsInput nextToken *string firstPage bool } // NewListKafkaVersionsPaginator returns a new ListKafkaVersionsPaginator func NewListKafkaVersionsPaginator(client ListKafkaVersionsAPIClient, params *ListKafkaVersionsInput, optFns ...func(*ListKafkaVersionsPaginatorOptions)) *ListKafkaVersionsPaginator { if params == nil { params = &ListKafkaVersionsInput{} } options := ListKafkaVersionsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListKafkaVersionsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListKafkaVersionsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListKafkaVersions page. func (p *ListKafkaVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListKafkaVersionsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListKafkaVersions(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_opListKafkaVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafka", OperationName: "ListKafkaVersions", } }
214
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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/kafka/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of the broker nodes in the cluster. func (c *Client) ListNodes(ctx context.Context, params *ListNodesInput, optFns ...func(*Options)) (*ListNodesOutput, error) { if params == nil { params = &ListNodesInput{} } result, metadata, err := c.invokeOperation(ctx, "ListNodes", params, optFns, c.addOperationListNodesMiddlewares) if err != nil { return nil, err } out := result.(*ListNodesOutput) out.ResultMetadata = metadata return out, nil } type ListNodesInput struct { // The Amazon Resource Name (ARN) that uniquely identifies the cluster. // // This member is required. ClusterArn *string // The maximum number of results to return in the response. If there are more // results, the response includes a NextToken parameter. MaxResults int32 // The paginated results marker. When the result of the operation is truncated, // the call returns NextToken in the response. To get the next batch, provide this // token in your next request. NextToken *string noSmithyDocumentSerde } type ListNodesOutput struct { // The paginated results marker. When the result of a ListNodes operation is // truncated, the call returns NextToken in the response. To get another batch of // nodes, provide this token in your next request. NextToken *string // List containing a NodeInfo object. NodeInfoList []types.NodeInfo // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListNodesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListNodes{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListNodes{}, 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 = addOpListNodesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListNodes(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 } // ListNodesAPIClient is a client that implements the ListNodes operation. type ListNodesAPIClient interface { ListNodes(context.Context, *ListNodesInput, ...func(*Options)) (*ListNodesOutput, error) } var _ ListNodesAPIClient = (*Client)(nil) // ListNodesPaginatorOptions is the paginator options for ListNodes type ListNodesPaginatorOptions struct { // The maximum number of results to return in the response. If there are more // results, the response includes a NextToken parameter. 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 } // ListNodesPaginator is a paginator for ListNodes type ListNodesPaginator struct { options ListNodesPaginatorOptions client ListNodesAPIClient params *ListNodesInput nextToken *string firstPage bool } // NewListNodesPaginator returns a new ListNodesPaginator func NewListNodesPaginator(client ListNodesAPIClient, params *ListNodesInput, optFns ...func(*ListNodesPaginatorOptions)) *ListNodesPaginator { if params == nil { params = &ListNodesInput{} } options := ListNodesPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListNodesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListNodesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListNodes page. func (p *ListNodesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNodesOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListNodes(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_opListNodes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafka", OperationName: "ListNodes", } }
226
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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" ) // Returns a list of the Scram Secrets associated with an Amazon MSK cluster. func (c *Client) ListScramSecrets(ctx context.Context, params *ListScramSecretsInput, optFns ...func(*Options)) (*ListScramSecretsOutput, error) { if params == nil { params = &ListScramSecretsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListScramSecrets", params, optFns, c.addOperationListScramSecretsMiddlewares) if err != nil { return nil, err } out := result.(*ListScramSecretsOutput) out.ResultMetadata = metadata return out, nil } type ListScramSecretsInput struct { // The arn of the cluster. // // This member is required. ClusterArn *string // The maxResults of the query. MaxResults int32 // The nextToken of the query. NextToken *string noSmithyDocumentSerde } type ListScramSecretsOutput struct { // Paginated results marker. NextToken *string // The list of scram secrets associated with the cluster. SecretArnList []string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListScramSecretsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListScramSecrets{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListScramSecrets{}, 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 = addOpListScramSecretsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListScramSecrets(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 } // ListScramSecretsAPIClient is a client that implements the ListScramSecrets // operation. type ListScramSecretsAPIClient interface { ListScramSecrets(context.Context, *ListScramSecretsInput, ...func(*Options)) (*ListScramSecretsOutput, error) } var _ ListScramSecretsAPIClient = (*Client)(nil) // ListScramSecretsPaginatorOptions is the paginator options for ListScramSecrets type ListScramSecretsPaginatorOptions struct { // The maxResults of the query. 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 } // ListScramSecretsPaginator is a paginator for ListScramSecrets type ListScramSecretsPaginator struct { options ListScramSecretsPaginatorOptions client ListScramSecretsAPIClient params *ListScramSecretsInput nextToken *string firstPage bool } // NewListScramSecretsPaginator returns a new ListScramSecretsPaginator func NewListScramSecretsPaginator(client ListScramSecretsAPIClient, params *ListScramSecretsInput, optFns ...func(*ListScramSecretsPaginatorOptions)) *ListScramSecretsPaginator { if params == nil { params = &ListScramSecretsInput{} } options := ListScramSecretsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListScramSecretsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListScramSecretsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListScramSecrets page. func (p *ListScramSecretsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListScramSecretsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListScramSecrets(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_opListScramSecrets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafka", OperationName: "ListScramSecrets", } }
220
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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" ) // Returns a list of the tags associated with the specified 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 Resource Name (ARN) that uniquely identifies the resource that's // associated with the tags. // // This member is required. ResourceArn *string noSmithyDocumentSerde } type ListTagsForResourceOutput struct { // The key-value pair for the resource tag. 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 = 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: "kafka", OperationName: "ListTagsForResource", } }
125
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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/kafka/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of all the VPC connections in this Region. func (c *Client) ListVpcConnections(ctx context.Context, params *ListVpcConnectionsInput, optFns ...func(*Options)) (*ListVpcConnectionsOutput, error) { if params == nil { params = &ListVpcConnectionsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListVpcConnections", params, optFns, c.addOperationListVpcConnectionsMiddlewares) if err != nil { return nil, err } out := result.(*ListVpcConnectionsOutput) out.ResultMetadata = metadata return out, nil } type ListVpcConnectionsInput struct { // The maximum number of results to return in the response. If there are more // results, the response includes a NextToken parameter. MaxResults int32 // The paginated results marker. When the result of the operation is truncated, // the call returns NextToken in the response. To get the next batch, provide this // token in your next request. NextToken *string noSmithyDocumentSerde } type ListVpcConnectionsOutput struct { // The paginated results marker. When the result of a ListClientVpcConnections // operation is truncated, the call returns NextToken in the response. To get // another batch of configurations, provide this token in your next request. NextToken *string // List of VPC connections. VpcConnections []types.VpcConnection // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListVpcConnectionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListVpcConnections{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListVpcConnections{}, 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_opListVpcConnections(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 } // ListVpcConnectionsAPIClient is a client that implements the ListVpcConnections // operation. type ListVpcConnectionsAPIClient interface { ListVpcConnections(context.Context, *ListVpcConnectionsInput, ...func(*Options)) (*ListVpcConnectionsOutput, error) } var _ ListVpcConnectionsAPIClient = (*Client)(nil) // ListVpcConnectionsPaginatorOptions is the paginator options for // ListVpcConnections type ListVpcConnectionsPaginatorOptions struct { // The maximum number of results to return in the response. If there are more // results, the response includes a NextToken parameter. 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 } // ListVpcConnectionsPaginator is a paginator for ListVpcConnections type ListVpcConnectionsPaginator struct { options ListVpcConnectionsPaginatorOptions client ListVpcConnectionsAPIClient params *ListVpcConnectionsInput nextToken *string firstPage bool } // NewListVpcConnectionsPaginator returns a new ListVpcConnectionsPaginator func NewListVpcConnectionsPaginator(client ListVpcConnectionsAPIClient, params *ListVpcConnectionsInput, optFns ...func(*ListVpcConnectionsPaginatorOptions)) *ListVpcConnectionsPaginator { if params == nil { params = &ListVpcConnectionsInput{} } options := ListVpcConnectionsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListVpcConnectionsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListVpcConnectionsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListVpcConnections page. func (p *ListVpcConnectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVpcConnectionsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListVpcConnections(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_opListVpcConnections(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafka", OperationName: "ListVpcConnections", } }
220
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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" ) // Creates or updates the MSK cluster policy specified by the cluster Amazon // Resource Name (ARN) in the request. func (c *Client) PutClusterPolicy(ctx context.Context, params *PutClusterPolicyInput, optFns ...func(*Options)) (*PutClusterPolicyOutput, error) { if params == nil { params = &PutClusterPolicyInput{} } result, metadata, err := c.invokeOperation(ctx, "PutClusterPolicy", params, optFns, c.addOperationPutClusterPolicyMiddlewares) if err != nil { return nil, err } out := result.(*PutClusterPolicyOutput) out.ResultMetadata = metadata return out, nil } type PutClusterPolicyInput struct { // The Amazon Resource Name (ARN) of the cluster. // // This member is required. ClusterArn *string // The policy. // // This member is required. Policy *string // The policy version. CurrentVersion *string noSmithyDocumentSerde } type PutClusterPolicyOutput struct { // The policy version. CurrentVersion *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationPutClusterPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpPutClusterPolicy{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutClusterPolicy{}, 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 = addOpPutClusterPolicyValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutClusterPolicy(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_opPutClusterPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafka", OperationName: "PutClusterPolicy", } }
133
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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" ) // Reboots brokers. func (c *Client) RebootBroker(ctx context.Context, params *RebootBrokerInput, optFns ...func(*Options)) (*RebootBrokerOutput, error) { if params == nil { params = &RebootBrokerInput{} } result, metadata, err := c.invokeOperation(ctx, "RebootBroker", params, optFns, c.addOperationRebootBrokerMiddlewares) if err != nil { return nil, err } out := result.(*RebootBrokerOutput) out.ResultMetadata = metadata return out, nil } // Reboots a node. type RebootBrokerInput struct { // The list of broker IDs to be rebooted. The reboot-broker operation supports // rebooting one broker at a time. // // This member is required. BrokerIds []string // The Amazon Resource Name (ARN) of the cluster to be updated. // // This member is required. ClusterArn *string noSmithyDocumentSerde } type RebootBrokerOutput struct { // The Amazon Resource Name (ARN) of the cluster. ClusterArn *string // The Amazon Resource Name (ARN) of the cluster operation. ClusterOperationArn *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationRebootBrokerMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpRebootBroker{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRebootBroker{}, 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 = addOpRebootBrokerValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRebootBroker(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_opRebootBroker(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafka", OperationName: "RebootBroker", } }
134
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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" ) // Returns empty response. func (c *Client) RejectClientVpcConnection(ctx context.Context, params *RejectClientVpcConnectionInput, optFns ...func(*Options)) (*RejectClientVpcConnectionOutput, error) { if params == nil { params = &RejectClientVpcConnectionInput{} } result, metadata, err := c.invokeOperation(ctx, "RejectClientVpcConnection", params, optFns, c.addOperationRejectClientVpcConnectionMiddlewares) if err != nil { return nil, err } out := result.(*RejectClientVpcConnectionOutput) out.ResultMetadata = metadata return out, nil } type RejectClientVpcConnectionInput struct { // The Amazon Resource Name (ARN) of the cluster. // // This member is required. ClusterArn *string // The VPC connection ARN. // // This member is required. VpcConnectionArn *string noSmithyDocumentSerde } type RejectClientVpcConnectionOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationRejectClientVpcConnectionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpRejectClientVpcConnection{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRejectClientVpcConnection{}, 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 = addOpRejectClientVpcConnectionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRejectClientVpcConnection(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_opRejectClientVpcConnection(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafka", OperationName: "RejectClientVpcConnection", } }
125
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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" ) // Adds tags to the specified MSK resource. 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) that uniquely identifies the resource that's // associated with the tags. // // This member is required. ResourceArn *string // The key-value pair for the resource tag. // // 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 = 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 } func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafka", OperationName: "TagResource", } }
126
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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" ) // Removes the tags associated with the keys that are provided in the query. 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) that uniquely identifies the resource that's // associated with the tags. // // This member is required. ResourceArn *string // Tag keys must be unique for a given cluster. In addition, the following // restrictions apply: // - Each tag key must be unique. If you add a tag with a key that's already in // use, your new tag overwrites the existing key-value pair. // - You can't start a tag key with aws: because this prefix is reserved for use // by AWS. AWS creates tags that begin with this prefix on your behalf, but you // can't edit or delete them. // - Tag keys must be between 1 and 128 Unicode characters in length. // - Tag keys must consist of the following characters: Unicode letters, digits, // white space, and the following special characters: _ . / = + - @. // // 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 = 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 } func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafka", OperationName: "UntagResource", } }
135
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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" ) // Updates the number of broker nodes in the cluster. func (c *Client) UpdateBrokerCount(ctx context.Context, params *UpdateBrokerCountInput, optFns ...func(*Options)) (*UpdateBrokerCountOutput, error) { if params == nil { params = &UpdateBrokerCountInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateBrokerCount", params, optFns, c.addOperationUpdateBrokerCountMiddlewares) if err != nil { return nil, err } out := result.(*UpdateBrokerCountOutput) out.ResultMetadata = metadata return out, nil } type UpdateBrokerCountInput struct { // The Amazon Resource Name (ARN) that uniquely identifies the cluster. // // This member is required. ClusterArn *string // The version of cluster to update from. A successful operation will then // generate a new version. // // This member is required. CurrentVersion *string // The number of broker nodes that you want the cluster to have after this // operation completes successfully. // // This member is required. TargetNumberOfBrokerNodes int32 noSmithyDocumentSerde } type UpdateBrokerCountOutput struct { // The Amazon Resource Name (ARN) of the cluster. ClusterArn *string // The Amazon Resource Name (ARN) of the cluster operation. ClusterOperationArn *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateBrokerCountMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateBrokerCount{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateBrokerCount{}, 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 = addOpUpdateBrokerCountValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateBrokerCount(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_opUpdateBrokerCount(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafka", OperationName: "UpdateBrokerCount", } }
139
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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/kafka/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates the EBS storage associated with MSK brokers. func (c *Client) UpdateBrokerStorage(ctx context.Context, params *UpdateBrokerStorageInput, optFns ...func(*Options)) (*UpdateBrokerStorageOutput, error) { if params == nil { params = &UpdateBrokerStorageInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateBrokerStorage", params, optFns, c.addOperationUpdateBrokerStorageMiddlewares) if err != nil { return nil, err } out := result.(*UpdateBrokerStorageOutput) out.ResultMetadata = metadata return out, nil } type UpdateBrokerStorageInput struct { // The Amazon Resource Name (ARN) that uniquely identifies the cluster. // // This member is required. ClusterArn *string // The version of cluster to update from. A successful operation will then // generate a new version. // // This member is required. CurrentVersion *string // Describes the target volume size and the ID of the broker to apply the update // to. // // This member is required. TargetBrokerEBSVolumeInfo []types.BrokerEBSVolumeInfo noSmithyDocumentSerde } type UpdateBrokerStorageOutput struct { // The Amazon Resource Name (ARN) of the cluster. ClusterArn *string // The Amazon Resource Name (ARN) of the cluster operation. ClusterOperationArn *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateBrokerStorageMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateBrokerStorage{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateBrokerStorage{}, 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 = addOpUpdateBrokerStorageValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateBrokerStorage(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_opUpdateBrokerStorage(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafka", OperationName: "UpdateBrokerStorage", } }
140
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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" ) // Updates EC2 instance type. func (c *Client) UpdateBrokerType(ctx context.Context, params *UpdateBrokerTypeInput, optFns ...func(*Options)) (*UpdateBrokerTypeOutput, error) { if params == nil { params = &UpdateBrokerTypeInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateBrokerType", params, optFns, c.addOperationUpdateBrokerTypeMiddlewares) if err != nil { return nil, err } out := result.(*UpdateBrokerTypeOutput) out.ResultMetadata = metadata return out, nil } type UpdateBrokerTypeInput struct { // The Amazon Resource Name (ARN) that uniquely identifies the cluster. // // This member is required. ClusterArn *string // The cluster version that you want to change. After this operation completes // successfully, the cluster will have a new version. // // This member is required. CurrentVersion *string // The Amazon MSK broker type that you want all of the brokers in this cluster to // be. // // This member is required. TargetInstanceType *string noSmithyDocumentSerde } type UpdateBrokerTypeOutput struct { // The Amazon Resource Name (ARN) of the cluster. ClusterArn *string // The Amazon Resource Name (ARN) of the cluster operation. ClusterOperationArn *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateBrokerTypeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateBrokerType{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateBrokerType{}, 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 = addOpUpdateBrokerTypeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateBrokerType(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_opUpdateBrokerType(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafka", OperationName: "UpdateBrokerType", } }
139
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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/kafka/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates the cluster with the configuration that is specified in the request // body. func (c *Client) UpdateClusterConfiguration(ctx context.Context, params *UpdateClusterConfigurationInput, optFns ...func(*Options)) (*UpdateClusterConfigurationOutput, error) { if params == nil { params = &UpdateClusterConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateClusterConfiguration", params, optFns, c.addOperationUpdateClusterConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*UpdateClusterConfigurationOutput) out.ResultMetadata = metadata return out, nil } type UpdateClusterConfigurationInput struct { // The Amazon Resource Name (ARN) that uniquely identifies the cluster. // // This member is required. ClusterArn *string // Represents the configuration that you want MSK to use for the brokers in a // cluster. // // This member is required. ConfigurationInfo *types.ConfigurationInfo // The version of the cluster that needs to be updated. // // This member is required. CurrentVersion *string noSmithyDocumentSerde } type UpdateClusterConfigurationOutput struct { // The Amazon Resource Name (ARN) of the cluster. ClusterArn *string // The Amazon Resource Name (ARN) of the cluster operation. ClusterOperationArn *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateClusterConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateClusterConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateClusterConfiguration{}, 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 = addOpUpdateClusterConfigurationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateClusterConfiguration(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_opUpdateClusterConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafka", OperationName: "UpdateClusterConfiguration", } }
140
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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/kafka/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates the Apache Kafka version for the cluster. func (c *Client) UpdateClusterKafkaVersion(ctx context.Context, params *UpdateClusterKafkaVersionInput, optFns ...func(*Options)) (*UpdateClusterKafkaVersionOutput, error) { if params == nil { params = &UpdateClusterKafkaVersionInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateClusterKafkaVersion", params, optFns, c.addOperationUpdateClusterKafkaVersionMiddlewares) if err != nil { return nil, err } out := result.(*UpdateClusterKafkaVersionOutput) out.ResultMetadata = metadata return out, nil } type UpdateClusterKafkaVersionInput struct { // The Amazon Resource Name (ARN) of the cluster to be updated. // // This member is required. ClusterArn *string // Current cluster version. // // This member is required. CurrentVersion *string // Target Kafka version. // // This member is required. TargetKafkaVersion *string // The custom configuration that should be applied on the new version of cluster. ConfigurationInfo *types.ConfigurationInfo noSmithyDocumentSerde } type UpdateClusterKafkaVersionOutput struct { // The Amazon Resource Name (ARN) of the cluster. ClusterArn *string // The Amazon Resource Name (ARN) of the cluster operation. ClusterOperationArn *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateClusterKafkaVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateClusterKafkaVersion{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateClusterKafkaVersion{}, 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 = addOpUpdateClusterKafkaVersionValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateClusterKafkaVersion(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_opUpdateClusterKafkaVersion(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafka", OperationName: "UpdateClusterKafkaVersion", } }
141
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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/kafka/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates an MSK configuration. func (c *Client) UpdateConfiguration(ctx context.Context, params *UpdateConfigurationInput, optFns ...func(*Options)) (*UpdateConfigurationOutput, error) { if params == nil { params = &UpdateConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateConfiguration", params, optFns, c.addOperationUpdateConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*UpdateConfigurationOutput) out.ResultMetadata = metadata return out, nil } type UpdateConfigurationInput struct { // The Amazon Resource Name (ARN) of the configuration. // // This member is required. Arn *string // Contents of the server.properties file. When using the API, you must ensure // that the contents of the file are base64 encoded. When using the AWS Management // Console, the SDK, or the AWS CLI, the contents of server.properties can be in // plaintext. // // This member is required. ServerProperties []byte // The description of the configuration revision. Description *string noSmithyDocumentSerde } type UpdateConfigurationOutput struct { // The Amazon Resource Name (ARN) of the configuration. Arn *string // Latest revision of the configuration. LatestRevision *types.ConfigurationRevision // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateConfiguration{}, 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 = addOpUpdateConfigurationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateConfiguration(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_opUpdateConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafka", OperationName: "UpdateConfiguration", } }
139
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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/kafka/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates the cluster's connectivity configuration. func (c *Client) UpdateConnectivity(ctx context.Context, params *UpdateConnectivityInput, optFns ...func(*Options)) (*UpdateConnectivityOutput, error) { if params == nil { params = &UpdateConnectivityInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateConnectivity", params, optFns, c.addOperationUpdateConnectivityMiddlewares) if err != nil { return nil, err } out := result.(*UpdateConnectivityOutput) out.ResultMetadata = metadata return out, nil } // Request body for UpdateConnectivity. type UpdateConnectivityInput struct { // The Amazon Resource Name (ARN) of the configuration. // // This member is required. ClusterArn *string // Information about the broker access configuration. // // This member is required. ConnectivityInfo *types.ConnectivityInfo // The version of the MSK cluster to update. Cluster versions aren't simple // numbers. You can describe an MSK cluster to find its version. When this update // operation is successful, it generates a new cluster version. // // This member is required. CurrentVersion *string noSmithyDocumentSerde } type UpdateConnectivityOutput struct { // The Amazon Resource Name (ARN) of the cluster. ClusterArn *string // The Amazon Resource Name (ARN) of the cluster operation. ClusterOperationArn *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateConnectivityMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateConnectivity{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateConnectivity{}, 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 = addOpUpdateConnectivityValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateConnectivity(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_opUpdateConnectivity(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafka", OperationName: "UpdateConnectivity", } }
141
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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/kafka/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates the monitoring settings for the cluster. You can use this operation to // specify which Apache Kafka metrics you want Amazon MSK to send to Amazon // CloudWatch. You can also specify settings for open monitoring with Prometheus. func (c *Client) UpdateMonitoring(ctx context.Context, params *UpdateMonitoringInput, optFns ...func(*Options)) (*UpdateMonitoringOutput, error) { if params == nil { params = &UpdateMonitoringInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateMonitoring", params, optFns, c.addOperationUpdateMonitoringMiddlewares) if err != nil { return nil, err } out := result.(*UpdateMonitoringOutput) out.ResultMetadata = metadata return out, nil } // Request body for UpdateMonitoring. type UpdateMonitoringInput struct { // The Amazon Resource Name (ARN) that uniquely identifies the cluster. // // This member is required. ClusterArn *string // The version of the MSK cluster to update. Cluster versions aren't simple // numbers. You can describe an MSK cluster to find its version. When this update // operation is successful, it generates a new cluster version. // // This member is required. CurrentVersion *string // Specifies which Apache Kafka metrics Amazon MSK gathers and sends to Amazon // CloudWatch for this cluster. EnhancedMonitoring types.EnhancedMonitoring LoggingInfo *types.LoggingInfo // The settings for open monitoring. OpenMonitoring *types.OpenMonitoringInfo noSmithyDocumentSerde } type UpdateMonitoringOutput struct { // The Amazon Resource Name (ARN) of the cluster. ClusterArn *string // The Amazon Resource Name (ARN) of the cluster operation. ClusterOperationArn *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateMonitoringMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateMonitoring{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateMonitoring{}, 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 = addOpUpdateMonitoringValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateMonitoring(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_opUpdateMonitoring(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafka", OperationName: "UpdateMonitoring", } }
147
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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/kafka/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates the security settings for the cluster. You can use this operation to // specify encryption and authentication on existing clusters. func (c *Client) UpdateSecurity(ctx context.Context, params *UpdateSecurityInput, optFns ...func(*Options)) (*UpdateSecurityOutput, error) { if params == nil { params = &UpdateSecurityInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateSecurity", params, optFns, c.addOperationUpdateSecurityMiddlewares) if err != nil { return nil, err } out := result.(*UpdateSecurityOutput) out.ResultMetadata = metadata return out, nil } type UpdateSecurityInput struct { // The Amazon Resource Name (ARN) that uniquely identifies the cluster. // // This member is required. ClusterArn *string // The version of the MSK cluster to update. Cluster versions aren't simple // numbers. You can describe an MSK cluster to find its version. When this update // operation is successful, it generates a new cluster version. // // This member is required. CurrentVersion *string // Includes all client authentication related information. ClientAuthentication *types.ClientAuthentication // Includes all encryption-related information. EncryptionInfo *types.EncryptionInfo noSmithyDocumentSerde } type UpdateSecurityOutput struct { // The Amazon Resource Name (ARN) of the cluster. ClusterArn *string // The Amazon Resource Name (ARN) of the cluster operation. ClusterOperationArn *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateSecurityMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateSecurity{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateSecurity{}, 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 = addOpUpdateSecurityValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSecurity(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_opUpdateSecurity(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafka", OperationName: "UpdateSecurity", } }
142
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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/kafka/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates cluster broker volume size (or) sets cluster storage mode to TIERED. func (c *Client) UpdateStorage(ctx context.Context, params *UpdateStorageInput, optFns ...func(*Options)) (*UpdateStorageOutput, error) { if params == nil { params = &UpdateStorageInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateStorage", params, optFns, c.addOperationUpdateStorageMiddlewares) if err != nil { return nil, err } out := result.(*UpdateStorageOutput) out.ResultMetadata = metadata return out, nil } // Request object for UpdateStorage api. Its used to update the storage attributes // for the cluster. type UpdateStorageInput struct { // The Amazon Resource Name (ARN) of the cluster to be updated. // // This member is required. ClusterArn *string // The version of cluster to update from. A successful operation will then // generate a new version. // // This member is required. CurrentVersion *string // EBS volume provisioned throughput information. ProvisionedThroughput *types.ProvisionedThroughput // Controls storage mode for supported storage tiers. StorageMode types.StorageMode // size of the EBS volume to update. VolumeSizeGB int32 noSmithyDocumentSerde } type UpdateStorageOutput struct { // The Amazon Resource Name (ARN) of the cluster. ClusterArn *string // The Amazon Resource Name (ARN) of the cluster operation. ClusterOperationArn *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateStorageMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateStorage{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateStorage{}, 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 = addOpUpdateStorageValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateStorage(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_opUpdateStorage(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafka", OperationName: "UpdateStorage", } }
145
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka import ( "bytes" "context" "encoding/base64" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/kafka/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" "io/ioutil" "math" "strings" ) type awsRestjson1_deserializeOpBatchAssociateScramSecret struct { } func (*awsRestjson1_deserializeOpBatchAssociateScramSecret) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpBatchAssociateScramSecret) 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_deserializeOpErrorBatchAssociateScramSecret(response, &metadata) } output := &BatchAssociateScramSecretOutput{} 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_deserializeOpDocumentBatchAssociateScramSecretOutput(&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_deserializeOpErrorBatchAssociateScramSecret(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentBatchAssociateScramSecretOutput(v **BatchAssociateScramSecretOutput, 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 *BatchAssociateScramSecretOutput if *v == nil { sv = &BatchAssociateScramSecretOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clusterArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterArn = ptr.String(jtv) } case "unprocessedScramSecrets": if err := awsRestjson1_deserializeDocument__listOfUnprocessedScramSecret(&sv.UnprocessedScramSecrets, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpBatchDisassociateScramSecret struct { } func (*awsRestjson1_deserializeOpBatchDisassociateScramSecret) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpBatchDisassociateScramSecret) 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_deserializeOpErrorBatchDisassociateScramSecret(response, &metadata) } output := &BatchDisassociateScramSecretOutput{} 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_deserializeOpDocumentBatchDisassociateScramSecretOutput(&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_deserializeOpErrorBatchDisassociateScramSecret(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentBatchDisassociateScramSecretOutput(v **BatchDisassociateScramSecretOutput, 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 *BatchDisassociateScramSecretOutput if *v == nil { sv = &BatchDisassociateScramSecretOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clusterArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterArn = ptr.String(jtv) } case "unprocessedScramSecrets": if err := awsRestjson1_deserializeDocument__listOfUnprocessedScramSecret(&sv.UnprocessedScramSecrets, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateCluster struct { } func (*awsRestjson1_deserializeOpCreateCluster) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateCluster) 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_deserializeOpErrorCreateCluster(response, &metadata) } output := &CreateClusterOutput{} 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_deserializeOpDocumentCreateClusterOutput(&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_deserializeOpErrorCreateCluster(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateClusterOutput(v **CreateClusterOutput, 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 *CreateClusterOutput if *v == nil { sv = &CreateClusterOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clusterArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterArn = ptr.String(jtv) } case "clusterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterName = ptr.String(jtv) } case "state": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClusterState to be of type string, got %T instead", value) } sv.State = types.ClusterState(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateClusterV2 struct { } func (*awsRestjson1_deserializeOpCreateClusterV2) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateClusterV2) 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_deserializeOpErrorCreateClusterV2(response, &metadata) } output := &CreateClusterV2Output{} 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_deserializeOpDocumentCreateClusterV2Output(&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_deserializeOpErrorCreateClusterV2(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateClusterV2Output(v **CreateClusterV2Output, 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 *CreateClusterV2Output if *v == nil { sv = &CreateClusterV2Output{} } else { sv = *v } for key, value := range shape { switch key { case "clusterArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterArn = ptr.String(jtv) } case "clusterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterName = ptr.String(jtv) } case "clusterType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClusterType to be of type string, got %T instead", value) } sv.ClusterType = types.ClusterType(jtv) } case "state": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClusterState to be of type string, got %T instead", value) } sv.State = types.ClusterState(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateConfiguration struct { } func (*awsRestjson1_deserializeOpCreateConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateConfiguration) 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_deserializeOpErrorCreateConfiguration(response, &metadata) } output := &CreateConfigurationOutput{} 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_deserializeOpDocumentCreateConfigurationOutput(&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_deserializeOpErrorCreateConfiguration(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateConfigurationOutput(v **CreateConfigurationOutput, 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 *CreateConfigurationOutput if *v == nil { sv = &CreateConfigurationOutput{} } 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 __string to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationTime = ptr.Time(t) } case "latestRevision": if err := awsRestjson1_deserializeDocumentConfigurationRevision(&sv.LatestRevision, value); err != nil { return err } 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 "state": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConfigurationState to be of type string, got %T instead", value) } sv.State = types.ConfigurationState(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateVpcConnection struct { } func (*awsRestjson1_deserializeOpCreateVpcConnection) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateVpcConnection) 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_deserializeOpErrorCreateVpcConnection(response, &metadata) } output := &CreateVpcConnectionOutput{} 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_deserializeOpDocumentCreateVpcConnectionOutput(&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_deserializeOpErrorCreateVpcConnection(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateVpcConnectionOutput(v **CreateVpcConnectionOutput, 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 *CreateVpcConnectionOutput if *v == nil { sv = &CreateVpcConnectionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "authentication": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Authentication = ptr.String(jtv) } case "clientSubnets": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.ClientSubnets, value); err != nil { return err } case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationTime = ptr.Time(t) } case "securityGroups": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.SecurityGroups, value); err != nil { return err } case "state": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VpcConnectionState to be of type string, got %T instead", value) } sv.State = types.VpcConnectionState(jtv) } case "tags": if err := awsRestjson1_deserializeDocument__mapOf__string(&sv.Tags, value); err != nil { return err } case "vpcConnectionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.VpcConnectionArn = ptr.String(jtv) } case "vpcId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.VpcId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteCluster struct { } func (*awsRestjson1_deserializeOpDeleteCluster) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteCluster) 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_deserializeOpErrorDeleteCluster(response, &metadata) } output := &DeleteClusterOutput{} 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_deserializeOpDocumentDeleteClusterOutput(&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_deserializeOpErrorDeleteCluster(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeleteClusterOutput(v **DeleteClusterOutput, 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 *DeleteClusterOutput if *v == nil { sv = &DeleteClusterOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clusterArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterArn = ptr.String(jtv) } case "state": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClusterState to be of type string, got %T instead", value) } sv.State = types.ClusterState(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteClusterPolicy struct { } func (*awsRestjson1_deserializeOpDeleteClusterPolicy) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteClusterPolicy) 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_deserializeOpErrorDeleteClusterPolicy(response, &metadata) } output := &DeleteClusterPolicyOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteClusterPolicy(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteConfiguration struct { } func (*awsRestjson1_deserializeOpDeleteConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteConfiguration) 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_deserializeOpErrorDeleteConfiguration(response, &metadata) } output := &DeleteConfigurationOutput{} 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_deserializeOpDocumentDeleteConfigurationOutput(&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_deserializeOpErrorDeleteConfiguration(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeleteConfigurationOutput(v **DeleteConfigurationOutput, 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 *DeleteConfigurationOutput if *v == nil { sv = &DeleteConfigurationOutput{} } 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 __string to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "state": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConfigurationState to be of type string, got %T instead", value) } sv.State = types.ConfigurationState(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteVpcConnection struct { } func (*awsRestjson1_deserializeOpDeleteVpcConnection) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteVpcConnection) 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_deserializeOpErrorDeleteVpcConnection(response, &metadata) } output := &DeleteVpcConnectionOutput{} 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_deserializeOpDocumentDeleteVpcConnectionOutput(&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_deserializeOpErrorDeleteVpcConnection(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeleteVpcConnectionOutput(v **DeleteVpcConnectionOutput, 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 *DeleteVpcConnectionOutput if *v == nil { sv = &DeleteVpcConnectionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "state": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VpcConnectionState to be of type string, got %T instead", value) } sv.State = types.VpcConnectionState(jtv) } case "vpcConnectionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.VpcConnectionArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeCluster struct { } func (*awsRestjson1_deserializeOpDescribeCluster) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeCluster) 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_deserializeOpErrorDescribeCluster(response, &metadata) } output := &DescribeClusterOutput{} 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_deserializeOpDocumentDescribeClusterOutput(&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_deserializeOpErrorDescribeCluster(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeClusterOutput(v **DescribeClusterOutput, 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 *DescribeClusterOutput if *v == nil { sv = &DescribeClusterOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clusterInfo": if err := awsRestjson1_deserializeDocumentClusterInfo(&sv.ClusterInfo, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeClusterOperation struct { } func (*awsRestjson1_deserializeOpDescribeClusterOperation) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeClusterOperation) 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_deserializeOpErrorDescribeClusterOperation(response, &metadata) } output := &DescribeClusterOperationOutput{} 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_deserializeOpDocumentDescribeClusterOperationOutput(&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_deserializeOpErrorDescribeClusterOperation(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeClusterOperationOutput(v **DescribeClusterOperationOutput, 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 *DescribeClusterOperationOutput if *v == nil { sv = &DescribeClusterOperationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clusterOperationInfo": if err := awsRestjson1_deserializeDocumentClusterOperationInfo(&sv.ClusterOperationInfo, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeClusterV2 struct { } func (*awsRestjson1_deserializeOpDescribeClusterV2) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeClusterV2) 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_deserializeOpErrorDescribeClusterV2(response, &metadata) } output := &DescribeClusterV2Output{} 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_deserializeOpDocumentDescribeClusterV2Output(&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_deserializeOpErrorDescribeClusterV2(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeClusterV2Output(v **DescribeClusterV2Output, 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 *DescribeClusterV2Output if *v == nil { sv = &DescribeClusterV2Output{} } else { sv = *v } for key, value := range shape { switch key { case "clusterInfo": if err := awsRestjson1_deserializeDocumentCluster(&sv.ClusterInfo, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeConfiguration struct { } func (*awsRestjson1_deserializeOpDescribeConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeConfiguration) 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_deserializeOpErrorDescribeConfiguration(response, &metadata) } output := &DescribeConfigurationOutput{} 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_deserializeOpDocumentDescribeConfigurationOutput(&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_deserializeOpErrorDescribeConfiguration(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeConfigurationOutput(v **DescribeConfigurationOutput, 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 *DescribeConfigurationOutput if *v == nil { sv = &DescribeConfigurationOutput{} } 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 __string to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationTime = ptr.Time(t) } 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 "kafkaVersions": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.KafkaVersions, value); err != nil { return err } case "latestRevision": if err := awsRestjson1_deserializeDocumentConfigurationRevision(&sv.LatestRevision, value); err != nil { return err } 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 "state": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConfigurationState to be of type string, got %T instead", value) } sv.State = types.ConfigurationState(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeConfigurationRevision struct { } func (*awsRestjson1_deserializeOpDescribeConfigurationRevision) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeConfigurationRevision) 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_deserializeOpErrorDescribeConfigurationRevision(response, &metadata) } output := &DescribeConfigurationRevisionOutput{} 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_deserializeOpDocumentDescribeConfigurationRevisionOutput(&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_deserializeOpErrorDescribeConfigurationRevision(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeConfigurationRevisionOutput(v **DescribeConfigurationRevisionOutput, 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 *DescribeConfigurationRevisionOutput if *v == nil { sv = &DescribeConfigurationRevisionOutput{} } 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 __string to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationTime = ptr.Time(t) } 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 "revision": 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.Revision = i64 } case "serverProperties": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __blob to be []byte, got %T instead", value) } dv, err := base64.StdEncoding.DecodeString(jtv) if err != nil { return fmt.Errorf("failed to base64 decode __blob, %w", err) } sv.ServerProperties = dv } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeVpcConnection struct { } func (*awsRestjson1_deserializeOpDescribeVpcConnection) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeVpcConnection) 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_deserializeOpErrorDescribeVpcConnection(response, &metadata) } output := &DescribeVpcConnectionOutput{} 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_deserializeOpDocumentDescribeVpcConnectionOutput(&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_deserializeOpErrorDescribeVpcConnection(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeVpcConnectionOutput(v **DescribeVpcConnectionOutput, 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 *DescribeVpcConnectionOutput if *v == nil { sv = &DescribeVpcConnectionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "authentication": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Authentication = ptr.String(jtv) } case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationTime = ptr.Time(t) } case "securityGroups": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.SecurityGroups, value); err != nil { return err } case "state": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VpcConnectionState to be of type string, got %T instead", value) } sv.State = types.VpcConnectionState(jtv) } case "subnets": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.Subnets, value); err != nil { return err } case "tags": if err := awsRestjson1_deserializeDocument__mapOf__string(&sv.Tags, value); err != nil { return err } case "targetClusterArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.TargetClusterArn = ptr.String(jtv) } case "vpcConnectionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.VpcConnectionArn = ptr.String(jtv) } case "vpcId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.VpcId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetBootstrapBrokers struct { } func (*awsRestjson1_deserializeOpGetBootstrapBrokers) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetBootstrapBrokers) 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_deserializeOpErrorGetBootstrapBrokers(response, &metadata) } output := &GetBootstrapBrokersOutput{} 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_deserializeOpDocumentGetBootstrapBrokersOutput(&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_deserializeOpErrorGetBootstrapBrokers(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetBootstrapBrokersOutput(v **GetBootstrapBrokersOutput, 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 *GetBootstrapBrokersOutput if *v == nil { sv = &GetBootstrapBrokersOutput{} } else { sv = *v } for key, value := range shape { switch key { case "bootstrapBrokerString": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.BootstrapBrokerString = ptr.String(jtv) } case "bootstrapBrokerStringPublicSaslIam": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.BootstrapBrokerStringPublicSaslIam = ptr.String(jtv) } case "bootstrapBrokerStringPublicSaslScram": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.BootstrapBrokerStringPublicSaslScram = ptr.String(jtv) } case "bootstrapBrokerStringPublicTls": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.BootstrapBrokerStringPublicTls = ptr.String(jtv) } case "bootstrapBrokerStringSaslIam": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.BootstrapBrokerStringSaslIam = ptr.String(jtv) } case "bootstrapBrokerStringSaslScram": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.BootstrapBrokerStringSaslScram = ptr.String(jtv) } case "bootstrapBrokerStringTls": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.BootstrapBrokerStringTls = ptr.String(jtv) } case "bootstrapBrokerStringVpcConnectivitySaslIam": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.BootstrapBrokerStringVpcConnectivitySaslIam = ptr.String(jtv) } case "bootstrapBrokerStringVpcConnectivitySaslScram": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.BootstrapBrokerStringVpcConnectivitySaslScram = ptr.String(jtv) } case "bootstrapBrokerStringVpcConnectivityTls": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.BootstrapBrokerStringVpcConnectivityTls = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetClusterPolicy struct { } func (*awsRestjson1_deserializeOpGetClusterPolicy) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetClusterPolicy) 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_deserializeOpErrorGetClusterPolicy(response, &metadata) } output := &GetClusterPolicyOutput{} 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_deserializeOpDocumentGetClusterPolicyOutput(&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_deserializeOpErrorGetClusterPolicy(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetClusterPolicyOutput(v **GetClusterPolicyOutput, 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 *GetClusterPolicyOutput if *v == nil { sv = &GetClusterPolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "currentVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.CurrentVersion = ptr.String(jtv) } case "policy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Policy = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpGetCompatibleKafkaVersions struct { } func (*awsRestjson1_deserializeOpGetCompatibleKafkaVersions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpGetCompatibleKafkaVersions) 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_deserializeOpErrorGetCompatibleKafkaVersions(response, &metadata) } output := &GetCompatibleKafkaVersionsOutput{} 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_deserializeOpDocumentGetCompatibleKafkaVersionsOutput(&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_deserializeOpErrorGetCompatibleKafkaVersions(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentGetCompatibleKafkaVersionsOutput(v **GetCompatibleKafkaVersionsOutput, 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 *GetCompatibleKafkaVersionsOutput if *v == nil { sv = &GetCompatibleKafkaVersionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "compatibleKafkaVersions": if err := awsRestjson1_deserializeDocument__listOfCompatibleKafkaVersion(&sv.CompatibleKafkaVersions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListClientVpcConnections struct { } func (*awsRestjson1_deserializeOpListClientVpcConnections) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListClientVpcConnections) 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_deserializeOpErrorListClientVpcConnections(response, &metadata) } output := &ListClientVpcConnectionsOutput{} 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_deserializeOpDocumentListClientVpcConnectionsOutput(&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_deserializeOpErrorListClientVpcConnections(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListClientVpcConnectionsOutput(v **ListClientVpcConnectionsOutput, 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 *ListClientVpcConnectionsOutput if *v == nil { sv = &ListClientVpcConnectionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clientVpcConnections": if err := awsRestjson1_deserializeDocument__listOfClientVpcConnection(&sv.ClientVpcConnections, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListClusterOperations struct { } func (*awsRestjson1_deserializeOpListClusterOperations) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListClusterOperations) 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_deserializeOpErrorListClusterOperations(response, &metadata) } output := &ListClusterOperationsOutput{} 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_deserializeOpDocumentListClusterOperationsOutput(&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_deserializeOpErrorListClusterOperations(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListClusterOperationsOutput(v **ListClusterOperationsOutput, 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 *ListClusterOperationsOutput if *v == nil { sv = &ListClusterOperationsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clusterOperationInfoList": if err := awsRestjson1_deserializeDocument__listOfClusterOperationInfo(&sv.ClusterOperationInfoList, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListClusters struct { } func (*awsRestjson1_deserializeOpListClusters) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListClusters) 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_deserializeOpErrorListClusters(response, &metadata) } output := &ListClustersOutput{} 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_deserializeOpDocumentListClustersOutput(&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_deserializeOpErrorListClusters(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListClustersOutput(v **ListClustersOutput, 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 *ListClustersOutput if *v == nil { sv = &ListClustersOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clusterInfoList": if err := awsRestjson1_deserializeDocument__listOfClusterInfo(&sv.ClusterInfoList, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListClustersV2 struct { } func (*awsRestjson1_deserializeOpListClustersV2) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListClustersV2) 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_deserializeOpErrorListClustersV2(response, &metadata) } output := &ListClustersV2Output{} 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_deserializeOpDocumentListClustersV2Output(&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_deserializeOpErrorListClustersV2(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListClustersV2Output(v **ListClustersV2Output, 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 *ListClustersV2Output if *v == nil { sv = &ListClustersV2Output{} } else { sv = *v } for key, value := range shape { switch key { case "clusterInfoList": if err := awsRestjson1_deserializeDocument__listOfCluster(&sv.ClusterInfoList, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListConfigurationRevisions struct { } func (*awsRestjson1_deserializeOpListConfigurationRevisions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListConfigurationRevisions) 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_deserializeOpErrorListConfigurationRevisions(response, &metadata) } output := &ListConfigurationRevisionsOutput{} 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_deserializeOpDocumentListConfigurationRevisionsOutput(&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_deserializeOpErrorListConfigurationRevisions(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListConfigurationRevisionsOutput(v **ListConfigurationRevisionsOutput, 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 *ListConfigurationRevisionsOutput if *v == nil { sv = &ListConfigurationRevisionsOutput{} } 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 __string to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "revisions": if err := awsRestjson1_deserializeDocument__listOfConfigurationRevision(&sv.Revisions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListConfigurations struct { } func (*awsRestjson1_deserializeOpListConfigurations) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListConfigurations) 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_deserializeOpErrorListConfigurations(response, &metadata) } output := &ListConfigurationsOutput{} 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_deserializeOpDocumentListConfigurationsOutput(&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_deserializeOpErrorListConfigurations(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListConfigurationsOutput(v **ListConfigurationsOutput, 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 *ListConfigurationsOutput if *v == nil { sv = &ListConfigurationsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "configurations": if err := awsRestjson1_deserializeDocument__listOfConfiguration(&sv.Configurations, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListKafkaVersions struct { } func (*awsRestjson1_deserializeOpListKafkaVersions) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListKafkaVersions) 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_deserializeOpErrorListKafkaVersions(response, &metadata) } output := &ListKafkaVersionsOutput{} 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_deserializeOpDocumentListKafkaVersionsOutput(&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_deserializeOpErrorListKafkaVersions(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListKafkaVersionsOutput(v **ListKafkaVersionsOutput, 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 *ListKafkaVersionsOutput if *v == nil { sv = &ListKafkaVersionsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "kafkaVersions": if err := awsRestjson1_deserializeDocument__listOfKafkaVersion(&sv.KafkaVersions, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListNodes struct { } func (*awsRestjson1_deserializeOpListNodes) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListNodes) 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_deserializeOpErrorListNodes(response, &metadata) } output := &ListNodesOutput{} 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_deserializeOpDocumentListNodesOutput(&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_deserializeOpErrorListNodes(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListNodesOutput(v **ListNodesOutput, 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 *ListNodesOutput if *v == nil { sv = &ListNodesOutput{} } 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 __string to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "nodeInfoList": if err := awsRestjson1_deserializeDocument__listOfNodeInfo(&sv.NodeInfoList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListScramSecrets struct { } func (*awsRestjson1_deserializeOpListScramSecrets) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListScramSecrets) 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_deserializeOpErrorListScramSecrets(response, &metadata) } output := &ListScramSecretsOutput{} 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_deserializeOpDocumentListScramSecretsOutput(&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_deserializeOpErrorListScramSecrets(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListScramSecretsOutput(v **ListScramSecretsOutput, 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 *ListScramSecretsOutput if *v == nil { sv = &ListScramSecretsOutput{} } 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 __string to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "secretArnList": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.SecretArnList, value); err != nil { return err } 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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(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_deserializeDocument__mapOf__string(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListVpcConnections struct { } func (*awsRestjson1_deserializeOpListVpcConnections) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListVpcConnections) 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_deserializeOpErrorListVpcConnections(response, &metadata) } output := &ListVpcConnectionsOutput{} 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_deserializeOpDocumentListVpcConnectionsOutput(&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_deserializeOpErrorListVpcConnections(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListVpcConnectionsOutput(v **ListVpcConnectionsOutput, 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 *ListVpcConnectionsOutput if *v == nil { sv = &ListVpcConnectionsOutput{} } 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 __string to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "vpcConnections": if err := awsRestjson1_deserializeDocument__listOfVpcConnection(&sv.VpcConnections, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpPutClusterPolicy struct { } func (*awsRestjson1_deserializeOpPutClusterPolicy) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpPutClusterPolicy) 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_deserializeOpErrorPutClusterPolicy(response, &metadata) } output := &PutClusterPolicyOutput{} 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_deserializeOpDocumentPutClusterPolicyOutput(&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_deserializeOpErrorPutClusterPolicy(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentPutClusterPolicyOutput(v **PutClusterPolicyOutput, 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 *PutClusterPolicyOutput if *v == nil { sv = &PutClusterPolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { case "currentVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.CurrentVersion = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpRebootBroker struct { } func (*awsRestjson1_deserializeOpRebootBroker) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpRebootBroker) 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_deserializeOpErrorRebootBroker(response, &metadata) } output := &RebootBrokerOutput{} 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_deserializeOpDocumentRebootBrokerOutput(&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_deserializeOpErrorRebootBroker(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentRebootBrokerOutput(v **RebootBrokerOutput, 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 *RebootBrokerOutput if *v == nil { sv = &RebootBrokerOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clusterArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterArn = ptr.String(jtv) } case "clusterOperationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterOperationArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpRejectClientVpcConnection struct { } func (*awsRestjson1_deserializeOpRejectClientVpcConnection) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpRejectClientVpcConnection) 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_deserializeOpErrorRejectClientVpcConnection(response, &metadata) } output := &RejectClientVpcConnectionOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorRejectClientVpcConnection(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(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 if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to discard response body, %w", err), } } 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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(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 if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to discard response body, %w", err), } } 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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUpdateBrokerCount struct { } func (*awsRestjson1_deserializeOpUpdateBrokerCount) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateBrokerCount) 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_deserializeOpErrorUpdateBrokerCount(response, &metadata) } output := &UpdateBrokerCountOutput{} 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_deserializeOpDocumentUpdateBrokerCountOutput(&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_deserializeOpErrorUpdateBrokerCount(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateBrokerCountOutput(v **UpdateBrokerCountOutput, 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 *UpdateBrokerCountOutput if *v == nil { sv = &UpdateBrokerCountOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clusterArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterArn = ptr.String(jtv) } case "clusterOperationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterOperationArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateBrokerStorage struct { } func (*awsRestjson1_deserializeOpUpdateBrokerStorage) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateBrokerStorage) 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_deserializeOpErrorUpdateBrokerStorage(response, &metadata) } output := &UpdateBrokerStorageOutput{} 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_deserializeOpDocumentUpdateBrokerStorageOutput(&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_deserializeOpErrorUpdateBrokerStorage(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateBrokerStorageOutput(v **UpdateBrokerStorageOutput, 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 *UpdateBrokerStorageOutput if *v == nil { sv = &UpdateBrokerStorageOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clusterArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterArn = ptr.String(jtv) } case "clusterOperationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterOperationArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateBrokerType struct { } func (*awsRestjson1_deserializeOpUpdateBrokerType) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateBrokerType) 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_deserializeOpErrorUpdateBrokerType(response, &metadata) } output := &UpdateBrokerTypeOutput{} 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_deserializeOpDocumentUpdateBrokerTypeOutput(&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_deserializeOpErrorUpdateBrokerType(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateBrokerTypeOutput(v **UpdateBrokerTypeOutput, 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 *UpdateBrokerTypeOutput if *v == nil { sv = &UpdateBrokerTypeOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clusterArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterArn = ptr.String(jtv) } case "clusterOperationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterOperationArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateClusterConfiguration struct { } func (*awsRestjson1_deserializeOpUpdateClusterConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateClusterConfiguration) 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_deserializeOpErrorUpdateClusterConfiguration(response, &metadata) } output := &UpdateClusterConfigurationOutput{} 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_deserializeOpDocumentUpdateClusterConfigurationOutput(&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_deserializeOpErrorUpdateClusterConfiguration(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateClusterConfigurationOutput(v **UpdateClusterConfigurationOutput, 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 *UpdateClusterConfigurationOutput if *v == nil { sv = &UpdateClusterConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clusterArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterArn = ptr.String(jtv) } case "clusterOperationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterOperationArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateClusterKafkaVersion struct { } func (*awsRestjson1_deserializeOpUpdateClusterKafkaVersion) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateClusterKafkaVersion) 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_deserializeOpErrorUpdateClusterKafkaVersion(response, &metadata) } output := &UpdateClusterKafkaVersionOutput{} 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_deserializeOpDocumentUpdateClusterKafkaVersionOutput(&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_deserializeOpErrorUpdateClusterKafkaVersion(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateClusterKafkaVersionOutput(v **UpdateClusterKafkaVersionOutput, 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 *UpdateClusterKafkaVersionOutput if *v == nil { sv = &UpdateClusterKafkaVersionOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clusterArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterArn = ptr.String(jtv) } case "clusterOperationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterOperationArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateConfiguration struct { } func (*awsRestjson1_deserializeOpUpdateConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateConfiguration) 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_deserializeOpErrorUpdateConfiguration(response, &metadata) } output := &UpdateConfigurationOutput{} 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_deserializeOpDocumentUpdateConfigurationOutput(&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_deserializeOpErrorUpdateConfiguration(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateConfigurationOutput(v **UpdateConfigurationOutput, 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 *UpdateConfigurationOutput if *v == nil { sv = &UpdateConfigurationOutput{} } 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 __string to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "latestRevision": if err := awsRestjson1_deserializeDocumentConfigurationRevision(&sv.LatestRevision, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateConnectivity struct { } func (*awsRestjson1_deserializeOpUpdateConnectivity) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateConnectivity) 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_deserializeOpErrorUpdateConnectivity(response, &metadata) } output := &UpdateConnectivityOutput{} 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_deserializeOpDocumentUpdateConnectivityOutput(&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_deserializeOpErrorUpdateConnectivity(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateConnectivityOutput(v **UpdateConnectivityOutput, 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 *UpdateConnectivityOutput if *v == nil { sv = &UpdateConnectivityOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clusterArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterArn = ptr.String(jtv) } case "clusterOperationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterOperationArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateMonitoring struct { } func (*awsRestjson1_deserializeOpUpdateMonitoring) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateMonitoring) 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_deserializeOpErrorUpdateMonitoring(response, &metadata) } output := &UpdateMonitoringOutput{} 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_deserializeOpDocumentUpdateMonitoringOutput(&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_deserializeOpErrorUpdateMonitoring(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateMonitoringOutput(v **UpdateMonitoringOutput, 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 *UpdateMonitoringOutput if *v == nil { sv = &UpdateMonitoringOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clusterArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterArn = ptr.String(jtv) } case "clusterOperationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterOperationArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateSecurity struct { } func (*awsRestjson1_deserializeOpUpdateSecurity) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateSecurity) 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_deserializeOpErrorUpdateSecurity(response, &metadata) } output := &UpdateSecurityOutput{} 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_deserializeOpDocumentUpdateSecurityOutput(&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_deserializeOpErrorUpdateSecurity(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateSecurityOutput(v **UpdateSecurityOutput, 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 *UpdateSecurityOutput if *v == nil { sv = &UpdateSecurityOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clusterArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterArn = ptr.String(jtv) } case "clusterOperationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterOperationArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateStorage struct { } func (*awsRestjson1_deserializeOpUpdateStorage) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateStorage) 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_deserializeOpErrorUpdateStorage(response, &metadata) } output := &UpdateStorageOutput{} 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_deserializeOpDocumentUpdateStorageOutput(&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_deserializeOpErrorUpdateStorage(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateStorageOutput(v **UpdateStorageOutput, 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 *UpdateStorageOutput if *v == nil { sv = &UpdateStorageOutput{} } else { sv = *v } for key, value := range shape { switch key { case "clusterArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterArn = ptr.String(jtv) } case "clusterOperationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterOperationArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeErrorBadRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.BadRequestException{} 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_deserializeDocumentBadRequestException(&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_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ConflictException{} 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_deserializeDocumentConflictException(&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_deserializeErrorForbiddenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ForbiddenException{} 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_deserializeDocumentForbiddenException(&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_deserializeErrorInternalServerErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InternalServerErrorException{} 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_deserializeDocumentInternalServerErrorException(&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_deserializeErrorNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.NotFoundException{} 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_deserializeDocumentNotFoundException(&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_deserializeErrorServiceUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ServiceUnavailableException{} 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_deserializeDocumentServiceUnavailableException(&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_deserializeErrorTooManyRequestsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.TooManyRequestsException{} 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_deserializeDocumentTooManyRequestsException(&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_deserializeErrorUnauthorizedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.UnauthorizedException{} 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_deserializeDocumentUnauthorizedException(&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_deserializeDocument__listOf__string(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfBrokerEBSVolumeInfo(v *[]types.BrokerEBSVolumeInfo, 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.BrokerEBSVolumeInfo if *v == nil { cv = []types.BrokerEBSVolumeInfo{} } else { cv = *v } for _, value := range shape { var col types.BrokerEBSVolumeInfo destAddr := &col if err := awsRestjson1_deserializeDocumentBrokerEBSVolumeInfo(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfClientVpcConnection(v *[]types.ClientVpcConnection, 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.ClientVpcConnection if *v == nil { cv = []types.ClientVpcConnection{} } else { cv = *v } for _, value := range shape { var col types.ClientVpcConnection destAddr := &col if err := awsRestjson1_deserializeDocumentClientVpcConnection(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfCluster(v *[]types.Cluster, 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.Cluster if *v == nil { cv = []types.Cluster{} } else { cv = *v } for _, value := range shape { var col types.Cluster destAddr := &col if err := awsRestjson1_deserializeDocumentCluster(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfClusterInfo(v *[]types.ClusterInfo, 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.ClusterInfo if *v == nil { cv = []types.ClusterInfo{} } else { cv = *v } for _, value := range shape { var col types.ClusterInfo destAddr := &col if err := awsRestjson1_deserializeDocumentClusterInfo(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfClusterOperationInfo(v *[]types.ClusterOperationInfo, 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.ClusterOperationInfo if *v == nil { cv = []types.ClusterOperationInfo{} } else { cv = *v } for _, value := range shape { var col types.ClusterOperationInfo destAddr := &col if err := awsRestjson1_deserializeDocumentClusterOperationInfo(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfClusterOperationStep(v *[]types.ClusterOperationStep, 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.ClusterOperationStep if *v == nil { cv = []types.ClusterOperationStep{} } else { cv = *v } for _, value := range shape { var col types.ClusterOperationStep destAddr := &col if err := awsRestjson1_deserializeDocumentClusterOperationStep(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfCompatibleKafkaVersion(v *[]types.CompatibleKafkaVersion, 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.CompatibleKafkaVersion if *v == nil { cv = []types.CompatibleKafkaVersion{} } else { cv = *v } for _, value := range shape { var col types.CompatibleKafkaVersion destAddr := &col if err := awsRestjson1_deserializeDocumentCompatibleKafkaVersion(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfConfiguration(v *[]types.Configuration, 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.Configuration if *v == nil { cv = []types.Configuration{} } else { cv = *v } for _, value := range shape { var col types.Configuration destAddr := &col if err := awsRestjson1_deserializeDocumentConfiguration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfConfigurationRevision(v *[]types.ConfigurationRevision, 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.ConfigurationRevision if *v == nil { cv = []types.ConfigurationRevision{} } else { cv = *v } for _, value := range shape { var col types.ConfigurationRevision destAddr := &col if err := awsRestjson1_deserializeDocumentConfigurationRevision(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfKafkaVersion(v *[]types.KafkaVersion, 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.KafkaVersion if *v == nil { cv = []types.KafkaVersion{} } else { cv = *v } for _, value := range shape { var col types.KafkaVersion destAddr := &col if err := awsRestjson1_deserializeDocumentKafkaVersion(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfNodeInfo(v *[]types.NodeInfo, 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.NodeInfo if *v == nil { cv = []types.NodeInfo{} } else { cv = *v } for _, value := range shape { var col types.NodeInfo destAddr := &col if err := awsRestjson1_deserializeDocumentNodeInfo(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfUnprocessedScramSecret(v *[]types.UnprocessedScramSecret, 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.UnprocessedScramSecret if *v == nil { cv = []types.UnprocessedScramSecret{} } else { cv = *v } for _, value := range shape { var col types.UnprocessedScramSecret destAddr := &col if err := awsRestjson1_deserializeDocumentUnprocessedScramSecret(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfVpcConfig(v *[]types.VpcConfig, 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.VpcConfig if *v == nil { cv = []types.VpcConfig{} } else { cv = *v } for _, value := range shape { var col types.VpcConfig destAddr := &col if err := awsRestjson1_deserializeDocumentVpcConfig(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfVpcConnection(v *[]types.VpcConnection, 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.VpcConnection if *v == nil { cv = []types.VpcConnection{} } else { cv = *v } for _, value := range shape { var col types.VpcConnection destAddr := &col if err := awsRestjson1_deserializeDocumentVpcConnection(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__mapOf__string(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 __string to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentBadRequestException(v **types.BadRequestException, 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.BadRequestException if *v == nil { sv = &types.BadRequestException{} } else { sv = *v } for key, value := range shape { switch key { case "invalidParameter": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.InvalidParameter = ptr.String(jtv) } 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_deserializeDocumentBrokerEBSVolumeInfo(v **types.BrokerEBSVolumeInfo, 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.BrokerEBSVolumeInfo if *v == nil { sv = &types.BrokerEBSVolumeInfo{} } else { sv = *v } for key, value := range shape { switch key { case "kafkaBrokerNodeId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.KafkaBrokerNodeId = ptr.String(jtv) } case "provisionedThroughput": if err := awsRestjson1_deserializeDocumentProvisionedThroughput(&sv.ProvisionedThroughput, value); err != nil { return err } case "volumeSizeGB": 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.VolumeSizeGB = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBrokerLogs(v **types.BrokerLogs, 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.BrokerLogs if *v == nil { sv = &types.BrokerLogs{} } else { sv = *v } for key, value := range shape { switch key { case "cloudWatchLogs": if err := awsRestjson1_deserializeDocumentCloudWatchLogs(&sv.CloudWatchLogs, value); err != nil { return err } case "firehose": if err := awsRestjson1_deserializeDocumentFirehose(&sv.Firehose, value); err != nil { return err } case "s3": if err := awsRestjson1_deserializeDocumentS3(&sv.S3, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBrokerNodeGroupInfo(v **types.BrokerNodeGroupInfo, 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.BrokerNodeGroupInfo if *v == nil { sv = &types.BrokerNodeGroupInfo{} } else { sv = *v } for key, value := range shape { switch key { case "brokerAZDistribution": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BrokerAZDistribution to be of type string, got %T instead", value) } sv.BrokerAZDistribution = types.BrokerAZDistribution(jtv) } case "clientSubnets": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.ClientSubnets, value); err != nil { return err } case "connectivityInfo": if err := awsRestjson1_deserializeDocumentConnectivityInfo(&sv.ConnectivityInfo, value); err != nil { return err } case "instanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __stringMin5Max32 to be of type string, got %T instead", value) } sv.InstanceType = ptr.String(jtv) } case "securityGroups": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.SecurityGroups, value); err != nil { return err } case "storageInfo": if err := awsRestjson1_deserializeDocumentStorageInfo(&sv.StorageInfo, value); err != nil { return err } case "zoneIds": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.ZoneIds, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBrokerNodeInfo(v **types.BrokerNodeInfo, 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.BrokerNodeInfo if *v == nil { sv = &types.BrokerNodeInfo{} } else { sv = *v } for key, value := range shape { switch key { case "attachedENIId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.AttachedENIId = ptr.String(jtv) } case "brokerId": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.BrokerId = f64 case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.BrokerId = f64 default: return fmt.Errorf("expected __double to be a JSON Number, got %T instead", value) } } case "clientSubnet": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClientSubnet = ptr.String(jtv) } case "clientVpcIpAddress": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClientVpcIpAddress = ptr.String(jtv) } case "currentBrokerSoftwareInfo": if err := awsRestjson1_deserializeDocumentBrokerSoftwareInfo(&sv.CurrentBrokerSoftwareInfo, value); err != nil { return err } case "endpoints": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.Endpoints, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBrokerSoftwareInfo(v **types.BrokerSoftwareInfo, 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.BrokerSoftwareInfo if *v == nil { sv = &types.BrokerSoftwareInfo{} } else { sv = *v } for key, value := range shape { switch key { case "configurationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ConfigurationArn = ptr.String(jtv) } case "configurationRevision": 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.ConfigurationRevision = i64 } case "kafkaVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.KafkaVersion = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentClientAuthentication(v **types.ClientAuthentication, 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.ClientAuthentication if *v == nil { sv = &types.ClientAuthentication{} } else { sv = *v } for key, value := range shape { switch key { case "sasl": if err := awsRestjson1_deserializeDocumentSasl(&sv.Sasl, value); err != nil { return err } case "tls": if err := awsRestjson1_deserializeDocumentTls(&sv.Tls, value); err != nil { return err } case "unauthenticated": if err := awsRestjson1_deserializeDocumentUnauthenticated(&sv.Unauthenticated, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentClientVpcConnection(v **types.ClientVpcConnection, 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.ClientVpcConnection if *v == nil { sv = &types.ClientVpcConnection{} } else { sv = *v } for key, value := range shape { switch key { case "authentication": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Authentication = ptr.String(jtv) } case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationTime = ptr.Time(t) } case "owner": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Owner = ptr.String(jtv) } case "state": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VpcConnectionState to be of type string, got %T instead", value) } sv.State = types.VpcConnectionState(jtv) } case "vpcConnectionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.VpcConnectionArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCloudWatchLogs(v **types.CloudWatchLogs, 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.CloudWatchLogs if *v == nil { sv = &types.CloudWatchLogs{} } else { sv = *v } for key, value := range shape { switch key { case "enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } case "logGroup": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.LogGroup = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCluster(v **types.Cluster, 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.Cluster if *v == nil { sv = &types.Cluster{} } else { sv = *v } for key, value := range shape { switch key { case "activeOperationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ActiveOperationArn = ptr.String(jtv) } case "clusterArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterArn = ptr.String(jtv) } case "clusterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterName = ptr.String(jtv) } case "clusterType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClusterType to be of type string, got %T instead", value) } sv.ClusterType = types.ClusterType(jtv) } case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationTime = ptr.Time(t) } case "currentVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.CurrentVersion = ptr.String(jtv) } case "provisioned": if err := awsRestjson1_deserializeDocumentProvisioned(&sv.Provisioned, value); err != nil { return err } case "serverless": if err := awsRestjson1_deserializeDocumentServerless(&sv.Serverless, value); err != nil { return err } case "state": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClusterState to be of type string, got %T instead", value) } sv.State = types.ClusterState(jtv) } case "stateInfo": if err := awsRestjson1_deserializeDocumentStateInfo(&sv.StateInfo, value); err != nil { return err } case "tags": if err := awsRestjson1_deserializeDocument__mapOf__string(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentClusterInfo(v **types.ClusterInfo, 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.ClusterInfo if *v == nil { sv = &types.ClusterInfo{} } else { sv = *v } for key, value := range shape { switch key { case "activeOperationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ActiveOperationArn = ptr.String(jtv) } case "brokerNodeGroupInfo": if err := awsRestjson1_deserializeDocumentBrokerNodeGroupInfo(&sv.BrokerNodeGroupInfo, value); err != nil { return err } case "clientAuthentication": if err := awsRestjson1_deserializeDocumentClientAuthentication(&sv.ClientAuthentication, value); err != nil { return err } case "clusterArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterArn = ptr.String(jtv) } case "clusterName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterName = ptr.String(jtv) } case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationTime = ptr.Time(t) } case "currentBrokerSoftwareInfo": if err := awsRestjson1_deserializeDocumentBrokerSoftwareInfo(&sv.CurrentBrokerSoftwareInfo, value); err != nil { return err } case "currentVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.CurrentVersion = ptr.String(jtv) } case "encryptionInfo": if err := awsRestjson1_deserializeDocumentEncryptionInfo(&sv.EncryptionInfo, value); err != nil { return err } case "enhancedMonitoring": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EnhancedMonitoring to be of type string, got %T instead", value) } sv.EnhancedMonitoring = types.EnhancedMonitoring(jtv) } case "loggingInfo": if err := awsRestjson1_deserializeDocumentLoggingInfo(&sv.LoggingInfo, value); err != nil { return err } case "numberOfBrokerNodes": 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.NumberOfBrokerNodes = int32(i64) } case "openMonitoring": if err := awsRestjson1_deserializeDocumentOpenMonitoring(&sv.OpenMonitoring, value); err != nil { return err } case "state": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClusterState to be of type string, got %T instead", value) } sv.State = types.ClusterState(jtv) } case "stateInfo": if err := awsRestjson1_deserializeDocumentStateInfo(&sv.StateInfo, value); err != nil { return err } case "storageMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected StorageMode to be of type string, got %T instead", value) } sv.StorageMode = types.StorageMode(jtv) } case "tags": if err := awsRestjson1_deserializeDocument__mapOf__string(&sv.Tags, value); err != nil { return err } case "zookeeperConnectString": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ZookeeperConnectString = ptr.String(jtv) } case "zookeeperConnectStringTls": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ZookeeperConnectStringTls = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentClusterOperationInfo(v **types.ClusterOperationInfo, 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.ClusterOperationInfo if *v == nil { sv = &types.ClusterOperationInfo{} } else { sv = *v } for key, value := range shape { switch key { case "clientRequestId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClientRequestId = ptr.String(jtv) } case "clusterArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClusterArn = ptr.String(jtv) } case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationTime = ptr.Time(t) } case "endTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.EndTime = ptr.Time(t) } case "errorInfo": if err := awsRestjson1_deserializeDocumentErrorInfo(&sv.ErrorInfo, value); err != nil { return err } case "operationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.OperationArn = ptr.String(jtv) } case "operationState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.OperationState = ptr.String(jtv) } case "operationSteps": if err := awsRestjson1_deserializeDocument__listOfClusterOperationStep(&sv.OperationSteps, value); err != nil { return err } case "operationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.OperationType = ptr.String(jtv) } case "sourceClusterInfo": if err := awsRestjson1_deserializeDocumentMutableClusterInfo(&sv.SourceClusterInfo, value); err != nil { return err } case "targetClusterInfo": if err := awsRestjson1_deserializeDocumentMutableClusterInfo(&sv.TargetClusterInfo, value); err != nil { return err } case "vpcConnectionInfo": if err := awsRestjson1_deserializeDocumentVpcConnectionInfo(&sv.VpcConnectionInfo, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentClusterOperationStep(v **types.ClusterOperationStep, 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.ClusterOperationStep if *v == nil { sv = &types.ClusterOperationStep{} } else { sv = *v } for key, value := range shape { switch key { case "stepInfo": if err := awsRestjson1_deserializeDocumentClusterOperationStepInfo(&sv.StepInfo, value); err != nil { return err } case "stepName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.StepName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentClusterOperationStepInfo(v **types.ClusterOperationStepInfo, 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.ClusterOperationStepInfo if *v == nil { sv = &types.ClusterOperationStepInfo{} } else { sv = *v } for key, value := range shape { switch key { case "stepStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.StepStatus = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCompatibleKafkaVersion(v **types.CompatibleKafkaVersion, 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.CompatibleKafkaVersion if *v == nil { sv = &types.CompatibleKafkaVersion{} } else { sv = *v } for key, value := range shape { switch key { case "sourceVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.SourceVersion = ptr.String(jtv) } case "targetVersions": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.TargetVersions, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConfiguration(v **types.Configuration, 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.Configuration if *v == nil { sv = &types.Configuration{} } 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 __string to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationTime = ptr.Time(t) } 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 "kafkaVersions": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.KafkaVersions, value); err != nil { return err } case "latestRevision": if err := awsRestjson1_deserializeDocumentConfigurationRevision(&sv.LatestRevision, value); err != nil { return err } 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 "state": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConfigurationState to be of type string, got %T instead", value) } sv.State = types.ConfigurationState(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConfigurationInfo(v **types.ConfigurationInfo, 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.ConfigurationInfo if *v == nil { sv = &types.ConfigurationInfo{} } 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 __string to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "revision": 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.Revision = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConfigurationRevision(v **types.ConfigurationRevision, 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.ConfigurationRevision if *v == nil { sv = &types.ConfigurationRevision{} } else { sv = *v } for key, value := range shape { switch key { case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationTime = ptr.Time(t) } 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 "revision": 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.Revision = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, 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.ConflictException if *v == nil { sv = &types.ConflictException{} } else { sv = *v } for key, value := range shape { switch key { case "invalidParameter": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.InvalidParameter = ptr.String(jtv) } 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_deserializeDocumentConnectivityInfo(v **types.ConnectivityInfo, 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.ConnectivityInfo if *v == nil { sv = &types.ConnectivityInfo{} } else { sv = *v } for key, value := range shape { switch key { case "publicAccess": if err := awsRestjson1_deserializeDocumentPublicAccess(&sv.PublicAccess, value); err != nil { return err } case "vpcConnectivity": if err := awsRestjson1_deserializeDocumentVpcConnectivity(&sv.VpcConnectivity, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEBSStorageInfo(v **types.EBSStorageInfo, 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.EBSStorageInfo if *v == nil { sv = &types.EBSStorageInfo{} } else { sv = *v } for key, value := range shape { switch key { case "provisionedThroughput": if err := awsRestjson1_deserializeDocumentProvisionedThroughput(&sv.ProvisionedThroughput, value); err != nil { return err } case "volumeSize": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected __integerMin1Max16384 to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.VolumeSize = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEncryptionAtRest(v **types.EncryptionAtRest, 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.EncryptionAtRest if *v == nil { sv = &types.EncryptionAtRest{} } else { sv = *v } for key, value := range shape { switch key { case "dataVolumeKMSKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.DataVolumeKMSKeyId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEncryptionInfo(v **types.EncryptionInfo, 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.EncryptionInfo if *v == nil { sv = &types.EncryptionInfo{} } else { sv = *v } for key, value := range shape { switch key { case "encryptionAtRest": if err := awsRestjson1_deserializeDocumentEncryptionAtRest(&sv.EncryptionAtRest, value); err != nil { return err } case "encryptionInTransit": if err := awsRestjson1_deserializeDocumentEncryptionInTransit(&sv.EncryptionInTransit, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentEncryptionInTransit(v **types.EncryptionInTransit, 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.EncryptionInTransit if *v == nil { sv = &types.EncryptionInTransit{} } else { sv = *v } for key, value := range shape { switch key { case "clientBroker": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClientBroker to be of type string, got %T instead", value) } sv.ClientBroker = types.ClientBroker(jtv) } case "inCluster": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.InCluster = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentErrorInfo(v **types.ErrorInfo, 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.ErrorInfo if *v == nil { sv = &types.ErrorInfo{} } 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 __string to be of type string, got %T instead", value) } sv.ErrorCode = ptr.String(jtv) } case "errorString": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ErrorString = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFirehose(v **types.Firehose, 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.Firehose if *v == nil { sv = &types.Firehose{} } else { sv = *v } for key, value := range shape { switch key { case "deliveryStream": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.DeliveryStream = ptr.String(jtv) } case "enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentForbiddenException(v **types.ForbiddenException, 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.ForbiddenException if *v == nil { sv = &types.ForbiddenException{} } else { sv = *v } for key, value := range shape { switch key { case "invalidParameter": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.InvalidParameter = ptr.String(jtv) } 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_deserializeDocumentIam(v **types.Iam, 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.Iam if *v == nil { sv = &types.Iam{} } else { sv = *v } for key, value := range shape { switch key { case "enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentInternalServerErrorException(v **types.InternalServerErrorException, 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.InternalServerErrorException if *v == nil { sv = &types.InternalServerErrorException{} } else { sv = *v } for key, value := range shape { switch key { case "invalidParameter": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.InvalidParameter = ptr.String(jtv) } 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_deserializeDocumentJmxExporter(v **types.JmxExporter, 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.JmxExporter if *v == nil { sv = &types.JmxExporter{} } else { sv = *v } for key, value := range shape { switch key { case "enabledInBroker": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.EnabledInBroker = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentJmxExporterInfo(v **types.JmxExporterInfo, 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.JmxExporterInfo if *v == nil { sv = &types.JmxExporterInfo{} } else { sv = *v } for key, value := range shape { switch key { case "enabledInBroker": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.EnabledInBroker = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentKafkaVersion(v **types.KafkaVersion, 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.KafkaVersion if *v == nil { sv = &types.KafkaVersion{} } else { sv = *v } for key, value := range shape { switch key { case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected KafkaVersionStatus to be of type string, got %T instead", value) } sv.Status = types.KafkaVersionStatus(jtv) } case "version": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Version = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLoggingInfo(v **types.LoggingInfo, 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.LoggingInfo if *v == nil { sv = &types.LoggingInfo{} } else { sv = *v } for key, value := range shape { switch key { case "brokerLogs": if err := awsRestjson1_deserializeDocumentBrokerLogs(&sv.BrokerLogs, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentMutableClusterInfo(v **types.MutableClusterInfo, 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.MutableClusterInfo if *v == nil { sv = &types.MutableClusterInfo{} } else { sv = *v } for key, value := range shape { switch key { case "brokerEBSVolumeInfo": if err := awsRestjson1_deserializeDocument__listOfBrokerEBSVolumeInfo(&sv.BrokerEBSVolumeInfo, value); err != nil { return err } case "clientAuthentication": if err := awsRestjson1_deserializeDocumentClientAuthentication(&sv.ClientAuthentication, value); err != nil { return err } case "configurationInfo": if err := awsRestjson1_deserializeDocumentConfigurationInfo(&sv.ConfigurationInfo, value); err != nil { return err } case "connectivityInfo": if err := awsRestjson1_deserializeDocumentConnectivityInfo(&sv.ConnectivityInfo, value); err != nil { return err } case "encryptionInfo": if err := awsRestjson1_deserializeDocumentEncryptionInfo(&sv.EncryptionInfo, value); err != nil { return err } case "enhancedMonitoring": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EnhancedMonitoring to be of type string, got %T instead", value) } sv.EnhancedMonitoring = types.EnhancedMonitoring(jtv) } case "instanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __stringMin5Max32 to be of type string, got %T instead", value) } sv.InstanceType = ptr.String(jtv) } case "kafkaVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.KafkaVersion = ptr.String(jtv) } case "loggingInfo": if err := awsRestjson1_deserializeDocumentLoggingInfo(&sv.LoggingInfo, value); err != nil { return err } case "numberOfBrokerNodes": 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.NumberOfBrokerNodes = int32(i64) } case "openMonitoring": if err := awsRestjson1_deserializeDocumentOpenMonitoring(&sv.OpenMonitoring, value); err != nil { return err } case "storageMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected StorageMode to be of type string, got %T instead", value) } sv.StorageMode = types.StorageMode(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNodeExporter(v **types.NodeExporter, 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.NodeExporter if *v == nil { sv = &types.NodeExporter{} } else { sv = *v } for key, value := range shape { switch key { case "enabledInBroker": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.EnabledInBroker = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNodeExporterInfo(v **types.NodeExporterInfo, 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.NodeExporterInfo if *v == nil { sv = &types.NodeExporterInfo{} } else { sv = *v } for key, value := range shape { switch key { case "enabledInBroker": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.EnabledInBroker = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNodeInfo(v **types.NodeInfo, 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.NodeInfo if *v == nil { sv = &types.NodeInfo{} } else { sv = *v } for key, value := range shape { switch key { case "addedToClusterTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.AddedToClusterTime = ptr.String(jtv) } case "brokerNodeInfo": if err := awsRestjson1_deserializeDocumentBrokerNodeInfo(&sv.BrokerNodeInfo, value); err != nil { return err } case "instanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.InstanceType = ptr.String(jtv) } case "nodeARN": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.NodeARN = ptr.String(jtv) } case "nodeType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NodeType to be of type string, got %T instead", value) } sv.NodeType = types.NodeType(jtv) } case "zookeeperNodeInfo": if err := awsRestjson1_deserializeDocumentZookeeperNodeInfo(&sv.ZookeeperNodeInfo, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNotFoundException(v **types.NotFoundException, 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.NotFoundException if *v == nil { sv = &types.NotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "invalidParameter": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.InvalidParameter = ptr.String(jtv) } 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_deserializeDocumentOpenMonitoring(v **types.OpenMonitoring, 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.OpenMonitoring if *v == nil { sv = &types.OpenMonitoring{} } else { sv = *v } for key, value := range shape { switch key { case "prometheus": if err := awsRestjson1_deserializeDocumentPrometheus(&sv.Prometheus, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentOpenMonitoringInfo(v **types.OpenMonitoringInfo, 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.OpenMonitoringInfo if *v == nil { sv = &types.OpenMonitoringInfo{} } else { sv = *v } for key, value := range shape { switch key { case "prometheus": if err := awsRestjson1_deserializeDocumentPrometheusInfo(&sv.Prometheus, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPrometheus(v **types.Prometheus, 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.Prometheus if *v == nil { sv = &types.Prometheus{} } else { sv = *v } for key, value := range shape { switch key { case "jmxExporter": if err := awsRestjson1_deserializeDocumentJmxExporter(&sv.JmxExporter, value); err != nil { return err } case "nodeExporter": if err := awsRestjson1_deserializeDocumentNodeExporter(&sv.NodeExporter, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPrometheusInfo(v **types.PrometheusInfo, 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.PrometheusInfo if *v == nil { sv = &types.PrometheusInfo{} } else { sv = *v } for key, value := range shape { switch key { case "jmxExporter": if err := awsRestjson1_deserializeDocumentJmxExporterInfo(&sv.JmxExporter, value); err != nil { return err } case "nodeExporter": if err := awsRestjson1_deserializeDocumentNodeExporterInfo(&sv.NodeExporter, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentProvisioned(v **types.Provisioned, 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.Provisioned if *v == nil { sv = &types.Provisioned{} } else { sv = *v } for key, value := range shape { switch key { case "brokerNodeGroupInfo": if err := awsRestjson1_deserializeDocumentBrokerNodeGroupInfo(&sv.BrokerNodeGroupInfo, value); err != nil { return err } case "clientAuthentication": if err := awsRestjson1_deserializeDocumentClientAuthentication(&sv.ClientAuthentication, value); err != nil { return err } case "currentBrokerSoftwareInfo": if err := awsRestjson1_deserializeDocumentBrokerSoftwareInfo(&sv.CurrentBrokerSoftwareInfo, value); err != nil { return err } case "encryptionInfo": if err := awsRestjson1_deserializeDocumentEncryptionInfo(&sv.EncryptionInfo, value); err != nil { return err } case "enhancedMonitoring": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EnhancedMonitoring to be of type string, got %T instead", value) } sv.EnhancedMonitoring = types.EnhancedMonitoring(jtv) } case "loggingInfo": if err := awsRestjson1_deserializeDocumentLoggingInfo(&sv.LoggingInfo, value); err != nil { return err } case "numberOfBrokerNodes": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected __integerMin1Max15 to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.NumberOfBrokerNodes = int32(i64) } case "openMonitoring": if err := awsRestjson1_deserializeDocumentOpenMonitoringInfo(&sv.OpenMonitoring, value); err != nil { return err } case "storageMode": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected StorageMode to be of type string, got %T instead", value) } sv.StorageMode = types.StorageMode(jtv) } case "zookeeperConnectString": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ZookeeperConnectString = ptr.String(jtv) } case "zookeeperConnectStringTls": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ZookeeperConnectStringTls = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentProvisionedThroughput(v **types.ProvisionedThroughput, 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.ProvisionedThroughput if *v == nil { sv = &types.ProvisionedThroughput{} } else { sv = *v } for key, value := range shape { switch key { case "enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } case "volumeThroughput": 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.VolumeThroughput = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentPublicAccess(v **types.PublicAccess, 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.PublicAccess if *v == nil { sv = &types.PublicAccess{} } else { sv = *v } for key, value := range shape { switch key { case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Type = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentS3(v **types.S3, 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.S3 if *v == nil { sv = &types.S3{} } else { sv = *v } for key, value := range shape { switch key { case "bucket": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Bucket = ptr.String(jtv) } case "enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } case "prefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Prefix = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSasl(v **types.Sasl, 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.Sasl if *v == nil { sv = &types.Sasl{} } else { sv = *v } for key, value := range shape { switch key { case "iam": if err := awsRestjson1_deserializeDocumentIam(&sv.Iam, value); err != nil { return err } case "scram": if err := awsRestjson1_deserializeDocumentScram(&sv.Scram, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentScram(v **types.Scram, 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.Scram if *v == nil { sv = &types.Scram{} } else { sv = *v } for key, value := range shape { switch key { case "enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentServerless(v **types.Serverless, 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.Serverless if *v == nil { sv = &types.Serverless{} } else { sv = *v } for key, value := range shape { switch key { case "clientAuthentication": if err := awsRestjson1_deserializeDocumentServerlessClientAuthentication(&sv.ClientAuthentication, value); err != nil { return err } case "vpcConfigs": if err := awsRestjson1_deserializeDocument__listOfVpcConfig(&sv.VpcConfigs, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentServerlessClientAuthentication(v **types.ServerlessClientAuthentication, 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.ServerlessClientAuthentication if *v == nil { sv = &types.ServerlessClientAuthentication{} } else { sv = *v } for key, value := range shape { switch key { case "sasl": if err := awsRestjson1_deserializeDocumentServerlessSasl(&sv.Sasl, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentServerlessSasl(v **types.ServerlessSasl, 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.ServerlessSasl if *v == nil { sv = &types.ServerlessSasl{} } else { sv = *v } for key, value := range shape { switch key { case "iam": if err := awsRestjson1_deserializeDocumentIam(&sv.Iam, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentServiceUnavailableException(v **types.ServiceUnavailableException, 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.ServiceUnavailableException if *v == nil { sv = &types.ServiceUnavailableException{} } else { sv = *v } for key, value := range shape { switch key { case "invalidParameter": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.InvalidParameter = ptr.String(jtv) } 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_deserializeDocumentStateInfo(v **types.StateInfo, 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.StateInfo if *v == nil { sv = &types.StateInfo{} } else { sv = *v } for key, value := range shape { switch key { case "code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Code = ptr.String(jtv) } 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_deserializeDocumentStorageInfo(v **types.StorageInfo, 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.StorageInfo if *v == nil { sv = &types.StorageInfo{} } else { sv = *v } for key, value := range shape { switch key { case "ebsStorageInfo": if err := awsRestjson1_deserializeDocumentEBSStorageInfo(&sv.EbsStorageInfo, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTls(v **types.Tls, 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.Tls if *v == nil { sv = &types.Tls{} } else { sv = *v } for key, value := range shape { switch key { case "certificateAuthorityArnList": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.CertificateAuthorityArnList, value); err != nil { return err } case "enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTooManyRequestsException(v **types.TooManyRequestsException, 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.TooManyRequestsException if *v == nil { sv = &types.TooManyRequestsException{} } else { sv = *v } for key, value := range shape { switch key { case "invalidParameter": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.InvalidParameter = ptr.String(jtv) } 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_deserializeDocumentUnauthenticated(v **types.Unauthenticated, 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.Unauthenticated if *v == nil { sv = &types.Unauthenticated{} } else { sv = *v } for key, value := range shape { switch key { case "enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentUnauthorizedException(v **types.UnauthorizedException, 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.UnauthorizedException if *v == nil { sv = &types.UnauthorizedException{} } else { sv = *v } for key, value := range shape { switch key { case "invalidParameter": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.InvalidParameter = ptr.String(jtv) } 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_deserializeDocumentUnprocessedScramSecret(v **types.UnprocessedScramSecret, 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.UnprocessedScramSecret if *v == nil { sv = &types.UnprocessedScramSecret{} } 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 __string 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 __string to be of type string, got %T instead", value) } sv.ErrorMessage = ptr.String(jtv) } case "secretArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.SecretArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentUserIdentity(v **types.UserIdentity, 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.UserIdentity if *v == nil { sv = &types.UserIdentity{} } else { sv = *v } for key, value := range shape { switch key { case "principalId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.PrincipalId = ptr.String(jtv) } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UserIdentityType to be of type string, got %T instead", value) } sv.Type = types.UserIdentityType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVpcConfig(v **types.VpcConfig, 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.VpcConfig if *v == nil { sv = &types.VpcConfig{} } else { sv = *v } for key, value := range shape { switch key { case "securityGroupIds": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.SecurityGroupIds, value); err != nil { return err } case "subnetIds": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.SubnetIds, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVpcConnection(v **types.VpcConnection, 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.VpcConnection if *v == nil { sv = &types.VpcConnection{} } else { sv = *v } for key, value := range shape { switch key { case "authentication": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Authentication = ptr.String(jtv) } case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationTime = ptr.Time(t) } case "state": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VpcConnectionState to be of type string, got %T instead", value) } sv.State = types.VpcConnectionState(jtv) } case "targetClusterArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.TargetClusterArn = ptr.String(jtv) } case "vpcConnectionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.VpcConnectionArn = ptr.String(jtv) } case "vpcId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.VpcId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVpcConnectionInfo(v **types.VpcConnectionInfo, 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.VpcConnectionInfo if *v == nil { sv = &types.VpcConnectionInfo{} } else { sv = *v } for key, value := range shape { switch key { case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationTime = ptr.Time(t) } case "owner": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Owner = ptr.String(jtv) } case "userIdentity": if err := awsRestjson1_deserializeDocumentUserIdentity(&sv.UserIdentity, value); err != nil { return err } case "vpcConnectionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.VpcConnectionArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVpcConnectivity(v **types.VpcConnectivity, 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.VpcConnectivity if *v == nil { sv = &types.VpcConnectivity{} } else { sv = *v } for key, value := range shape { switch key { case "clientAuthentication": if err := awsRestjson1_deserializeDocumentVpcConnectivityClientAuthentication(&sv.ClientAuthentication, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVpcConnectivityClientAuthentication(v **types.VpcConnectivityClientAuthentication, 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.VpcConnectivityClientAuthentication if *v == nil { sv = &types.VpcConnectivityClientAuthentication{} } else { sv = *v } for key, value := range shape { switch key { case "sasl": if err := awsRestjson1_deserializeDocumentVpcConnectivitySasl(&sv.Sasl, value); err != nil { return err } case "tls": if err := awsRestjson1_deserializeDocumentVpcConnectivityTls(&sv.Tls, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVpcConnectivityIam(v **types.VpcConnectivityIam, 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.VpcConnectivityIam if *v == nil { sv = &types.VpcConnectivityIam{} } else { sv = *v } for key, value := range shape { switch key { case "enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVpcConnectivitySasl(v **types.VpcConnectivitySasl, 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.VpcConnectivitySasl if *v == nil { sv = &types.VpcConnectivitySasl{} } else { sv = *v } for key, value := range shape { switch key { case "iam": if err := awsRestjson1_deserializeDocumentVpcConnectivityIam(&sv.Iam, value); err != nil { return err } case "scram": if err := awsRestjson1_deserializeDocumentVpcConnectivityScram(&sv.Scram, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVpcConnectivityScram(v **types.VpcConnectivityScram, 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.VpcConnectivityScram if *v == nil { sv = &types.VpcConnectivityScram{} } else { sv = *v } for key, value := range shape { switch key { case "enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentVpcConnectivityTls(v **types.VpcConnectivityTls, 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.VpcConnectivityTls if *v == nil { sv = &types.VpcConnectivityTls{} } else { sv = *v } for key, value := range shape { switch key { case "enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentZookeeperNodeInfo(v **types.ZookeeperNodeInfo, 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.ZookeeperNodeInfo if *v == nil { sv = &types.ZookeeperNodeInfo{} } else { sv = *v } for key, value := range shape { switch key { case "attachedENIId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.AttachedENIId = ptr.String(jtv) } case "clientVpcIpAddress": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ClientVpcIpAddress = ptr.String(jtv) } case "endpoints": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.Endpoints, value); err != nil { return err } case "zookeeperId": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.ZookeeperId = f64 case string: var f64 float64 switch { case strings.EqualFold(jtv, "NaN"): f64 = math.NaN() case strings.EqualFold(jtv, "Infinity"): f64 = math.Inf(1) case strings.EqualFold(jtv, "-Infinity"): f64 = math.Inf(-1) default: return fmt.Errorf("unknown JSON number value: %s", jtv) } sv.ZookeeperId = f64 default: return fmt.Errorf("expected __double to be a JSON Number, got %T instead", value) } } case "zookeeperVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ZookeeperVersion = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil }
12,411
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package kafka provides the API client, operations, and parameter types for // Managed Streaming for Kafka. // // The operations for managing an Amazon MSK cluster. package kafka
8
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka 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/kafka/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 = "kafka" } 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 kafka // goModuleVersion is the tagged release for this module const goModuleVersion = "1.20.5"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/kafka/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" smithyhttp "github.com/aws/smithy-go/transport/http" ) type awsRestjson1_serializeOpBatchAssociateScramSecret struct { } func (*awsRestjson1_serializeOpBatchAssociateScramSecret) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpBatchAssociateScramSecret) 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.(*BatchAssociateScramSecretInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/clusters/{ClusterArn}/scram-secrets") 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_serializeOpHttpBindingsBatchAssociateScramSecretInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentBatchAssociateScramSecretInput(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_serializeOpHttpBindingsBatchAssociateScramSecretInput(v *BatchAssociateScramSecretInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterArn == nil || len(*v.ClusterArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ClusterArn must not be empty")} } if v.ClusterArn != nil { if err := encoder.SetURI("ClusterArn").String(*v.ClusterArn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentBatchAssociateScramSecretInput(v *BatchAssociateScramSecretInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SecretArnList != nil { ok := object.Key("secretArnList") if err := awsRestjson1_serializeDocument__listOf__string(v.SecretArnList, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpBatchDisassociateScramSecret struct { } func (*awsRestjson1_serializeOpBatchDisassociateScramSecret) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpBatchDisassociateScramSecret) 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.(*BatchDisassociateScramSecretInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/clusters/{ClusterArn}/scram-secrets") 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_serializeOpHttpBindingsBatchDisassociateScramSecretInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentBatchDisassociateScramSecretInput(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_serializeOpHttpBindingsBatchDisassociateScramSecretInput(v *BatchDisassociateScramSecretInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterArn == nil || len(*v.ClusterArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ClusterArn must not be empty")} } if v.ClusterArn != nil { if err := encoder.SetURI("ClusterArn").String(*v.ClusterArn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentBatchDisassociateScramSecretInput(v *BatchDisassociateScramSecretInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SecretArnList != nil { ok := object.Key("secretArnList") if err := awsRestjson1_serializeDocument__listOf__string(v.SecretArnList, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateCluster struct { } func (*awsRestjson1_serializeOpCreateCluster) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateCluster) 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.(*CreateClusterInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/clusters") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateClusterInput(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_serializeOpHttpBindingsCreateClusterInput(v *CreateClusterInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateClusterInput(v *CreateClusterInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.BrokerNodeGroupInfo != nil { ok := object.Key("brokerNodeGroupInfo") if err := awsRestjson1_serializeDocumentBrokerNodeGroupInfo(v.BrokerNodeGroupInfo, ok); err != nil { return err } } if v.ClientAuthentication != nil { ok := object.Key("clientAuthentication") if err := awsRestjson1_serializeDocumentClientAuthentication(v.ClientAuthentication, ok); err != nil { return err } } if v.ClusterName != nil { ok := object.Key("clusterName") ok.String(*v.ClusterName) } if v.ConfigurationInfo != nil { ok := object.Key("configurationInfo") if err := awsRestjson1_serializeDocumentConfigurationInfo(v.ConfigurationInfo, ok); err != nil { return err } } if v.EncryptionInfo != nil { ok := object.Key("encryptionInfo") if err := awsRestjson1_serializeDocumentEncryptionInfo(v.EncryptionInfo, ok); err != nil { return err } } if len(v.EnhancedMonitoring) > 0 { ok := object.Key("enhancedMonitoring") ok.String(string(v.EnhancedMonitoring)) } if v.KafkaVersion != nil { ok := object.Key("kafkaVersion") ok.String(*v.KafkaVersion) } if v.LoggingInfo != nil { ok := object.Key("loggingInfo") if err := awsRestjson1_serializeDocumentLoggingInfo(v.LoggingInfo, ok); err != nil { return err } } { ok := object.Key("numberOfBrokerNodes") ok.Integer(v.NumberOfBrokerNodes) } if v.OpenMonitoring != nil { ok := object.Key("openMonitoring") if err := awsRestjson1_serializeDocumentOpenMonitoringInfo(v.OpenMonitoring, ok); err != nil { return err } } if len(v.StorageMode) > 0 { ok := object.Key("storageMode") ok.String(string(v.StorageMode)) } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocument__mapOf__string(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateClusterV2 struct { } func (*awsRestjson1_serializeOpCreateClusterV2) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateClusterV2) 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.(*CreateClusterV2Input) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/api/v2/clusters") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateClusterV2Input(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_serializeOpHttpBindingsCreateClusterV2Input(v *CreateClusterV2Input, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateClusterV2Input(v *CreateClusterV2Input, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClusterName != nil { ok := object.Key("clusterName") ok.String(*v.ClusterName) } if v.Provisioned != nil { ok := object.Key("provisioned") if err := awsRestjson1_serializeDocumentProvisionedRequest(v.Provisioned, ok); err != nil { return err } } if v.Serverless != nil { ok := object.Key("serverless") if err := awsRestjson1_serializeDocumentServerlessRequest(v.Serverless, ok); err != nil { return err } } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocument__mapOf__string(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateConfiguration struct { } func (*awsRestjson1_serializeOpCreateConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateConfiguration) 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.(*CreateConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/configurations") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateConfigurationInput(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_serializeOpHttpBindingsCreateConfigurationInput(v *CreateConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateConfigurationInput(v *CreateConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.KafkaVersions != nil { ok := object.Key("kafkaVersions") if err := awsRestjson1_serializeDocument__listOf__string(v.KafkaVersions, ok); err != nil { return err } } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.ServerProperties != nil { ok := object.Key("serverProperties") ok.Base64EncodeBytes(v.ServerProperties) } return nil } type awsRestjson1_serializeOpCreateVpcConnection struct { } func (*awsRestjson1_serializeOpCreateVpcConnection) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateVpcConnection) 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.(*CreateVpcConnectionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/vpc-connection") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateVpcConnectionInput(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_serializeOpHttpBindingsCreateVpcConnectionInput(v *CreateVpcConnectionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateVpcConnectionInput(v *CreateVpcConnectionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Authentication != nil { ok := object.Key("authentication") ok.String(*v.Authentication) } if v.ClientSubnets != nil { ok := object.Key("clientSubnets") if err := awsRestjson1_serializeDocument__listOf__string(v.ClientSubnets, ok); err != nil { return err } } if v.SecurityGroups != nil { ok := object.Key("securityGroups") if err := awsRestjson1_serializeDocument__listOf__string(v.SecurityGroups, ok); err != nil { return err } } if v.Tags != nil { ok := object.Key("tags") if err := awsRestjson1_serializeDocument__mapOf__string(v.Tags, ok); err != nil { return err } } if v.TargetClusterArn != nil { ok := object.Key("targetClusterArn") ok.String(*v.TargetClusterArn) } if v.VpcId != nil { ok := object.Key("vpcId") ok.String(*v.VpcId) } return nil } type awsRestjson1_serializeOpDeleteCluster struct { } func (*awsRestjson1_serializeOpDeleteCluster) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteCluster) 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.(*DeleteClusterInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/clusters/{ClusterArn}") 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_serializeOpHttpBindingsDeleteClusterInput(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_serializeOpHttpBindingsDeleteClusterInput(v *DeleteClusterInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterArn == nil || len(*v.ClusterArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ClusterArn must not be empty")} } if v.ClusterArn != nil { if err := encoder.SetURI("ClusterArn").String(*v.ClusterArn); err != nil { return err } } if v.CurrentVersion != nil { encoder.SetQuery("currentVersion").String(*v.CurrentVersion) } return nil } type awsRestjson1_serializeOpDeleteClusterPolicy struct { } func (*awsRestjson1_serializeOpDeleteClusterPolicy) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteClusterPolicy) 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.(*DeleteClusterPolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/clusters/{ClusterArn}/policy") 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_serializeOpHttpBindingsDeleteClusterPolicyInput(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_serializeOpHttpBindingsDeleteClusterPolicyInput(v *DeleteClusterPolicyInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterArn == nil || len(*v.ClusterArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ClusterArn must not be empty")} } if v.ClusterArn != nil { if err := encoder.SetURI("ClusterArn").String(*v.ClusterArn); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteConfiguration struct { } func (*awsRestjson1_serializeOpDeleteConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteConfiguration) 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.(*DeleteConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/configurations/{Arn}") 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_serializeOpHttpBindingsDeleteConfigurationInput(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_serializeOpHttpBindingsDeleteConfigurationInput(v *DeleteConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Arn == nil || len(*v.Arn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Arn must not be empty")} } if v.Arn != nil { if err := encoder.SetURI("Arn").String(*v.Arn); err != nil { return err } } return nil } type awsRestjson1_serializeOpDeleteVpcConnection struct { } func (*awsRestjson1_serializeOpDeleteVpcConnection) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteVpcConnection) 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.(*DeleteVpcConnectionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/vpc-connection/{Arn}") 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_serializeOpHttpBindingsDeleteVpcConnectionInput(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_serializeOpHttpBindingsDeleteVpcConnectionInput(v *DeleteVpcConnectionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Arn == nil || len(*v.Arn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Arn must not be empty")} } if v.Arn != nil { if err := encoder.SetURI("Arn").String(*v.Arn); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeCluster struct { } func (*awsRestjson1_serializeOpDescribeCluster) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeCluster) 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.(*DescribeClusterInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/clusters/{ClusterArn}") 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_serializeOpHttpBindingsDescribeClusterInput(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_serializeOpHttpBindingsDescribeClusterInput(v *DescribeClusterInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterArn == nil || len(*v.ClusterArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ClusterArn must not be empty")} } if v.ClusterArn != nil { if err := encoder.SetURI("ClusterArn").String(*v.ClusterArn); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeClusterOperation struct { } func (*awsRestjson1_serializeOpDescribeClusterOperation) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeClusterOperation) 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.(*DescribeClusterOperationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/operations/{ClusterOperationArn}") 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_serializeOpHttpBindingsDescribeClusterOperationInput(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_serializeOpHttpBindingsDescribeClusterOperationInput(v *DescribeClusterOperationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterOperationArn == nil || len(*v.ClusterOperationArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ClusterOperationArn must not be empty")} } if v.ClusterOperationArn != nil { if err := encoder.SetURI("ClusterOperationArn").String(*v.ClusterOperationArn); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeClusterV2 struct { } func (*awsRestjson1_serializeOpDescribeClusterV2) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeClusterV2) 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.(*DescribeClusterV2Input) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/api/v2/clusters/{ClusterArn}") 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_serializeOpHttpBindingsDescribeClusterV2Input(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_serializeOpHttpBindingsDescribeClusterV2Input(v *DescribeClusterV2Input, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterArn == nil || len(*v.ClusterArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ClusterArn must not be empty")} } if v.ClusterArn != nil { if err := encoder.SetURI("ClusterArn").String(*v.ClusterArn); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeConfiguration struct { } func (*awsRestjson1_serializeOpDescribeConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeConfiguration) 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.(*DescribeConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/configurations/{Arn}") 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_serializeOpHttpBindingsDescribeConfigurationInput(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_serializeOpHttpBindingsDescribeConfigurationInput(v *DescribeConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Arn == nil || len(*v.Arn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Arn must not be empty")} } if v.Arn != nil { if err := encoder.SetURI("Arn").String(*v.Arn); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeConfigurationRevision struct { } func (*awsRestjson1_serializeOpDescribeConfigurationRevision) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeConfigurationRevision) 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.(*DescribeConfigurationRevisionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/configurations/{Arn}/revisions/{Revision}") 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_serializeOpHttpBindingsDescribeConfigurationRevisionInput(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_serializeOpHttpBindingsDescribeConfigurationRevisionInput(v *DescribeConfigurationRevisionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Arn == nil || len(*v.Arn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Arn must not be empty")} } if v.Arn != nil { if err := encoder.SetURI("Arn").String(*v.Arn); err != nil { return err } } { if err := encoder.SetURI("Revision").Long(v.Revision); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeVpcConnection struct { } func (*awsRestjson1_serializeOpDescribeVpcConnection) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeVpcConnection) 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.(*DescribeVpcConnectionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/vpc-connection/{Arn}") 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_serializeOpHttpBindingsDescribeVpcConnectionInput(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_serializeOpHttpBindingsDescribeVpcConnectionInput(v *DescribeVpcConnectionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Arn == nil || len(*v.Arn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Arn must not be empty")} } if v.Arn != nil { if err := encoder.SetURI("Arn").String(*v.Arn); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetBootstrapBrokers struct { } func (*awsRestjson1_serializeOpGetBootstrapBrokers) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetBootstrapBrokers) 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.(*GetBootstrapBrokersInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/clusters/{ClusterArn}/bootstrap-brokers") 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_serializeOpHttpBindingsGetBootstrapBrokersInput(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_serializeOpHttpBindingsGetBootstrapBrokersInput(v *GetBootstrapBrokersInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterArn == nil || len(*v.ClusterArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ClusterArn must not be empty")} } if v.ClusterArn != nil { if err := encoder.SetURI("ClusterArn").String(*v.ClusterArn); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetClusterPolicy struct { } func (*awsRestjson1_serializeOpGetClusterPolicy) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetClusterPolicy) 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.(*GetClusterPolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/clusters/{ClusterArn}/policy") 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_serializeOpHttpBindingsGetClusterPolicyInput(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_serializeOpHttpBindingsGetClusterPolicyInput(v *GetClusterPolicyInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterArn == nil || len(*v.ClusterArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ClusterArn must not be empty")} } if v.ClusterArn != nil { if err := encoder.SetURI("ClusterArn").String(*v.ClusterArn); err != nil { return err } } return nil } type awsRestjson1_serializeOpGetCompatibleKafkaVersions struct { } func (*awsRestjson1_serializeOpGetCompatibleKafkaVersions) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpGetCompatibleKafkaVersions) 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.(*GetCompatibleKafkaVersionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/compatible-kafka-versions") 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_serializeOpHttpBindingsGetCompatibleKafkaVersionsInput(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_serializeOpHttpBindingsGetCompatibleKafkaVersionsInput(v *GetCompatibleKafkaVersionsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterArn != nil { encoder.SetQuery("clusterArn").String(*v.ClusterArn) } return nil } type awsRestjson1_serializeOpListClientVpcConnections struct { } func (*awsRestjson1_serializeOpListClientVpcConnections) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListClientVpcConnections) 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.(*ListClientVpcConnectionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/clusters/{ClusterArn}/client-vpc-connections") 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_serializeOpHttpBindingsListClientVpcConnectionsInput(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_serializeOpHttpBindingsListClientVpcConnectionsInput(v *ListClientVpcConnectionsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterArn == nil || len(*v.ClusterArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ClusterArn must not be empty")} } if v.ClusterArn != nil { if err := encoder.SetURI("ClusterArn").String(*v.ClusterArn); err != nil { return err } } if v.MaxResults != 0 { encoder.SetQuery("maxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListClusterOperations struct { } func (*awsRestjson1_serializeOpListClusterOperations) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListClusterOperations) 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.(*ListClusterOperationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/clusters/{ClusterArn}/operations") 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_serializeOpHttpBindingsListClusterOperationsInput(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_serializeOpHttpBindingsListClusterOperationsInput(v *ListClusterOperationsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterArn == nil || len(*v.ClusterArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ClusterArn must not be empty")} } if v.ClusterArn != nil { if err := encoder.SetURI("ClusterArn").String(*v.ClusterArn); err != nil { return err } } if v.MaxResults != 0 { encoder.SetQuery("maxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListClusters struct { } func (*awsRestjson1_serializeOpListClusters) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListClusters) 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.(*ListClustersInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/clusters") 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_serializeOpHttpBindingsListClustersInput(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_serializeOpHttpBindingsListClustersInput(v *ListClustersInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterNameFilter != nil { encoder.SetQuery("clusterNameFilter").String(*v.ClusterNameFilter) } if v.MaxResults != 0 { encoder.SetQuery("maxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListClustersV2 struct { } func (*awsRestjson1_serializeOpListClustersV2) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListClustersV2) 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.(*ListClustersV2Input) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/api/v2/clusters") 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_serializeOpHttpBindingsListClustersV2Input(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_serializeOpHttpBindingsListClustersV2Input(v *ListClustersV2Input, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterNameFilter != nil { encoder.SetQuery("clusterNameFilter").String(*v.ClusterNameFilter) } if v.ClusterTypeFilter != nil { encoder.SetQuery("clusterTypeFilter").String(*v.ClusterTypeFilter) } if v.MaxResults != 0 { encoder.SetQuery("maxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListConfigurationRevisions struct { } func (*awsRestjson1_serializeOpListConfigurationRevisions) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListConfigurationRevisions) 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.(*ListConfigurationRevisionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/configurations/{Arn}/revisions") 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_serializeOpHttpBindingsListConfigurationRevisionsInput(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_serializeOpHttpBindingsListConfigurationRevisionsInput(v *ListConfigurationRevisionsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Arn == nil || len(*v.Arn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Arn must not be empty")} } if v.Arn != nil { if err := encoder.SetURI("Arn").String(*v.Arn); err != nil { return err } } if v.MaxResults != 0 { encoder.SetQuery("maxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListConfigurations struct { } func (*awsRestjson1_serializeOpListConfigurations) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListConfigurations) 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.(*ListConfigurationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/configurations") 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_serializeOpHttpBindingsListConfigurationsInput(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_serializeOpHttpBindingsListConfigurationsInput(v *ListConfigurationsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MaxResults != 0 { encoder.SetQuery("maxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListKafkaVersions struct { } func (*awsRestjson1_serializeOpListKafkaVersions) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListKafkaVersions) 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.(*ListKafkaVersionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/kafka-versions") 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_serializeOpHttpBindingsListKafkaVersionsInput(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_serializeOpHttpBindingsListKafkaVersionsInput(v *ListKafkaVersionsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MaxResults != 0 { encoder.SetQuery("maxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListNodes struct { } func (*awsRestjson1_serializeOpListNodes) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListNodes) 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.(*ListNodesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/clusters/{ClusterArn}/nodes") 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_serializeOpHttpBindingsListNodesInput(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_serializeOpHttpBindingsListNodesInput(v *ListNodesInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterArn == nil || len(*v.ClusterArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ClusterArn must not be empty")} } if v.ClusterArn != nil { if err := encoder.SetURI("ClusterArn").String(*v.ClusterArn); err != nil { return err } } if v.MaxResults != 0 { encoder.SetQuery("maxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListScramSecrets struct { } func (*awsRestjson1_serializeOpListScramSecrets) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListScramSecrets) 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.(*ListScramSecretsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/clusters/{ClusterArn}/scram-secrets") 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_serializeOpHttpBindingsListScramSecretsInput(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_serializeOpHttpBindingsListScramSecretsInput(v *ListScramSecretsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterArn == nil || len(*v.ClusterArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ClusterArn must not be empty")} } if v.ClusterArn != nil { if err := encoder.SetURI("ClusterArn").String(*v.ClusterArn); err != nil { return err } } if v.MaxResults != 0 { 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("/v1/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_serializeOpListVpcConnections struct { } func (*awsRestjson1_serializeOpListVpcConnections) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListVpcConnections) 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.(*ListVpcConnectionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/vpc-connections") 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_serializeOpHttpBindingsListVpcConnectionsInput(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_serializeOpHttpBindingsListVpcConnectionsInput(v *ListVpcConnectionsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MaxResults != 0 { encoder.SetQuery("maxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpPutClusterPolicy struct { } func (*awsRestjson1_serializeOpPutClusterPolicy) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpPutClusterPolicy) 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.(*PutClusterPolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/clusters/{ClusterArn}/policy") 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_serializeOpHttpBindingsPutClusterPolicyInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentPutClusterPolicyInput(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_serializeOpHttpBindingsPutClusterPolicyInput(v *PutClusterPolicyInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterArn == nil || len(*v.ClusterArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ClusterArn must not be empty")} } if v.ClusterArn != nil { if err := encoder.SetURI("ClusterArn").String(*v.ClusterArn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentPutClusterPolicyInput(v *PutClusterPolicyInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CurrentVersion != nil { ok := object.Key("currentVersion") ok.String(*v.CurrentVersion) } if v.Policy != nil { ok := object.Key("policy") ok.String(*v.Policy) } return nil } type awsRestjson1_serializeOpRebootBroker struct { } func (*awsRestjson1_serializeOpRebootBroker) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpRebootBroker) 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.(*RebootBrokerInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/clusters/{ClusterArn}/reboot-broker") 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_serializeOpHttpBindingsRebootBrokerInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentRebootBrokerInput(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_serializeOpHttpBindingsRebootBrokerInput(v *RebootBrokerInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterArn == nil || len(*v.ClusterArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ClusterArn must not be empty")} } if v.ClusterArn != nil { if err := encoder.SetURI("ClusterArn").String(*v.ClusterArn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentRebootBrokerInput(v *RebootBrokerInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.BrokerIds != nil { ok := object.Key("brokerIds") if err := awsRestjson1_serializeDocument__listOf__string(v.BrokerIds, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpRejectClientVpcConnection struct { } func (*awsRestjson1_serializeOpRejectClientVpcConnection) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpRejectClientVpcConnection) 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.(*RejectClientVpcConnectionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/clusters/{ClusterArn}/client-vpc-connection") 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_serializeOpHttpBindingsRejectClientVpcConnectionInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentRejectClientVpcConnectionInput(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_serializeOpHttpBindingsRejectClientVpcConnectionInput(v *RejectClientVpcConnectionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterArn == nil || len(*v.ClusterArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ClusterArn must not be empty")} } if v.ClusterArn != nil { if err := encoder.SetURI("ClusterArn").String(*v.ClusterArn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentRejectClientVpcConnectionInput(v *RejectClientVpcConnectionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.VpcConnectionArn != nil { ok := object.Key("vpcConnectionArn") ok.String(*v.VpcConnectionArn) } 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("/v1/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_serializeDocument__mapOf__string(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("/v1/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_serializeOpUpdateBrokerCount struct { } func (*awsRestjson1_serializeOpUpdateBrokerCount) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateBrokerCount) 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.(*UpdateBrokerCountInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/clusters/{ClusterArn}/nodes/count") 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_serializeOpHttpBindingsUpdateBrokerCountInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateBrokerCountInput(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_serializeOpHttpBindingsUpdateBrokerCountInput(v *UpdateBrokerCountInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterArn == nil || len(*v.ClusterArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ClusterArn must not be empty")} } if v.ClusterArn != nil { if err := encoder.SetURI("ClusterArn").String(*v.ClusterArn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateBrokerCountInput(v *UpdateBrokerCountInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CurrentVersion != nil { ok := object.Key("currentVersion") ok.String(*v.CurrentVersion) } { ok := object.Key("targetNumberOfBrokerNodes") ok.Integer(v.TargetNumberOfBrokerNodes) } return nil } type awsRestjson1_serializeOpUpdateBrokerStorage struct { } func (*awsRestjson1_serializeOpUpdateBrokerStorage) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateBrokerStorage) 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.(*UpdateBrokerStorageInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/clusters/{ClusterArn}/nodes/storage") 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_serializeOpHttpBindingsUpdateBrokerStorageInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateBrokerStorageInput(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_serializeOpHttpBindingsUpdateBrokerStorageInput(v *UpdateBrokerStorageInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterArn == nil || len(*v.ClusterArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ClusterArn must not be empty")} } if v.ClusterArn != nil { if err := encoder.SetURI("ClusterArn").String(*v.ClusterArn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateBrokerStorageInput(v *UpdateBrokerStorageInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CurrentVersion != nil { ok := object.Key("currentVersion") ok.String(*v.CurrentVersion) } if v.TargetBrokerEBSVolumeInfo != nil { ok := object.Key("targetBrokerEBSVolumeInfo") if err := awsRestjson1_serializeDocument__listOfBrokerEBSVolumeInfo(v.TargetBrokerEBSVolumeInfo, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUpdateBrokerType struct { } func (*awsRestjson1_serializeOpUpdateBrokerType) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateBrokerType) 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.(*UpdateBrokerTypeInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/clusters/{ClusterArn}/nodes/type") 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_serializeOpHttpBindingsUpdateBrokerTypeInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateBrokerTypeInput(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_serializeOpHttpBindingsUpdateBrokerTypeInput(v *UpdateBrokerTypeInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterArn == nil || len(*v.ClusterArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ClusterArn must not be empty")} } if v.ClusterArn != nil { if err := encoder.SetURI("ClusterArn").String(*v.ClusterArn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateBrokerTypeInput(v *UpdateBrokerTypeInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CurrentVersion != nil { ok := object.Key("currentVersion") ok.String(*v.CurrentVersion) } if v.TargetInstanceType != nil { ok := object.Key("targetInstanceType") ok.String(*v.TargetInstanceType) } return nil } type awsRestjson1_serializeOpUpdateClusterConfiguration struct { } func (*awsRestjson1_serializeOpUpdateClusterConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateClusterConfiguration) 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.(*UpdateClusterConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/clusters/{ClusterArn}/configuration") 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_serializeOpHttpBindingsUpdateClusterConfigurationInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateClusterConfigurationInput(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_serializeOpHttpBindingsUpdateClusterConfigurationInput(v *UpdateClusterConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterArn == nil || len(*v.ClusterArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ClusterArn must not be empty")} } if v.ClusterArn != nil { if err := encoder.SetURI("ClusterArn").String(*v.ClusterArn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateClusterConfigurationInput(v *UpdateClusterConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ConfigurationInfo != nil { ok := object.Key("configurationInfo") if err := awsRestjson1_serializeDocumentConfigurationInfo(v.ConfigurationInfo, ok); err != nil { return err } } if v.CurrentVersion != nil { ok := object.Key("currentVersion") ok.String(*v.CurrentVersion) } return nil } type awsRestjson1_serializeOpUpdateClusterKafkaVersion struct { } func (*awsRestjson1_serializeOpUpdateClusterKafkaVersion) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateClusterKafkaVersion) 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.(*UpdateClusterKafkaVersionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/clusters/{ClusterArn}/version") 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_serializeOpHttpBindingsUpdateClusterKafkaVersionInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateClusterKafkaVersionInput(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_serializeOpHttpBindingsUpdateClusterKafkaVersionInput(v *UpdateClusterKafkaVersionInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterArn == nil || len(*v.ClusterArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ClusterArn must not be empty")} } if v.ClusterArn != nil { if err := encoder.SetURI("ClusterArn").String(*v.ClusterArn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateClusterKafkaVersionInput(v *UpdateClusterKafkaVersionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ConfigurationInfo != nil { ok := object.Key("configurationInfo") if err := awsRestjson1_serializeDocumentConfigurationInfo(v.ConfigurationInfo, ok); err != nil { return err } } if v.CurrentVersion != nil { ok := object.Key("currentVersion") ok.String(*v.CurrentVersion) } if v.TargetKafkaVersion != nil { ok := object.Key("targetKafkaVersion") ok.String(*v.TargetKafkaVersion) } return nil } type awsRestjson1_serializeOpUpdateConfiguration struct { } func (*awsRestjson1_serializeOpUpdateConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateConfiguration) 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.(*UpdateConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/configurations/{Arn}") 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_serializeOpHttpBindingsUpdateConfigurationInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateConfigurationInput(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_serializeOpHttpBindingsUpdateConfigurationInput(v *UpdateConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Arn == nil || len(*v.Arn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Arn must not be empty")} } if v.Arn != nil { if err := encoder.SetURI("Arn").String(*v.Arn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateConfigurationInput(v *UpdateConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.ServerProperties != nil { ok := object.Key("serverProperties") ok.Base64EncodeBytes(v.ServerProperties) } return nil } type awsRestjson1_serializeOpUpdateConnectivity struct { } func (*awsRestjson1_serializeOpUpdateConnectivity) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateConnectivity) 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.(*UpdateConnectivityInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/clusters/{ClusterArn}/connectivity") 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_serializeOpHttpBindingsUpdateConnectivityInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateConnectivityInput(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_serializeOpHttpBindingsUpdateConnectivityInput(v *UpdateConnectivityInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterArn == nil || len(*v.ClusterArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ClusterArn must not be empty")} } if v.ClusterArn != nil { if err := encoder.SetURI("ClusterArn").String(*v.ClusterArn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateConnectivityInput(v *UpdateConnectivityInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ConnectivityInfo != nil { ok := object.Key("connectivityInfo") if err := awsRestjson1_serializeDocumentConnectivityInfo(v.ConnectivityInfo, ok); err != nil { return err } } if v.CurrentVersion != nil { ok := object.Key("currentVersion") ok.String(*v.CurrentVersion) } return nil } type awsRestjson1_serializeOpUpdateMonitoring struct { } func (*awsRestjson1_serializeOpUpdateMonitoring) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateMonitoring) 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.(*UpdateMonitoringInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/clusters/{ClusterArn}/monitoring") 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_serializeOpHttpBindingsUpdateMonitoringInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateMonitoringInput(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_serializeOpHttpBindingsUpdateMonitoringInput(v *UpdateMonitoringInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterArn == nil || len(*v.ClusterArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ClusterArn must not be empty")} } if v.ClusterArn != nil { if err := encoder.SetURI("ClusterArn").String(*v.ClusterArn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateMonitoringInput(v *UpdateMonitoringInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CurrentVersion != nil { ok := object.Key("currentVersion") ok.String(*v.CurrentVersion) } if len(v.EnhancedMonitoring) > 0 { ok := object.Key("enhancedMonitoring") ok.String(string(v.EnhancedMonitoring)) } if v.LoggingInfo != nil { ok := object.Key("loggingInfo") if err := awsRestjson1_serializeDocumentLoggingInfo(v.LoggingInfo, ok); err != nil { return err } } if v.OpenMonitoring != nil { ok := object.Key("openMonitoring") if err := awsRestjson1_serializeDocumentOpenMonitoringInfo(v.OpenMonitoring, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUpdateSecurity struct { } func (*awsRestjson1_serializeOpUpdateSecurity) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateSecurity) 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.(*UpdateSecurityInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/clusters/{ClusterArn}/security") 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_serializeOpHttpBindingsUpdateSecurityInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateSecurityInput(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_serializeOpHttpBindingsUpdateSecurityInput(v *UpdateSecurityInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterArn == nil || len(*v.ClusterArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ClusterArn must not be empty")} } if v.ClusterArn != nil { if err := encoder.SetURI("ClusterArn").String(*v.ClusterArn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateSecurityInput(v *UpdateSecurityInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientAuthentication != nil { ok := object.Key("clientAuthentication") if err := awsRestjson1_serializeDocumentClientAuthentication(v.ClientAuthentication, ok); err != nil { return err } } if v.CurrentVersion != nil { ok := object.Key("currentVersion") ok.String(*v.CurrentVersion) } if v.EncryptionInfo != nil { ok := object.Key("encryptionInfo") if err := awsRestjson1_serializeDocumentEncryptionInfo(v.EncryptionInfo, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUpdateStorage struct { } func (*awsRestjson1_serializeOpUpdateStorage) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateStorage) 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.(*UpdateStorageInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/clusters/{ClusterArn}/storage") 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_serializeOpHttpBindingsUpdateStorageInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateStorageInput(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_serializeOpHttpBindingsUpdateStorageInput(v *UpdateStorageInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ClusterArn == nil || len(*v.ClusterArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ClusterArn must not be empty")} } if v.ClusterArn != nil { if err := encoder.SetURI("ClusterArn").String(*v.ClusterArn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentUpdateStorageInput(v *UpdateStorageInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CurrentVersion != nil { ok := object.Key("currentVersion") ok.String(*v.CurrentVersion) } if v.ProvisionedThroughput != nil { ok := object.Key("provisionedThroughput") if err := awsRestjson1_serializeDocumentProvisionedThroughput(v.ProvisionedThroughput, ok); err != nil { return err } } if len(v.StorageMode) > 0 { ok := object.Key("storageMode") ok.String(string(v.StorageMode)) } if v.VolumeSizeGB != 0 { ok := object.Key("volumeSizeGB") ok.Integer(v.VolumeSizeGB) } return nil } func awsRestjson1_serializeDocument__listOf__string(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_serializeDocument__listOfBrokerEBSVolumeInfo(v []types.BrokerEBSVolumeInfo, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentBrokerEBSVolumeInfo(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocument__listOfVpcConfig(v []types.VpcConfig, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentVpcConfig(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocument__mapOf__string(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_serializeDocumentBrokerEBSVolumeInfo(v *types.BrokerEBSVolumeInfo, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.KafkaBrokerNodeId != nil { ok := object.Key("kafkaBrokerNodeId") ok.String(*v.KafkaBrokerNodeId) } if v.ProvisionedThroughput != nil { ok := object.Key("provisionedThroughput") if err := awsRestjson1_serializeDocumentProvisionedThroughput(v.ProvisionedThroughput, ok); err != nil { return err } } if v.VolumeSizeGB != 0 { ok := object.Key("volumeSizeGB") ok.Integer(v.VolumeSizeGB) } return nil } func awsRestjson1_serializeDocumentBrokerLogs(v *types.BrokerLogs, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CloudWatchLogs != nil { ok := object.Key("cloudWatchLogs") if err := awsRestjson1_serializeDocumentCloudWatchLogs(v.CloudWatchLogs, ok); err != nil { return err } } if v.Firehose != nil { ok := object.Key("firehose") if err := awsRestjson1_serializeDocumentFirehose(v.Firehose, ok); err != nil { return err } } if v.S3 != nil { ok := object.Key("s3") if err := awsRestjson1_serializeDocumentS3(v.S3, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentBrokerNodeGroupInfo(v *types.BrokerNodeGroupInfo, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.BrokerAZDistribution) > 0 { ok := object.Key("brokerAZDistribution") ok.String(string(v.BrokerAZDistribution)) } if v.ClientSubnets != nil { ok := object.Key("clientSubnets") if err := awsRestjson1_serializeDocument__listOf__string(v.ClientSubnets, ok); err != nil { return err } } if v.ConnectivityInfo != nil { ok := object.Key("connectivityInfo") if err := awsRestjson1_serializeDocumentConnectivityInfo(v.ConnectivityInfo, ok); err != nil { return err } } if v.InstanceType != nil { ok := object.Key("instanceType") ok.String(*v.InstanceType) } if v.SecurityGroups != nil { ok := object.Key("securityGroups") if err := awsRestjson1_serializeDocument__listOf__string(v.SecurityGroups, ok); err != nil { return err } } if v.StorageInfo != nil { ok := object.Key("storageInfo") if err := awsRestjson1_serializeDocumentStorageInfo(v.StorageInfo, ok); err != nil { return err } } if v.ZoneIds != nil { ok := object.Key("zoneIds") if err := awsRestjson1_serializeDocument__listOf__string(v.ZoneIds, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentClientAuthentication(v *types.ClientAuthentication, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Sasl != nil { ok := object.Key("sasl") if err := awsRestjson1_serializeDocumentSasl(v.Sasl, ok); err != nil { return err } } if v.Tls != nil { ok := object.Key("tls") if err := awsRestjson1_serializeDocumentTls(v.Tls, ok); err != nil { return err } } if v.Unauthenticated != nil { ok := object.Key("unauthenticated") if err := awsRestjson1_serializeDocumentUnauthenticated(v.Unauthenticated, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentCloudWatchLogs(v *types.CloudWatchLogs, value smithyjson.Value) error { object := value.Object() defer object.Close() { ok := object.Key("enabled") ok.Boolean(v.Enabled) } if v.LogGroup != nil { ok := object.Key("logGroup") ok.String(*v.LogGroup) } return nil } func awsRestjson1_serializeDocumentConfigurationInfo(v *types.ConfigurationInfo, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Arn != nil { ok := object.Key("arn") ok.String(*v.Arn) } { ok := object.Key("revision") ok.Long(v.Revision) } return nil } func awsRestjson1_serializeDocumentConnectivityInfo(v *types.ConnectivityInfo, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.PublicAccess != nil { ok := object.Key("publicAccess") if err := awsRestjson1_serializeDocumentPublicAccess(v.PublicAccess, ok); err != nil { return err } } if v.VpcConnectivity != nil { ok := object.Key("vpcConnectivity") if err := awsRestjson1_serializeDocumentVpcConnectivity(v.VpcConnectivity, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentEBSStorageInfo(v *types.EBSStorageInfo, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ProvisionedThroughput != nil { ok := object.Key("provisionedThroughput") if err := awsRestjson1_serializeDocumentProvisionedThroughput(v.ProvisionedThroughput, ok); err != nil { return err } } if v.VolumeSize != 0 { ok := object.Key("volumeSize") ok.Integer(v.VolumeSize) } return nil } func awsRestjson1_serializeDocumentEncryptionAtRest(v *types.EncryptionAtRest, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DataVolumeKMSKeyId != nil { ok := object.Key("dataVolumeKMSKeyId") ok.String(*v.DataVolumeKMSKeyId) } return nil } func awsRestjson1_serializeDocumentEncryptionInfo(v *types.EncryptionInfo, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.EncryptionAtRest != nil { ok := object.Key("encryptionAtRest") if err := awsRestjson1_serializeDocumentEncryptionAtRest(v.EncryptionAtRest, ok); err != nil { return err } } if v.EncryptionInTransit != nil { ok := object.Key("encryptionInTransit") if err := awsRestjson1_serializeDocumentEncryptionInTransit(v.EncryptionInTransit, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentEncryptionInTransit(v *types.EncryptionInTransit, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.ClientBroker) > 0 { ok := object.Key("clientBroker") ok.String(string(v.ClientBroker)) } if v.InCluster { ok := object.Key("inCluster") ok.Boolean(v.InCluster) } return nil } func awsRestjson1_serializeDocumentFirehose(v *types.Firehose, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DeliveryStream != nil { ok := object.Key("deliveryStream") ok.String(*v.DeliveryStream) } { ok := object.Key("enabled") ok.Boolean(v.Enabled) } return nil } func awsRestjson1_serializeDocumentIam(v *types.Iam, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Enabled { ok := object.Key("enabled") ok.Boolean(v.Enabled) } return nil } func awsRestjson1_serializeDocumentJmxExporterInfo(v *types.JmxExporterInfo, value smithyjson.Value) error { object := value.Object() defer object.Close() { ok := object.Key("enabledInBroker") ok.Boolean(v.EnabledInBroker) } return nil } func awsRestjson1_serializeDocumentLoggingInfo(v *types.LoggingInfo, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.BrokerLogs != nil { ok := object.Key("brokerLogs") if err := awsRestjson1_serializeDocumentBrokerLogs(v.BrokerLogs, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentNodeExporterInfo(v *types.NodeExporterInfo, value smithyjson.Value) error { object := value.Object() defer object.Close() { ok := object.Key("enabledInBroker") ok.Boolean(v.EnabledInBroker) } return nil } func awsRestjson1_serializeDocumentOpenMonitoringInfo(v *types.OpenMonitoringInfo, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Prometheus != nil { ok := object.Key("prometheus") if err := awsRestjson1_serializeDocumentPrometheusInfo(v.Prometheus, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentPrometheusInfo(v *types.PrometheusInfo, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.JmxExporter != nil { ok := object.Key("jmxExporter") if err := awsRestjson1_serializeDocumentJmxExporterInfo(v.JmxExporter, ok); err != nil { return err } } if v.NodeExporter != nil { ok := object.Key("nodeExporter") if err := awsRestjson1_serializeDocumentNodeExporterInfo(v.NodeExporter, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentProvisionedRequest(v *types.ProvisionedRequest, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.BrokerNodeGroupInfo != nil { ok := object.Key("brokerNodeGroupInfo") if err := awsRestjson1_serializeDocumentBrokerNodeGroupInfo(v.BrokerNodeGroupInfo, ok); err != nil { return err } } if v.ClientAuthentication != nil { ok := object.Key("clientAuthentication") if err := awsRestjson1_serializeDocumentClientAuthentication(v.ClientAuthentication, ok); err != nil { return err } } if v.ConfigurationInfo != nil { ok := object.Key("configurationInfo") if err := awsRestjson1_serializeDocumentConfigurationInfo(v.ConfigurationInfo, ok); err != nil { return err } } if v.EncryptionInfo != nil { ok := object.Key("encryptionInfo") if err := awsRestjson1_serializeDocumentEncryptionInfo(v.EncryptionInfo, ok); err != nil { return err } } if len(v.EnhancedMonitoring) > 0 { ok := object.Key("enhancedMonitoring") ok.String(string(v.EnhancedMonitoring)) } if v.KafkaVersion != nil { ok := object.Key("kafkaVersion") ok.String(*v.KafkaVersion) } if v.LoggingInfo != nil { ok := object.Key("loggingInfo") if err := awsRestjson1_serializeDocumentLoggingInfo(v.LoggingInfo, ok); err != nil { return err } } { ok := object.Key("numberOfBrokerNodes") ok.Integer(v.NumberOfBrokerNodes) } if v.OpenMonitoring != nil { ok := object.Key("openMonitoring") if err := awsRestjson1_serializeDocumentOpenMonitoringInfo(v.OpenMonitoring, ok); err != nil { return err } } if len(v.StorageMode) > 0 { ok := object.Key("storageMode") ok.String(string(v.StorageMode)) } return nil } func awsRestjson1_serializeDocumentProvisionedThroughput(v *types.ProvisionedThroughput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Enabled { ok := object.Key("enabled") ok.Boolean(v.Enabled) } if v.VolumeThroughput != 0 { ok := object.Key("volumeThroughput") ok.Integer(v.VolumeThroughput) } return nil } func awsRestjson1_serializeDocumentPublicAccess(v *types.PublicAccess, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Type != nil { ok := object.Key("type") ok.String(*v.Type) } return nil } func awsRestjson1_serializeDocumentS3(v *types.S3, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Bucket != nil { ok := object.Key("bucket") ok.String(*v.Bucket) } { ok := object.Key("enabled") ok.Boolean(v.Enabled) } if v.Prefix != nil { ok := object.Key("prefix") ok.String(*v.Prefix) } return nil } func awsRestjson1_serializeDocumentSasl(v *types.Sasl, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Iam != nil { ok := object.Key("iam") if err := awsRestjson1_serializeDocumentIam(v.Iam, ok); err != nil { return err } } if v.Scram != nil { ok := object.Key("scram") if err := awsRestjson1_serializeDocumentScram(v.Scram, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentScram(v *types.Scram, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Enabled { ok := object.Key("enabled") ok.Boolean(v.Enabled) } return nil } func awsRestjson1_serializeDocumentServerlessClientAuthentication(v *types.ServerlessClientAuthentication, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Sasl != nil { ok := object.Key("sasl") if err := awsRestjson1_serializeDocumentServerlessSasl(v.Sasl, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentServerlessRequest(v *types.ServerlessRequest, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientAuthentication != nil { ok := object.Key("clientAuthentication") if err := awsRestjson1_serializeDocumentServerlessClientAuthentication(v.ClientAuthentication, ok); err != nil { return err } } if v.VpcConfigs != nil { ok := object.Key("vpcConfigs") if err := awsRestjson1_serializeDocument__listOfVpcConfig(v.VpcConfigs, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentServerlessSasl(v *types.ServerlessSasl, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Iam != nil { ok := object.Key("iam") if err := awsRestjson1_serializeDocumentIam(v.Iam, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentStorageInfo(v *types.StorageInfo, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.EbsStorageInfo != nil { ok := object.Key("ebsStorageInfo") if err := awsRestjson1_serializeDocumentEBSStorageInfo(v.EbsStorageInfo, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentTls(v *types.Tls, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CertificateAuthorityArnList != nil { ok := object.Key("certificateAuthorityArnList") if err := awsRestjson1_serializeDocument__listOf__string(v.CertificateAuthorityArnList, ok); err != nil { return err } } if v.Enabled { ok := object.Key("enabled") ok.Boolean(v.Enabled) } return nil } func awsRestjson1_serializeDocumentUnauthenticated(v *types.Unauthenticated, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Enabled { ok := object.Key("enabled") ok.Boolean(v.Enabled) } return nil } func awsRestjson1_serializeDocumentVpcConfig(v *types.VpcConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SecurityGroupIds != nil { ok := object.Key("securityGroupIds") if err := awsRestjson1_serializeDocument__listOf__string(v.SecurityGroupIds, ok); err != nil { return err } } if v.SubnetIds != nil { ok := object.Key("subnetIds") if err := awsRestjson1_serializeDocument__listOf__string(v.SubnetIds, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentVpcConnectivity(v *types.VpcConnectivity, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientAuthentication != nil { ok := object.Key("clientAuthentication") if err := awsRestjson1_serializeDocumentVpcConnectivityClientAuthentication(v.ClientAuthentication, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentVpcConnectivityClientAuthentication(v *types.VpcConnectivityClientAuthentication, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Sasl != nil { ok := object.Key("sasl") if err := awsRestjson1_serializeDocumentVpcConnectivitySasl(v.Sasl, ok); err != nil { return err } } if v.Tls != nil { ok := object.Key("tls") if err := awsRestjson1_serializeDocumentVpcConnectivityTls(v.Tls, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentVpcConnectivityIam(v *types.VpcConnectivityIam, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Enabled { ok := object.Key("enabled") ok.Boolean(v.Enabled) } return nil } func awsRestjson1_serializeDocumentVpcConnectivitySasl(v *types.VpcConnectivitySasl, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Iam != nil { ok := object.Key("iam") if err := awsRestjson1_serializeDocumentVpcConnectivityIam(v.Iam, ok); err != nil { return err } } if v.Scram != nil { ok := object.Key("scram") if err := awsRestjson1_serializeDocumentVpcConnectivityScram(v.Scram, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentVpcConnectivityScram(v *types.VpcConnectivityScram, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Enabled { ok := object.Key("enabled") ok.Boolean(v.Enabled) } return nil } func awsRestjson1_serializeDocumentVpcConnectivityTls(v *types.VpcConnectivityTls, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Enabled { ok := object.Key("enabled") ok.Boolean(v.Enabled) } return nil }
4,107
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafka import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/kafka/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpBatchAssociateScramSecret struct { } func (*validateOpBatchAssociateScramSecret) ID() string { return "OperationInputValidation" } func (m *validateOpBatchAssociateScramSecret) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*BatchAssociateScramSecretInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpBatchAssociateScramSecretInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpBatchDisassociateScramSecret struct { } func (*validateOpBatchDisassociateScramSecret) ID() string { return "OperationInputValidation" } func (m *validateOpBatchDisassociateScramSecret) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*BatchDisassociateScramSecretInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpBatchDisassociateScramSecretInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateCluster struct { } func (*validateOpCreateCluster) ID() string { return "OperationInputValidation" } func (m *validateOpCreateCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateClusterInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateClusterInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateClusterV2 struct { } func (*validateOpCreateClusterV2) ID() string { return "OperationInputValidation" } func (m *validateOpCreateClusterV2) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateClusterV2Input) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateClusterV2Input(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateConfiguration struct { } func (*validateOpCreateConfiguration) ID() string { return "OperationInputValidation" } func (m *validateOpCreateConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateConfigurationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateConfigurationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateVpcConnection struct { } func (*validateOpCreateVpcConnection) ID() string { return "OperationInputValidation" } func (m *validateOpCreateVpcConnection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateVpcConnectionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateVpcConnectionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteCluster struct { } func (*validateOpDeleteCluster) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteClusterInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteClusterInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteClusterPolicy struct { } func (*validateOpDeleteClusterPolicy) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteClusterPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteClusterPolicyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteClusterPolicyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteConfiguration struct { } func (*validateOpDeleteConfiguration) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteConfigurationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteConfigurationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteVpcConnection struct { } func (*validateOpDeleteVpcConnection) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteVpcConnection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteVpcConnectionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteVpcConnectionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeCluster struct { } func (*validateOpDescribeCluster) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeCluster) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeClusterInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeClusterInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeClusterOperation struct { } func (*validateOpDescribeClusterOperation) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeClusterOperation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeClusterOperationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeClusterOperationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeClusterV2 struct { } func (*validateOpDescribeClusterV2) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeClusterV2) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeClusterV2Input) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeClusterV2Input(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeConfiguration struct { } func (*validateOpDescribeConfiguration) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeConfigurationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeConfigurationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeConfigurationRevision struct { } func (*validateOpDescribeConfigurationRevision) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeConfigurationRevision) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeConfigurationRevisionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeConfigurationRevisionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeVpcConnection struct { } func (*validateOpDescribeVpcConnection) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeVpcConnection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeVpcConnectionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeVpcConnectionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetBootstrapBrokers struct { } func (*validateOpGetBootstrapBrokers) ID() string { return "OperationInputValidation" } func (m *validateOpGetBootstrapBrokers) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetBootstrapBrokersInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetBootstrapBrokersInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetClusterPolicy struct { } func (*validateOpGetClusterPolicy) ID() string { return "OperationInputValidation" } func (m *validateOpGetClusterPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetClusterPolicyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetClusterPolicyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListClientVpcConnections struct { } func (*validateOpListClientVpcConnections) ID() string { return "OperationInputValidation" } func (m *validateOpListClientVpcConnections) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListClientVpcConnectionsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListClientVpcConnectionsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListClusterOperations struct { } func (*validateOpListClusterOperations) ID() string { return "OperationInputValidation" } func (m *validateOpListClusterOperations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListClusterOperationsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListClusterOperationsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListConfigurationRevisions struct { } func (*validateOpListConfigurationRevisions) ID() string { return "OperationInputValidation" } func (m *validateOpListConfigurationRevisions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListConfigurationRevisionsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListConfigurationRevisionsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListNodes struct { } func (*validateOpListNodes) ID() string { return "OperationInputValidation" } func (m *validateOpListNodes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListNodesInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListNodesInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListScramSecrets struct { } func (*validateOpListScramSecrets) ID() string { return "OperationInputValidation" } func (m *validateOpListScramSecrets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListScramSecretsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListScramSecretsInput(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 validateOpPutClusterPolicy struct { } func (*validateOpPutClusterPolicy) ID() string { return "OperationInputValidation" } func (m *validateOpPutClusterPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*PutClusterPolicyInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpPutClusterPolicyInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRebootBroker struct { } func (*validateOpRebootBroker) ID() string { return "OperationInputValidation" } func (m *validateOpRebootBroker) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RebootBrokerInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRebootBrokerInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpRejectClientVpcConnection struct { } func (*validateOpRejectClientVpcConnection) ID() string { return "OperationInputValidation" } func (m *validateOpRejectClientVpcConnection) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*RejectClientVpcConnectionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpRejectClientVpcConnectionInput(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 validateOpUpdateBrokerCount struct { } func (*validateOpUpdateBrokerCount) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateBrokerCount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateBrokerCountInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateBrokerCountInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateBrokerStorage struct { } func (*validateOpUpdateBrokerStorage) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateBrokerStorage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateBrokerStorageInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateBrokerStorageInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateBrokerType struct { } func (*validateOpUpdateBrokerType) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateBrokerType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateBrokerTypeInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateBrokerTypeInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateClusterConfiguration struct { } func (*validateOpUpdateClusterConfiguration) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateClusterConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateClusterConfigurationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateClusterConfigurationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateClusterKafkaVersion struct { } func (*validateOpUpdateClusterKafkaVersion) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateClusterKafkaVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateClusterKafkaVersionInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateClusterKafkaVersionInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateConfiguration struct { } func (*validateOpUpdateConfiguration) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateConfigurationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateConfigurationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateConnectivity struct { } func (*validateOpUpdateConnectivity) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateConnectivity) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateConnectivityInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateConnectivityInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateMonitoring struct { } func (*validateOpUpdateMonitoring) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateMonitoring) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateMonitoringInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateMonitoringInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateSecurity struct { } func (*validateOpUpdateSecurity) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateSecurity) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateSecurityInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateSecurityInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateStorage struct { } func (*validateOpUpdateStorage) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateStorage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateStorageInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateStorageInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpBatchAssociateScramSecretValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpBatchAssociateScramSecret{}, middleware.After) } func addOpBatchDisassociateScramSecretValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpBatchDisassociateScramSecret{}, middleware.After) } func addOpCreateClusterValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateCluster{}, middleware.After) } func addOpCreateClusterV2ValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateClusterV2{}, middleware.After) } func addOpCreateConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateConfiguration{}, middleware.After) } func addOpCreateVpcConnectionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateVpcConnection{}, middleware.After) } func addOpDeleteClusterValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteCluster{}, middleware.After) } func addOpDeleteClusterPolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteClusterPolicy{}, middleware.After) } func addOpDeleteConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteConfiguration{}, middleware.After) } func addOpDeleteVpcConnectionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteVpcConnection{}, middleware.After) } func addOpDescribeClusterValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeCluster{}, middleware.After) } func addOpDescribeClusterOperationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeClusterOperation{}, middleware.After) } func addOpDescribeClusterV2ValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeClusterV2{}, middleware.After) } func addOpDescribeConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeConfiguration{}, middleware.After) } func addOpDescribeConfigurationRevisionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeConfigurationRevision{}, middleware.After) } func addOpDescribeVpcConnectionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeVpcConnection{}, middleware.After) } func addOpGetBootstrapBrokersValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetBootstrapBrokers{}, middleware.After) } func addOpGetClusterPolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetClusterPolicy{}, middleware.After) } func addOpListClientVpcConnectionsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListClientVpcConnections{}, middleware.After) } func addOpListClusterOperationsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListClusterOperations{}, middleware.After) } func addOpListConfigurationRevisionsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListConfigurationRevisions{}, middleware.After) } func addOpListNodesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListNodes{}, middleware.After) } func addOpListScramSecretsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListScramSecrets{}, middleware.After) } func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } func addOpPutClusterPolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutClusterPolicy{}, middleware.After) } func addOpRebootBrokerValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRebootBroker{}, middleware.After) } func addOpRejectClientVpcConnectionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRejectClientVpcConnection{}, 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 addOpUpdateBrokerCountValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateBrokerCount{}, middleware.After) } func addOpUpdateBrokerStorageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateBrokerStorage{}, middleware.After) } func addOpUpdateBrokerTypeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateBrokerType{}, middleware.After) } func addOpUpdateClusterConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateClusterConfiguration{}, middleware.After) } func addOpUpdateClusterKafkaVersionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateClusterKafkaVersion{}, middleware.After) } func addOpUpdateConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateConfiguration{}, middleware.After) } func addOpUpdateConnectivityValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateConnectivity{}, middleware.After) } func addOpUpdateMonitoringValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateMonitoring{}, middleware.After) } func addOpUpdateSecurityValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateSecurity{}, middleware.After) } func addOpUpdateStorageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateStorage{}, middleware.After) } func validate__listOfBrokerEBSVolumeInfo(v []types.BrokerEBSVolumeInfo) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListOfBrokerEBSVolumeInfo"} for i := range v { if err := validateBrokerEBSVolumeInfo(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validate__listOfVpcConfig(v []types.VpcConfig) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListOfVpcConfig"} for i := range v { if err := validateVpcConfig(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateBrokerEBSVolumeInfo(v *types.BrokerEBSVolumeInfo) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "BrokerEBSVolumeInfo"} if v.KafkaBrokerNodeId == nil { invalidParams.Add(smithy.NewErrParamRequired("KafkaBrokerNodeId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateBrokerLogs(v *types.BrokerLogs) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "BrokerLogs"} if v.CloudWatchLogs != nil { if err := validateCloudWatchLogs(v.CloudWatchLogs); err != nil { invalidParams.AddNested("CloudWatchLogs", err.(smithy.InvalidParamsError)) } } if v.Firehose != nil { if err := validateFirehose(v.Firehose); err != nil { invalidParams.AddNested("Firehose", err.(smithy.InvalidParamsError)) } } if v.S3 != nil { if err := validateS3(v.S3); err != nil { invalidParams.AddNested("S3", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateBrokerNodeGroupInfo(v *types.BrokerNodeGroupInfo) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "BrokerNodeGroupInfo"} if v.ClientSubnets == nil { invalidParams.Add(smithy.NewErrParamRequired("ClientSubnets")) } if v.InstanceType == nil { invalidParams.Add(smithy.NewErrParamRequired("InstanceType")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateCloudWatchLogs(v *types.CloudWatchLogs) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CloudWatchLogs"} if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateConfigurationInfo(v *types.ConfigurationInfo) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ConfigurationInfo"} if v.Arn == nil { invalidParams.Add(smithy.NewErrParamRequired("Arn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateEncryptionAtRest(v *types.EncryptionAtRest) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "EncryptionAtRest"} if v.DataVolumeKMSKeyId == nil { invalidParams.Add(smithy.NewErrParamRequired("DataVolumeKMSKeyId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateEncryptionInfo(v *types.EncryptionInfo) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "EncryptionInfo"} if v.EncryptionAtRest != nil { if err := validateEncryptionAtRest(v.EncryptionAtRest); err != nil { invalidParams.AddNested("EncryptionAtRest", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateFirehose(v *types.Firehose) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Firehose"} if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateJmxExporterInfo(v *types.JmxExporterInfo) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "JmxExporterInfo"} if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateLoggingInfo(v *types.LoggingInfo) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "LoggingInfo"} if v.BrokerLogs == nil { invalidParams.Add(smithy.NewErrParamRequired("BrokerLogs")) } else if v.BrokerLogs != nil { if err := validateBrokerLogs(v.BrokerLogs); err != nil { invalidParams.AddNested("BrokerLogs", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateNodeExporterInfo(v *types.NodeExporterInfo) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "NodeExporterInfo"} if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpenMonitoringInfo(v *types.OpenMonitoringInfo) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "OpenMonitoringInfo"} if v.Prometheus == nil { invalidParams.Add(smithy.NewErrParamRequired("Prometheus")) } else if v.Prometheus != nil { if err := validatePrometheusInfo(v.Prometheus); err != nil { invalidParams.AddNested("Prometheus", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validatePrometheusInfo(v *types.PrometheusInfo) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PrometheusInfo"} if v.JmxExporter != nil { if err := validateJmxExporterInfo(v.JmxExporter); err != nil { invalidParams.AddNested("JmxExporter", err.(smithy.InvalidParamsError)) } } if v.NodeExporter != nil { if err := validateNodeExporterInfo(v.NodeExporter); err != nil { invalidParams.AddNested("NodeExporter", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateProvisionedRequest(v *types.ProvisionedRequest) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ProvisionedRequest"} if v.BrokerNodeGroupInfo == nil { invalidParams.Add(smithy.NewErrParamRequired("BrokerNodeGroupInfo")) } else if v.BrokerNodeGroupInfo != nil { if err := validateBrokerNodeGroupInfo(v.BrokerNodeGroupInfo); err != nil { invalidParams.AddNested("BrokerNodeGroupInfo", err.(smithy.InvalidParamsError)) } } if v.ConfigurationInfo != nil { if err := validateConfigurationInfo(v.ConfigurationInfo); err != nil { invalidParams.AddNested("ConfigurationInfo", err.(smithy.InvalidParamsError)) } } if v.EncryptionInfo != nil { if err := validateEncryptionInfo(v.EncryptionInfo); err != nil { invalidParams.AddNested("EncryptionInfo", err.(smithy.InvalidParamsError)) } } if v.OpenMonitoring != nil { if err := validateOpenMonitoringInfo(v.OpenMonitoring); err != nil { invalidParams.AddNested("OpenMonitoring", err.(smithy.InvalidParamsError)) } } if v.KafkaVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("KafkaVersion")) } if v.LoggingInfo != nil { if err := validateLoggingInfo(v.LoggingInfo); err != nil { invalidParams.AddNested("LoggingInfo", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateS3(v *types.S3) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "S3"} if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateServerlessRequest(v *types.ServerlessRequest) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ServerlessRequest"} if v.VpcConfigs == nil { invalidParams.Add(smithy.NewErrParamRequired("VpcConfigs")) } else if v.VpcConfigs != nil { if err := validate__listOfVpcConfig(v.VpcConfigs); err != nil { invalidParams.AddNested("VpcConfigs", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateVpcConfig(v *types.VpcConfig) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "VpcConfig"} if v.SubnetIds == nil { invalidParams.Add(smithy.NewErrParamRequired("SubnetIds")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpBatchAssociateScramSecretInput(v *BatchAssociateScramSecretInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "BatchAssociateScramSecretInput"} if v.ClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) } if v.SecretArnList == nil { invalidParams.Add(smithy.NewErrParamRequired("SecretArnList")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpBatchDisassociateScramSecretInput(v *BatchDisassociateScramSecretInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "BatchDisassociateScramSecretInput"} if v.ClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) } if v.SecretArnList == nil { invalidParams.Add(smithy.NewErrParamRequired("SecretArnList")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateClusterInput(v *CreateClusterInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateClusterInput"} if v.BrokerNodeGroupInfo == nil { invalidParams.Add(smithy.NewErrParamRequired("BrokerNodeGroupInfo")) } else if v.BrokerNodeGroupInfo != nil { if err := validateBrokerNodeGroupInfo(v.BrokerNodeGroupInfo); err != nil { invalidParams.AddNested("BrokerNodeGroupInfo", err.(smithy.InvalidParamsError)) } } if v.ClusterName == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) } if v.ConfigurationInfo != nil { if err := validateConfigurationInfo(v.ConfigurationInfo); err != nil { invalidParams.AddNested("ConfigurationInfo", err.(smithy.InvalidParamsError)) } } if v.EncryptionInfo != nil { if err := validateEncryptionInfo(v.EncryptionInfo); err != nil { invalidParams.AddNested("EncryptionInfo", err.(smithy.InvalidParamsError)) } } if v.OpenMonitoring != nil { if err := validateOpenMonitoringInfo(v.OpenMonitoring); err != nil { invalidParams.AddNested("OpenMonitoring", err.(smithy.InvalidParamsError)) } } if v.KafkaVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("KafkaVersion")) } if v.LoggingInfo != nil { if err := validateLoggingInfo(v.LoggingInfo); err != nil { invalidParams.AddNested("LoggingInfo", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateClusterV2Input(v *CreateClusterV2Input) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateClusterV2Input"} if v.ClusterName == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterName")) } if v.Provisioned != nil { if err := validateProvisionedRequest(v.Provisioned); err != nil { invalidParams.AddNested("Provisioned", err.(smithy.InvalidParamsError)) } } if v.Serverless != nil { if err := validateServerlessRequest(v.Serverless); err != nil { invalidParams.AddNested("Serverless", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateConfigurationInput(v *CreateConfigurationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateConfigurationInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.ServerProperties == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerProperties")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateVpcConnectionInput(v *CreateVpcConnectionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateVpcConnectionInput"} if v.TargetClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("TargetClusterArn")) } if v.Authentication == nil { invalidParams.Add(smithy.NewErrParamRequired("Authentication")) } if v.VpcId == nil { invalidParams.Add(smithy.NewErrParamRequired("VpcId")) } if v.ClientSubnets == nil { invalidParams.Add(smithy.NewErrParamRequired("ClientSubnets")) } if v.SecurityGroups == nil { invalidParams.Add(smithy.NewErrParamRequired("SecurityGroups")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteClusterInput(v *DeleteClusterInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteClusterInput"} if v.ClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteClusterPolicyInput(v *DeleteClusterPolicyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteClusterPolicyInput"} if v.ClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteConfigurationInput(v *DeleteConfigurationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteConfigurationInput"} if v.Arn == nil { invalidParams.Add(smithy.NewErrParamRequired("Arn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteVpcConnectionInput(v *DeleteVpcConnectionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteVpcConnectionInput"} if v.Arn == nil { invalidParams.Add(smithy.NewErrParamRequired("Arn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeClusterInput(v *DescribeClusterInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeClusterInput"} if v.ClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeClusterOperationInput(v *DescribeClusterOperationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeClusterOperationInput"} if v.ClusterOperationArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterOperationArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeClusterV2Input(v *DescribeClusterV2Input) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeClusterV2Input"} if v.ClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeConfigurationInput(v *DescribeConfigurationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeConfigurationInput"} if v.Arn == nil { invalidParams.Add(smithy.NewErrParamRequired("Arn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeConfigurationRevisionInput(v *DescribeConfigurationRevisionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeConfigurationRevisionInput"} if v.Arn == nil { invalidParams.Add(smithy.NewErrParamRequired("Arn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeVpcConnectionInput(v *DescribeVpcConnectionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeVpcConnectionInput"} if v.Arn == nil { invalidParams.Add(smithy.NewErrParamRequired("Arn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetBootstrapBrokersInput(v *GetBootstrapBrokersInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetBootstrapBrokersInput"} if v.ClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetClusterPolicyInput(v *GetClusterPolicyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetClusterPolicyInput"} if v.ClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListClientVpcConnectionsInput(v *ListClientVpcConnectionsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListClientVpcConnectionsInput"} if v.ClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListClusterOperationsInput(v *ListClusterOperationsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListClusterOperationsInput"} if v.ClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListConfigurationRevisionsInput(v *ListConfigurationRevisionsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListConfigurationRevisionsInput"} if v.Arn == nil { invalidParams.Add(smithy.NewErrParamRequired("Arn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListNodesInput(v *ListNodesInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListNodesInput"} if v.ClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListScramSecretsInput(v *ListScramSecretsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListScramSecretsInput"} if v.ClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) } 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 validateOpPutClusterPolicyInput(v *PutClusterPolicyInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PutClusterPolicyInput"} if v.ClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) } if v.Policy == nil { invalidParams.Add(smithy.NewErrParamRequired("Policy")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRebootBrokerInput(v *RebootBrokerInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RebootBrokerInput"} if v.BrokerIds == nil { invalidParams.Add(smithy.NewErrParamRequired("BrokerIds")) } if v.ClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpRejectClientVpcConnectionInput(v *RejectClientVpcConnectionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "RejectClientVpcConnectionInput"} if v.ClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) } if v.VpcConnectionArn == nil { invalidParams.Add(smithy.NewErrParamRequired("VpcConnectionArn")) } 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 validateOpUpdateBrokerCountInput(v *UpdateBrokerCountInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateBrokerCountInput"} if v.ClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) } if v.CurrentVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("CurrentVersion")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateBrokerStorageInput(v *UpdateBrokerStorageInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateBrokerStorageInput"} if v.ClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) } if v.CurrentVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("CurrentVersion")) } if v.TargetBrokerEBSVolumeInfo == nil { invalidParams.Add(smithy.NewErrParamRequired("TargetBrokerEBSVolumeInfo")) } else if v.TargetBrokerEBSVolumeInfo != nil { if err := validate__listOfBrokerEBSVolumeInfo(v.TargetBrokerEBSVolumeInfo); err != nil { invalidParams.AddNested("TargetBrokerEBSVolumeInfo", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateBrokerTypeInput(v *UpdateBrokerTypeInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateBrokerTypeInput"} if v.ClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) } if v.CurrentVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("CurrentVersion")) } if v.TargetInstanceType == nil { invalidParams.Add(smithy.NewErrParamRequired("TargetInstanceType")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateClusterConfigurationInput(v *UpdateClusterConfigurationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateClusterConfigurationInput"} if v.ClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) } if v.ConfigurationInfo == nil { invalidParams.Add(smithy.NewErrParamRequired("ConfigurationInfo")) } else if v.ConfigurationInfo != nil { if err := validateConfigurationInfo(v.ConfigurationInfo); err != nil { invalidParams.AddNested("ConfigurationInfo", err.(smithy.InvalidParamsError)) } } if v.CurrentVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("CurrentVersion")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateClusterKafkaVersionInput(v *UpdateClusterKafkaVersionInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateClusterKafkaVersionInput"} if v.ClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) } if v.ConfigurationInfo != nil { if err := validateConfigurationInfo(v.ConfigurationInfo); err != nil { invalidParams.AddNested("ConfigurationInfo", err.(smithy.InvalidParamsError)) } } if v.CurrentVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("CurrentVersion")) } if v.TargetKafkaVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("TargetKafkaVersion")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateConfigurationInput(v *UpdateConfigurationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateConfigurationInput"} if v.Arn == nil { invalidParams.Add(smithy.NewErrParamRequired("Arn")) } if v.ServerProperties == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerProperties")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateConnectivityInput(v *UpdateConnectivityInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateConnectivityInput"} if v.ClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) } if v.ConnectivityInfo == nil { invalidParams.Add(smithy.NewErrParamRequired("ConnectivityInfo")) } if v.CurrentVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("CurrentVersion")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateMonitoringInput(v *UpdateMonitoringInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateMonitoringInput"} if v.ClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) } if v.CurrentVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("CurrentVersion")) } if v.OpenMonitoring != nil { if err := validateOpenMonitoringInfo(v.OpenMonitoring); err != nil { invalidParams.AddNested("OpenMonitoring", err.(smithy.InvalidParamsError)) } } if v.LoggingInfo != nil { if err := validateLoggingInfo(v.LoggingInfo); err != nil { invalidParams.AddNested("LoggingInfo", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateSecurityInput(v *UpdateSecurityInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateSecurityInput"} if v.ClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) } if v.CurrentVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("CurrentVersion")) } if v.EncryptionInfo != nil { if err := validateEncryptionInfo(v.EncryptionInfo); err != nil { invalidParams.AddNested("EncryptionInfo", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateStorageInput(v *UpdateStorageInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateStorageInput"} if v.ClusterArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ClusterArn")) } if v.CurrentVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("CurrentVersion")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
2,019
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 Kafka 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: "kafka.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "kafka-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "kafka-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "kafka.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "af-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-south-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-3", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-4", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", Variant: endpoints.FIPSVariant, }: { Hostname: "kafka-fips.ca-central-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-south-2", }: 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: "fips-ca-central-1", }: endpoints.Endpoint{ Hostname: "kafka-fips.ca-central-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "ca-central-1", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "fips-us-east-1", }: endpoints.Endpoint{ Hostname: "kafka-fips.us-east-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-east-1", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "fips-us-east-2", }: endpoints.Endpoint{ Hostname: "kafka-fips.us-east-2.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-east-2", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "fips-us-west-1", }: endpoints.Endpoint{ Hostname: "kafka-fips.us-west-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-west-1", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "fips-us-west-2", }: endpoints.Endpoint{ Hostname: "kafka-fips.us-west-2.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-west-2", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "me-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "me-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "sa-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", Variant: endpoints.FIPSVariant, }: { Hostname: "kafka-fips.us-east-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-2", Variant: endpoints.FIPSVariant, }: { Hostname: "kafka-fips.us-east-2.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-1", Variant: endpoints.FIPSVariant, }: { Hostname: "kafka-fips.us-west-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", Variant: endpoints.FIPSVariant, }: { Hostname: "kafka-fips.us-west-2.amazonaws.com", }, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "kafka.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "kafka-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "kafka-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "kafka.{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: "kafka-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "kafka.{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: "kafka-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "kafka.{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: "kafka-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "kafka.{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: "kafka-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "kafka.{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: "kafka.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "kafka-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "kafka-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "kafka.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "us-gov-east-1", }: endpoints.Endpoint{ Hostname: "kafka.us-gov-east-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-east-1", }, }, endpoints.EndpointKey{ Region: "us-gov-east-1", Variant: endpoints.FIPSVariant, }: { Hostname: "kafka.us-gov-east-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-east-1", }, }, endpoints.EndpointKey{ Region: "us-gov-east-1-fips", }: endpoints.Endpoint{ Hostname: "kafka.us-gov-east-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-east-1", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "us-gov-west-1", }: endpoints.Endpoint{ Hostname: "kafka.us-gov-west-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-west-1", }, }, endpoints.EndpointKey{ Region: "us-gov-west-1", Variant: endpoints.FIPSVariant, }: { Hostname: "kafka.us-gov-west-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-west-1", }, }, endpoints.EndpointKey{ Region: "us-gov-west-1-fips", }: endpoints.Endpoint{ Hostname: "kafka.us-gov-west-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-west-1", }, Deprecated: aws.TrueTernary, }, }, }, }
517
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 BrokerAZDistribution string // Enum values for BrokerAZDistribution const ( BrokerAZDistributionDefault BrokerAZDistribution = "DEFAULT" ) // Values returns all known values for BrokerAZDistribution. 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 (BrokerAZDistribution) Values() []BrokerAZDistribution { return []BrokerAZDistribution{ "DEFAULT", } } type ClientBroker string // Enum values for ClientBroker const ( ClientBrokerTls ClientBroker = "TLS" ClientBrokerTlsPlaintext ClientBroker = "TLS_PLAINTEXT" ClientBrokerPlaintext ClientBroker = "PLAINTEXT" ) // Values returns all known values for ClientBroker. 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 (ClientBroker) Values() []ClientBroker { return []ClientBroker{ "TLS", "TLS_PLAINTEXT", "PLAINTEXT", } } type ClusterState string // Enum values for ClusterState const ( ClusterStateActive ClusterState = "ACTIVE" ClusterStateCreating ClusterState = "CREATING" ClusterStateDeleting ClusterState = "DELETING" ClusterStateFailed ClusterState = "FAILED" ClusterStateHealing ClusterState = "HEALING" ClusterStateMaintenance ClusterState = "MAINTENANCE" ClusterStateRebootingBroker ClusterState = "REBOOTING_BROKER" ClusterStateUpdating ClusterState = "UPDATING" ) // Values returns all known values for ClusterState. 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 (ClusterState) Values() []ClusterState { return []ClusterState{ "ACTIVE", "CREATING", "DELETING", "FAILED", "HEALING", "MAINTENANCE", "REBOOTING_BROKER", "UPDATING", } } type ClusterType string // Enum values for ClusterType const ( ClusterTypeProvisioned ClusterType = "PROVISIONED" ClusterTypeServerless ClusterType = "SERVERLESS" ) // Values returns all known values for ClusterType. 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 (ClusterType) Values() []ClusterType { return []ClusterType{ "PROVISIONED", "SERVERLESS", } } type ConfigurationState string // Enum values for ConfigurationState const ( ConfigurationStateActive ConfigurationState = "ACTIVE" ConfigurationStateDeleting ConfigurationState = "DELETING" ConfigurationStateDeleteFailed ConfigurationState = "DELETE_FAILED" ) // Values returns all known values for ConfigurationState. 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 (ConfigurationState) Values() []ConfigurationState { return []ConfigurationState{ "ACTIVE", "DELETING", "DELETE_FAILED", } } type EnhancedMonitoring string // Enum values for EnhancedMonitoring const ( EnhancedMonitoringDefault EnhancedMonitoring = "DEFAULT" EnhancedMonitoringPerBroker EnhancedMonitoring = "PER_BROKER" EnhancedMonitoringPerTopicPerBroker EnhancedMonitoring = "PER_TOPIC_PER_BROKER" EnhancedMonitoringPerTopicPerPartition EnhancedMonitoring = "PER_TOPIC_PER_PARTITION" ) // Values returns all known values for EnhancedMonitoring. 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 (EnhancedMonitoring) Values() []EnhancedMonitoring { return []EnhancedMonitoring{ "DEFAULT", "PER_BROKER", "PER_TOPIC_PER_BROKER", "PER_TOPIC_PER_PARTITION", } } type KafkaVersionStatus string // Enum values for KafkaVersionStatus const ( KafkaVersionStatusActive KafkaVersionStatus = "ACTIVE" KafkaVersionStatusDeprecated KafkaVersionStatus = "DEPRECATED" ) // Values returns all known values for KafkaVersionStatus. 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 (KafkaVersionStatus) Values() []KafkaVersionStatus { return []KafkaVersionStatus{ "ACTIVE", "DEPRECATED", } } type NodeType string // Enum values for NodeType const ( NodeTypeBroker NodeType = "BROKER" ) // Values returns all known values for NodeType. 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 (NodeType) Values() []NodeType { return []NodeType{ "BROKER", } } type StorageMode string // Enum values for StorageMode const ( StorageModeLocal StorageMode = "LOCAL" StorageModeTiered StorageMode = "TIERED" ) // Values returns all known values for StorageMode. 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 (StorageMode) Values() []StorageMode { return []StorageMode{ "LOCAL", "TIERED", } } type UserIdentityType string // Enum values for UserIdentityType const ( UserIdentityTypeAwsaccount UserIdentityType = "AWSACCOUNT" UserIdentityTypeAwsservice UserIdentityType = "AWSSERVICE" ) // Values returns all known values for UserIdentityType. 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 (UserIdentityType) Values() []UserIdentityType { return []UserIdentityType{ "AWSACCOUNT", "AWSSERVICE", } } type VpcConnectionState string // Enum values for VpcConnectionState const ( VpcConnectionStateCreating VpcConnectionState = "CREATING" VpcConnectionStateAvailable VpcConnectionState = "AVAILABLE" VpcConnectionStateInactive VpcConnectionState = "INACTIVE" VpcConnectionStateDeactivating VpcConnectionState = "DEACTIVATING" VpcConnectionStateDeleting VpcConnectionState = "DELETING" VpcConnectionStateFailed VpcConnectionState = "FAILED" VpcConnectionStateRejected VpcConnectionState = "REJECTED" VpcConnectionStateRejecting VpcConnectionState = "REJECTING" ) // Values returns all known values for VpcConnectionState. 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 (VpcConnectionState) Values() []VpcConnectionState { return []VpcConnectionState{ "CREATING", "AVAILABLE", "INACTIVE", "DEACTIVATING", "DELETING", "FAILED", "REJECTED", "REJECTING", } }
230
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" ) // Returns information about an error. type BadRequestException struct { Message *string ErrorCodeOverride *string InvalidParameter *string noSmithyDocumentSerde } func (e *BadRequestException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *BadRequestException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *BadRequestException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "BadRequestException" } return *e.ErrorCodeOverride } func (e *BadRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Returns information about an error. type ConflictException struct { Message *string ErrorCodeOverride *string InvalidParameter *string noSmithyDocumentSerde } func (e *ConflictException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ConflictException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ConflictException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ConflictException" } return *e.ErrorCodeOverride } func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Returns information about an error. type ForbiddenException struct { Message *string ErrorCodeOverride *string InvalidParameter *string noSmithyDocumentSerde } func (e *ForbiddenException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ForbiddenException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ForbiddenException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ForbiddenException" } return *e.ErrorCodeOverride } func (e *ForbiddenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Returns information about an error. type InternalServerErrorException struct { Message *string ErrorCodeOverride *string InvalidParameter *string noSmithyDocumentSerde } func (e *InternalServerErrorException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InternalServerErrorException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InternalServerErrorException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InternalServerErrorException" } return *e.ErrorCodeOverride } func (e *InternalServerErrorException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // Returns information about an error. type NotFoundException struct { Message *string ErrorCodeOverride *string InvalidParameter *string noSmithyDocumentSerde } func (e *NotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *NotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *NotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "NotFoundException" } return *e.ErrorCodeOverride } func (e *NotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Returns information about an error. type ServiceUnavailableException struct { Message *string ErrorCodeOverride *string InvalidParameter *string noSmithyDocumentSerde } func (e *ServiceUnavailableException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ServiceUnavailableException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ServiceUnavailableException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ServiceUnavailableException" } return *e.ErrorCodeOverride } func (e *ServiceUnavailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // Returns information about an error. type TooManyRequestsException struct { Message *string ErrorCodeOverride *string InvalidParameter *string noSmithyDocumentSerde } func (e *TooManyRequestsException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *TooManyRequestsException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *TooManyRequestsException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "TooManyRequestsException" } return *e.ErrorCodeOverride } func (e *TooManyRequestsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // Returns information about an error. type UnauthorizedException struct { Message *string ErrorCodeOverride *string InvalidParameter *string noSmithyDocumentSerde } func (e *UnauthorizedException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *UnauthorizedException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *UnauthorizedException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "UnauthorizedException" } return *e.ErrorCodeOverride } func (e *UnauthorizedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
233
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" ) // Specifies the EBS volume upgrade information. The broker identifier must be set // to the keyword ALL. This means the changes apply to all the brokers in the // cluster. type BrokerEBSVolumeInfo struct { // The ID of the broker to update. // // This member is required. KafkaBrokerNodeId *string // EBS volume provisioned throughput information. ProvisionedThroughput *ProvisionedThroughput // Size of the EBS volume to update. VolumeSizeGB int32 noSmithyDocumentSerde } type BrokerLogs struct { CloudWatchLogs *CloudWatchLogs Firehose *Firehose S3 *S3 noSmithyDocumentSerde } // Describes the setup to be used for Apache Kafka broker nodes in the cluster. type BrokerNodeGroupInfo struct { // The list of subnets to connect to in the client virtual private cloud (VPC). // AWS creates elastic network interfaces inside these subnets. Client applications // use elastic network interfaces to produce and consume data. Client subnets can't // occupy the Availability Zone with ID use use1-az3. // // This member is required. ClientSubnets []string // The type of Amazon EC2 instances to use for Apache Kafka brokers. The following // instance types are allowed: kafka.m5.large, kafka.m5.xlarge, kafka.m5.2xlarge, // kafka.m5.4xlarge, kafka.m5.12xlarge, and kafka.m5.24xlarge. // // This member is required. InstanceType *string // The distribution of broker nodes across Availability Zones. This is an optional // parameter. If you don't specify it, Amazon MSK gives it the value DEFAULT. You // can also explicitly set this parameter to the value DEFAULT. No other values are // currently allowed. Amazon MSK distributes the broker nodes evenly across the // Availability Zones that correspond to the subnets you provide when you create // the cluster. BrokerAZDistribution BrokerAZDistribution // Information about the broker access configuration. ConnectivityInfo *ConnectivityInfo // The AWS security groups to associate with the elastic network interfaces in // order to specify who can connect to and communicate with the Amazon MSK cluster. // If you don't specify a security group, Amazon MSK uses the default security // group associated with the VPC. SecurityGroups []string // Contains information about storage volumes attached to MSK broker nodes. StorageInfo *StorageInfo // The list of zoneIds for the cluster in the virtual private cloud (VPC). ZoneIds []string noSmithyDocumentSerde } // BrokerNodeInfo type BrokerNodeInfo struct { // The attached elastic network interface of the broker. AttachedENIId *string // The ID of the broker. BrokerId float64 // The client subnet to which this broker node belongs. ClientSubnet *string // The virtual private cloud (VPC) of the client. ClientVpcIpAddress *string // Information about the version of software currently deployed on the Apache // Kafka brokers in the cluster. CurrentBrokerSoftwareInfo *BrokerSoftwareInfo // Endpoints for accessing the broker. Endpoints []string noSmithyDocumentSerde } // Information about the current software installed on the cluster. type BrokerSoftwareInfo struct { // The Amazon Resource Name (ARN) of the configuration used for the cluster. This // field isn't visible in this preview release. ConfigurationArn *string // The revision of the configuration to use. This field isn't visible in this // preview release. ConfigurationRevision int64 // The version of Apache Kafka. KafkaVersion *string noSmithyDocumentSerde } // Includes all client authentication information. type ClientAuthentication struct { // Details for ClientAuthentication using SASL. Sasl *Sasl // Details for ClientAuthentication using TLS. Tls *Tls // Contains information about unauthenticated traffic to the cluster. Unauthenticated *Unauthenticated noSmithyDocumentSerde } // The client VPC connection object. type ClientVpcConnection struct { // The ARN that identifies the Vpc Connection. // // This member is required. VpcConnectionArn *string // Information about the auth scheme of Vpc Connection. Authentication *string // Creation time of the Vpc Connection. CreationTime *time.Time // The Owner of the Vpc Connection. Owner *string // State of the Vpc Connection. State VpcConnectionState noSmithyDocumentSerde } type CloudWatchLogs struct { // This member is required. Enabled bool LogGroup *string noSmithyDocumentSerde } // Returns information about a cluster. type Cluster struct { // The Amazon Resource Name (ARN) that uniquely identifies a cluster operation. ActiveOperationArn *string // The Amazon Resource Name (ARN) that uniquely identifies the cluster. ClusterArn *string // The name of the cluster. ClusterName *string // Cluster Type. ClusterType ClusterType // The time when the cluster was created. CreationTime *time.Time // The current version of the MSK cluster. CurrentVersion *string // Information about the provisioned cluster. Provisioned *Provisioned // Information about the serverless cluster. Serverless *Serverless // The state of the cluster. The possible states are ACTIVE, CREATING, DELETING, // FAILED, HEALING, MAINTENANCE, REBOOTING_BROKER, and UPDATING. State ClusterState // State Info for the Amazon MSK cluster. StateInfo *StateInfo // Tags attached to the cluster. Tags map[string]string noSmithyDocumentSerde } // Returns information about a cluster. type ClusterInfo struct { // Arn of active cluster operation. ActiveOperationArn *string // Information about the broker nodes. BrokerNodeGroupInfo *BrokerNodeGroupInfo // Includes all client authentication information. ClientAuthentication *ClientAuthentication // The Amazon Resource Name (ARN) that uniquely identifies the cluster. ClusterArn *string // The name of the cluster. ClusterName *string // The time when the cluster was created. CreationTime *time.Time // Information about the version of software currently deployed on the Apache // Kafka brokers in the cluster. CurrentBrokerSoftwareInfo *BrokerSoftwareInfo // The current version of the MSK cluster. CurrentVersion *string // Includes all encryption-related information. EncryptionInfo *EncryptionInfo // Specifies which metrics are gathered for the MSK cluster. This property has the // following possible values: DEFAULT, PER_BROKER, PER_TOPIC_PER_BROKER, and // PER_TOPIC_PER_PARTITION. For a list of the metrics associated with each of these // levels of monitoring, see Monitoring (https://docs.aws.amazon.com/msk/latest/developerguide/monitoring.html) // . EnhancedMonitoring EnhancedMonitoring LoggingInfo *LoggingInfo // The number of broker nodes in the cluster. NumberOfBrokerNodes int32 // Settings for open monitoring using Prometheus. OpenMonitoring *OpenMonitoring // The state of the cluster. The possible states are ACTIVE, CREATING, DELETING, // FAILED, HEALING, MAINTENANCE, REBOOTING_BROKER, and UPDATING. State ClusterState StateInfo *StateInfo // This controls storage mode for supported storage tiers. StorageMode StorageMode // Tags attached to the cluster. Tags map[string]string // The connection string to use to connect to the Apache ZooKeeper cluster. ZookeeperConnectString *string // The connection string to use to connect to zookeeper cluster on Tls port. ZookeeperConnectStringTls *string noSmithyDocumentSerde } // Returns information about a cluster operation. type ClusterOperationInfo struct { // The ID of the API request that triggered this operation. ClientRequestId *string // ARN of the cluster. ClusterArn *string // The time that the operation was created. CreationTime *time.Time // The time at which the operation finished. EndTime *time.Time // Describes the error if the operation fails. ErrorInfo *ErrorInfo // ARN of the cluster operation. OperationArn *string // State of the cluster operation. OperationState *string // Steps completed during the operation. OperationSteps []ClusterOperationStep // Type of the cluster operation. OperationType *string // Information about cluster attributes before a cluster is updated. SourceClusterInfo *MutableClusterInfo // Information about cluster attributes after a cluster is updated. TargetClusterInfo *MutableClusterInfo // Description of the VPC connection for CreateVpcConnection and // DeleteVpcConnection operations. VpcConnectionInfo *VpcConnectionInfo noSmithyDocumentSerde } // Step taken during a cluster operation. type ClusterOperationStep struct { // Information about the step and its status. StepInfo *ClusterOperationStepInfo // The name of the step. StepName *string noSmithyDocumentSerde } // State information about the operation step. type ClusterOperationStepInfo struct { // The steps current status. StepStatus *string noSmithyDocumentSerde } // Contains source Apache Kafka versions and compatible target Apache Kafka // versions. type CompatibleKafkaVersion struct { // An Apache Kafka version. SourceVersion *string // A list of Apache Kafka versions. TargetVersions []string noSmithyDocumentSerde } // Represents an MSK Configuration. type Configuration struct { // The Amazon Resource Name (ARN) of the configuration. // // This member is required. Arn *string // The time when the configuration was created. // // This member is required. CreationTime *time.Time // The description of the configuration. // // This member is required. Description *string // An array of the versions of Apache Kafka with which you can use this MSK // configuration. You can use this configuration for an MSK cluster only if the // Apache Kafka version specified for the cluster appears in this array. // // This member is required. KafkaVersions []string // Latest revision of the configuration. // // This member is required. LatestRevision *ConfigurationRevision // The name of the configuration. // // This member is required. Name *string // The state of the configuration. The possible states are ACTIVE, DELETING, and // DELETE_FAILED. // // This member is required. State ConfigurationState noSmithyDocumentSerde } // Specifies the configuration to use for the brokers. type ConfigurationInfo struct { // ARN of the configuration to use. // // This member is required. Arn *string // The revision of the configuration to use. // // This member is required. Revision int64 noSmithyDocumentSerde } // Describes a configuration revision. type ConfigurationRevision struct { // The time when the configuration revision was created. // // This member is required. CreationTime *time.Time // The revision number. // // This member is required. Revision int64 // The description of the configuration revision. Description *string noSmithyDocumentSerde } // Information about the broker access configuration. type ConnectivityInfo struct { // Public access control for brokers. PublicAccess *PublicAccess // VPC connectivity access control for brokers. VpcConnectivity *VpcConnectivity noSmithyDocumentSerde } // Contains information about the EBS storage volumes attached to Apache Kafka // broker nodes. type EBSStorageInfo struct { // EBS volume provisioned throughput information. ProvisionedThroughput *ProvisionedThroughput // The size in GiB of the EBS volume for the data drive on each broker node. VolumeSize int32 noSmithyDocumentSerde } // The data-volume encryption details. type EncryptionAtRest struct { // The ARN of the AWS KMS key for encrypting data at rest. If you don't specify a // KMS key, MSK creates one for you and uses it. // // This member is required. DataVolumeKMSKeyId *string noSmithyDocumentSerde } // Includes encryption-related information, such as the AWS KMS key used for // encrypting data at rest and whether you want MSK to encrypt your data in // transit. type EncryptionInfo struct { // The data-volume encryption details. EncryptionAtRest *EncryptionAtRest // The details for encryption in transit. EncryptionInTransit *EncryptionInTransit noSmithyDocumentSerde } // The settings for encrypting data in transit. type EncryptionInTransit struct { // Indicates the encryption setting for data in transit between clients and // brokers. The following are the possible values. TLS means that client-broker // communication is enabled with TLS only. TLS_PLAINTEXT means that client-broker // communication is enabled for both TLS-encrypted, as well as plaintext data. // PLAINTEXT means that client-broker communication is enabled in plaintext only. // The default value is TLS_PLAINTEXT. ClientBroker ClientBroker // When set to true, it indicates that data communication among the broker nodes // of the cluster is encrypted. When set to false, the communication happens in // plaintext. The default value is true. InCluster bool noSmithyDocumentSerde } // Returns information about an error state of the cluster. type ErrorInfo struct { // A number describing the error programmatically. ErrorCode *string // An optional field to provide more details about the error. ErrorString *string noSmithyDocumentSerde } type Firehose struct { // This member is required. Enabled bool DeliveryStream *string noSmithyDocumentSerde } // Details for IAM access control. type Iam struct { // Indicates whether IAM access control is enabled. Enabled bool noSmithyDocumentSerde } // Indicates whether you want to turn on or turn off the JMX Exporter. type JmxExporter struct { // Indicates whether you want to turn on or turn off the JMX Exporter. // // This member is required. EnabledInBroker bool noSmithyDocumentSerde } // Indicates whether you want to turn on or turn off the JMX Exporter. type JmxExporterInfo struct { // Indicates whether you want to turn on or turn off the JMX Exporter. // // This member is required. EnabledInBroker bool noSmithyDocumentSerde } type KafkaVersion struct { Status KafkaVersionStatus Version *string noSmithyDocumentSerde } type LoggingInfo struct { // This member is required. BrokerLogs *BrokerLogs noSmithyDocumentSerde } // Information about cluster attributes that can be updated via update APIs. type MutableClusterInfo struct { // Specifies the size of the EBS volume and the ID of the associated broker. BrokerEBSVolumeInfo []BrokerEBSVolumeInfo // Includes all client authentication information. ClientAuthentication *ClientAuthentication // Information about the changes in the configuration of the brokers. ConfigurationInfo *ConfigurationInfo // Information about the broker access configuration. ConnectivityInfo *ConnectivityInfo // Includes all encryption-related information. EncryptionInfo *EncryptionInfo // Specifies which Apache Kafka metrics Amazon MSK gathers and sends to Amazon // CloudWatch for this cluster. EnhancedMonitoring EnhancedMonitoring // Information about the Amazon MSK broker type. InstanceType *string // The Apache Kafka version. KafkaVersion *string // You can configure your MSK cluster to send broker logs to different destination // types. This is a container for the configuration details related to broker logs. LoggingInfo *LoggingInfo // The number of broker nodes in the cluster. NumberOfBrokerNodes int32 // The settings for open monitoring. OpenMonitoring *OpenMonitoring // This controls storage mode for supported storage tiers. StorageMode StorageMode noSmithyDocumentSerde } // Indicates whether you want to turn on or turn off the Node Exporter. type NodeExporter struct { // Indicates whether you want to turn on or turn off the Node Exporter. // // This member is required. EnabledInBroker bool noSmithyDocumentSerde } // Indicates whether you want to turn on or turn off the Node Exporter. type NodeExporterInfo struct { // Indicates whether you want to turn on or turn off the Node Exporter. // // This member is required. EnabledInBroker bool noSmithyDocumentSerde } // The node information object. type NodeInfo struct { // The start time. AddedToClusterTime *string // The broker node info. BrokerNodeInfo *BrokerNodeInfo // The instance type. InstanceType *string // The Amazon Resource Name (ARN) of the node. NodeARN *string // The node type. NodeType NodeType // The ZookeeperNodeInfo. ZookeeperNodeInfo *ZookeeperNodeInfo noSmithyDocumentSerde } // JMX and Node monitoring for the MSK cluster. type OpenMonitoring struct { // Prometheus settings. // // This member is required. Prometheus *Prometheus noSmithyDocumentSerde } // JMX and Node monitoring for the MSK cluster. type OpenMonitoringInfo struct { // Prometheus settings. // // This member is required. Prometheus *PrometheusInfo noSmithyDocumentSerde } // Prometheus settings. type Prometheus struct { // Indicates whether you want to turn on or turn off the JMX Exporter. JmxExporter *JmxExporter // Indicates whether you want to turn on or turn off the Node Exporter. NodeExporter *NodeExporter noSmithyDocumentSerde } // Prometheus settings. type PrometheusInfo struct { // Indicates whether you want to turn on or turn off the JMX Exporter. JmxExporter *JmxExporterInfo // Indicates whether you want to turn on or turn off the Node Exporter. NodeExporter *NodeExporterInfo noSmithyDocumentSerde } // Provisioned cluster. type Provisioned struct { // Information about the brokers. // // This member is required. BrokerNodeGroupInfo *BrokerNodeGroupInfo // The number of broker nodes in the cluster. // // This member is required. NumberOfBrokerNodes int32 // Includes all client authentication information. ClientAuthentication *ClientAuthentication // Information about the Apache Kafka version deployed on the brokers. CurrentBrokerSoftwareInfo *BrokerSoftwareInfo // Includes all encryption-related information. EncryptionInfo *EncryptionInfo // Specifies the level of monitoring for the MSK cluster. The possible values are // DEFAULT, PER_BROKER, PER_TOPIC_PER_BROKER, and PER_TOPIC_PER_PARTITION. EnhancedMonitoring EnhancedMonitoring // Log delivery information for the cluster. LoggingInfo *LoggingInfo // The settings for open monitoring. OpenMonitoring *OpenMonitoringInfo // This controls storage mode for supported storage tiers. StorageMode StorageMode // The connection string to use to connect to the Apache ZooKeeper cluster. ZookeeperConnectString *string // The connection string to use to connect to the Apache ZooKeeper cluster on a // TLS port. ZookeeperConnectStringTls *string noSmithyDocumentSerde } // Provisioned cluster request. type ProvisionedRequest struct { // Information about the brokers. // // This member is required. BrokerNodeGroupInfo *BrokerNodeGroupInfo // The Apache Kafka version that you want for the cluster. // // This member is required. KafkaVersion *string // The number of broker nodes in the cluster. // // This member is required. NumberOfBrokerNodes int32 // Includes all client authentication information. ClientAuthentication *ClientAuthentication // Represents the configuration that you want Amazon MSK to use for the brokers in // a cluster. ConfigurationInfo *ConfigurationInfo // Includes all encryption-related information. EncryptionInfo *EncryptionInfo // Specifies the level of monitoring for the MSK cluster. The possible values are // DEFAULT, PER_BROKER, PER_TOPIC_PER_BROKER, and PER_TOPIC_PER_PARTITION. EnhancedMonitoring EnhancedMonitoring // Log delivery information for the cluster. LoggingInfo *LoggingInfo // The settings for open monitoring. OpenMonitoring *OpenMonitoringInfo // This controls storage mode for supported storage tiers. StorageMode StorageMode noSmithyDocumentSerde } // Contains information about provisioned throughput for EBS storage volumes // attached to kafka broker nodes. type ProvisionedThroughput struct { // Provisioned throughput is enabled or not. Enabled bool // Throughput value of the EBS volumes for the data drive on each kafka broker // node in MiB per second. VolumeThroughput int32 noSmithyDocumentSerde } // Public access control for brokers. type PublicAccess struct { // The value DISABLED indicates that public access is turned off. // SERVICE_PROVIDED_EIPS indicates that public access is turned on. Type *string noSmithyDocumentSerde } type S3 struct { // This member is required. Enabled bool Bucket *string Prefix *string noSmithyDocumentSerde } // Details for client authentication using SASL. type Sasl struct { // Indicates whether IAM access control is enabled. Iam *Iam // Details for SASL/SCRAM client authentication. Scram *Scram noSmithyDocumentSerde } // Details for SASL/SCRAM client authentication. type Scram struct { // SASL/SCRAM authentication is enabled or not. Enabled bool noSmithyDocumentSerde } // Serverless cluster. type Serverless struct { // The configuration of the Amazon VPCs for the cluster. // // This member is required. VpcConfigs []VpcConfig // Includes all client authentication information. ClientAuthentication *ServerlessClientAuthentication noSmithyDocumentSerde } // Includes all client authentication information. type ServerlessClientAuthentication struct { // Details for ClientAuthentication using SASL. Sasl *ServerlessSasl noSmithyDocumentSerde } // Serverless cluster request. type ServerlessRequest struct { // The configuration of the Amazon VPCs for the cluster. // // This member is required. VpcConfigs []VpcConfig // Includes all client authentication information. ClientAuthentication *ServerlessClientAuthentication noSmithyDocumentSerde } // Details for client authentication using SASL. type ServerlessSasl struct { // Indicates whether IAM access control is enabled. Iam *Iam noSmithyDocumentSerde } type StateInfo struct { Code *string Message *string noSmithyDocumentSerde } // Contains information about storage volumes attached to MSK broker nodes. type StorageInfo struct { // EBS volume information. EbsStorageInfo *EBSStorageInfo noSmithyDocumentSerde } // Details for client authentication using TLS. type Tls struct { // List of ACM Certificate Authority ARNs. CertificateAuthorityArnList []string // Specifies whether you want to turn on or turn off TLS authentication. Enabled bool noSmithyDocumentSerde } type Unauthenticated struct { // Specifies whether you want to turn on or turn off unauthenticated traffic to // your cluster. Enabled bool noSmithyDocumentSerde } // Error info for scram secret associate/disassociate failure. type UnprocessedScramSecret struct { // Error code for associate/disassociate failure. ErrorCode *string // Error message for associate/disassociate failure. ErrorMessage *string // AWS Secrets Manager secret ARN. SecretArn *string noSmithyDocumentSerde } // Description of the requester that calls the API operation. type UserIdentity struct { // A unique identifier for the requester that calls the API operation. PrincipalId *string // The identity type of the requester that calls the API operation. Type UserIdentityType noSmithyDocumentSerde } // The configuration of the Amazon VPCs for the cluster. type VpcConfig struct { // The IDs of the subnets associated with the cluster. // // This member is required. SubnetIds []string // The IDs of the security groups associated with the cluster. SecurityGroupIds []string noSmithyDocumentSerde } // The VPC connection object. type VpcConnection struct { // The ARN that identifies the Cluster which the Vpc Connection belongs to. // // This member is required. TargetClusterArn *string // The ARN that identifies the Vpc Connection. // // This member is required. VpcConnectionArn *string // Information about the auth scheme of Vpc Connection. Authentication *string // Creation time of the Vpc Connection. CreationTime *time.Time // State of the Vpc Connection. State VpcConnectionState // The vpcId that belongs to the Vpc Connection. VpcId *string noSmithyDocumentSerde } // Description of the VPC connection. type VpcConnectionInfo struct { // The time when Amazon MSK creates the VPC Connnection. CreationTime *time.Time // The owner of the VPC Connection. Owner *string // Description of the requester that calls the API operation. UserIdentity *UserIdentity // The Amazon Resource Name (ARN) of the VPC connection. VpcConnectionArn *string noSmithyDocumentSerde } // VPC connectivity access control for brokers. type VpcConnectivity struct { // Includes all client authentication information for VPC connectivity. ClientAuthentication *VpcConnectivityClientAuthentication noSmithyDocumentSerde } // Includes all client authentication information for VPC connectivity. type VpcConnectivityClientAuthentication struct { // SASL authentication type details for VPC connectivity. Sasl *VpcConnectivitySasl // TLS authentication type details for VPC connectivity. Tls *VpcConnectivityTls noSmithyDocumentSerde } // Details for IAM access control for VPC connectivity. type VpcConnectivityIam struct { // SASL/IAM authentication is on or off for VPC connectivity. Enabled bool noSmithyDocumentSerde } // Details for SASL client authentication for VPC connectivity. type VpcConnectivitySasl struct { // Details for SASL/IAM client authentication for VPC connectivity. Iam *VpcConnectivityIam // Details for SASL/SCRAM client authentication for VPC connectivity. Scram *VpcConnectivityScram noSmithyDocumentSerde } // Details for SASL/SCRAM client authentication for VPC connectivity. type VpcConnectivityScram struct { // SASL/SCRAM authentication is on or off for VPC connectivity. Enabled bool noSmithyDocumentSerde } // Details for TLS client authentication for VPC connectivity. type VpcConnectivityTls struct { // TLS authentication is on or off for VPC connectivity. Enabled bool noSmithyDocumentSerde } // Zookeeper node information. type ZookeeperNodeInfo struct { // The attached elastic network interface of the broker. AttachedENIId *string // The virtual private cloud (VPC) IP address of the client. ClientVpcIpAddress *string // Endpoints for accessing the ZooKeeper. Endpoints []string // The role-specific ID for Zookeeper. ZookeeperId float64 // The version of Zookeeper. ZookeeperVersion *string noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
1,110
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafkaconnect 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 = "KafkaConnect" const ServiceAPIVersion = "2021-09-14" // Client provides the API client to make operations call for Managed Streaming // for Kafka Connect. 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, "kafkaconnect", 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) }
435
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafkaconnect 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 kafkaconnect 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/kafkaconnect/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a connector using the specified properties. func (c *Client) CreateConnector(ctx context.Context, params *CreateConnectorInput, optFns ...func(*Options)) (*CreateConnectorOutput, error) { if params == nil { params = &CreateConnectorInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateConnector", params, optFns, c.addOperationCreateConnectorMiddlewares) if err != nil { return nil, err } out := result.(*CreateConnectorOutput) out.ResultMetadata = metadata return out, nil } type CreateConnectorInput struct { // Information about the capacity allocated to the connector. Exactly one of the // two properties must be specified. // // This member is required. Capacity *types.Capacity // A map of keys to values that represent the configuration for the connector. // // This member is required. ConnectorConfiguration map[string]string // The name of the connector. // // This member is required. ConnectorName *string // Specifies which Apache Kafka cluster to connect to. // // This member is required. KafkaCluster *types.KafkaCluster // Details of the client authentication used by the Apache Kafka cluster. // // This member is required. KafkaClusterClientAuthentication *types.KafkaClusterClientAuthentication // Details of encryption in transit to the Apache Kafka cluster. // // This member is required. KafkaClusterEncryptionInTransit *types.KafkaClusterEncryptionInTransit // The version of Kafka Connect. It has to be compatible with both the Apache // Kafka cluster's version and the plugins. // // This member is required. KafkaConnectVersion *string // Specifies which plugins to use for the connector. // // This member is required. Plugins []types.Plugin // The Amazon Resource Name (ARN) of the IAM role used by the connector to access // the Amazon Web Services resources that it needs. The types of resources depends // on the logic of the connector. For example, a connector that has Amazon S3 as a // destination must have permissions that allow it to write to the S3 destination // bucket. // // This member is required. ServiceExecutionRoleArn *string // A summary description of the connector. ConnectorDescription *string // Details about log delivery. LogDelivery *types.LogDelivery // Specifies which worker configuration to use with the connector. WorkerConfiguration *types.WorkerConfiguration noSmithyDocumentSerde } type CreateConnectorOutput struct { // The Amazon Resource Name (ARN) that Amazon assigned to the connector. ConnectorArn *string // The name of the connector. ConnectorName *string // The state of the connector. ConnectorState types.ConnectorState // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateConnectorMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateConnector{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateConnector{}, 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 = addOpCreateConnectorValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateConnector(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_opCreateConnector(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafkaconnect", OperationName: "CreateConnector", } }
186
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafkaconnect 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/kafkaconnect/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a custom plugin using the specified properties. func (c *Client) CreateCustomPlugin(ctx context.Context, params *CreateCustomPluginInput, optFns ...func(*Options)) (*CreateCustomPluginOutput, error) { if params == nil { params = &CreateCustomPluginInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateCustomPlugin", params, optFns, c.addOperationCreateCustomPluginMiddlewares) if err != nil { return nil, err } out := result.(*CreateCustomPluginOutput) out.ResultMetadata = metadata return out, nil } type CreateCustomPluginInput struct { // The type of the plugin file. // // This member is required. ContentType types.CustomPluginContentType // Information about the location of a custom plugin. // // This member is required. Location *types.CustomPluginLocation // The name of the custom plugin. // // This member is required. Name *string // A summary description of the custom plugin. Description *string noSmithyDocumentSerde } type CreateCustomPluginOutput struct { // The Amazon Resource Name (ARN) that Amazon assigned to the custom plugin. CustomPluginArn *string // The state of the custom plugin. CustomPluginState types.CustomPluginState // The name of the custom plugin. Name *string // The revision of the custom plugin. Revision int64 // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateCustomPluginMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateCustomPlugin{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateCustomPlugin{}, 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 = addOpCreateCustomPluginValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCustomPlugin(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_opCreateCustomPlugin(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafkaconnect", OperationName: "CreateCustomPlugin", } }
147
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafkaconnect 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/kafkaconnect/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Creates a worker configuration using the specified properties. func (c *Client) CreateWorkerConfiguration(ctx context.Context, params *CreateWorkerConfigurationInput, optFns ...func(*Options)) (*CreateWorkerConfigurationOutput, error) { if params == nil { params = &CreateWorkerConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateWorkerConfiguration", params, optFns, c.addOperationCreateWorkerConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*CreateWorkerConfigurationOutput) out.ResultMetadata = metadata return out, nil } type CreateWorkerConfigurationInput struct { // The name of the worker configuration. // // This member is required. Name *string // Base64 encoded contents of connect-distributed.properties file. // // This member is required. PropertiesFileContent *string // A summary description of the worker configuration. Description *string noSmithyDocumentSerde } type CreateWorkerConfigurationOutput struct { // The time that the worker configuration was created. CreationTime *time.Time // The latest revision of the worker configuration. LatestRevision *types.WorkerConfigurationRevisionSummary // The name of the worker configuration. Name *string // The Amazon Resource Name (ARN) that Amazon assigned to the worker configuration. WorkerConfigurationArn *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateWorkerConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateWorkerConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateWorkerConfiguration{}, 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 = addOpCreateWorkerConfigurationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateWorkerConfiguration(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_opCreateWorkerConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafkaconnect", OperationName: "CreateWorkerConfiguration", } }
143
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafkaconnect 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/kafkaconnect/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes the specified connector. func (c *Client) DeleteConnector(ctx context.Context, params *DeleteConnectorInput, optFns ...func(*Options)) (*DeleteConnectorOutput, error) { if params == nil { params = &DeleteConnectorInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteConnector", params, optFns, c.addOperationDeleteConnectorMiddlewares) if err != nil { return nil, err } out := result.(*DeleteConnectorOutput) out.ResultMetadata = metadata return out, nil } type DeleteConnectorInput struct { // The Amazon Resource Name (ARN) of the connector that you want to delete. // // This member is required. ConnectorArn *string // The current version of the connector that you want to delete. CurrentVersion *string noSmithyDocumentSerde } type DeleteConnectorOutput struct { // The Amazon Resource Name (ARN) of the connector that you requested to delete. ConnectorArn *string // The state of the connector that you requested to delete. ConnectorState types.ConnectorState // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteConnectorMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteConnector{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteConnector{}, 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 = addOpDeleteConnectorValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteConnector(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_opDeleteConnector(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafkaconnect", OperationName: "DeleteConnector", } }
131
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafkaconnect 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/kafkaconnect/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes a custom plugin. func (c *Client) DeleteCustomPlugin(ctx context.Context, params *DeleteCustomPluginInput, optFns ...func(*Options)) (*DeleteCustomPluginOutput, error) { if params == nil { params = &DeleteCustomPluginInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteCustomPlugin", params, optFns, c.addOperationDeleteCustomPluginMiddlewares) if err != nil { return nil, err } out := result.(*DeleteCustomPluginOutput) out.ResultMetadata = metadata return out, nil } type DeleteCustomPluginInput struct { // The Amazon Resource Name (ARN) of the custom plugin that you want to delete. // // This member is required. CustomPluginArn *string noSmithyDocumentSerde } type DeleteCustomPluginOutput struct { // The Amazon Resource Name (ARN) of the custom plugin that you requested to // delete. CustomPluginArn *string // The state of the custom plugin. CustomPluginState types.CustomPluginState // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteCustomPluginMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteCustomPlugin{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteCustomPlugin{}, 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 = addOpDeleteCustomPluginValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCustomPlugin(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_opDeleteCustomPlugin(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafkaconnect", OperationName: "DeleteCustomPlugin", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafkaconnect 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/kafkaconnect/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Returns summary information about the connector. func (c *Client) DescribeConnector(ctx context.Context, params *DescribeConnectorInput, optFns ...func(*Options)) (*DescribeConnectorOutput, error) { if params == nil { params = &DescribeConnectorInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeConnector", params, optFns, c.addOperationDescribeConnectorMiddlewares) if err != nil { return nil, err } out := result.(*DescribeConnectorOutput) out.ResultMetadata = metadata return out, nil } type DescribeConnectorInput struct { // The Amazon Resource Name (ARN) of the connector that you want to describe. // // This member is required. ConnectorArn *string noSmithyDocumentSerde } type DescribeConnectorOutput struct { // Information about the capacity of the connector, whether it is auto scaled or // provisioned. Capacity *types.CapacityDescription // The Amazon Resource Name (ARN) of the connector. ConnectorArn *string // A map of keys to values that represent the configuration for the connector. ConnectorConfiguration map[string]string // A summary description of the connector. ConnectorDescription *string // The name of the connector. ConnectorName *string // The state of the connector. ConnectorState types.ConnectorState // The time the connector was created. CreationTime *time.Time // The current version of the connector. CurrentVersion *string // The Apache Kafka cluster that the connector is connected to. KafkaCluster *types.KafkaClusterDescription // The type of client authentication used to connect to the Apache Kafka cluster. // The value is NONE when no client authentication is used. KafkaClusterClientAuthentication *types.KafkaClusterClientAuthenticationDescription // Details of encryption in transit to the Apache Kafka cluster. KafkaClusterEncryptionInTransit *types.KafkaClusterEncryptionInTransitDescription // The version of Kafka Connect. It has to be compatible with both the Apache // Kafka cluster's version and the plugins. KafkaConnectVersion *string // Details about delivering logs to Amazon CloudWatch Logs. LogDelivery *types.LogDeliveryDescription // Specifies which plugins were used for this connector. Plugins []types.PluginDescription // The Amazon Resource Name (ARN) of the IAM role used by the connector to access // Amazon Web Services resources. ServiceExecutionRoleArn *string // Details about the state of a connector. StateDescription *types.StateDescription // Specifies which worker configuration was used for the connector. WorkerConfiguration *types.WorkerConfigurationDescription // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeConnectorMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeConnector{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeConnector{}, 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 = addOpDescribeConnectorValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeConnector(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_opDescribeConnector(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafkaconnect", OperationName: "DescribeConnector", } }
178
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafkaconnect 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/kafkaconnect/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // A summary description of the custom plugin. func (c *Client) DescribeCustomPlugin(ctx context.Context, params *DescribeCustomPluginInput, optFns ...func(*Options)) (*DescribeCustomPluginOutput, error) { if params == nil { params = &DescribeCustomPluginInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeCustomPlugin", params, optFns, c.addOperationDescribeCustomPluginMiddlewares) if err != nil { return nil, err } out := result.(*DescribeCustomPluginOutput) out.ResultMetadata = metadata return out, nil } type DescribeCustomPluginInput struct { // Returns information about a custom plugin. // // This member is required. CustomPluginArn *string noSmithyDocumentSerde } type DescribeCustomPluginOutput struct { // The time that the custom plugin was created. CreationTime *time.Time // The Amazon Resource Name (ARN) of the custom plugin. CustomPluginArn *string // The state of the custom plugin. CustomPluginState types.CustomPluginState // The description of the custom plugin. Description *string // The latest successfully created revision of the custom plugin. If there are no // successfully created revisions, this field will be absent. LatestRevision *types.CustomPluginRevisionSummary // The name of the custom plugin. Name *string // Details about the state of a custom plugin. StateDescription *types.StateDescription // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeCustomPluginMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeCustomPlugin{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeCustomPlugin{}, 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 = addOpDescribeCustomPluginValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCustomPlugin(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_opDescribeCustomPlugin(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafkaconnect", OperationName: "DescribeCustomPlugin", } }
145
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafkaconnect 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/kafkaconnect/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Returns information about a worker configuration. func (c *Client) DescribeWorkerConfiguration(ctx context.Context, params *DescribeWorkerConfigurationInput, optFns ...func(*Options)) (*DescribeWorkerConfigurationOutput, error) { if params == nil { params = &DescribeWorkerConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeWorkerConfiguration", params, optFns, c.addOperationDescribeWorkerConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*DescribeWorkerConfigurationOutput) out.ResultMetadata = metadata return out, nil } type DescribeWorkerConfigurationInput struct { // The Amazon Resource Name (ARN) of the worker configuration that you want to get // information about. // // This member is required. WorkerConfigurationArn *string noSmithyDocumentSerde } type DescribeWorkerConfigurationOutput struct { // The time that the worker configuration was created. CreationTime *time.Time // The description of the worker configuration. Description *string // The latest revision of the custom configuration. LatestRevision *types.WorkerConfigurationRevisionDescription // The name of the worker configuration. Name *string // The Amazon Resource Name (ARN) of the custom configuration. WorkerConfigurationArn *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeWorkerConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeWorkerConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeWorkerConfiguration{}, 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 = addOpDescribeWorkerConfigurationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeWorkerConfiguration(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_opDescribeWorkerConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafkaconnect", OperationName: "DescribeWorkerConfiguration", } }
139
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafkaconnect 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/kafkaconnect/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of all the connectors in this account and Region. The list is // limited to connectors whose name starts with the specified prefix. The response // also includes a description of each of the listed connectors. func (c *Client) ListConnectors(ctx context.Context, params *ListConnectorsInput, optFns ...func(*Options)) (*ListConnectorsOutput, error) { if params == nil { params = &ListConnectorsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListConnectors", params, optFns, c.addOperationListConnectorsMiddlewares) if err != nil { return nil, err } out := result.(*ListConnectorsOutput) out.ResultMetadata = metadata return out, nil } type ListConnectorsInput struct { // The name prefix that you want to use to search for and list connectors. ConnectorNamePrefix *string // The maximum number of connectors to list in one response. MaxResults int32 // If the response of a ListConnectors operation is truncated, it will include a // NextToken. Send this NextToken in a subsequent request to continue listing from // where the previous operation left off. NextToken *string noSmithyDocumentSerde } type ListConnectorsOutput struct { // An array of connector descriptions. Connectors []types.ConnectorSummary // If the response of a ListConnectors operation is truncated, it will include a // NextToken. Send this NextToken in a subsequent request to continue listing from // where it left off. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListConnectorsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListConnectors{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListConnectors{}, 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_opListConnectors(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 } // ListConnectorsAPIClient is a client that implements the ListConnectors // operation. type ListConnectorsAPIClient interface { ListConnectors(context.Context, *ListConnectorsInput, ...func(*Options)) (*ListConnectorsOutput, error) } var _ ListConnectorsAPIClient = (*Client)(nil) // ListConnectorsPaginatorOptions is the paginator options for ListConnectors type ListConnectorsPaginatorOptions struct { // The maximum number of connectors to list in one response. 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 } // ListConnectorsPaginator is a paginator for ListConnectors type ListConnectorsPaginator struct { options ListConnectorsPaginatorOptions client ListConnectorsAPIClient params *ListConnectorsInput nextToken *string firstPage bool } // NewListConnectorsPaginator returns a new ListConnectorsPaginator func NewListConnectorsPaginator(client ListConnectorsAPIClient, params *ListConnectorsInput, optFns ...func(*ListConnectorsPaginatorOptions)) *ListConnectorsPaginator { if params == nil { params = &ListConnectorsInput{} } options := ListConnectorsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListConnectorsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListConnectorsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListConnectors page. func (p *ListConnectorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConnectorsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListConnectors(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_opListConnectors(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafkaconnect", OperationName: "ListConnectors", } }
222
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafkaconnect 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/kafkaconnect/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of all of the custom plugins in this account and Region. func (c *Client) ListCustomPlugins(ctx context.Context, params *ListCustomPluginsInput, optFns ...func(*Options)) (*ListCustomPluginsOutput, error) { if params == nil { params = &ListCustomPluginsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListCustomPlugins", params, optFns, c.addOperationListCustomPluginsMiddlewares) if err != nil { return nil, err } out := result.(*ListCustomPluginsOutput) out.ResultMetadata = metadata return out, nil } type ListCustomPluginsInput struct { // The maximum number of custom plugins to list in one response. MaxResults int32 // If the response of a ListCustomPlugins operation is truncated, it will include // a NextToken. Send this NextToken in a subsequent request to continue listing // from where the previous operation left off. NextToken *string noSmithyDocumentSerde } type ListCustomPluginsOutput struct { // An array of custom plugin descriptions. CustomPlugins []types.CustomPluginSummary // If the response of a ListCustomPlugins operation is truncated, it will include // a NextToken. Send this NextToken in a subsequent request to continue listing // from where the previous operation left off. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListCustomPluginsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListCustomPlugins{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListCustomPlugins{}, 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_opListCustomPlugins(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 } // ListCustomPluginsAPIClient is a client that implements the ListCustomPlugins // operation. type ListCustomPluginsAPIClient interface { ListCustomPlugins(context.Context, *ListCustomPluginsInput, ...func(*Options)) (*ListCustomPluginsOutput, error) } var _ ListCustomPluginsAPIClient = (*Client)(nil) // ListCustomPluginsPaginatorOptions is the paginator options for ListCustomPlugins type ListCustomPluginsPaginatorOptions struct { // The maximum number of custom plugins to list in one response. 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 } // ListCustomPluginsPaginator is a paginator for ListCustomPlugins type ListCustomPluginsPaginator struct { options ListCustomPluginsPaginatorOptions client ListCustomPluginsAPIClient params *ListCustomPluginsInput nextToken *string firstPage bool } // NewListCustomPluginsPaginator returns a new ListCustomPluginsPaginator func NewListCustomPluginsPaginator(client ListCustomPluginsAPIClient, params *ListCustomPluginsInput, optFns ...func(*ListCustomPluginsPaginatorOptions)) *ListCustomPluginsPaginator { if params == nil { params = &ListCustomPluginsInput{} } options := ListCustomPluginsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListCustomPluginsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListCustomPluginsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListCustomPlugins page. func (p *ListCustomPluginsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCustomPluginsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListCustomPlugins(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_opListCustomPlugins(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafkaconnect", OperationName: "ListCustomPlugins", } }
217
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafkaconnect 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/kafkaconnect/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a list of all of the worker configurations in this account and Region. func (c *Client) ListWorkerConfigurations(ctx context.Context, params *ListWorkerConfigurationsInput, optFns ...func(*Options)) (*ListWorkerConfigurationsOutput, error) { if params == nil { params = &ListWorkerConfigurationsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListWorkerConfigurations", params, optFns, c.addOperationListWorkerConfigurationsMiddlewares) if err != nil { return nil, err } out := result.(*ListWorkerConfigurationsOutput) out.ResultMetadata = metadata return out, nil } type ListWorkerConfigurationsInput struct { // The maximum number of worker configurations to list in one response. MaxResults int32 // If the response of a ListWorkerConfigurations operation is truncated, it will // include a NextToken. Send this NextToken in a subsequent request to continue // listing from where the previous operation left off. NextToken *string noSmithyDocumentSerde } type ListWorkerConfigurationsOutput struct { // If the response of a ListWorkerConfigurations operation is truncated, it will // include a NextToken. Send this NextToken in a subsequent request to continue // listing from where the previous operation left off. NextToken *string // An array of worker configuration descriptions. WorkerConfigurations []types.WorkerConfigurationSummary // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListWorkerConfigurationsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListWorkerConfigurations{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListWorkerConfigurations{}, 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_opListWorkerConfigurations(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 } // ListWorkerConfigurationsAPIClient is a client that implements the // ListWorkerConfigurations operation. type ListWorkerConfigurationsAPIClient interface { ListWorkerConfigurations(context.Context, *ListWorkerConfigurationsInput, ...func(*Options)) (*ListWorkerConfigurationsOutput, error) } var _ ListWorkerConfigurationsAPIClient = (*Client)(nil) // ListWorkerConfigurationsPaginatorOptions is the paginator options for // ListWorkerConfigurations type ListWorkerConfigurationsPaginatorOptions struct { // The maximum number of worker configurations to list in one response. 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 } // ListWorkerConfigurationsPaginator is a paginator for ListWorkerConfigurations type ListWorkerConfigurationsPaginator struct { options ListWorkerConfigurationsPaginatorOptions client ListWorkerConfigurationsAPIClient params *ListWorkerConfigurationsInput nextToken *string firstPage bool } // NewListWorkerConfigurationsPaginator returns a new // ListWorkerConfigurationsPaginator func NewListWorkerConfigurationsPaginator(client ListWorkerConfigurationsAPIClient, params *ListWorkerConfigurationsInput, optFns ...func(*ListWorkerConfigurationsPaginatorOptions)) *ListWorkerConfigurationsPaginator { if params == nil { params = &ListWorkerConfigurationsInput{} } options := ListWorkerConfigurationsPaginatorOptions{} if params.MaxResults != 0 { options.Limit = params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListWorkerConfigurationsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListWorkerConfigurationsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListWorkerConfigurations page. func (p *ListWorkerConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkerConfigurationsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken params.MaxResults = p.options.Limit result, err := p.client.ListWorkerConfigurations(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_opListWorkerConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafkaconnect", OperationName: "ListWorkerConfigurations", } }
219
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafkaconnect 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/kafkaconnect/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates the specified connector. func (c *Client) UpdateConnector(ctx context.Context, params *UpdateConnectorInput, optFns ...func(*Options)) (*UpdateConnectorOutput, error) { if params == nil { params = &UpdateConnectorInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateConnector", params, optFns, c.addOperationUpdateConnectorMiddlewares) if err != nil { return nil, err } out := result.(*UpdateConnectorOutput) out.ResultMetadata = metadata return out, nil } type UpdateConnectorInput struct { // The target capacity. // // This member is required. Capacity *types.CapacityUpdate // The Amazon Resource Name (ARN) of the connector that you want to update. // // This member is required. ConnectorArn *string // The current version of the connector that you want to update. // // This member is required. CurrentVersion *string noSmithyDocumentSerde } type UpdateConnectorOutput struct { // The Amazon Resource Name (ARN) of the connector. ConnectorArn *string // The state of the connector. ConnectorState types.ConnectorState // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateConnectorMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateConnector{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateConnector{}, 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 = addOpUpdateConnectorValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateConnector(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_opUpdateConnector(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kafkaconnect", OperationName: "UpdateConnector", } }
138
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafkaconnect import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/kafkaconnect/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_deserializeOpCreateConnector struct { } func (*awsRestjson1_deserializeOpCreateConnector) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateConnector) 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_deserializeOpErrorCreateConnector(response, &metadata) } output := &CreateConnectorOutput{} 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_deserializeOpDocumentCreateConnectorOutput(&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_deserializeOpErrorCreateConnector(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateConnectorOutput(v **CreateConnectorOutput, 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 *CreateConnectorOutput if *v == nil { sv = &CreateConnectorOutput{} } else { sv = *v } for key, value := range shape { switch key { case "connectorArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ConnectorArn = ptr.String(jtv) } case "connectorName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ConnectorName = ptr.String(jtv) } case "connectorState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConnectorState to be of type string, got %T instead", value) } sv.ConnectorState = types.ConnectorState(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateCustomPlugin struct { } func (*awsRestjson1_deserializeOpCreateCustomPlugin) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateCustomPlugin) 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_deserializeOpErrorCreateCustomPlugin(response, &metadata) } output := &CreateCustomPluginOutput{} 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_deserializeOpDocumentCreateCustomPluginOutput(&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_deserializeOpErrorCreateCustomPlugin(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateCustomPluginOutput(v **CreateCustomPluginOutput, 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 *CreateCustomPluginOutput if *v == nil { sv = &CreateCustomPluginOutput{} } else { sv = *v } for key, value := range shape { switch key { case "customPluginArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.CustomPluginArn = ptr.String(jtv) } case "customPluginState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CustomPluginState to be of type string, got %T instead", value) } sv.CustomPluginState = types.CustomPluginState(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 "revision": 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.Revision = i64 } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpCreateWorkerConfiguration struct { } func (*awsRestjson1_deserializeOpCreateWorkerConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateWorkerConfiguration) 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_deserializeOpErrorCreateWorkerConfiguration(response, &metadata) } output := &CreateWorkerConfigurationOutput{} 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_deserializeOpDocumentCreateWorkerConfigurationOutput(&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_deserializeOpErrorCreateWorkerConfiguration(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentCreateWorkerConfigurationOutput(v **CreateWorkerConfigurationOutput, 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 *CreateWorkerConfigurationOutput if *v == nil { sv = &CreateWorkerConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationTime = ptr.Time(t) } case "latestRevision": if err := awsRestjson1_deserializeDocumentWorkerConfigurationRevisionSummary(&sv.LatestRevision, value); err != nil { return err } 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 "workerConfigurationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.WorkerConfigurationArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteConnector struct { } func (*awsRestjson1_deserializeOpDeleteConnector) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteConnector) 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_deserializeOpErrorDeleteConnector(response, &metadata) } output := &DeleteConnectorOutput{} 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_deserializeOpDocumentDeleteConnectorOutput(&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_deserializeOpErrorDeleteConnector(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeleteConnectorOutput(v **DeleteConnectorOutput, 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 *DeleteConnectorOutput if *v == nil { sv = &DeleteConnectorOutput{} } else { sv = *v } for key, value := range shape { switch key { case "connectorArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ConnectorArn = ptr.String(jtv) } case "connectorState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConnectorState to be of type string, got %T instead", value) } sv.ConnectorState = types.ConnectorState(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDeleteCustomPlugin struct { } func (*awsRestjson1_deserializeOpDeleteCustomPlugin) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteCustomPlugin) 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_deserializeOpErrorDeleteCustomPlugin(response, &metadata) } output := &DeleteCustomPluginOutput{} 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_deserializeOpDocumentDeleteCustomPluginOutput(&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_deserializeOpErrorDeleteCustomPlugin(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDeleteCustomPluginOutput(v **DeleteCustomPluginOutput, 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 *DeleteCustomPluginOutput if *v == nil { sv = &DeleteCustomPluginOutput{} } else { sv = *v } for key, value := range shape { switch key { case "customPluginArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.CustomPluginArn = ptr.String(jtv) } case "customPluginState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CustomPluginState to be of type string, got %T instead", value) } sv.CustomPluginState = types.CustomPluginState(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeConnector struct { } func (*awsRestjson1_deserializeOpDescribeConnector) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeConnector) 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_deserializeOpErrorDescribeConnector(response, &metadata) } output := &DescribeConnectorOutput{} 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_deserializeOpDocumentDescribeConnectorOutput(&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_deserializeOpErrorDescribeConnector(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeConnectorOutput(v **DescribeConnectorOutput, 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 *DescribeConnectorOutput if *v == nil { sv = &DescribeConnectorOutput{} } else { sv = *v } for key, value := range shape { switch key { case "capacity": if err := awsRestjson1_deserializeDocumentCapacityDescription(&sv.Capacity, value); err != nil { return err } case "connectorArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ConnectorArn = ptr.String(jtv) } case "connectorConfiguration": if err := awsRestjson1_deserializeDocument__sensitive__mapOf__string(&sv.ConnectorConfiguration, value); err != nil { return err } case "connectorDescription": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ConnectorDescription = ptr.String(jtv) } case "connectorName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ConnectorName = ptr.String(jtv) } case "connectorState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConnectorState to be of type string, got %T instead", value) } sv.ConnectorState = types.ConnectorState(jtv) } case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationTime = ptr.Time(t) } case "currentVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.CurrentVersion = ptr.String(jtv) } case "kafkaCluster": if err := awsRestjson1_deserializeDocumentKafkaClusterDescription(&sv.KafkaCluster, value); err != nil { return err } case "kafkaClusterClientAuthentication": if err := awsRestjson1_deserializeDocumentKafkaClusterClientAuthenticationDescription(&sv.KafkaClusterClientAuthentication, value); err != nil { return err } case "kafkaClusterEncryptionInTransit": if err := awsRestjson1_deserializeDocumentKafkaClusterEncryptionInTransitDescription(&sv.KafkaClusterEncryptionInTransit, value); err != nil { return err } case "kafkaConnectVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.KafkaConnectVersion = ptr.String(jtv) } case "logDelivery": if err := awsRestjson1_deserializeDocumentLogDeliveryDescription(&sv.LogDelivery, value); err != nil { return err } case "plugins": if err := awsRestjson1_deserializeDocument__listOfPluginDescription(&sv.Plugins, value); err != nil { return err } case "serviceExecutionRoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ServiceExecutionRoleArn = ptr.String(jtv) } case "stateDescription": if err := awsRestjson1_deserializeDocumentStateDescription(&sv.StateDescription, value); err != nil { return err } case "workerConfiguration": if err := awsRestjson1_deserializeDocumentWorkerConfigurationDescription(&sv.WorkerConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeCustomPlugin struct { } func (*awsRestjson1_deserializeOpDescribeCustomPlugin) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeCustomPlugin) 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_deserializeOpErrorDescribeCustomPlugin(response, &metadata) } output := &DescribeCustomPluginOutput{} 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_deserializeOpDocumentDescribeCustomPluginOutput(&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_deserializeOpErrorDescribeCustomPlugin(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeCustomPluginOutput(v **DescribeCustomPluginOutput, 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 *DescribeCustomPluginOutput if *v == nil { sv = &DescribeCustomPluginOutput{} } else { sv = *v } for key, value := range shape { switch key { case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationTime = ptr.Time(t) } case "customPluginArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.CustomPluginArn = ptr.String(jtv) } case "customPluginState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CustomPluginState to be of type string, got %T instead", value) } sv.CustomPluginState = types.CustomPluginState(jtv) } 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 "latestRevision": if err := awsRestjson1_deserializeDocumentCustomPluginRevisionSummary(&sv.LatestRevision, value); err != nil { return err } 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 "stateDescription": if err := awsRestjson1_deserializeDocumentStateDescription(&sv.StateDescription, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeWorkerConfiguration struct { } func (*awsRestjson1_deserializeOpDescribeWorkerConfiguration) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeWorkerConfiguration) 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_deserializeOpErrorDescribeWorkerConfiguration(response, &metadata) } output := &DescribeWorkerConfigurationOutput{} 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_deserializeOpDocumentDescribeWorkerConfigurationOutput(&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_deserializeOpErrorDescribeWorkerConfiguration(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeWorkerConfigurationOutput(v **DescribeWorkerConfigurationOutput, 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 *DescribeWorkerConfigurationOutput if *v == nil { sv = &DescribeWorkerConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationTime = ptr.Time(t) } 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 "latestRevision": if err := awsRestjson1_deserializeDocumentWorkerConfigurationRevisionDescription(&sv.LatestRevision, value); err != nil { return err } 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 "workerConfigurationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.WorkerConfigurationArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListConnectors struct { } func (*awsRestjson1_deserializeOpListConnectors) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListConnectors) 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_deserializeOpErrorListConnectors(response, &metadata) } output := &ListConnectorsOutput{} 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_deserializeOpDocumentListConnectorsOutput(&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_deserializeOpErrorListConnectors(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListConnectorsOutput(v **ListConnectorsOutput, 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 *ListConnectorsOutput if *v == nil { sv = &ListConnectorsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "connectors": if err := awsRestjson1_deserializeDocument__listOfConnectorSummary(&sv.Connectors, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListCustomPlugins struct { } func (*awsRestjson1_deserializeOpListCustomPlugins) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListCustomPlugins) 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_deserializeOpErrorListCustomPlugins(response, &metadata) } output := &ListCustomPluginsOutput{} 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_deserializeOpDocumentListCustomPluginsOutput(&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_deserializeOpErrorListCustomPlugins(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListCustomPluginsOutput(v **ListCustomPluginsOutput, 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 *ListCustomPluginsOutput if *v == nil { sv = &ListCustomPluginsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "customPlugins": if err := awsRestjson1_deserializeDocument__listOfCustomPluginSummary(&sv.CustomPlugins, value); err != nil { return err } case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListWorkerConfigurations struct { } func (*awsRestjson1_deserializeOpListWorkerConfigurations) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListWorkerConfigurations) 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_deserializeOpErrorListWorkerConfigurations(response, &metadata) } output := &ListWorkerConfigurationsOutput{} 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_deserializeOpDocumentListWorkerConfigurationsOutput(&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_deserializeOpErrorListWorkerConfigurations(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListWorkerConfigurationsOutput(v **ListWorkerConfigurationsOutput, 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 *ListWorkerConfigurationsOutput if *v == nil { sv = &ListWorkerConfigurationsOutput{} } 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 __string to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "workerConfigurations": if err := awsRestjson1_deserializeDocument__listOfWorkerConfigurationSummary(&sv.WorkerConfigurations, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpUpdateConnector struct { } func (*awsRestjson1_deserializeOpUpdateConnector) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUpdateConnector) 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_deserializeOpErrorUpdateConnector(response, &metadata) } output := &UpdateConnectorOutput{} 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_deserializeOpDocumentUpdateConnectorOutput(&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_deserializeOpErrorUpdateConnector(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("BadRequestException", errorCode): return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InternalServerErrorException", errorCode): return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody) case strings.EqualFold("NotFoundException", errorCode): return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("TooManyRequestsException", errorCode): return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentUpdateConnectorOutput(v **UpdateConnectorOutput, 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 *UpdateConnectorOutput if *v == nil { sv = &UpdateConnectorOutput{} } else { sv = *v } for key, value := range shape { switch key { case "connectorArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ConnectorArn = ptr.String(jtv) } case "connectorState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConnectorState to be of type string, got %T instead", value) } sv.ConnectorState = types.ConnectorState(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeErrorBadRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.BadRequestException{} 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_deserializeDocumentBadRequestException(&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_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ConflictException{} 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_deserializeDocumentConflictException(&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_deserializeErrorForbiddenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ForbiddenException{} 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_deserializeDocumentForbiddenException(&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_deserializeErrorInternalServerErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InternalServerErrorException{} 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_deserializeDocumentInternalServerErrorException(&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_deserializeErrorNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.NotFoundException{} 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_deserializeDocumentNotFoundException(&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_deserializeErrorServiceUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ServiceUnavailableException{} 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_deserializeDocumentServiceUnavailableException(&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_deserializeErrorTooManyRequestsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.TooManyRequestsException{} 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_deserializeDocumentTooManyRequestsException(&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_deserializeErrorUnauthorizedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.UnauthorizedException{} 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_deserializeDocumentUnauthorizedException(&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_deserializeDocument__listOf__string(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var cv []string if *v == nil { cv = []string{} } else { cv = *v } for _, value := range shape { var col string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfConnectorSummary(v *[]types.ConnectorSummary, 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.ConnectorSummary if *v == nil { cv = []types.ConnectorSummary{} } else { cv = *v } for _, value := range shape { var col types.ConnectorSummary destAddr := &col if err := awsRestjson1_deserializeDocumentConnectorSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfCustomPluginSummary(v *[]types.CustomPluginSummary, 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.CustomPluginSummary if *v == nil { cv = []types.CustomPluginSummary{} } else { cv = *v } for _, value := range shape { var col types.CustomPluginSummary destAddr := &col if err := awsRestjson1_deserializeDocumentCustomPluginSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfPluginDescription(v *[]types.PluginDescription, 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.PluginDescription if *v == nil { cv = []types.PluginDescription{} } else { cv = *v } for _, value := range shape { var col types.PluginDescription destAddr := &col if err := awsRestjson1_deserializeDocumentPluginDescription(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__listOfWorkerConfigurationSummary(v *[]types.WorkerConfigurationSummary, 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.WorkerConfigurationSummary if *v == nil { cv = []types.WorkerConfigurationSummary{} } else { cv = *v } for _, value := range shape { var col types.WorkerConfigurationSummary destAddr := &col if err := awsRestjson1_deserializeDocumentWorkerConfigurationSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocument__sensitive__mapOf__string(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 __string to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentApacheKafkaClusterDescription(v **types.ApacheKafkaClusterDescription, 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.ApacheKafkaClusterDescription if *v == nil { sv = &types.ApacheKafkaClusterDescription{} } else { sv = *v } for key, value := range shape { switch key { case "bootstrapServers": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.BootstrapServers = ptr.String(jtv) } case "vpc": if err := awsRestjson1_deserializeDocumentVpcDescription(&sv.Vpc, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAutoScalingDescription(v **types.AutoScalingDescription, 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.AutoScalingDescription if *v == nil { sv = &types.AutoScalingDescription{} } else { sv = *v } for key, value := range shape { switch key { case "maxWorkerCount": 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.MaxWorkerCount = int32(i64) } case "mcuCount": 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.McuCount = int32(i64) } case "minWorkerCount": 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.MinWorkerCount = int32(i64) } case "scaleInPolicy": if err := awsRestjson1_deserializeDocumentScaleInPolicyDescription(&sv.ScaleInPolicy, value); err != nil { return err } case "scaleOutPolicy": if err := awsRestjson1_deserializeDocumentScaleOutPolicyDescription(&sv.ScaleOutPolicy, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentBadRequestException(v **types.BadRequestException, 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.BadRequestException if *v == nil { sv = &types.BadRequestException{} } 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_deserializeDocumentCapacityDescription(v **types.CapacityDescription, 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.CapacityDescription if *v == nil { sv = &types.CapacityDescription{} } else { sv = *v } for key, value := range shape { switch key { case "autoScaling": if err := awsRestjson1_deserializeDocumentAutoScalingDescription(&sv.AutoScaling, value); err != nil { return err } case "provisionedCapacity": if err := awsRestjson1_deserializeDocumentProvisionedCapacityDescription(&sv.ProvisionedCapacity, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCloudWatchLogsLogDeliveryDescription(v **types.CloudWatchLogsLogDeliveryDescription, 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.CloudWatchLogsLogDeliveryDescription if *v == nil { sv = &types.CloudWatchLogsLogDeliveryDescription{} } else { sv = *v } for key, value := range shape { switch key { case "enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } case "logGroup": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.LogGroup = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, 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.ConflictException if *v == nil { sv = &types.ConflictException{} } 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_deserializeDocumentConnectorSummary(v **types.ConnectorSummary, 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.ConnectorSummary if *v == nil { sv = &types.ConnectorSummary{} } else { sv = *v } for key, value := range shape { switch key { case "capacity": if err := awsRestjson1_deserializeDocumentCapacityDescription(&sv.Capacity, value); err != nil { return err } case "connectorArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ConnectorArn = ptr.String(jtv) } case "connectorDescription": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ConnectorDescription = ptr.String(jtv) } case "connectorName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ConnectorName = ptr.String(jtv) } case "connectorState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConnectorState to be of type string, got %T instead", value) } sv.ConnectorState = types.ConnectorState(jtv) } case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationTime = ptr.Time(t) } case "currentVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.CurrentVersion = ptr.String(jtv) } case "kafkaCluster": if err := awsRestjson1_deserializeDocumentKafkaClusterDescription(&sv.KafkaCluster, value); err != nil { return err } case "kafkaClusterClientAuthentication": if err := awsRestjson1_deserializeDocumentKafkaClusterClientAuthenticationDescription(&sv.KafkaClusterClientAuthentication, value); err != nil { return err } case "kafkaClusterEncryptionInTransit": if err := awsRestjson1_deserializeDocumentKafkaClusterEncryptionInTransitDescription(&sv.KafkaClusterEncryptionInTransit, value); err != nil { return err } case "kafkaConnectVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.KafkaConnectVersion = ptr.String(jtv) } case "logDelivery": if err := awsRestjson1_deserializeDocumentLogDeliveryDescription(&sv.LogDelivery, value); err != nil { return err } case "plugins": if err := awsRestjson1_deserializeDocument__listOfPluginDescription(&sv.Plugins, value); err != nil { return err } case "serviceExecutionRoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ServiceExecutionRoleArn = ptr.String(jtv) } case "workerConfiguration": if err := awsRestjson1_deserializeDocumentWorkerConfigurationDescription(&sv.WorkerConfiguration, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCustomPluginDescription(v **types.CustomPluginDescription, 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.CustomPluginDescription if *v == nil { sv = &types.CustomPluginDescription{} } else { sv = *v } for key, value := range shape { switch key { case "customPluginArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.CustomPluginArn = ptr.String(jtv) } case "revision": 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.Revision = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCustomPluginFileDescription(v **types.CustomPluginFileDescription, 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.CustomPluginFileDescription if *v == nil { sv = &types.CustomPluginFileDescription{} } else { sv = *v } for key, value := range shape { switch key { case "fileMd5": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.FileMd5 = ptr.String(jtv) } case "fileSize": 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.FileSize = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCustomPluginLocationDescription(v **types.CustomPluginLocationDescription, 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.CustomPluginLocationDescription if *v == nil { sv = &types.CustomPluginLocationDescription{} } else { sv = *v } for key, value := range shape { switch key { case "s3Location": if err := awsRestjson1_deserializeDocumentS3LocationDescription(&sv.S3Location, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCustomPluginRevisionSummary(v **types.CustomPluginRevisionSummary, 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.CustomPluginRevisionSummary if *v == nil { sv = &types.CustomPluginRevisionSummary{} } else { sv = *v } for key, value := range shape { switch key { case "contentType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CustomPluginContentType to be of type string, got %T instead", value) } sv.ContentType = types.CustomPluginContentType(jtv) } case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationTime = ptr.Time(t) } 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 "fileDescription": if err := awsRestjson1_deserializeDocumentCustomPluginFileDescription(&sv.FileDescription, value); err != nil { return err } case "location": if err := awsRestjson1_deserializeDocumentCustomPluginLocationDescription(&sv.Location, value); err != nil { return err } case "revision": 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.Revision = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentCustomPluginSummary(v **types.CustomPluginSummary, 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.CustomPluginSummary if *v == nil { sv = &types.CustomPluginSummary{} } else { sv = *v } for key, value := range shape { switch key { case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationTime = ptr.Time(t) } case "customPluginArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.CustomPluginArn = ptr.String(jtv) } case "customPluginState": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected CustomPluginState to be of type string, got %T instead", value) } sv.CustomPluginState = types.CustomPluginState(jtv) } 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 "latestRevision": if err := awsRestjson1_deserializeDocumentCustomPluginRevisionSummary(&sv.LatestRevision, value); err != nil { return err } 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) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentFirehoseLogDeliveryDescription(v **types.FirehoseLogDeliveryDescription, 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.FirehoseLogDeliveryDescription if *v == nil { sv = &types.FirehoseLogDeliveryDescription{} } else { sv = *v } for key, value := range shape { switch key { case "deliveryStream": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.DeliveryStream = ptr.String(jtv) } case "enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentForbiddenException(v **types.ForbiddenException, 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.ForbiddenException if *v == nil { sv = &types.ForbiddenException{} } 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_deserializeDocumentInternalServerErrorException(v **types.InternalServerErrorException, 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.InternalServerErrorException if *v == nil { sv = &types.InternalServerErrorException{} } 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_deserializeDocumentKafkaClusterClientAuthenticationDescription(v **types.KafkaClusterClientAuthenticationDescription, 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.KafkaClusterClientAuthenticationDescription if *v == nil { sv = &types.KafkaClusterClientAuthenticationDescription{} } else { sv = *v } for key, value := range shape { switch key { case "authenticationType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected KafkaClusterClientAuthenticationType to be of type string, got %T instead", value) } sv.AuthenticationType = types.KafkaClusterClientAuthenticationType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentKafkaClusterDescription(v **types.KafkaClusterDescription, 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.KafkaClusterDescription if *v == nil { sv = &types.KafkaClusterDescription{} } else { sv = *v } for key, value := range shape { switch key { case "apacheKafkaCluster": if err := awsRestjson1_deserializeDocumentApacheKafkaClusterDescription(&sv.ApacheKafkaCluster, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentKafkaClusterEncryptionInTransitDescription(v **types.KafkaClusterEncryptionInTransitDescription, 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.KafkaClusterEncryptionInTransitDescription if *v == nil { sv = &types.KafkaClusterEncryptionInTransitDescription{} } else { sv = *v } for key, value := range shape { switch key { case "encryptionType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected KafkaClusterEncryptionInTransitType to be of type string, got %T instead", value) } sv.EncryptionType = types.KafkaClusterEncryptionInTransitType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLogDeliveryDescription(v **types.LogDeliveryDescription, 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.LogDeliveryDescription if *v == nil { sv = &types.LogDeliveryDescription{} } else { sv = *v } for key, value := range shape { switch key { case "workerLogDelivery": if err := awsRestjson1_deserializeDocumentWorkerLogDeliveryDescription(&sv.WorkerLogDelivery, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentNotFoundException(v **types.NotFoundException, 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.NotFoundException if *v == nil { sv = &types.NotFoundException{} } 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_deserializeDocumentPluginDescription(v **types.PluginDescription, 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.PluginDescription if *v == nil { sv = &types.PluginDescription{} } else { sv = *v } for key, value := range shape { switch key { case "customPlugin": if err := awsRestjson1_deserializeDocumentCustomPluginDescription(&sv.CustomPlugin, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentProvisionedCapacityDescription(v **types.ProvisionedCapacityDescription, 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.ProvisionedCapacityDescription if *v == nil { sv = &types.ProvisionedCapacityDescription{} } else { sv = *v } for key, value := range shape { switch key { case "mcuCount": 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.McuCount = int32(i64) } case "workerCount": 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.WorkerCount = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentS3LocationDescription(v **types.S3LocationDescription, 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.S3LocationDescription if *v == nil { sv = &types.S3LocationDescription{} } else { sv = *v } for key, value := range shape { switch key { case "bucketArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.BucketArn = ptr.String(jtv) } case "fileKey": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.FileKey = ptr.String(jtv) } case "objectVersion": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.ObjectVersion = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentS3LogDeliveryDescription(v **types.S3LogDeliveryDescription, 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.S3LogDeliveryDescription if *v == nil { sv = &types.S3LogDeliveryDescription{} } else { sv = *v } for key, value := range shape { switch key { case "bucket": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Bucket = ptr.String(jtv) } case "enabled": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) } sv.Enabled = jtv } case "prefix": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Prefix = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentScaleInPolicyDescription(v **types.ScaleInPolicyDescription, 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.ScaleInPolicyDescription if *v == nil { sv = &types.ScaleInPolicyDescription{} } else { sv = *v } for key, value := range shape { switch key { case "cpuUtilizationPercentage": 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.CpuUtilizationPercentage = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentScaleOutPolicyDescription(v **types.ScaleOutPolicyDescription, 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.ScaleOutPolicyDescription if *v == nil { sv = &types.ScaleOutPolicyDescription{} } else { sv = *v } for key, value := range shape { switch key { case "cpuUtilizationPercentage": 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.CpuUtilizationPercentage = int32(i64) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentServiceUnavailableException(v **types.ServiceUnavailableException, 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.ServiceUnavailableException if *v == nil { sv = &types.ServiceUnavailableException{} } 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_deserializeDocumentStateDescription(v **types.StateDescription, 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.StateDescription if *v == nil { sv = &types.StateDescription{} } else { sv = *v } for key, value := range shape { switch key { case "code": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.Code = ptr.String(jtv) } 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_deserializeDocumentTooManyRequestsException(v **types.TooManyRequestsException, 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.TooManyRequestsException if *v == nil { sv = &types.TooManyRequestsException{} } 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_deserializeDocumentUnauthorizedException(v **types.UnauthorizedException, 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.UnauthorizedException if *v == nil { sv = &types.UnauthorizedException{} } 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_deserializeDocumentVpcDescription(v **types.VpcDescription, 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.VpcDescription if *v == nil { sv = &types.VpcDescription{} } else { sv = *v } for key, value := range shape { switch key { case "securityGroups": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.SecurityGroups, value); err != nil { return err } case "subnets": if err := awsRestjson1_deserializeDocument__listOf__string(&sv.Subnets, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWorkerConfigurationDescription(v **types.WorkerConfigurationDescription, 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.WorkerConfigurationDescription if *v == nil { sv = &types.WorkerConfigurationDescription{} } else { sv = *v } for key, value := range shape { switch key { case "revision": 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.Revision = i64 } case "workerConfigurationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.WorkerConfigurationArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWorkerConfigurationRevisionDescription(v **types.WorkerConfigurationRevisionDescription, 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.WorkerConfigurationRevisionDescription if *v == nil { sv = &types.WorkerConfigurationRevisionDescription{} } else { sv = *v } for key, value := range shape { switch key { case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationTime = ptr.Time(t) } 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 "propertiesFileContent": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __sensitiveString to be of type string, got %T instead", value) } sv.PropertiesFileContent = ptr.String(jtv) } case "revision": 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.Revision = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWorkerConfigurationRevisionSummary(v **types.WorkerConfigurationRevisionSummary, 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.WorkerConfigurationRevisionSummary if *v == nil { sv = &types.WorkerConfigurationRevisionSummary{} } else { sv = *v } for key, value := range shape { switch key { case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationTime = ptr.Time(t) } 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 "revision": 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.Revision = i64 } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWorkerConfigurationSummary(v **types.WorkerConfigurationSummary, 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.WorkerConfigurationSummary if *v == nil { sv = &types.WorkerConfigurationSummary{} } else { sv = *v } for key, value := range shape { switch key { case "creationTime": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __timestampIso8601 to be of type string, got %T instead", value) } t, err := smithytime.ParseDateTime(jtv) if err != nil { return err } sv.CreationTime = ptr.Time(t) } 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 "latestRevision": if err := awsRestjson1_deserializeDocumentWorkerConfigurationRevisionSummary(&sv.LatestRevision, value); err != nil { return err } 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 "workerConfigurationArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected __string to be of type string, got %T instead", value) } sv.WorkerConfigurationArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentWorkerLogDeliveryDescription(v **types.WorkerLogDeliveryDescription, 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.WorkerLogDeliveryDescription if *v == nil { sv = &types.WorkerLogDeliveryDescription{} } else { sv = *v } for key, value := range shape { switch key { case "cloudWatchLogs": if err := awsRestjson1_deserializeDocumentCloudWatchLogsLogDeliveryDescription(&sv.CloudWatchLogs, value); err != nil { return err } case "firehose": if err := awsRestjson1_deserializeDocumentFirehoseLogDeliveryDescription(&sv.Firehose, value); err != nil { return err } case "s3": if err := awsRestjson1_deserializeDocumentS3LogDeliveryDescription(&sv.S3, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil }
4,763
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package kafkaconnect provides the API client, operations, and parameter types // for Managed Streaming for Kafka Connect. package kafkaconnect
6
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafkaconnect 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/kafkaconnect/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 = "kafkaconnect" } 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 kafkaconnect // goModuleVersion is the tagged release for this module const goModuleVersion = "1.9.12"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafkaconnect
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafkaconnect import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/kafkaconnect/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" smithyhttp "github.com/aws/smithy-go/transport/http" ) type awsRestjson1_serializeOpCreateConnector struct { } func (*awsRestjson1_serializeOpCreateConnector) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateConnector) 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.(*CreateConnectorInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/connectors") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateConnectorInput(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_serializeOpHttpBindingsCreateConnectorInput(v *CreateConnectorInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateConnectorInput(v *CreateConnectorInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Capacity != nil { ok := object.Key("capacity") if err := awsRestjson1_serializeDocumentCapacity(v.Capacity, ok); err != nil { return err } } if v.ConnectorConfiguration != nil { ok := object.Key("connectorConfiguration") if err := awsRestjson1_serializeDocument__sensitive__mapOf__string(v.ConnectorConfiguration, ok); err != nil { return err } } if v.ConnectorDescription != nil { ok := object.Key("connectorDescription") ok.String(*v.ConnectorDescription) } if v.ConnectorName != nil { ok := object.Key("connectorName") ok.String(*v.ConnectorName) } if v.KafkaCluster != nil { ok := object.Key("kafkaCluster") if err := awsRestjson1_serializeDocumentKafkaCluster(v.KafkaCluster, ok); err != nil { return err } } if v.KafkaClusterClientAuthentication != nil { ok := object.Key("kafkaClusterClientAuthentication") if err := awsRestjson1_serializeDocumentKafkaClusterClientAuthentication(v.KafkaClusterClientAuthentication, ok); err != nil { return err } } if v.KafkaClusterEncryptionInTransit != nil { ok := object.Key("kafkaClusterEncryptionInTransit") if err := awsRestjson1_serializeDocumentKafkaClusterEncryptionInTransit(v.KafkaClusterEncryptionInTransit, ok); err != nil { return err } } if v.KafkaConnectVersion != nil { ok := object.Key("kafkaConnectVersion") ok.String(*v.KafkaConnectVersion) } if v.LogDelivery != nil { ok := object.Key("logDelivery") if err := awsRestjson1_serializeDocumentLogDelivery(v.LogDelivery, ok); err != nil { return err } } if v.Plugins != nil { ok := object.Key("plugins") if err := awsRestjson1_serializeDocument__listOfPlugin(v.Plugins, ok); err != nil { return err } } if v.ServiceExecutionRoleArn != nil { ok := object.Key("serviceExecutionRoleArn") ok.String(*v.ServiceExecutionRoleArn) } if v.WorkerConfiguration != nil { ok := object.Key("workerConfiguration") if err := awsRestjson1_serializeDocumentWorkerConfiguration(v.WorkerConfiguration, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpCreateCustomPlugin struct { } func (*awsRestjson1_serializeOpCreateCustomPlugin) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateCustomPlugin) 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.(*CreateCustomPluginInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/custom-plugins") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateCustomPluginInput(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_serializeOpHttpBindingsCreateCustomPluginInput(v *CreateCustomPluginInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateCustomPluginInput(v *CreateCustomPluginInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.ContentType) > 0 { ok := object.Key("contentType") ok.String(string(v.ContentType)) } if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.Location != nil { ok := object.Key("location") if err := awsRestjson1_serializeDocumentCustomPluginLocation(v.Location, ok); err != nil { return err } } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } return nil } type awsRestjson1_serializeOpCreateWorkerConfiguration struct { } func (*awsRestjson1_serializeOpCreateWorkerConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateWorkerConfiguration) 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.(*CreateWorkerConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/worker-configurations") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentCreateWorkerConfigurationInput(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_serializeOpHttpBindingsCreateWorkerConfigurationInput(v *CreateWorkerConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateWorkerConfigurationInput(v *CreateWorkerConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.PropertiesFileContent != nil { ok := object.Key("propertiesFileContent") ok.String(*v.PropertiesFileContent) } return nil } type awsRestjson1_serializeOpDeleteConnector struct { } func (*awsRestjson1_serializeOpDeleteConnector) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteConnector) 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.(*DeleteConnectorInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/connectors/{connectorArn}") 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_serializeOpHttpBindingsDeleteConnectorInput(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_serializeOpHttpBindingsDeleteConnectorInput(v *DeleteConnectorInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ConnectorArn == nil || len(*v.ConnectorArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member connectorArn must not be empty")} } if v.ConnectorArn != nil { if err := encoder.SetURI("connectorArn").String(*v.ConnectorArn); err != nil { return err } } if v.CurrentVersion != nil { encoder.SetQuery("currentVersion").String(*v.CurrentVersion) } return nil } type awsRestjson1_serializeOpDeleteCustomPlugin struct { } func (*awsRestjson1_serializeOpDeleteCustomPlugin) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteCustomPlugin) 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.(*DeleteCustomPluginInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/custom-plugins/{customPluginArn}") 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_serializeOpHttpBindingsDeleteCustomPluginInput(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_serializeOpHttpBindingsDeleteCustomPluginInput(v *DeleteCustomPluginInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.CustomPluginArn == nil || len(*v.CustomPluginArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member customPluginArn must not be empty")} } if v.CustomPluginArn != nil { if err := encoder.SetURI("customPluginArn").String(*v.CustomPluginArn); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeConnector struct { } func (*awsRestjson1_serializeOpDescribeConnector) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeConnector) 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.(*DescribeConnectorInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/connectors/{connectorArn}") 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_serializeOpHttpBindingsDescribeConnectorInput(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_serializeOpHttpBindingsDescribeConnectorInput(v *DescribeConnectorInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ConnectorArn == nil || len(*v.ConnectorArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member connectorArn must not be empty")} } if v.ConnectorArn != nil { if err := encoder.SetURI("connectorArn").String(*v.ConnectorArn); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeCustomPlugin struct { } func (*awsRestjson1_serializeOpDescribeCustomPlugin) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeCustomPlugin) 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.(*DescribeCustomPluginInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/custom-plugins/{customPluginArn}") 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_serializeOpHttpBindingsDescribeCustomPluginInput(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_serializeOpHttpBindingsDescribeCustomPluginInput(v *DescribeCustomPluginInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.CustomPluginArn == nil || len(*v.CustomPluginArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member customPluginArn must not be empty")} } if v.CustomPluginArn != nil { if err := encoder.SetURI("customPluginArn").String(*v.CustomPluginArn); err != nil { return err } } return nil } type awsRestjson1_serializeOpDescribeWorkerConfiguration struct { } func (*awsRestjson1_serializeOpDescribeWorkerConfiguration) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeWorkerConfiguration) 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.(*DescribeWorkerConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/worker-configurations/{workerConfigurationArn}") 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_serializeOpHttpBindingsDescribeWorkerConfigurationInput(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_serializeOpHttpBindingsDescribeWorkerConfigurationInput(v *DescribeWorkerConfigurationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.WorkerConfigurationArn == nil || len(*v.WorkerConfigurationArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member workerConfigurationArn must not be empty")} } if v.WorkerConfigurationArn != nil { if err := encoder.SetURI("workerConfigurationArn").String(*v.WorkerConfigurationArn); err != nil { return err } } return nil } type awsRestjson1_serializeOpListConnectors struct { } func (*awsRestjson1_serializeOpListConnectors) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListConnectors) 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.(*ListConnectorsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/connectors") 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_serializeOpHttpBindingsListConnectorsInput(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_serializeOpHttpBindingsListConnectorsInput(v *ListConnectorsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ConnectorNamePrefix != nil { encoder.SetQuery("connectorNamePrefix").String(*v.ConnectorNamePrefix) } if v.MaxResults != 0 { encoder.SetQuery("maxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListCustomPlugins struct { } func (*awsRestjson1_serializeOpListCustomPlugins) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListCustomPlugins) 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.(*ListCustomPluginsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/custom-plugins") 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_serializeOpHttpBindingsListCustomPluginsInput(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_serializeOpHttpBindingsListCustomPluginsInput(v *ListCustomPluginsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MaxResults != 0 { encoder.SetQuery("maxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListWorkerConfigurations struct { } func (*awsRestjson1_serializeOpListWorkerConfigurations) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListWorkerConfigurations) 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.(*ListWorkerConfigurationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/worker-configurations") 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_serializeOpHttpBindingsListWorkerConfigurationsInput(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_serializeOpHttpBindingsListWorkerConfigurationsInput(v *ListWorkerConfigurationsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MaxResults != 0 { encoder.SetQuery("maxResults").Integer(v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpUpdateConnector struct { } func (*awsRestjson1_serializeOpUpdateConnector) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUpdateConnector) 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.(*UpdateConnectorInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/v1/connectors/{connectorArn}") 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_serializeOpHttpBindingsUpdateConnectorInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentUpdateConnectorInput(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_serializeOpHttpBindingsUpdateConnectorInput(v *UpdateConnectorInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ConnectorArn == nil || len(*v.ConnectorArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member connectorArn must not be empty")} } if v.ConnectorArn != nil { if err := encoder.SetURI("connectorArn").String(*v.ConnectorArn); err != nil { return err } } if v.CurrentVersion != nil { encoder.SetQuery("currentVersion").String(*v.CurrentVersion) } return nil } func awsRestjson1_serializeOpDocumentUpdateConnectorInput(v *UpdateConnectorInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Capacity != nil { ok := object.Key("capacity") if err := awsRestjson1_serializeDocumentCapacityUpdate(v.Capacity, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocument__listOf__string(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_serializeDocument__listOfPlugin(v []types.Plugin, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsRestjson1_serializeDocumentPlugin(&v[i], av); err != nil { return err } } return nil } func awsRestjson1_serializeDocument__sensitive__mapOf__string(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_serializeDocumentApacheKafkaCluster(v *types.ApacheKafkaCluster, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.BootstrapServers != nil { ok := object.Key("bootstrapServers") ok.String(*v.BootstrapServers) } if v.Vpc != nil { ok := object.Key("vpc") if err := awsRestjson1_serializeDocumentVpc(v.Vpc, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentAutoScaling(v *types.AutoScaling, value smithyjson.Value) error { object := value.Object() defer object.Close() { ok := object.Key("maxWorkerCount") ok.Integer(v.MaxWorkerCount) } { ok := object.Key("mcuCount") ok.Integer(v.McuCount) } { ok := object.Key("minWorkerCount") ok.Integer(v.MinWorkerCount) } if v.ScaleInPolicy != nil { ok := object.Key("scaleInPolicy") if err := awsRestjson1_serializeDocumentScaleInPolicy(v.ScaleInPolicy, ok); err != nil { return err } } if v.ScaleOutPolicy != nil { ok := object.Key("scaleOutPolicy") if err := awsRestjson1_serializeDocumentScaleOutPolicy(v.ScaleOutPolicy, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentAutoScalingUpdate(v *types.AutoScalingUpdate, value smithyjson.Value) error { object := value.Object() defer object.Close() { ok := object.Key("maxWorkerCount") ok.Integer(v.MaxWorkerCount) } { ok := object.Key("mcuCount") ok.Integer(v.McuCount) } { ok := object.Key("minWorkerCount") ok.Integer(v.MinWorkerCount) } if v.ScaleInPolicy != nil { ok := object.Key("scaleInPolicy") if err := awsRestjson1_serializeDocumentScaleInPolicyUpdate(v.ScaleInPolicy, ok); err != nil { return err } } if v.ScaleOutPolicy != nil { ok := object.Key("scaleOutPolicy") if err := awsRestjson1_serializeDocumentScaleOutPolicyUpdate(v.ScaleOutPolicy, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentCapacity(v *types.Capacity, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AutoScaling != nil { ok := object.Key("autoScaling") if err := awsRestjson1_serializeDocumentAutoScaling(v.AutoScaling, ok); err != nil { return err } } if v.ProvisionedCapacity != nil { ok := object.Key("provisionedCapacity") if err := awsRestjson1_serializeDocumentProvisionedCapacity(v.ProvisionedCapacity, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentCapacityUpdate(v *types.CapacityUpdate, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AutoScaling != nil { ok := object.Key("autoScaling") if err := awsRestjson1_serializeDocumentAutoScalingUpdate(v.AutoScaling, ok); err != nil { return err } } if v.ProvisionedCapacity != nil { ok := object.Key("provisionedCapacity") if err := awsRestjson1_serializeDocumentProvisionedCapacityUpdate(v.ProvisionedCapacity, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentCloudWatchLogsLogDelivery(v *types.CloudWatchLogsLogDelivery, value smithyjson.Value) error { object := value.Object() defer object.Close() { ok := object.Key("enabled") ok.Boolean(v.Enabled) } if v.LogGroup != nil { ok := object.Key("logGroup") ok.String(*v.LogGroup) } return nil } func awsRestjson1_serializeDocumentCustomPlugin(v *types.CustomPlugin, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CustomPluginArn != nil { ok := object.Key("customPluginArn") ok.String(*v.CustomPluginArn) } { ok := object.Key("revision") ok.Long(v.Revision) } return nil } func awsRestjson1_serializeDocumentCustomPluginLocation(v *types.CustomPluginLocation, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.S3Location != nil { ok := object.Key("s3Location") if err := awsRestjson1_serializeDocumentS3Location(v.S3Location, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentFirehoseLogDelivery(v *types.FirehoseLogDelivery, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.DeliveryStream != nil { ok := object.Key("deliveryStream") ok.String(*v.DeliveryStream) } { ok := object.Key("enabled") ok.Boolean(v.Enabled) } return nil } func awsRestjson1_serializeDocumentKafkaCluster(v *types.KafkaCluster, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ApacheKafkaCluster != nil { ok := object.Key("apacheKafkaCluster") if err := awsRestjson1_serializeDocumentApacheKafkaCluster(v.ApacheKafkaCluster, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentKafkaClusterClientAuthentication(v *types.KafkaClusterClientAuthentication, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.AuthenticationType) > 0 { ok := object.Key("authenticationType") ok.String(string(v.AuthenticationType)) } return nil } func awsRestjson1_serializeDocumentKafkaClusterEncryptionInTransit(v *types.KafkaClusterEncryptionInTransit, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.EncryptionType) > 0 { ok := object.Key("encryptionType") ok.String(string(v.EncryptionType)) } return nil } func awsRestjson1_serializeDocumentLogDelivery(v *types.LogDelivery, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.WorkerLogDelivery != nil { ok := object.Key("workerLogDelivery") if err := awsRestjson1_serializeDocumentWorkerLogDelivery(v.WorkerLogDelivery, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentPlugin(v *types.Plugin, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CustomPlugin != nil { ok := object.Key("customPlugin") if err := awsRestjson1_serializeDocumentCustomPlugin(v.CustomPlugin, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentProvisionedCapacity(v *types.ProvisionedCapacity, value smithyjson.Value) error { object := value.Object() defer object.Close() { ok := object.Key("mcuCount") ok.Integer(v.McuCount) } { ok := object.Key("workerCount") ok.Integer(v.WorkerCount) } return nil } func awsRestjson1_serializeDocumentProvisionedCapacityUpdate(v *types.ProvisionedCapacityUpdate, value smithyjson.Value) error { object := value.Object() defer object.Close() { ok := object.Key("mcuCount") ok.Integer(v.McuCount) } { ok := object.Key("workerCount") ok.Integer(v.WorkerCount) } return nil } func awsRestjson1_serializeDocumentS3Location(v *types.S3Location, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.BucketArn != nil { ok := object.Key("bucketArn") ok.String(*v.BucketArn) } if v.FileKey != nil { ok := object.Key("fileKey") ok.String(*v.FileKey) } if v.ObjectVersion != nil { ok := object.Key("objectVersion") ok.String(*v.ObjectVersion) } return nil } func awsRestjson1_serializeDocumentS3LogDelivery(v *types.S3LogDelivery, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Bucket != nil { ok := object.Key("bucket") ok.String(*v.Bucket) } { ok := object.Key("enabled") ok.Boolean(v.Enabled) } if v.Prefix != nil { ok := object.Key("prefix") ok.String(*v.Prefix) } return nil } func awsRestjson1_serializeDocumentScaleInPolicy(v *types.ScaleInPolicy, value smithyjson.Value) error { object := value.Object() defer object.Close() { ok := object.Key("cpuUtilizationPercentage") ok.Integer(v.CpuUtilizationPercentage) } return nil } func awsRestjson1_serializeDocumentScaleInPolicyUpdate(v *types.ScaleInPolicyUpdate, value smithyjson.Value) error { object := value.Object() defer object.Close() { ok := object.Key("cpuUtilizationPercentage") ok.Integer(v.CpuUtilizationPercentage) } return nil } func awsRestjson1_serializeDocumentScaleOutPolicy(v *types.ScaleOutPolicy, value smithyjson.Value) error { object := value.Object() defer object.Close() { ok := object.Key("cpuUtilizationPercentage") ok.Integer(v.CpuUtilizationPercentage) } return nil } func awsRestjson1_serializeDocumentScaleOutPolicyUpdate(v *types.ScaleOutPolicyUpdate, value smithyjson.Value) error { object := value.Object() defer object.Close() { ok := object.Key("cpuUtilizationPercentage") ok.Integer(v.CpuUtilizationPercentage) } return nil } func awsRestjson1_serializeDocumentVpc(v *types.Vpc, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.SecurityGroups != nil { ok := object.Key("securityGroups") if err := awsRestjson1_serializeDocument__listOf__string(v.SecurityGroups, ok); err != nil { return err } } if v.Subnets != nil { ok := object.Key("subnets") if err := awsRestjson1_serializeDocument__listOf__string(v.Subnets, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentWorkerConfiguration(v *types.WorkerConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() { ok := object.Key("revision") ok.Long(v.Revision) } if v.WorkerConfigurationArn != nil { ok := object.Key("workerConfigurationArn") ok.String(*v.WorkerConfigurationArn) } return nil } func awsRestjson1_serializeDocumentWorkerLogDelivery(v *types.WorkerLogDelivery, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.CloudWatchLogs != nil { ok := object.Key("cloudWatchLogs") if err := awsRestjson1_serializeDocumentCloudWatchLogsLogDelivery(v.CloudWatchLogs, ok); err != nil { return err } } if v.Firehose != nil { ok := object.Key("firehose") if err := awsRestjson1_serializeDocumentFirehoseLogDelivery(v.Firehose, ok); err != nil { return err } } if v.S3 != nil { ok := object.Key("s3") if err := awsRestjson1_serializeDocumentS3LogDelivery(v.S3, ok); err != nil { return err } } return nil }
1,365
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kafkaconnect import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/kafkaconnect/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpCreateConnector struct { } func (*validateOpCreateConnector) ID() string { return "OperationInputValidation" } func (m *validateOpCreateConnector) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateConnectorInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateConnectorInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateCustomPlugin struct { } func (*validateOpCreateCustomPlugin) ID() string { return "OperationInputValidation" } func (m *validateOpCreateCustomPlugin) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateCustomPluginInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateCustomPluginInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpCreateWorkerConfiguration struct { } func (*validateOpCreateWorkerConfiguration) ID() string { return "OperationInputValidation" } func (m *validateOpCreateWorkerConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateWorkerConfigurationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateWorkerConfigurationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteConnector struct { } func (*validateOpDeleteConnector) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteConnector) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteConnectorInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteConnectorInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteCustomPlugin struct { } func (*validateOpDeleteCustomPlugin) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteCustomPlugin) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteCustomPluginInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteCustomPluginInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeConnector struct { } func (*validateOpDescribeConnector) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeConnector) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeConnectorInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeConnectorInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeCustomPlugin struct { } func (*validateOpDescribeCustomPlugin) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeCustomPlugin) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeCustomPluginInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeCustomPluginInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeWorkerConfiguration struct { } func (*validateOpDescribeWorkerConfiguration) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeWorkerConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeWorkerConfigurationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeWorkerConfigurationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateConnector struct { } func (*validateOpUpdateConnector) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateConnector) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateConnectorInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateConnectorInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpCreateConnectorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateConnector{}, middleware.After) } func addOpCreateCustomPluginValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateCustomPlugin{}, middleware.After) } func addOpCreateWorkerConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateWorkerConfiguration{}, middleware.After) } func addOpDeleteConnectorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteConnector{}, middleware.After) } func addOpDeleteCustomPluginValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteCustomPlugin{}, middleware.After) } func addOpDescribeConnectorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeConnector{}, middleware.After) } func addOpDescribeCustomPluginValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeCustomPlugin{}, middleware.After) } func addOpDescribeWorkerConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeWorkerConfiguration{}, middleware.After) } func addOpUpdateConnectorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateConnector{}, middleware.After) } func validate__listOfPlugin(v []types.Plugin) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListOfPlugin"} for i := range v { if err := validatePlugin(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateApacheKafkaCluster(v *types.ApacheKafkaCluster) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ApacheKafkaCluster"} if v.BootstrapServers == nil { invalidParams.Add(smithy.NewErrParamRequired("BootstrapServers")) } if v.Vpc == nil { invalidParams.Add(smithy.NewErrParamRequired("Vpc")) } else if v.Vpc != nil { if err := validateVpc(v.Vpc); err != nil { invalidParams.AddNested("Vpc", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateAutoScaling(v *types.AutoScaling) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AutoScaling"} if v.ScaleInPolicy != nil { if err := validateScaleInPolicy(v.ScaleInPolicy); err != nil { invalidParams.AddNested("ScaleInPolicy", err.(smithy.InvalidParamsError)) } } if v.ScaleOutPolicy != nil { if err := validateScaleOutPolicy(v.ScaleOutPolicy); err != nil { invalidParams.AddNested("ScaleOutPolicy", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateAutoScalingUpdate(v *types.AutoScalingUpdate) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "AutoScalingUpdate"} if v.ScaleInPolicy == nil { invalidParams.Add(smithy.NewErrParamRequired("ScaleInPolicy")) } else if v.ScaleInPolicy != nil { if err := validateScaleInPolicyUpdate(v.ScaleInPolicy); err != nil { invalidParams.AddNested("ScaleInPolicy", err.(smithy.InvalidParamsError)) } } if v.ScaleOutPolicy == nil { invalidParams.Add(smithy.NewErrParamRequired("ScaleOutPolicy")) } else if v.ScaleOutPolicy != nil { if err := validateScaleOutPolicyUpdate(v.ScaleOutPolicy); err != nil { invalidParams.AddNested("ScaleOutPolicy", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateCapacity(v *types.Capacity) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Capacity"} if v.AutoScaling != nil { if err := validateAutoScaling(v.AutoScaling); err != nil { invalidParams.AddNested("AutoScaling", err.(smithy.InvalidParamsError)) } } if v.ProvisionedCapacity != nil { if err := validateProvisionedCapacity(v.ProvisionedCapacity); err != nil { invalidParams.AddNested("ProvisionedCapacity", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateCapacityUpdate(v *types.CapacityUpdate) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CapacityUpdate"} if v.AutoScaling != nil { if err := validateAutoScalingUpdate(v.AutoScaling); err != nil { invalidParams.AddNested("AutoScaling", err.(smithy.InvalidParamsError)) } } if v.ProvisionedCapacity != nil { if err := validateProvisionedCapacityUpdate(v.ProvisionedCapacity); err != nil { invalidParams.AddNested("ProvisionedCapacity", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateCloudWatchLogsLogDelivery(v *types.CloudWatchLogsLogDelivery) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CloudWatchLogsLogDelivery"} if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateCustomPlugin(v *types.CustomPlugin) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CustomPlugin"} if v.CustomPluginArn == nil { invalidParams.Add(smithy.NewErrParamRequired("CustomPluginArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateCustomPluginLocation(v *types.CustomPluginLocation) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CustomPluginLocation"} if v.S3Location == nil { invalidParams.Add(smithy.NewErrParamRequired("S3Location")) } else if v.S3Location != nil { if err := validateS3Location(v.S3Location); err != nil { invalidParams.AddNested("S3Location", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateFirehoseLogDelivery(v *types.FirehoseLogDelivery) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "FirehoseLogDelivery"} if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateKafkaCluster(v *types.KafkaCluster) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "KafkaCluster"} if v.ApacheKafkaCluster == nil { invalidParams.Add(smithy.NewErrParamRequired("ApacheKafkaCluster")) } else if v.ApacheKafkaCluster != nil { if err := validateApacheKafkaCluster(v.ApacheKafkaCluster); err != nil { invalidParams.AddNested("ApacheKafkaCluster", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateKafkaClusterClientAuthentication(v *types.KafkaClusterClientAuthentication) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "KafkaClusterClientAuthentication"} if len(v.AuthenticationType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("AuthenticationType")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateKafkaClusterEncryptionInTransit(v *types.KafkaClusterEncryptionInTransit) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "KafkaClusterEncryptionInTransit"} if len(v.EncryptionType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("EncryptionType")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateLogDelivery(v *types.LogDelivery) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "LogDelivery"} if v.WorkerLogDelivery == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkerLogDelivery")) } else if v.WorkerLogDelivery != nil { if err := validateWorkerLogDelivery(v.WorkerLogDelivery); err != nil { invalidParams.AddNested("WorkerLogDelivery", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validatePlugin(v *types.Plugin) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Plugin"} if v.CustomPlugin == nil { invalidParams.Add(smithy.NewErrParamRequired("CustomPlugin")) } else if v.CustomPlugin != nil { if err := validateCustomPlugin(v.CustomPlugin); err != nil { invalidParams.AddNested("CustomPlugin", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateProvisionedCapacity(v *types.ProvisionedCapacity) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ProvisionedCapacity"} if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateProvisionedCapacityUpdate(v *types.ProvisionedCapacityUpdate) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ProvisionedCapacityUpdate"} if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateS3Location(v *types.S3Location) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "S3Location"} if v.BucketArn == nil { invalidParams.Add(smithy.NewErrParamRequired("BucketArn")) } if v.FileKey == nil { invalidParams.Add(smithy.NewErrParamRequired("FileKey")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateS3LogDelivery(v *types.S3LogDelivery) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "S3LogDelivery"} if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateScaleInPolicy(v *types.ScaleInPolicy) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ScaleInPolicy"} if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateScaleInPolicyUpdate(v *types.ScaleInPolicyUpdate) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ScaleInPolicyUpdate"} if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateScaleOutPolicy(v *types.ScaleOutPolicy) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ScaleOutPolicy"} if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateScaleOutPolicyUpdate(v *types.ScaleOutPolicyUpdate) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ScaleOutPolicyUpdate"} if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateVpc(v *types.Vpc) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "Vpc"} if v.Subnets == nil { invalidParams.Add(smithy.NewErrParamRequired("Subnets")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateWorkerConfiguration(v *types.WorkerConfiguration) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "WorkerConfiguration"} if v.WorkerConfigurationArn == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkerConfigurationArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateWorkerLogDelivery(v *types.WorkerLogDelivery) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "WorkerLogDelivery"} if v.CloudWatchLogs != nil { if err := validateCloudWatchLogsLogDelivery(v.CloudWatchLogs); err != nil { invalidParams.AddNested("CloudWatchLogs", err.(smithy.InvalidParamsError)) } } if v.Firehose != nil { if err := validateFirehoseLogDelivery(v.Firehose); err != nil { invalidParams.AddNested("Firehose", err.(smithy.InvalidParamsError)) } } if v.S3 != nil { if err := validateS3LogDelivery(v.S3); err != nil { invalidParams.AddNested("S3", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateConnectorInput(v *CreateConnectorInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateConnectorInput"} if v.Capacity == nil { invalidParams.Add(smithy.NewErrParamRequired("Capacity")) } else if v.Capacity != nil { if err := validateCapacity(v.Capacity); err != nil { invalidParams.AddNested("Capacity", err.(smithy.InvalidParamsError)) } } if v.ConnectorConfiguration == nil { invalidParams.Add(smithy.NewErrParamRequired("ConnectorConfiguration")) } if v.ConnectorName == nil { invalidParams.Add(smithy.NewErrParamRequired("ConnectorName")) } if v.KafkaCluster == nil { invalidParams.Add(smithy.NewErrParamRequired("KafkaCluster")) } else if v.KafkaCluster != nil { if err := validateKafkaCluster(v.KafkaCluster); err != nil { invalidParams.AddNested("KafkaCluster", err.(smithy.InvalidParamsError)) } } if v.KafkaClusterClientAuthentication == nil { invalidParams.Add(smithy.NewErrParamRequired("KafkaClusterClientAuthentication")) } else if v.KafkaClusterClientAuthentication != nil { if err := validateKafkaClusterClientAuthentication(v.KafkaClusterClientAuthentication); err != nil { invalidParams.AddNested("KafkaClusterClientAuthentication", err.(smithy.InvalidParamsError)) } } if v.KafkaClusterEncryptionInTransit == nil { invalidParams.Add(smithy.NewErrParamRequired("KafkaClusterEncryptionInTransit")) } else if v.KafkaClusterEncryptionInTransit != nil { if err := validateKafkaClusterEncryptionInTransit(v.KafkaClusterEncryptionInTransit); err != nil { invalidParams.AddNested("KafkaClusterEncryptionInTransit", err.(smithy.InvalidParamsError)) } } if v.KafkaConnectVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("KafkaConnectVersion")) } if v.LogDelivery != nil { if err := validateLogDelivery(v.LogDelivery); err != nil { invalidParams.AddNested("LogDelivery", err.(smithy.InvalidParamsError)) } } if v.Plugins == nil { invalidParams.Add(smithy.NewErrParamRequired("Plugins")) } else if v.Plugins != nil { if err := validate__listOfPlugin(v.Plugins); err != nil { invalidParams.AddNested("Plugins", err.(smithy.InvalidParamsError)) } } if v.ServiceExecutionRoleArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ServiceExecutionRoleArn")) } if v.WorkerConfiguration != nil { if err := validateWorkerConfiguration(v.WorkerConfiguration); err != nil { invalidParams.AddNested("WorkerConfiguration", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateCustomPluginInput(v *CreateCustomPluginInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateCustomPluginInput"} if len(v.ContentType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("ContentType")) } if v.Location == nil { invalidParams.Add(smithy.NewErrParamRequired("Location")) } else if v.Location != nil { if err := validateCustomPluginLocation(v.Location); err != nil { invalidParams.AddNested("Location", err.(smithy.InvalidParamsError)) } } if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpCreateWorkerConfigurationInput(v *CreateWorkerConfigurationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateWorkerConfigurationInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.PropertiesFileContent == nil { invalidParams.Add(smithy.NewErrParamRequired("PropertiesFileContent")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteConnectorInput(v *DeleteConnectorInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteConnectorInput"} if v.ConnectorArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ConnectorArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteCustomPluginInput(v *DeleteCustomPluginInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteCustomPluginInput"} if v.CustomPluginArn == nil { invalidParams.Add(smithy.NewErrParamRequired("CustomPluginArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeConnectorInput(v *DescribeConnectorInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeConnectorInput"} if v.ConnectorArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ConnectorArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeCustomPluginInput(v *DescribeCustomPluginInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeCustomPluginInput"} if v.CustomPluginArn == nil { invalidParams.Add(smithy.NewErrParamRequired("CustomPluginArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeWorkerConfigurationInput(v *DescribeWorkerConfigurationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeWorkerConfigurationInput"} if v.WorkerConfigurationArn == nil { invalidParams.Add(smithy.NewErrParamRequired("WorkerConfigurationArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateConnectorInput(v *UpdateConnectorInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateConnectorInput"} if v.Capacity == nil { invalidParams.Add(smithy.NewErrParamRequired("Capacity")) } else if v.Capacity != nil { if err := validateCapacityUpdate(v.Capacity); err != nil { invalidParams.AddNested("Capacity", err.(smithy.InvalidParamsError)) } } if v.ConnectorArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ConnectorArn")) } if v.CurrentVersion == nil { invalidParams.Add(smithy.NewErrParamRequired("CurrentVersion")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
875
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 KafkaConnect 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: "kafkaconnect.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "kafkaconnect-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "kafkaconnect-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "kafkaconnect.{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-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "kafkaconnect.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "kafkaconnect-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "kafkaconnect-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "kafkaconnect.{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: "kafkaconnect-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "kafkaconnect.{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: "kafkaconnect-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "kafkaconnect.{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: "kafkaconnect-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "kafkaconnect.{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: "kafkaconnect-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "kafkaconnect.{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: "kafkaconnect.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "kafkaconnect-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "kafkaconnect-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "kafkaconnect.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, }, }
347
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 ConnectorState string // Enum values for ConnectorState const ( ConnectorStateRunning ConnectorState = "RUNNING" ConnectorStateCreating ConnectorState = "CREATING" ConnectorStateUpdating ConnectorState = "UPDATING" ConnectorStateDeleting ConnectorState = "DELETING" ConnectorStateFailed ConnectorState = "FAILED" ) // Values returns all known values for ConnectorState. 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 (ConnectorState) Values() []ConnectorState { return []ConnectorState{ "RUNNING", "CREATING", "UPDATING", "DELETING", "FAILED", } } type CustomPluginContentType string // Enum values for CustomPluginContentType const ( CustomPluginContentTypeJar CustomPluginContentType = "JAR" CustomPluginContentTypeZip CustomPluginContentType = "ZIP" ) // Values returns all known values for CustomPluginContentType. 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 (CustomPluginContentType) Values() []CustomPluginContentType { return []CustomPluginContentType{ "JAR", "ZIP", } } type CustomPluginState string // Enum values for CustomPluginState const ( CustomPluginStateCreating CustomPluginState = "CREATING" CustomPluginStateCreateFailed CustomPluginState = "CREATE_FAILED" CustomPluginStateActive CustomPluginState = "ACTIVE" CustomPluginStateUpdating CustomPluginState = "UPDATING" CustomPluginStateUpdateFailed CustomPluginState = "UPDATE_FAILED" CustomPluginStateDeleting CustomPluginState = "DELETING" ) // Values returns all known values for CustomPluginState. 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 (CustomPluginState) Values() []CustomPluginState { return []CustomPluginState{ "CREATING", "CREATE_FAILED", "ACTIVE", "UPDATING", "UPDATE_FAILED", "DELETING", } } type KafkaClusterClientAuthenticationType string // Enum values for KafkaClusterClientAuthenticationType const ( KafkaClusterClientAuthenticationTypeNone KafkaClusterClientAuthenticationType = "NONE" KafkaClusterClientAuthenticationTypeIam KafkaClusterClientAuthenticationType = "IAM" ) // Values returns all known values for KafkaClusterClientAuthenticationType. 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 (KafkaClusterClientAuthenticationType) Values() []KafkaClusterClientAuthenticationType { return []KafkaClusterClientAuthenticationType{ "NONE", "IAM", } } type KafkaClusterEncryptionInTransitType string // Enum values for KafkaClusterEncryptionInTransitType const ( KafkaClusterEncryptionInTransitTypePlaintext KafkaClusterEncryptionInTransitType = "PLAINTEXT" KafkaClusterEncryptionInTransitTypeTls KafkaClusterEncryptionInTransitType = "TLS" ) // Values returns all known values for KafkaClusterEncryptionInTransitType. 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 (KafkaClusterEncryptionInTransitType) Values() []KafkaClusterEncryptionInTransitType { return []KafkaClusterEncryptionInTransitType{ "PLAINTEXT", "TLS", } }
110
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" ) // HTTP Status Code 400: Bad request due to incorrect input. Correct your request // and then retry it. type BadRequestException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *BadRequestException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *BadRequestException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *BadRequestException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "BadRequestException" } return *e.ErrorCodeOverride } func (e *BadRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // HTTP Status Code 409: Conflict. A resource with this name already exists. Retry // your request with another name. type ConflictException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ConflictException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ConflictException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ConflictException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ConflictException" } return *e.ErrorCodeOverride } func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // HTTP Status Code 403: Access forbidden. Correct your credentials and then retry // your request. type ForbiddenException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ForbiddenException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ForbiddenException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ForbiddenException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ForbiddenException" } return *e.ErrorCodeOverride } func (e *ForbiddenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // HTTP Status Code 500: Unexpected internal server error. Retrying your request // might resolve the issue. type InternalServerErrorException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InternalServerErrorException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InternalServerErrorException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InternalServerErrorException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InternalServerErrorException" } return *e.ErrorCodeOverride } func (e *InternalServerErrorException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // HTTP Status Code 404: Resource not found due to incorrect input. Correct your // request and then retry it. type NotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *NotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *NotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *NotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "NotFoundException" } return *e.ErrorCodeOverride } func (e *NotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // HTTP Status Code 503: Service Unavailable. Retrying your request in some time // might resolve the issue. type ServiceUnavailableException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ServiceUnavailableException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ServiceUnavailableException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ServiceUnavailableException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ServiceUnavailableException" } return *e.ErrorCodeOverride } func (e *ServiceUnavailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // HTTP Status Code 429: Limit exceeded. Resource limit reached. type TooManyRequestsException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *TooManyRequestsException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *TooManyRequestsException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *TooManyRequestsException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "TooManyRequestsException" } return *e.ErrorCodeOverride } func (e *TooManyRequestsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // HTTP Status Code 401: Unauthorized request. The provided credentials couldn't // be validated. type UnauthorizedException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *UnauthorizedException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *UnauthorizedException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *UnauthorizedException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "UnauthorizedException" } return *e.ErrorCodeOverride } func (e *UnauthorizedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
224
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 details of the Apache Kafka cluster to which the connector is connected. type ApacheKafkaCluster struct { // The bootstrap servers of the cluster. // // This member is required. BootstrapServers *string // Details of an Amazon VPC which has network connectivity to the Apache Kafka // cluster. // // This member is required. Vpc *Vpc noSmithyDocumentSerde } // The description of the Apache Kafka cluster to which the connector is connected. type ApacheKafkaClusterDescription struct { // The bootstrap servers of the cluster. BootstrapServers *string // Details of an Amazon VPC which has network connectivity to the Apache Kafka // cluster. Vpc *VpcDescription noSmithyDocumentSerde } // Specifies how the connector scales. type AutoScaling struct { // The maximum number of workers allocated to the connector. // // This member is required. MaxWorkerCount int32 // The number of microcontroller units (MCUs) allocated to each connector worker. // The valid values are 1,2,4,8. // // This member is required. McuCount int32 // The minimum number of workers allocated to the connector. // // This member is required. MinWorkerCount int32 // The sacle-in policy for the connector. ScaleInPolicy *ScaleInPolicy // The sacle-out policy for the connector. ScaleOutPolicy *ScaleOutPolicy noSmithyDocumentSerde } // Information about the auto scaling parameters for the connector. type AutoScalingDescription struct { // The maximum number of workers allocated to the connector. MaxWorkerCount int32 // The number of microcontroller units (MCUs) allocated to each connector worker. // The valid values are 1,2,4,8. McuCount int32 // The minimum number of workers allocated to the connector. MinWorkerCount int32 // The sacle-in policy for the connector. ScaleInPolicy *ScaleInPolicyDescription // The sacle-out policy for the connector.> ScaleOutPolicy *ScaleOutPolicyDescription noSmithyDocumentSerde } // The updates to the auto scaling parameters for the connector. type AutoScalingUpdate struct { // The target maximum number of workers allocated to the connector. // // This member is required. MaxWorkerCount int32 // The target number of microcontroller units (MCUs) allocated to each connector // worker. The valid values are 1,2,4,8. // // This member is required. McuCount int32 // The target minimum number of workers allocated to the connector. // // This member is required. MinWorkerCount int32 // The target sacle-in policy for the connector. // // This member is required. ScaleInPolicy *ScaleInPolicyUpdate // The target sacle-out policy for the connector. // // This member is required. ScaleOutPolicy *ScaleOutPolicyUpdate noSmithyDocumentSerde } // Information about the capacity of the connector, whether it is auto scaled or // provisioned. type Capacity struct { // Information about the auto scaling parameters for the connector. AutoScaling *AutoScaling // Details about a fixed capacity allocated to a connector. ProvisionedCapacity *ProvisionedCapacity noSmithyDocumentSerde } // A description of the connector's capacity. type CapacityDescription struct { // Describes the connector's auto scaling capacity. AutoScaling *AutoScalingDescription // Describes a connector's provisioned capacity. ProvisionedCapacity *ProvisionedCapacityDescription noSmithyDocumentSerde } // The target capacity for the connector. The capacity can be auto scaled or // provisioned. type CapacityUpdate struct { // The target auto scaling setting. AutoScaling *AutoScalingUpdate // The target settings for provisioned capacity. ProvisionedCapacity *ProvisionedCapacityUpdate noSmithyDocumentSerde } // The settings for delivering connector logs to Amazon CloudWatch Logs. type CloudWatchLogsLogDelivery struct { // Whether log delivery to Amazon CloudWatch Logs is enabled. // // This member is required. Enabled bool // The name of the CloudWatch log group that is the destination for log delivery. LogGroup *string noSmithyDocumentSerde } // A description of the log delivery settings. type CloudWatchLogsLogDeliveryDescription struct { // Whether log delivery to Amazon CloudWatch Logs is enabled. Enabled bool // The name of the CloudWatch log group that is the destination for log delivery. LogGroup *string noSmithyDocumentSerde } // Summary of a connector. type ConnectorSummary struct { // The connector's compute capacity settings. Capacity *CapacityDescription // The Amazon Resource Name (ARN) of the connector. ConnectorArn *string // The description of the connector. ConnectorDescription *string // The name of the connector. ConnectorName *string // The state of the connector. ConnectorState ConnectorState // The time that the connector was created. CreationTime *time.Time // The current version of the connector. CurrentVersion *string // The details of the Apache Kafka cluster to which the connector is connected. KafkaCluster *KafkaClusterDescription // The type of client authentication used to connect to the Apache Kafka cluster. // The value is NONE when no client authentication is used. KafkaClusterClientAuthentication *KafkaClusterClientAuthenticationDescription // Details of encryption in transit to the Apache Kafka cluster. KafkaClusterEncryptionInTransit *KafkaClusterEncryptionInTransitDescription // The version of Kafka Connect. It has to be compatible with both the Apache // Kafka cluster's version and the plugins. KafkaConnectVersion *string // The settings for delivering connector logs to Amazon CloudWatch Logs. LogDelivery *LogDeliveryDescription // Specifies which plugins were used for this connector. Plugins []PluginDescription // The Amazon Resource Name (ARN) of the IAM role used by the connector to access // Amazon Web Services resources. ServiceExecutionRoleArn *string // The worker configurations that are in use with the connector. WorkerConfiguration *WorkerConfigurationDescription noSmithyDocumentSerde } // A plugin is an AWS resource that contains the code that defines a connector's // logic. type CustomPlugin struct { // The Amazon Resource Name (ARN) of the custom plugin. // // This member is required. CustomPluginArn *string // The revision of the custom plugin. // // This member is required. Revision int64 noSmithyDocumentSerde } // Details about a custom plugin. type CustomPluginDescription struct { // The Amazon Resource Name (ARN) of the custom plugin. CustomPluginArn *string // The revision of the custom plugin. Revision int64 noSmithyDocumentSerde } // Details about a custom plugin file. type CustomPluginFileDescription struct { // The hex-encoded MD5 checksum of the custom plugin file. You can use it to // validate the file. FileMd5 *string // The size in bytes of the custom plugin file. You can use it to validate the // file. FileSize int64 noSmithyDocumentSerde } // Information about the location of a custom plugin. type CustomPluginLocation struct { // The S3 bucket Amazon Resource Name (ARN), file key, and object version of the // plugin file stored in Amazon S3. // // This member is required. S3Location *S3Location noSmithyDocumentSerde } // Information about the location of a custom plugin. type CustomPluginLocationDescription struct { // The S3 bucket Amazon Resource Name (ARN), file key, and object version of the // plugin file stored in Amazon S3. S3Location *S3LocationDescription noSmithyDocumentSerde } // Details about the revision of a custom plugin. type CustomPluginRevisionSummary struct { // The format of the plugin file. ContentType CustomPluginContentType // The time that the custom plugin was created. CreationTime *time.Time // The description of the custom plugin. Description *string // Details about the custom plugin file. FileDescription *CustomPluginFileDescription // Information about the location of the custom plugin. Location *CustomPluginLocationDescription // The revision of the custom plugin. Revision int64 noSmithyDocumentSerde } // A summary of the custom plugin. type CustomPluginSummary struct { // The time that the custom plugin was created. CreationTime *time.Time // The Amazon Resource Name (ARN) of the custom plugin. CustomPluginArn *string // The state of the custom plugin. CustomPluginState CustomPluginState // A description of the custom plugin. Description *string // The latest revision of the custom plugin. LatestRevision *CustomPluginRevisionSummary // The name of the custom plugin. Name *string noSmithyDocumentSerde } // The settings for delivering logs to Amazon Kinesis Data Firehose. type FirehoseLogDelivery struct { // Specifies whether connector logs get delivered to Amazon Kinesis Data Firehose. // // This member is required. Enabled bool // The name of the Kinesis Data Firehose delivery stream that is the destination // for log delivery. DeliveryStream *string noSmithyDocumentSerde } // A description of the settings for delivering logs to Amazon Kinesis Data // Firehose. type FirehoseLogDeliveryDescription struct { // The name of the Kinesis Data Firehose delivery stream that is the destination // for log delivery. DeliveryStream *string // Specifies whether connector logs get delivered to Amazon Kinesis Data Firehose. Enabled bool noSmithyDocumentSerde } // The details of the Apache Kafka cluster to which the connector is connected. type KafkaCluster struct { // The Apache Kafka cluster to which the connector is connected. // // This member is required. ApacheKafkaCluster *ApacheKafkaCluster noSmithyDocumentSerde } // The client authentication information used in order to authenticate with the // Apache Kafka cluster. type KafkaClusterClientAuthentication struct { // The type of client authentication used to connect to the Apache Kafka cluster. // Value NONE means that no client authentication is used. // // This member is required. AuthenticationType KafkaClusterClientAuthenticationType noSmithyDocumentSerde } // The client authentication information used in order to authenticate with the // Apache Kafka cluster. type KafkaClusterClientAuthenticationDescription struct { // The type of client authentication used to connect to the Apache Kafka cluster. // Value NONE means that no client authentication is used. AuthenticationType KafkaClusterClientAuthenticationType noSmithyDocumentSerde } // Details of how to connect to the Apache Kafka cluster. type KafkaClusterDescription struct { // The Apache Kafka cluster to which the connector is connected. ApacheKafkaCluster *ApacheKafkaClusterDescription noSmithyDocumentSerde } // Details of encryption in transit to the Apache Kafka cluster. type KafkaClusterEncryptionInTransit struct { // The type of encryption in transit to the Apache Kafka cluster. // // This member is required. EncryptionType KafkaClusterEncryptionInTransitType noSmithyDocumentSerde } // The description of the encryption in transit to the Apache Kafka cluster. type KafkaClusterEncryptionInTransitDescription struct { // The type of encryption in transit to the Apache Kafka cluster. EncryptionType KafkaClusterEncryptionInTransitType noSmithyDocumentSerde } // Details about log delivery. type LogDelivery struct { // The workers can send worker logs to different destination types. This // configuration specifies the details of these destinations. // // This member is required. WorkerLogDelivery *WorkerLogDelivery noSmithyDocumentSerde } // The description of the log delivery settings. type LogDeliveryDescription struct { // The workers can send worker logs to different destination types. This // configuration specifies the details of these destinations. WorkerLogDelivery *WorkerLogDeliveryDescription noSmithyDocumentSerde } // A plugin is an AWS resource that contains the code that defines your connector // logic. type Plugin struct { // Details about a custom plugin. // // This member is required. CustomPlugin *CustomPlugin noSmithyDocumentSerde } // The description of the plugin. type PluginDescription struct { // Details about a custom plugin. CustomPlugin *CustomPluginDescription noSmithyDocumentSerde } // Details about a connector's provisioned capacity. type ProvisionedCapacity struct { // The number of microcontroller units (MCUs) allocated to each connector worker. // The valid values are 1,2,4,8. // // This member is required. McuCount int32 // The number of workers that are allocated to the connector. // // This member is required. WorkerCount int32 noSmithyDocumentSerde } // The description of a connector's provisioned capacity. type ProvisionedCapacityDescription struct { // The number of microcontroller units (MCUs) allocated to each connector worker. // The valid values are 1,2,4,8. McuCount int32 // The number of workers that are allocated to the connector. WorkerCount int32 noSmithyDocumentSerde } // An update to a connector's fixed capacity. type ProvisionedCapacityUpdate struct { // The number of microcontroller units (MCUs) allocated to each connector worker. // The valid values are 1,2,4,8. // // This member is required. McuCount int32 // The number of workers that are allocated to the connector. // // This member is required. WorkerCount int32 noSmithyDocumentSerde } // The location of an object in Amazon S3. type S3Location struct { // The Amazon Resource Name (ARN) of an S3 bucket. // // This member is required. BucketArn *string // The file key for an object in an S3 bucket. // // This member is required. FileKey *string // The version of an object in an S3 bucket. ObjectVersion *string noSmithyDocumentSerde } // The description of the location of an object in Amazon S3. type S3LocationDescription struct { // The Amazon Resource Name (ARN) of an S3 bucket. BucketArn *string // The file key for an object in an S3 bucket. FileKey *string // The version of an object in an S3 bucket. ObjectVersion *string noSmithyDocumentSerde } // Details about delivering logs to Amazon S3. type S3LogDelivery struct { // Specifies whether connector logs get sent to the specified Amazon S3 // destination. // // This member is required. Enabled bool // The name of the S3 bucket that is the destination for log delivery. Bucket *string // The S3 prefix that is the destination for log delivery. Prefix *string noSmithyDocumentSerde } // The description of the details about delivering logs to Amazon S3. type S3LogDeliveryDescription struct { // The name of the S3 bucket that is the destination for log delivery. Bucket *string // Specifies whether connector logs get sent to the specified Amazon S3 // destination. Enabled bool // The S3 prefix that is the destination for log delivery. Prefix *string noSmithyDocumentSerde } // The scale-in policy for the connector. type ScaleInPolicy struct { // Specifies the CPU utilization percentage threshold at which you want connector // scale in to be triggered. // // This member is required. CpuUtilizationPercentage int32 noSmithyDocumentSerde } // The description of the scale-in policy for the connector. type ScaleInPolicyDescription struct { // Specifies the CPU utilization percentage threshold at which you want connector // scale in to be triggered. CpuUtilizationPercentage int32 noSmithyDocumentSerde } // An update to the connector's scale-in policy. type ScaleInPolicyUpdate struct { // The target CPU utilization percentage threshold at which you want connector // scale in to be triggered. // // This member is required. CpuUtilizationPercentage int32 noSmithyDocumentSerde } // The scale-out policy for the connector. type ScaleOutPolicy struct { // The CPU utilization percentage threshold at which you want connector scale out // to be triggered. // // This member is required. CpuUtilizationPercentage int32 noSmithyDocumentSerde } // The description of the scale-out policy for the connector. type ScaleOutPolicyDescription struct { // The CPU utilization percentage threshold at which you want connector scale out // to be triggered. CpuUtilizationPercentage int32 noSmithyDocumentSerde } // An update to the connector's scale-out policy. type ScaleOutPolicyUpdate struct { // The target CPU utilization percentage threshold at which you want connector // scale out to be triggered. // // This member is required. CpuUtilizationPercentage int32 noSmithyDocumentSerde } // Details about the state of a resource. type StateDescription struct { // A code that describes the state of a resource. Code *string // A message that describes the state of a resource. Message *string noSmithyDocumentSerde } // Information about the VPC in which the connector resides. type Vpc struct { // The subnets for the connector. // // This member is required. Subnets []string // The security groups for the connector. SecurityGroups []string noSmithyDocumentSerde } // The description of the VPC in which the connector resides. type VpcDescription struct { // The security groups for the connector. SecurityGroups []string // The subnets for the connector. Subnets []string noSmithyDocumentSerde } // The configuration of the workers, which are the processes that run the // connector logic. type WorkerConfiguration struct { // The revision of the worker configuration. // // This member is required. Revision int64 // The Amazon Resource Name (ARN) of the worker configuration. // // This member is required. WorkerConfigurationArn *string noSmithyDocumentSerde } // The description of the worker configuration. type WorkerConfigurationDescription struct { // The revision of the worker configuration. Revision int64 // The Amazon Resource Name (ARN) of the worker configuration. WorkerConfigurationArn *string noSmithyDocumentSerde } // The description of the worker configuration revision. type WorkerConfigurationRevisionDescription struct { // The time that the worker configuration was created. CreationTime *time.Time // The description of the worker configuration revision. Description *string // Base64 encoded contents of the connect-distributed.properties file. PropertiesFileContent *string // The description of a revision of the worker configuration. Revision int64 noSmithyDocumentSerde } // The summary of a worker configuration revision. type WorkerConfigurationRevisionSummary struct { // The time that a worker configuration revision was created. CreationTime *time.Time // The description of a worker configuration revision. Description *string // The revision of a worker configuration. Revision int64 noSmithyDocumentSerde } // The summary of a worker configuration. type WorkerConfigurationSummary struct { // The time that a worker configuration was created. CreationTime *time.Time // The description of a worker configuration. Description *string // The latest revision of a worker configuration. LatestRevision *WorkerConfigurationRevisionSummary // The name of the worker configuration. Name *string // The Amazon Resource Name (ARN) of the worker configuration. WorkerConfigurationArn *string noSmithyDocumentSerde } // Workers can send worker logs to different destination types. This configuration // specifies the details of these destinations. type WorkerLogDelivery struct { // Details about delivering logs to Amazon CloudWatch Logs. CloudWatchLogs *CloudWatchLogsLogDelivery // Details about delivering logs to Amazon Kinesis Data Firehose. Firehose *FirehoseLogDelivery // Details about delivering logs to Amazon S3. S3 *S3LogDelivery noSmithyDocumentSerde } // Workers can send worker logs to different destination types. This configuration // specifies the details of these destinations. type WorkerLogDeliveryDescription struct { // Details about delivering logs to Amazon CloudWatch Logs. CloudWatchLogs *CloudWatchLogsLogDeliveryDescription // Details about delivering logs to Amazon Kinesis Data Firehose. Firehose *FirehoseLogDeliveryDescription // Details about delivering logs to Amazon S3. S3 *S3LogDeliveryDescription noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
826
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra import ( "context" cryptorand "crypto/rand" "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" smithyrand "github.com/aws/smithy-go/rand" smithyhttp "github.com/aws/smithy-go/transport/http" "net" "net/http" "time" ) const ServiceID = "kendra" const ServiceAPIVersion = "2019-02-03" // Client provides the API client to make operations call for // AWSKendraFrontendService. 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) resolveIdempotencyTokenProvider(&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 // Provides idempotency tokens values that will be automatically populated into // idempotent API operations. IdempotencyTokenProvider IdempotencyTokenProvider // 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, "kendra", 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 resolveIdempotencyTokenProvider(o *Options) { if o.IdempotencyTokenProvider != nil { return } o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader) } 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 } // IdempotencyTokenProvider interface for providing idempotency token type IdempotencyTokenProvider interface { GetIdempotencyToken() (string, error) } 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) }
455
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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 kendra 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/kendra/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Grants users or groups in your IAM Identity Center identity source access to // your Amazon Kendra experience. You can create an Amazon Kendra experience such // as a search application. For more information on creating a search application // experience, see Building a search experience with no code (https://docs.aws.amazon.com/kendra/latest/dg/deploying-search-experience-no-code.html) // . func (c *Client) AssociateEntitiesToExperience(ctx context.Context, params *AssociateEntitiesToExperienceInput, optFns ...func(*Options)) (*AssociateEntitiesToExperienceOutput, error) { if params == nil { params = &AssociateEntitiesToExperienceInput{} } result, metadata, err := c.invokeOperation(ctx, "AssociateEntitiesToExperience", params, optFns, c.addOperationAssociateEntitiesToExperienceMiddlewares) if err != nil { return nil, err } out := result.(*AssociateEntitiesToExperienceOutput) out.ResultMetadata = metadata return out, nil } type AssociateEntitiesToExperienceInput struct { // Lists users or groups in your IAM Identity Center identity source. // // This member is required. EntityList []types.EntityConfiguration // The identifier of your Amazon Kendra experience. // // This member is required. Id *string // The identifier of the index for your Amazon Kendra experience. // // This member is required. IndexId *string noSmithyDocumentSerde } type AssociateEntitiesToExperienceOutput struct { // Lists the users or groups in your IAM Identity Center identity source that // failed to properly configure with your Amazon Kendra experience. FailedEntityList []types.FailedEntity // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAssociateEntitiesToExperienceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssociateEntitiesToExperience{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssociateEntitiesToExperience{}, 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 = addOpAssociateEntitiesToExperienceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateEntitiesToExperience(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_opAssociateEntitiesToExperience(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "AssociateEntitiesToExperience", } }
140
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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/kendra/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Defines the specific permissions of users or groups in your IAM Identity Center // identity source with access to your Amazon Kendra experience. You can create an // Amazon Kendra experience such as a search application. For more information on // creating a search application experience, see Building a search experience with // no code (https://docs.aws.amazon.com/kendra/latest/dg/deploying-search-experience-no-code.html) // . func (c *Client) AssociatePersonasToEntities(ctx context.Context, params *AssociatePersonasToEntitiesInput, optFns ...func(*Options)) (*AssociatePersonasToEntitiesOutput, error) { if params == nil { params = &AssociatePersonasToEntitiesInput{} } result, metadata, err := c.invokeOperation(ctx, "AssociatePersonasToEntities", params, optFns, c.addOperationAssociatePersonasToEntitiesMiddlewares) if err != nil { return nil, err } out := result.(*AssociatePersonasToEntitiesOutput) out.ResultMetadata = metadata return out, nil } type AssociatePersonasToEntitiesInput struct { // The identifier of your Amazon Kendra experience. // // This member is required. Id *string // The identifier of the index for your Amazon Kendra experience. // // This member is required. IndexId *string // The personas that define the specific permissions of users or groups in your // IAM Identity Center identity source. The available personas or access roles are // Owner and Viewer . For more information on these personas, see Providing access // to your search page (https://docs.aws.amazon.com/kendra/latest/dg/deploying-search-experience-no-code.html#access-search-experience) // . // // This member is required. Personas []types.EntityPersonaConfiguration noSmithyDocumentSerde } type AssociatePersonasToEntitiesOutput struct { // Lists the users or groups in your IAM Identity Center identity source that // failed to properly configure with your Amazon Kendra experience. FailedEntityList []types.FailedEntity // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationAssociatePersonasToEntitiesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssociatePersonasToEntities{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssociatePersonasToEntities{}, 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 = addOpAssociatePersonasToEntitiesValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociatePersonasToEntities(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_opAssociatePersonasToEntities(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "AssociatePersonasToEntities", } }
145
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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/kendra/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Removes one or more documents from an index. The documents must have been added // with the BatchPutDocument API. The documents are deleted asynchronously. You // can see the progress of the deletion by using Amazon Web Services CloudWatch. // Any error messages related to the processing of the batch are sent to you // CloudWatch log. func (c *Client) BatchDeleteDocument(ctx context.Context, params *BatchDeleteDocumentInput, optFns ...func(*Options)) (*BatchDeleteDocumentOutput, error) { if params == nil { params = &BatchDeleteDocumentInput{} } result, metadata, err := c.invokeOperation(ctx, "BatchDeleteDocument", params, optFns, c.addOperationBatchDeleteDocumentMiddlewares) if err != nil { return nil, err } out := result.(*BatchDeleteDocumentOutput) out.ResultMetadata = metadata return out, nil } type BatchDeleteDocumentInput struct { // One or more identifiers for documents to delete from the index. // // This member is required. DocumentIdList []string // The identifier of the index that contains the documents to delete. // // This member is required. IndexId *string // Maps a particular data source sync job to a particular data source. DataSourceSyncJobMetricTarget *types.DataSourceSyncJobMetricTarget noSmithyDocumentSerde } type BatchDeleteDocumentOutput struct { // A list of documents that could not be removed from the index. Each entry // contains an error message that indicates why the document couldn't be removed // from the index. FailedDocuments []types.BatchDeleteDocumentResponseFailedDocument // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationBatchDeleteDocumentMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchDeleteDocument{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpBatchDeleteDocument{}, 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 = addOpBatchDeleteDocumentValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchDeleteDocument(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_opBatchDeleteDocument(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "BatchDeleteDocument", } }
139
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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/kendra/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Removes one or more sets of featured results. Features results are placed above // all other results for certain queries. If there's an exact match of a query, // then one or more specific documents are featured in the search results. func (c *Client) BatchDeleteFeaturedResultsSet(ctx context.Context, params *BatchDeleteFeaturedResultsSetInput, optFns ...func(*Options)) (*BatchDeleteFeaturedResultsSetOutput, error) { if params == nil { params = &BatchDeleteFeaturedResultsSetInput{} } result, metadata, err := c.invokeOperation(ctx, "BatchDeleteFeaturedResultsSet", params, optFns, c.addOperationBatchDeleteFeaturedResultsSetMiddlewares) if err != nil { return nil, err } out := result.(*BatchDeleteFeaturedResultsSetOutput) out.ResultMetadata = metadata return out, nil } type BatchDeleteFeaturedResultsSetInput struct { // The identifiers of the featured results sets that you want to delete. // // This member is required. FeaturedResultsSetIds []string // The identifier of the index used for featuring results. // // This member is required. IndexId *string noSmithyDocumentSerde } type BatchDeleteFeaturedResultsSetOutput struct { // The list of errors for the featured results set IDs, explaining why they // couldn't be removed from the index. // // This member is required. Errors []types.BatchDeleteFeaturedResultsSetError // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationBatchDeleteFeaturedResultsSetMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchDeleteFeaturedResultsSet{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpBatchDeleteFeaturedResultsSet{}, 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 = addOpBatchDeleteFeaturedResultsSetValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchDeleteFeaturedResultsSet(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_opBatchDeleteFeaturedResultsSet(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "BatchDeleteFeaturedResultsSet", } }
135
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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/kendra/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns the indexing status for one or more documents submitted with the // BatchPutDocument (https://docs.aws.amazon.com/kendra/latest/dg/API_BatchPutDocument.html) // API. When you use the BatchPutDocument API, documents are indexed // asynchronously. You can use the BatchGetDocumentStatus API to get the current // status of a list of documents so that you can determine if they have been // successfully indexed. You can also use the BatchGetDocumentStatus API to check // the status of the BatchDeleteDocument (https://docs.aws.amazon.com/kendra/latest/dg/API_BatchDeleteDocument.html) // API. When a document is deleted from the index, Amazon Kendra returns NOT_FOUND // as the status. func (c *Client) BatchGetDocumentStatus(ctx context.Context, params *BatchGetDocumentStatusInput, optFns ...func(*Options)) (*BatchGetDocumentStatusOutput, error) { if params == nil { params = &BatchGetDocumentStatusInput{} } result, metadata, err := c.invokeOperation(ctx, "BatchGetDocumentStatus", params, optFns, c.addOperationBatchGetDocumentStatusMiddlewares) if err != nil { return nil, err } out := result.(*BatchGetDocumentStatusOutput) out.ResultMetadata = metadata return out, nil } type BatchGetDocumentStatusInput struct { // A list of DocumentInfo objects that identify the documents for which to get the // status. You identify the documents by their document ID and optional attributes. // // This member is required. DocumentInfoList []types.DocumentInfo // The identifier of the index to add documents to. The index ID is returned by // the CreateIndex (https://docs.aws.amazon.com/kendra/latest/dg/API_CreateIndex.html) // API. // // This member is required. IndexId *string noSmithyDocumentSerde } type BatchGetDocumentStatusOutput struct { // The status of documents. The status indicates if the document is waiting to be // indexed, is in the process of indexing, has completed indexing, or failed // indexing. If a document failed indexing, the status provides the reason why. DocumentStatusList []types.Status // A list of documents that Amazon Kendra couldn't get the status for. The list // includes the ID of the document and the reason that the status couldn't be // found. Errors []types.BatchGetDocumentStatusResponseError // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationBatchGetDocumentStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchGetDocumentStatus{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpBatchGetDocumentStatus{}, 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 = addOpBatchGetDocumentStatusValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchGetDocumentStatus(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_opBatchGetDocumentStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "BatchGetDocumentStatus", } }
148
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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/kendra/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Adds one or more documents to an index. The BatchPutDocument API enables you to // ingest inline documents or a set of documents stored in an Amazon S3 bucket. Use // this API to ingest your text and unstructured text into an index, add custom // attributes to the documents, and to attach an access control list to the // documents added to the index. The documents are indexed asynchronously. You can // see the progress of the batch using Amazon Web Services CloudWatch. Any error // messages related to processing the batch are sent to your Amazon Web Services // CloudWatch log. For an example of ingesting inline documents using Python and // Java SDKs, see Adding files directly to an index (https://docs.aws.amazon.com/kendra/latest/dg/in-adding-binary-doc.html) // . func (c *Client) BatchPutDocument(ctx context.Context, params *BatchPutDocumentInput, optFns ...func(*Options)) (*BatchPutDocumentOutput, error) { if params == nil { params = &BatchPutDocumentInput{} } result, metadata, err := c.invokeOperation(ctx, "BatchPutDocument", params, optFns, c.addOperationBatchPutDocumentMiddlewares) if err != nil { return nil, err } out := result.(*BatchPutDocumentOutput) out.ResultMetadata = metadata return out, nil } type BatchPutDocumentInput struct { // One or more documents to add to the index. Documents have the following file // size limits. // - 50 MB total size for any file // - 5 MB extracted text for any file // For more information, see Quotas (https://docs.aws.amazon.com/kendra/latest/dg/quotas.html) // . // // This member is required. Documents []types.Document // The identifier of the index to add the documents to. You need to create the // index first using the CreateIndex API. // // This member is required. IndexId *string // Configuration information for altering your document metadata and content // during the document ingestion process when you use the BatchPutDocument API. // For more information on how to create, modify and delete document metadata, or // make other content alterations when you ingest documents into Amazon Kendra, see // Customizing document metadata during the ingestion process (https://docs.aws.amazon.com/kendra/latest/dg/custom-document-enrichment.html) // . CustomDocumentEnrichmentConfiguration *types.CustomDocumentEnrichmentConfiguration // The Amazon Resource Name (ARN) of an IAM role with permission to access your S3 // bucket. For more information, see IAM access roles for Amazon Kendra (https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html) // . RoleArn *string noSmithyDocumentSerde } type BatchPutDocumentOutput struct { // A list of documents that were not added to the index because the document // failed a validation check. Each document contains an error message that // indicates why the document couldn't be added to the index. If there was an error // adding a document to an index the error is reported in your Amazon Web Services // CloudWatch log. For more information, see Monitoring Amazon Kendra with Amazon // CloudWatch Logs (https://docs.aws.amazon.com/kendra/latest/dg/cloudwatch-logs.html) FailedDocuments []types.BatchPutDocumentResponseFailedDocument // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationBatchPutDocumentMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchPutDocument{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpBatchPutDocument{}, 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 = addOpBatchPutDocumentValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchPutDocument(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_opBatchPutDocument(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "BatchPutDocument", } }
163
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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" ) // Clears existing query suggestions from an index. This deletes existing // suggestions only, not the queries in the query log. After you clear suggestions, // Amazon Kendra learns new suggestions based on new queries added to the query log // from the time you cleared suggestions. If you do not see any new suggestions, // then please allow Amazon Kendra to collect enough queries to learn new // suggestions. ClearQuerySuggestions is currently not supported in the Amazon Web // Services GovCloud (US-West) region. func (c *Client) ClearQuerySuggestions(ctx context.Context, params *ClearQuerySuggestionsInput, optFns ...func(*Options)) (*ClearQuerySuggestionsOutput, error) { if params == nil { params = &ClearQuerySuggestionsInput{} } result, metadata, err := c.invokeOperation(ctx, "ClearQuerySuggestions", params, optFns, c.addOperationClearQuerySuggestionsMiddlewares) if err != nil { return nil, err } out := result.(*ClearQuerySuggestionsOutput) out.ResultMetadata = metadata return out, nil } type ClearQuerySuggestionsInput struct { // The identifier of the index you want to clear query suggestions from. // // This member is required. IndexId *string noSmithyDocumentSerde } type ClearQuerySuggestionsOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationClearQuerySuggestionsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpClearQuerySuggestions{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpClearQuerySuggestions{}, 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 = addOpClearQuerySuggestionsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opClearQuerySuggestions(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_opClearQuerySuggestions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "ClearQuerySuggestions", } }
126
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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/kendra/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates an access configuration for your documents. This includes user and // group access information for your documents. This is useful for user context // filtering, where search results are filtered based on the user or their group // access to documents. You can use this to re-configure your existing document // level access control without indexing all of your documents again. For example, // your index contains top-secret company documents that only certain employees or // users should access. One of these users leaves the company or switches to a team // that should be blocked from accessing top-secret documents. The user still has // access to top-secret documents because the user had access when your documents // were previously indexed. You can create a specific access control configuration // for the user with deny access. You can later update the access control // configuration to allow access if the user returns to the company and re-joins // the 'top-secret' team. You can re-configure access control for your documents as // circumstances change. To apply your access control configuration to certain // documents, you call the BatchPutDocument (https://docs.aws.amazon.com/kendra/latest/dg/API_BatchPutDocument.html) // API with the AccessControlConfigurationId included in the Document (https://docs.aws.amazon.com/kendra/latest/dg/API_Document.html) // object. If you use an S3 bucket as a data source, you update the .metadata.json // with the AccessControlConfigurationId and synchronize your data source. Amazon // Kendra currently only supports access control configuration for S3 data sources // and documents indexed using the BatchPutDocument API. func (c *Client) CreateAccessControlConfiguration(ctx context.Context, params *CreateAccessControlConfigurationInput, optFns ...func(*Options)) (*CreateAccessControlConfigurationOutput, error) { if params == nil { params = &CreateAccessControlConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateAccessControlConfiguration", params, optFns, c.addOperationCreateAccessControlConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*CreateAccessControlConfigurationOutput) out.ResultMetadata = metadata return out, nil } type CreateAccessControlConfigurationInput struct { // The identifier of the index to create an access control configuration for your // documents. // // This member is required. IndexId *string // A name for the access control configuration. // // This member is required. Name *string // Information on principals (users and/or groups) and which documents they should // have access to. This is useful for user context filtering, where search results // are filtered based on the user or their group access to documents. AccessControlList []types.Principal // A token that you provide to identify the request to create an access control // configuration. Multiple calls to the CreateAccessControlConfiguration API with // the same client token will create only one access control configuration. ClientToken *string // A description for the access control configuration. Description *string // The list of principal (https://docs.aws.amazon.com/kendra/latest/dg/API_Principal.html) // lists that define the hierarchy for which documents users should have access to. HierarchicalAccessControlList []types.HierarchicalPrincipal noSmithyDocumentSerde } type CreateAccessControlConfigurationOutput struct { // The identifier of the access control configuration for your documents in an // index. // // This member is required. Id *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateAccessControlConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateAccessControlConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateAccessControlConfiguration{}, 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 = addIdempotencyToken_opCreateAccessControlConfigurationMiddleware(stack, options); err != nil { return err } if err = addOpCreateAccessControlConfigurationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAccessControlConfiguration(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 idempotencyToken_initializeOpCreateAccessControlConfiguration struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateAccessControlConfiguration) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateAccessControlConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { if m.tokenProvider == nil { return next.HandleInitialize(ctx, in) } input, ok := in.Parameters.(*CreateAccessControlConfigurationInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateAccessControlConfigurationInput ") } if input.ClientToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opCreateAccessControlConfigurationMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateAccessControlConfiguration{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateAccessControlConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "CreateAccessControlConfiguration", } }
207
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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/kendra/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a data source connector that you want to use with an Amazon Kendra // index. You specify a name, data source connector type and description for your // data source. You also specify configuration information for the data source // connector. CreateDataSource is a synchronous operation. The operation returns // 200 if the data source was successfully created. Otherwise, an exception is // raised. For an example of creating an index and data source using the Python // SDK, see Getting started with Python SDK (https://docs.aws.amazon.com/kendra/latest/dg/gs-python.html) // . For an example of creating an index and data source using the Java SDK, see // Getting started with Java SDK (https://docs.aws.amazon.com/kendra/latest/dg/gs-java.html) // . func (c *Client) CreateDataSource(ctx context.Context, params *CreateDataSourceInput, optFns ...func(*Options)) (*CreateDataSourceOutput, error) { if params == nil { params = &CreateDataSourceInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateDataSource", params, optFns, c.addOperationCreateDataSourceMiddlewares) if err != nil { return nil, err } out := result.(*CreateDataSourceOutput) out.ResultMetadata = metadata return out, nil } type CreateDataSourceInput struct { // The identifier of the index you want to use with the data source connector. // // This member is required. IndexId *string // A name for the data source connector. // // This member is required. Name *string // The type of data source repository. For example, SHAREPOINT . // // This member is required. Type types.DataSourceType // A token that you provide to identify the request to create a data source // connector. Multiple calls to the CreateDataSource API with the same client // token will create only one data source connector. ClientToken *string // Configuration information to connect to your data source repository. You can't // specify the Configuration parameter when the Type parameter is set to CUSTOM . // If you do, you receive a ValidationException exception. The Configuration // parameter is required for all other data sources. Configuration *types.DataSourceConfiguration // Configuration information for altering document metadata and content during the // document ingestion process. For more information on how to create, modify and // delete document metadata, or make other content alterations when you ingest // documents into Amazon Kendra, see Customizing document metadata during the // ingestion process (https://docs.aws.amazon.com/kendra/latest/dg/custom-document-enrichment.html) // . CustomDocumentEnrichmentConfiguration *types.CustomDocumentEnrichmentConfiguration // A description for the data source connector. Description *string // The code for a language. This allows you to support a language for all // documents when creating the data source connector. English is supported by // default. For more information on supported languages, including their codes, see // Adding documents in languages other than English (https://docs.aws.amazon.com/kendra/latest/dg/in-adding-languages.html) // . LanguageCode *string // The Amazon Resource Name (ARN) of an IAM role with permission to access the // data source and required resources. For more information, see IAM access roles // for Amazon Kendra. (https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html) // . You can't specify the RoleArn parameter when the Type parameter is set to // CUSTOM . If you do, you receive a ValidationException exception. The RoleArn // parameter is required for all other data sources. RoleArn *string // Sets the frequency for Amazon Kendra to check the documents in your data source // repository and update the index. If you don't set a schedule Amazon Kendra will // not periodically update the index. You can call the StartDataSourceSyncJob API // to update the index. Specify a cron- format schedule string or an empty string // to indicate that the index is updated on demand. You can't specify the Schedule // parameter when the Type parameter is set to CUSTOM . If you do, you receive a // ValidationException exception. Schedule *string // A list of key-value pairs that identify or categorize the data source // connector. You can also use tags to help control access to the data source // connector. Tag keys and values can consist of Unicode letters, digits, white // space, and any of the following symbols: _ . : / = + - @. Tags []types.Tag // Configuration information for an Amazon Virtual Private Cloud to connect to // your data source. For more information, see Configuring a VPC (https://docs.aws.amazon.com/kendra/latest/dg/vpc-configuration.html) // . VpcConfiguration *types.DataSourceVpcConfiguration noSmithyDocumentSerde } type CreateDataSourceOutput struct { // The identifier of the data source connector. // // This member is required. Id *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateDataSourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateDataSource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateDataSource{}, 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 = addIdempotencyToken_opCreateDataSourceMiddleware(stack, options); err != nil { return err } if err = addOpCreateDataSourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDataSource(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 idempotencyToken_initializeOpCreateDataSource struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateDataSource) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateDataSource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { if m.tokenProvider == nil { return next.HandleInitialize(ctx, in) } input, ok := in.Parameters.(*CreateDataSourceInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateDataSourceInput ") } if input.ClientToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opCreateDataSourceMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateDataSource{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateDataSource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "CreateDataSource", } }
240
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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/kendra/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates an Amazon Kendra experience such as a search application. For more // information on creating a search application experience, including using the // Python and Java SDKs, see Building a search experience with no code (https://docs.aws.amazon.com/kendra/latest/dg/deploying-search-experience-no-code.html) // . func (c *Client) CreateExperience(ctx context.Context, params *CreateExperienceInput, optFns ...func(*Options)) (*CreateExperienceOutput, error) { if params == nil { params = &CreateExperienceInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateExperience", params, optFns, c.addOperationCreateExperienceMiddlewares) if err != nil { return nil, err } out := result.(*CreateExperienceOutput) out.ResultMetadata = metadata return out, nil } type CreateExperienceInput struct { // The identifier of the index for your Amazon Kendra experience. // // This member is required. IndexId *string // A name for your Amazon Kendra experience. // // This member is required. Name *string // A token that you provide to identify the request to create your Amazon Kendra // experience. Multiple calls to the CreateExperience API with the same client // token creates only one Amazon Kendra experience. ClientToken *string // Configuration information for your Amazon Kendra experience. This includes // ContentSourceConfiguration , which specifies the data source IDs and/or FAQ IDs, // and UserIdentityConfiguration , which specifies the user or group information to // grant access to your Amazon Kendra experience. Configuration *types.ExperienceConfiguration // A description for your Amazon Kendra experience. Description *string // The Amazon Resource Name (ARN) of an IAM role with permission to access Query // API, GetQuerySuggestions API, and other required APIs. The role also must // include permission to access IAM Identity Center (successor to Single Sign-On) // that stores your user and group information. For more information, see IAM // access roles for Amazon Kendra (https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html) // . RoleArn *string noSmithyDocumentSerde } type CreateExperienceOutput struct { // The identifier of your Amazon Kendra experience. // // This member is required. Id *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateExperienceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateExperience{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateExperience{}, 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 = addIdempotencyToken_opCreateExperienceMiddleware(stack, options); err != nil { return err } if err = addOpCreateExperienceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateExperience(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 idempotencyToken_initializeOpCreateExperience struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateExperience) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateExperience) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { if m.tokenProvider == nil { return next.HandleInitialize(ctx, in) } input, ok := in.Parameters.(*CreateExperienceInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateExperienceInput ") } if input.ClientToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opCreateExperienceMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateExperience{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateExperience(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "CreateExperience", } }
194
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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/kendra/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a set of frequently ask questions (FAQs) using a specified FAQ file // stored in an Amazon S3 bucket. Adding FAQs to an index is an asynchronous // operation. For an example of adding an FAQ to an index using Python and Java // SDKs, see Using your FAQ file (https://docs.aws.amazon.com/kendra/latest/dg/in-creating-faq.html#using-faq-file) // . func (c *Client) CreateFaq(ctx context.Context, params *CreateFaqInput, optFns ...func(*Options)) (*CreateFaqOutput, error) { if params == nil { params = &CreateFaqInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateFaq", params, optFns, c.addOperationCreateFaqMiddlewares) if err != nil { return nil, err } out := result.(*CreateFaqOutput) out.ResultMetadata = metadata return out, nil } type CreateFaqInput struct { // The identifier of the index for the FAQ. // // This member is required. IndexId *string // A name for the FAQ. // // This member is required. Name *string // The Amazon Resource Name (ARN) of an IAM role with permission to access the S3 // bucket that contains the FAQs. For more information, see IAM access roles for // Amazon Kendra (https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html) . // // This member is required. RoleArn *string // The path to the FAQ file in S3. // // This member is required. S3Path *types.S3Path // A token that you provide to identify the request to create a FAQ. Multiple // calls to the CreateFaqRequest API with the same client token will create only // one FAQ. ClientToken *string // A description for the FAQ. Description *string // The format of the FAQ input file. You can choose between a basic CSV format, a // CSV format that includes customs attributes in a header, and a JSON format that // includes custom attributes. The default format is CSV. The format must match the // format of the file stored in the S3 bucket identified in the S3Path parameter. // For more information, see Adding questions and answers (https://docs.aws.amazon.com/kendra/latest/dg/in-creating-faq.html) // . FileFormat types.FaqFileFormat // The code for a language. This allows you to support a language for the FAQ // document. English is supported by default. For more information on supported // languages, including their codes, see Adding documents in languages other than // English (https://docs.aws.amazon.com/kendra/latest/dg/in-adding-languages.html) . LanguageCode *string // A list of key-value pairs that identify the FAQ. You can use the tags to // identify and organize your resources and to control access to resources. Tags []types.Tag noSmithyDocumentSerde } type CreateFaqOutput struct { // The identifier of the FAQ. Id *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateFaqMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateFaq{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateFaq{}, 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 = addIdempotencyToken_opCreateFaqMiddleware(stack, options); err != nil { return err } if err = addOpCreateFaqValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateFaq(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 idempotencyToken_initializeOpCreateFaq struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateFaq) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateFaq) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { if m.tokenProvider == nil { return next.HandleInitialize(ctx, in) } input, ok := in.Parameters.(*CreateFaqInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateFaqInput ") } if input.ClientToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opCreateFaqMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateFaq{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateFaq(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "CreateFaq", } }
209
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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/kendra/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a set of featured results to display at the top of the search results // page. Featured results are placed above all other results for certain queries. // You map specific queries to specific documents for featuring in the results. If // a query contains an exact match, then one or more specific documents are // featured in the search results. You can create up to 50 sets of featured results // per index. You can request to increase this limit by contacting Support (http://aws.amazon.com/contact-us/) // . func (c *Client) CreateFeaturedResultsSet(ctx context.Context, params *CreateFeaturedResultsSetInput, optFns ...func(*Options)) (*CreateFeaturedResultsSetOutput, error) { if params == nil { params = &CreateFeaturedResultsSetInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateFeaturedResultsSet", params, optFns, c.addOperationCreateFeaturedResultsSetMiddlewares) if err != nil { return nil, err } out := result.(*CreateFeaturedResultsSetOutput) out.ResultMetadata = metadata return out, nil } type CreateFeaturedResultsSetInput struct { // A name for the set of featured results. // // This member is required. FeaturedResultsSetName *string // The identifier of the index that you want to use for featuring results. // // This member is required. IndexId *string // A token that you provide to identify the request to create a set of featured // results. Multiple calls to the CreateFeaturedResultsSet API with the same // client token will create only one featured results set. ClientToken *string // A description for the set of featured results. Description *string // A list of document IDs for the documents you want to feature at the top of the // search results page. For more information on the list of documents, see // FeaturedResultsSet (https://docs.aws.amazon.com/kendra/latest/dg/API_FeaturedResultsSet.html) // . FeaturedDocuments []types.FeaturedDocument // A list of queries for featuring results. For more information on the list of // queries, see FeaturedResultsSet (https://docs.aws.amazon.com/kendra/latest/dg/API_FeaturedResultsSet.html) // . QueryTexts []string // The current status of the set of featured results. When the value is ACTIVE , // featured results are ready for use. You can still configure your settings before // setting the status to ACTIVE . You can set the status to ACTIVE or INACTIVE // using the UpdateFeaturedResultsSet (https://docs.aws.amazon.com/kendra/latest/dg/API_UpdateFeaturedResultsSet.html) // API. The queries you specify for featured results must be unique per featured // results set for each index, whether the status is ACTIVE or INACTIVE . Status types.FeaturedResultsSetStatus // A list of key-value pairs that identify or categorize the featured results set. // You can also use tags to help control access to the featured results set. Tag // keys and values can consist of Unicode letters, digits, white space, and any of // the following symbols:_ . : / = + - @. Tags []types.Tag noSmithyDocumentSerde } type CreateFeaturedResultsSetOutput struct { // Information on the set of featured results. This includes the identifier of the // featured results set, whether the featured results set is active or inactive, // when the featured results set was created, and more. FeaturedResultsSet *types.FeaturedResultsSet // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateFeaturedResultsSetMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateFeaturedResultsSet{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateFeaturedResultsSet{}, 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 = addOpCreateFeaturedResultsSetValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateFeaturedResultsSet(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_opCreateFeaturedResultsSet(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "CreateFeaturedResultsSet", } }
171
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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/kendra/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates an Amazon Kendra index. Index creation is an asynchronous API. To // determine if index creation has completed, check the Status field returned from // a call to DescribeIndex . The Status field is set to ACTIVE when the index is // ready to use. Once the index is active you can index your documents using the // BatchPutDocument API or using one of the supported data sources. For an example // of creating an index and data source using the Python SDK, see Getting started // with Python SDK (https://docs.aws.amazon.com/kendra/latest/dg/gs-python.html) . // For an example of creating an index and data source using the Java SDK, see // Getting started with Java SDK (https://docs.aws.amazon.com/kendra/latest/dg/gs-java.html) // . func (c *Client) CreateIndex(ctx context.Context, params *CreateIndexInput, optFns ...func(*Options)) (*CreateIndexOutput, error) { if params == nil { params = &CreateIndexInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateIndex", params, optFns, c.addOperationCreateIndexMiddlewares) if err != nil { return nil, err } out := result.(*CreateIndexOutput) out.ResultMetadata = metadata return out, nil } type CreateIndexInput struct { // A name for the index. // // This member is required. Name *string // The Amazon Resource Name (ARN) of an IAM role with permission to access your // Amazon CloudWatch logs and metrics. For more information, see IAM access roles // for Amazon Kendra (https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html) . // // This member is required. RoleArn *string // A token that you provide to identify the request to create an index. Multiple // calls to the CreateIndex API with the same client token will create only one // index. ClientToken *string // A description for the index. Description *string // The Amazon Kendra edition to use for the index. Choose DEVELOPER_EDITION for // indexes intended for development, testing, or proof of concept. Use // ENTERPRISE_EDITION for production. Once you set the edition for an index, it // can't be changed. The Edition parameter is optional. If you don't supply a // value, the default is ENTERPRISE_EDITION . For more information on quota limits // for Enterprise and Developer editions, see Quotas (https://docs.aws.amazon.com/kendra/latest/dg/quotas.html) // . Edition types.IndexEdition // The identifier of the KMS customer managed key (CMK) that's used to encrypt // data indexed by Amazon Kendra. Amazon Kendra doesn't support asymmetric CMKs. ServerSideEncryptionConfiguration *types.ServerSideEncryptionConfiguration // A list of key-value pairs that identify or categorize the index. You can also // use tags to help control access to the index. Tag keys and values can consist of // Unicode letters, digits, white space, and any of the following symbols: _ . : / // = + - @. Tags []types.Tag // The user context policy. ATTRIBUTE_FILTER All indexed content is searchable and // displayable for all users. If you want to filter search results on user context, // you can use the attribute filters of _user_id and _group_ids or you can provide // user and group information in UserContext . USER_TOKEN Enables token-based user // access control to filter search results on user context. All documents with no // access control and all documents accessible to the user will be searchable and // displayable. UserContextPolicy types.UserContextPolicy // Gets users and groups from IAM Identity Center (successor to Single Sign-On) // identity source. To configure this, see UserGroupResolutionConfiguration (https://docs.aws.amazon.com/kendra/latest/dg/API_UserGroupResolutionConfiguration.html) // . UserGroupResolutionConfiguration *types.UserGroupResolutionConfiguration // The user token configuration. UserTokenConfigurations []types.UserTokenConfiguration noSmithyDocumentSerde } type CreateIndexOutput struct { // The identifier of the index. Use this identifier when you query an index, set // up a data source, or index a document. Id *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateIndexMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateIndex{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateIndex{}, 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 = addIdempotencyToken_opCreateIndexMiddleware(stack, options); err != nil { return err } if err = addOpCreateIndexValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateIndex(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 idempotencyToken_initializeOpCreateIndex struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateIndex) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateIndex) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { if m.tokenProvider == nil { return next.HandleInitialize(ctx, in) } input, ok := in.Parameters.(*CreateIndexInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateIndexInput ") } if input.ClientToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opCreateIndexMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateIndex{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateIndex(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "CreateIndex", } }
223
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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/kendra/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a block list to exlcude certain queries from suggestions. Any query // that contains words or phrases specified in the block list is blocked or // filtered out from being shown as a suggestion. You need to provide the file // location of your block list text file in your S3 bucket. In your text file, // enter each block word or phrase on a separate line. For information on the // current quota limits for block lists, see Quotas for Amazon Kendra (https://docs.aws.amazon.com/kendra/latest/dg/quotas.html) // . CreateQuerySuggestionsBlockList is currently not supported in the Amazon Web // Services GovCloud (US-West) region. For an example of creating a block list for // query suggestions using the Python SDK, see Query suggestions block list (https://docs.aws.amazon.com/kendra/latest/dg/query-suggestions.html#query-suggestions-blocklist) // . func (c *Client) CreateQuerySuggestionsBlockList(ctx context.Context, params *CreateQuerySuggestionsBlockListInput, optFns ...func(*Options)) (*CreateQuerySuggestionsBlockListOutput, error) { if params == nil { params = &CreateQuerySuggestionsBlockListInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateQuerySuggestionsBlockList", params, optFns, c.addOperationCreateQuerySuggestionsBlockListMiddlewares) if err != nil { return nil, err } out := result.(*CreateQuerySuggestionsBlockListOutput) out.ResultMetadata = metadata return out, nil } type CreateQuerySuggestionsBlockListInput struct { // The identifier of the index you want to create a query suggestions block list // for. // // This member is required. IndexId *string // A name for the block list. For example, the name 'offensive-words', which // includes all offensive words that could appear in user queries and need to be // blocked from suggestions. // // This member is required. Name *string // The Amazon Resource Name (ARN) of an IAM role with permission to access your S3 // bucket that contains the block list text file. For more information, see IAM // access roles for Amazon Kendra (https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html) // . // // This member is required. RoleArn *string // The S3 path to your block list text file in your S3 bucket. Each block word or // phrase should be on a separate line in a text file. For information on the // current quota limits for block lists, see Quotas for Amazon Kendra (https://docs.aws.amazon.com/kendra/latest/dg/quotas.html) // . // // This member is required. SourceS3Path *types.S3Path // A token that you provide to identify the request to create a query suggestions // block list. ClientToken *string // A description for the block list. For example, the description "List of all // offensive words that can appear in user queries and need to be blocked from // suggestions." Description *string // A list of key-value pairs that identify or categorize the block list. Tag keys // and values can consist of Unicode letters, digits, white space, and any of the // following symbols: _ . : / = + - @. Tags []types.Tag noSmithyDocumentSerde } type CreateQuerySuggestionsBlockListOutput struct { // The identifier of the block list. Id *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateQuerySuggestionsBlockListMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateQuerySuggestionsBlockList{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateQuerySuggestionsBlockList{}, 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 = addIdempotencyToken_opCreateQuerySuggestionsBlockListMiddleware(stack, options); err != nil { return err } if err = addOpCreateQuerySuggestionsBlockListValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateQuerySuggestionsBlockList(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 idempotencyToken_initializeOpCreateQuerySuggestionsBlockList struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateQuerySuggestionsBlockList) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateQuerySuggestionsBlockList) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { if m.tokenProvider == nil { return next.HandleInitialize(ctx, in) } input, ok := in.Parameters.(*CreateQuerySuggestionsBlockListInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateQuerySuggestionsBlockListInput ") } if input.ClientToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opCreateQuerySuggestionsBlockListMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateQuerySuggestionsBlockList{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateQuerySuggestionsBlockList(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "CreateQuerySuggestionsBlockList", } }
209
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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/kendra/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a thesaurus for an index. The thesaurus contains a list of synonyms in // Solr format. For an example of adding a thesaurus file to an index, see Adding // custom synonyms to an index (https://docs.aws.amazon.com/kendra/latest/dg/index-synonyms-adding-thesaurus-file.html) // . func (c *Client) CreateThesaurus(ctx context.Context, params *CreateThesaurusInput, optFns ...func(*Options)) (*CreateThesaurusOutput, error) { if params == nil { params = &CreateThesaurusInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateThesaurus", params, optFns, c.addOperationCreateThesaurusMiddlewares) if err != nil { return nil, err } out := result.(*CreateThesaurusOutput) out.ResultMetadata = metadata return out, nil } type CreateThesaurusInput struct { // The identifier of the index for the thesaurus. // // This member is required. IndexId *string // A name for the thesaurus. // // This member is required. Name *string // The Amazon Resource Name (ARN) of an IAM role with permission to access your S3 // bucket that contains the thesaurus file. For more information, see IAM access // roles for Amazon Kendra (https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html) // . // // This member is required. RoleArn *string // The path to the thesaurus file in S3. // // This member is required. SourceS3Path *types.S3Path // A token that you provide to identify the request to create a thesaurus. // Multiple calls to the CreateThesaurus API with the same client token will // create only one thesaurus. ClientToken *string // A description for the thesaurus. Description *string // A list of key-value pairs that identify or categorize the thesaurus. You can // also use tags to help control access to the thesaurus. Tag keys and values can // consist of Unicode letters, digits, white space, and any of the following // symbols: _ . : / = + - @. Tags []types.Tag noSmithyDocumentSerde } type CreateThesaurusOutput struct { // The identifier of the thesaurus. Id *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateThesaurusMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateThesaurus{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateThesaurus{}, 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 = addIdempotencyToken_opCreateThesaurusMiddleware(stack, options); err != nil { return err } if err = addOpCreateThesaurusValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateThesaurus(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 idempotencyToken_initializeOpCreateThesaurus struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpCreateThesaurus) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpCreateThesaurus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { if m.tokenProvider == nil { return next.HandleInitialize(ctx, in) } input, ok := in.Parameters.(*CreateThesaurusInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateThesaurusInput ") } if input.ClientToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opCreateThesaurusMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpCreateThesaurus{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opCreateThesaurus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "CreateThesaurus", } }
197
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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 an access control configuration that you created for your documents in // an index. This includes user and group access information for your documents. // This is useful for user context filtering, where search results are filtered // based on the user or their group access to documents. func (c *Client) DeleteAccessControlConfiguration(ctx context.Context, params *DeleteAccessControlConfigurationInput, optFns ...func(*Options)) (*DeleteAccessControlConfigurationOutput, error) { if params == nil { params = &DeleteAccessControlConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteAccessControlConfiguration", params, optFns, c.addOperationDeleteAccessControlConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*DeleteAccessControlConfigurationOutput) out.ResultMetadata = metadata return out, nil } type DeleteAccessControlConfigurationInput struct { // The identifier of the access control configuration you want to delete. // // This member is required. Id *string // The identifier of the index for an access control configuration. // // This member is required. IndexId *string noSmithyDocumentSerde } type DeleteAccessControlConfigurationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteAccessControlConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteAccessControlConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteAccessControlConfiguration{}, 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 = addOpDeleteAccessControlConfigurationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAccessControlConfiguration(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_opDeleteAccessControlConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "DeleteAccessControlConfiguration", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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 an Amazon Kendra data source connector. An exception is not thrown if // the data source is already being deleted. While the data source is being // deleted, the Status field returned by a call to the DescribeDataSource API is // set to DELETING . For more information, see Deleting Data Sources (https://docs.aws.amazon.com/kendra/latest/dg/delete-data-source.html) // . func (c *Client) DeleteDataSource(ctx context.Context, params *DeleteDataSourceInput, optFns ...func(*Options)) (*DeleteDataSourceOutput, error) { if params == nil { params = &DeleteDataSourceInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteDataSource", params, optFns, c.addOperationDeleteDataSourceMiddlewares) if err != nil { return nil, err } out := result.(*DeleteDataSourceOutput) out.ResultMetadata = metadata return out, nil } type DeleteDataSourceInput struct { // The identifier of the data source connector you want to delete. // // This member is required. Id *string // The identifier of the index used with the data source connector. // // This member is required. IndexId *string noSmithyDocumentSerde } type DeleteDataSourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteDataSourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteDataSource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteDataSource{}, 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 = addOpDeleteDataSourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDataSource(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_opDeleteDataSource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "DeleteDataSource", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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 your Amazon Kendra experience such as a search application. For more // information on creating a search application experience, see Building a search // experience with no code (https://docs.aws.amazon.com/kendra/latest/dg/deploying-search-experience-no-code.html) // . func (c *Client) DeleteExperience(ctx context.Context, params *DeleteExperienceInput, optFns ...func(*Options)) (*DeleteExperienceOutput, error) { if params == nil { params = &DeleteExperienceInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteExperience", params, optFns, c.addOperationDeleteExperienceMiddlewares) if err != nil { return nil, err } out := result.(*DeleteExperienceOutput) out.ResultMetadata = metadata return out, nil } type DeleteExperienceInput struct { // The identifier of your Amazon Kendra experience you want to delete. // // This member is required. Id *string // The identifier of the index for your Amazon Kendra experience. // // This member is required. IndexId *string noSmithyDocumentSerde } type DeleteExperienceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteExperienceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteExperience{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteExperience{}, 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 = addOpDeleteExperienceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteExperience(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_opDeleteExperience(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "DeleteExperience", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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" ) // Removes an FAQ from an index. func (c *Client) DeleteFaq(ctx context.Context, params *DeleteFaqInput, optFns ...func(*Options)) (*DeleteFaqOutput, error) { if params == nil { params = &DeleteFaqInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteFaq", params, optFns, c.addOperationDeleteFaqMiddlewares) if err != nil { return nil, err } out := result.(*DeleteFaqOutput) out.ResultMetadata = metadata return out, nil } type DeleteFaqInput struct { // The identifier of the FAQ you want to remove. // // This member is required. Id *string // The identifier of the index for the FAQ. // // This member is required. IndexId *string noSmithyDocumentSerde } type DeleteFaqOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteFaqMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteFaq{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteFaq{}, 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 = addOpDeleteFaqValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteFaq(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_opDeleteFaq(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "DeleteFaq", } }
125
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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 an existing Amazon Kendra index. An exception is not thrown if the // index is already being deleted. While the index is being deleted, the Status // field returned by a call to the DescribeIndex API is set to DELETING . func (c *Client) DeleteIndex(ctx context.Context, params *DeleteIndexInput, optFns ...func(*Options)) (*DeleteIndexOutput, error) { if params == nil { params = &DeleteIndexInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteIndex", params, optFns, c.addOperationDeleteIndexMiddlewares) if err != nil { return nil, err } out := result.(*DeleteIndexOutput) out.ResultMetadata = metadata return out, nil } type DeleteIndexInput struct { // The identifier of the index you want to delete. // // This member is required. Id *string noSmithyDocumentSerde } type DeleteIndexOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteIndexMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteIndex{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteIndex{}, 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 = addOpDeleteIndexValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteIndex(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_opDeleteIndex(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "DeleteIndex", } }
122
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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 group so that all users and sub groups that belong to the group can // no longer access documents only available to that group. For example, after // deleting the group "Summer Interns", all interns who belonged to that group no // longer see intern-only documents in their search results. If you want to delete // or replace users or sub groups of a group, you need to use the // PutPrincipalMapping operation. For example, if a user in the group "Engineering" // leaves the engineering team and another user takes their place, you provide an // updated list of users or sub groups that belong to the "Engineering" group when // calling PutPrincipalMapping . You can update your internal list of users or sub // groups and input this list when calling PutPrincipalMapping . // DeletePrincipalMapping is currently not supported in the Amazon Web Services // GovCloud (US-West) region. func (c *Client) DeletePrincipalMapping(ctx context.Context, params *DeletePrincipalMappingInput, optFns ...func(*Options)) (*DeletePrincipalMappingOutput, error) { if params == nil { params = &DeletePrincipalMappingInput{} } result, metadata, err := c.invokeOperation(ctx, "DeletePrincipalMapping", params, optFns, c.addOperationDeletePrincipalMappingMiddlewares) if err != nil { return nil, err } out := result.(*DeletePrincipalMappingOutput) out.ResultMetadata = metadata return out, nil } type DeletePrincipalMappingInput struct { // The identifier of the group you want to delete. // // This member is required. GroupId *string // The identifier of the index you want to delete a group from. // // This member is required. IndexId *string // The identifier of the data source you want to delete a group from. A group can // be tied to multiple data sources. You can delete a group from accessing // documents in a certain data source. For example, the groups "Research", // "Engineering", and "Sales and Marketing" are all tied to the company's documents // stored in the data sources Confluence and Salesforce. You want to delete // "Research" and "Engineering" groups from Salesforce, so that these groups cannot // access customer-related documents stored in Salesforce. Only "Sales and // Marketing" should access documents in the Salesforce data source. DataSourceId *string // The timestamp identifier you specify to ensure Amazon Kendra does not override // the latest DELETE action with previous actions. The highest number ID, which is // the ordering ID, is the latest action you want to process and apply on top of // other actions with lower number IDs. This prevents previous actions with lower // number IDs from possibly overriding the latest action. The ordering ID can be // the Unix time of the last update you made to a group members list. You would // then provide this list when calling PutPrincipalMapping . This ensures your // DELETE action for that updated group with the latest members list doesn't get // overwritten by earlier DELETE actions for the same group which are yet to be // processed. The default ordering ID is the current Unix time in milliseconds that // the action was received by Amazon Kendra. OrderingId *int64 noSmithyDocumentSerde } type DeletePrincipalMappingOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeletePrincipalMappingMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeletePrincipalMapping{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeletePrincipalMapping{}, 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 = addOpDeletePrincipalMappingValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePrincipalMapping(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_opDeletePrincipalMapping(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "DeletePrincipalMapping", } }
159
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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 block list used for query suggestions for an index. A deleted block // list might not take effect right away. Amazon Kendra needs to refresh the entire // suggestions list to add back the queries that were previously blocked. // DeleteQuerySuggestionsBlockList is currently not supported in the Amazon Web // Services GovCloud (US-West) region. func (c *Client) DeleteQuerySuggestionsBlockList(ctx context.Context, params *DeleteQuerySuggestionsBlockListInput, optFns ...func(*Options)) (*DeleteQuerySuggestionsBlockListOutput, error) { if params == nil { params = &DeleteQuerySuggestionsBlockListInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteQuerySuggestionsBlockList", params, optFns, c.addOperationDeleteQuerySuggestionsBlockListMiddlewares) if err != nil { return nil, err } out := result.(*DeleteQuerySuggestionsBlockListOutput) out.ResultMetadata = metadata return out, nil } type DeleteQuerySuggestionsBlockListInput struct { // The identifier of the block list you want to delete. // // This member is required. Id *string // The identifier of the index for the block list. // // This member is required. IndexId *string noSmithyDocumentSerde } type DeleteQuerySuggestionsBlockListOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteQuerySuggestionsBlockListMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteQuerySuggestionsBlockList{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteQuerySuggestionsBlockList{}, 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 = addOpDeleteQuerySuggestionsBlockListValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteQuerySuggestionsBlockList(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_opDeleteQuerySuggestionsBlockList(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "DeleteQuerySuggestionsBlockList", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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 an existing Amazon Kendra thesaurus. func (c *Client) DeleteThesaurus(ctx context.Context, params *DeleteThesaurusInput, optFns ...func(*Options)) (*DeleteThesaurusOutput, error) { if params == nil { params = &DeleteThesaurusInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteThesaurus", params, optFns, c.addOperationDeleteThesaurusMiddlewares) if err != nil { return nil, err } out := result.(*DeleteThesaurusOutput) out.ResultMetadata = metadata return out, nil } type DeleteThesaurusInput struct { // The identifier of the thesaurus you want to delete. // // This member is required. Id *string // The identifier of the index for the thesaurus. // // This member is required. IndexId *string noSmithyDocumentSerde } type DeleteThesaurusOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteThesaurusMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteThesaurus{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteThesaurus{}, 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 = addOpDeleteThesaurusValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteThesaurus(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_opDeleteThesaurus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "DeleteThesaurus", } }
125
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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/kendra/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Gets information about an access control configuration that you created for // your documents in an index. This includes user and group access information for // your documents. This is useful for user context filtering, where search results // are filtered based on the user or their group access to documents. func (c *Client) DescribeAccessControlConfiguration(ctx context.Context, params *DescribeAccessControlConfigurationInput, optFns ...func(*Options)) (*DescribeAccessControlConfigurationOutput, error) { if params == nil { params = &DescribeAccessControlConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeAccessControlConfiguration", params, optFns, c.addOperationDescribeAccessControlConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*DescribeAccessControlConfigurationOutput) out.ResultMetadata = metadata return out, nil } type DescribeAccessControlConfigurationInput struct { // The identifier of the access control configuration you want to get information // on. // // This member is required. Id *string // The identifier of the index for an access control configuration. // // This member is required. IndexId *string noSmithyDocumentSerde } type DescribeAccessControlConfigurationOutput struct { // The name for the access control configuration. // // This member is required. Name *string // Information on principals (users and/or groups) and which documents they should // have access to. This is useful for user context filtering, where search results // are filtered based on the user or their group access to documents. AccessControlList []types.Principal // The description for the access control configuration. Description *string // The error message containing details if there are issues processing the access // control configuration. ErrorMessage *string // The list of principal (https://docs.aws.amazon.com/kendra/latest/dg/API_Principal.html) // lists that define the hierarchy for which documents users should have access to. HierarchicalAccessControlList []types.HierarchicalPrincipal // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeAccessControlConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAccessControlConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeAccessControlConfiguration{}, 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 = addOpDescribeAccessControlConfigurationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAccessControlConfiguration(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_opDescribeAccessControlConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "DescribeAccessControlConfiguration", } }
152
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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/kendra/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Gets information about an Amazon Kendra data source connector. func (c *Client) DescribeDataSource(ctx context.Context, params *DescribeDataSourceInput, optFns ...func(*Options)) (*DescribeDataSourceOutput, error) { if params == nil { params = &DescribeDataSourceInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeDataSource", params, optFns, c.addOperationDescribeDataSourceMiddlewares) if err != nil { return nil, err } out := result.(*DescribeDataSourceOutput) out.ResultMetadata = metadata return out, nil } type DescribeDataSourceInput struct { // The identifier of the data source connector. // // This member is required. Id *string // The identifier of the index used with the data source connector. // // This member is required. IndexId *string noSmithyDocumentSerde } type DescribeDataSourceOutput struct { // Configuration details for the data source connector. This shows how the data // source is configured. The configuration options for a data source depend on the // data source provider. Configuration *types.DataSourceConfiguration // The Unix timestamp when the data source connector was created. CreatedAt *time.Time // Configuration information for altering document metadata and content during the // document ingestion process when you describe a data source. For more information // on how to create, modify and delete document metadata, or make other content // alterations when you ingest documents into Amazon Kendra, see Customizing // document metadata during the ingestion process (https://docs.aws.amazon.com/kendra/latest/dg/custom-document-enrichment.html) // . CustomDocumentEnrichmentConfiguration *types.CustomDocumentEnrichmentConfiguration // The description for the data source connector. Description *string // When the Status field value is FAILED , the ErrorMessage field contains a // description of the error that caused the data source to fail. ErrorMessage *string // The identifier of the data source connector. Id *string // The identifier of the index used with the data source connector. IndexId *string // The code for a language. This shows a supported language for all documents in // the data source. English is supported by default. For more information on // supported languages, including their codes, see Adding documents in languages // other than English (https://docs.aws.amazon.com/kendra/latest/dg/in-adding-languages.html) // . LanguageCode *string // The name for the data source connector. Name *string // The Amazon Resource Name (ARN) of the role with permission to access the data // source and required resources. RoleArn *string // The schedule for Amazon Kendra to update the index. Schedule *string // The current status of the data source connector. When the status is ACTIVE the // data source is ready to use. When the status is FAILED , the ErrorMessage field // contains the reason that the data source failed. Status types.DataSourceStatus // The type of the data source. For example, SHAREPOINT . Type types.DataSourceType // The Unix timestamp when the data source connector was last updated. UpdatedAt *time.Time // Configuration information for an Amazon Virtual Private Cloud to connect to // your data source. For more information, see Configuring a VPC (https://docs.aws.amazon.com/kendra/latest/dg/vpc-configuration.html) // . VpcConfiguration *types.DataSourceVpcConfiguration // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeDataSourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeDataSource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeDataSource{}, 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 = addOpDescribeDataSourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDataSource(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_opDescribeDataSource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "DescribeDataSource", } }
190
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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/kendra/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Gets information about your Amazon Kendra experience such as a search // application. For more information on creating a search application experience, // see Building a search experience with no code (https://docs.aws.amazon.com/kendra/latest/dg/deploying-search-experience-no-code.html) // . func (c *Client) DescribeExperience(ctx context.Context, params *DescribeExperienceInput, optFns ...func(*Options)) (*DescribeExperienceOutput, error) { if params == nil { params = &DescribeExperienceInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeExperience", params, optFns, c.addOperationDescribeExperienceMiddlewares) if err != nil { return nil, err } out := result.(*DescribeExperienceOutput) out.ResultMetadata = metadata return out, nil } type DescribeExperienceInput struct { // The identifier of your Amazon Kendra experience you want to get information on. // // This member is required. Id *string // The identifier of the index for your Amazon Kendra experience. // // This member is required. IndexId *string noSmithyDocumentSerde } type DescribeExperienceOutput struct { // Shows the configuration information for your Amazon Kendra experience. This // includes ContentSourceConfiguration , which specifies the data source IDs and/or // FAQ IDs, and UserIdentityConfiguration , which specifies the user or group // information to grant access to your Amazon Kendra experience. Configuration *types.ExperienceConfiguration // The Unix timestamp when your Amazon Kendra experience was created. CreatedAt *time.Time // Shows the description for your Amazon Kendra experience. Description *string // Shows the endpoint URLs for your Amazon Kendra experiences. The URLs are unique // and fully hosted by Amazon Web Services. Endpoints []types.ExperienceEndpoint // The reason your Amazon Kendra experience could not properly process. ErrorMessage *string // Shows the identifier of your Amazon Kendra experience. Id *string // Shows the identifier of the index for your Amazon Kendra experience. IndexId *string // Shows the name of your Amazon Kendra experience. Name *string // Shows the Amazon Resource Name (ARN) of a role with permission to access Query // API, QuerySuggestions API, SubmitFeedback API, and IAM Identity Center that // stores your user and group information. RoleArn *string // The current processing status of your Amazon Kendra experience. When the status // is ACTIVE , your Amazon Kendra experience is ready to use. When the status is // FAILED , the ErrorMessage field contains the reason that this failed. Status types.ExperienceStatus // The Unix timestamp when your Amazon Kendra experience was last updated. UpdatedAt *time.Time // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeExperienceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeExperience{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeExperience{}, 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 = addOpDescribeExperienceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeExperience(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_opDescribeExperience(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "DescribeExperience", } }
172
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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/kendra/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Gets information about an FAQ list. func (c *Client) DescribeFaq(ctx context.Context, params *DescribeFaqInput, optFns ...func(*Options)) (*DescribeFaqOutput, error) { if params == nil { params = &DescribeFaqInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeFaq", params, optFns, c.addOperationDescribeFaqMiddlewares) if err != nil { return nil, err } out := result.(*DescribeFaqOutput) out.ResultMetadata = metadata return out, nil } type DescribeFaqInput struct { // The identifier of the FAQ you want to get information on. // // This member is required. Id *string // The identifier of the index for the FAQ. // // This member is required. IndexId *string noSmithyDocumentSerde } type DescribeFaqOutput struct { // The Unix timestamp when the FAQ was created. CreatedAt *time.Time // The description of the FAQ that you provided when it was created. Description *string // If the Status field is FAILED , the ErrorMessage field contains the reason why // the FAQ failed. ErrorMessage *string // The file format used by the input files for the FAQ. FileFormat types.FaqFileFormat // The identifier of the FAQ. Id *string // The identifier of the index for the FAQ. IndexId *string // The code for a language. This shows a supported language for the FAQ document. // English is supported by default. For more information on supported languages, // including their codes, see Adding documents in languages other than English (https://docs.aws.amazon.com/kendra/latest/dg/in-adding-languages.html) // . LanguageCode *string // The name that you gave the FAQ when it was created. Name *string // The Amazon Resource Name (ARN) of the role that provides access to the S3 // bucket containing the input files for the FAQ. RoleArn *string // Information required to find a specific file in an Amazon S3 bucket. S3Path *types.S3Path // The status of the FAQ. It is ready to use when the status is ACTIVE . Status types.FaqStatus // The Unix timestamp when the FAQ was last updated. UpdatedAt *time.Time // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeFaqMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeFaq{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeFaq{}, 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 = addOpDescribeFaqValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeFaq(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_opDescribeFaq(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "DescribeFaq", } }
169
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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/kendra/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Gets information about a set of featured results. Features results are placed // above all other results for certain queries. If there's an exact match of a // query, then one or more specific documents are featured in the search results. func (c *Client) DescribeFeaturedResultsSet(ctx context.Context, params *DescribeFeaturedResultsSetInput, optFns ...func(*Options)) (*DescribeFeaturedResultsSetOutput, error) { if params == nil { params = &DescribeFeaturedResultsSetInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeFeaturedResultsSet", params, optFns, c.addOperationDescribeFeaturedResultsSetMiddlewares) if err != nil { return nil, err } out := result.(*DescribeFeaturedResultsSetOutput) out.ResultMetadata = metadata return out, nil } type DescribeFeaturedResultsSetInput struct { // The identifier of the set of featured results that you want to get information // on. // // This member is required. FeaturedResultsSetId *string // The identifier of the index used for featuring results. // // This member is required. IndexId *string noSmithyDocumentSerde } type DescribeFeaturedResultsSetOutput struct { // The Unix timestamp when the set of the featured results was created. CreationTimestamp *int64 // The description for the set of featured results. Description *string // The list of document IDs that don't exist but you have specified as featured // documents. Amazon Kendra cannot feature these documents if they don't exist in // the index. You can check the status of a document and its ID or check for // documents with status errors using the BatchGetDocumentStatus (https://docs.aws.amazon.com/kendra/latest/dg/API_BatchGetDocumentStatus.html) // API. FeaturedDocumentsMissing []types.FeaturedDocumentMissing // The list of document IDs for the documents you want to feature with their // metadata information. For more information on the list of featured documents, // see FeaturedResultsSet (https://docs.aws.amazon.com/kendra/latest/dg/API_FeaturedResultsSet.html) // . FeaturedDocumentsWithMetadata []types.FeaturedDocumentWithMetadata // The identifier of the set of featured results. FeaturedResultsSetId *string // The name for the set of featured results. FeaturedResultsSetName *string // The timestamp when the set of featured results was last updated. LastUpdatedTimestamp *int64 // The list of queries for featuring results. For more information on the list of // queries, see FeaturedResultsSet (https://docs.aws.amazon.com/kendra/latest/dg/API_FeaturedResultsSet.html) // . QueryTexts []string // The current status of the set of featured results. When the value is ACTIVE , // featured results are ready for use. You can still configure your settings before // setting the status to ACTIVE . You can set the status to ACTIVE or INACTIVE // using the UpdateFeaturedResultsSet (https://docs.aws.amazon.com/kendra/latest/dg/API_UpdateFeaturedResultsSet.html) // API. The queries you specify for featured results must be unique per featured // results set for each index, whether the status is ACTIVE or INACTIVE . Status types.FeaturedResultsSetStatus // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeFeaturedResultsSetMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeFeaturedResultsSet{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeFeaturedResultsSet{}, 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 = addOpDescribeFeaturedResultsSetValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeFeaturedResultsSet(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_opDescribeFeaturedResultsSet(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "DescribeFeaturedResultsSet", } }
171
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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/kendra/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Gets information about an existing Amazon Kendra index. func (c *Client) DescribeIndex(ctx context.Context, params *DescribeIndexInput, optFns ...func(*Options)) (*DescribeIndexOutput, error) { if params == nil { params = &DescribeIndexInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeIndex", params, optFns, c.addOperationDescribeIndexMiddlewares) if err != nil { return nil, err } out := result.(*DescribeIndexOutput) out.ResultMetadata = metadata return out, nil } type DescribeIndexInput struct { // The identifier of the index you want to get information on. // // This member is required. Id *string noSmithyDocumentSerde } type DescribeIndexOutput struct { // For Enterprise Edition indexes, you can choose to use additional capacity to // meet the needs of your application. This contains the capacity units used for // the index. A query or document storage capacity of zero indicates that the index // is using the default capacity. For more information on the default capacity for // an index and adjusting this, see Adjusting capacity (https://docs.aws.amazon.com/kendra/latest/dg/adjusting-capacity.html) // . CapacityUnits *types.CapacityUnitsConfiguration // The Unix timestamp when the index was created. CreatedAt *time.Time // The description for the index. Description *string // Configuration information for document metadata or fields. Document metadata // are fields or attributes associated with your documents. For example, the // company department name associated with each document. DocumentMetadataConfigurations []types.DocumentMetadataConfiguration // The Amazon Kendra edition used for the index. You decide the edition when you // create the index. Edition types.IndexEdition // When the Status field value is FAILED , the ErrorMessage field contains a // message that explains why. ErrorMessage *string // The identifier of the index. Id *string // Provides information about the number of FAQ questions and answers and the // number of text documents indexed. IndexStatistics *types.IndexStatistics // The name of the index. Name *string // The Amazon Resource Name (ARN) of the IAM role that gives Amazon Kendra // permission to write to your Amazon Cloudwatch logs. RoleArn *string // The identifier of the KMScustomer master key (CMK) that is used to encrypt your // data. Amazon Kendra doesn't support asymmetric CMKs. ServerSideEncryptionConfiguration *types.ServerSideEncryptionConfiguration // The current status of the index. When the value is ACTIVE , the index is ready // for use. If the Status field value is FAILED , the ErrorMessage field contains // a message that explains why. Status types.IndexStatus // The Unix when the index was last updated. UpdatedAt *time.Time // The user context policy for the Amazon Kendra index. UserContextPolicy types.UserContextPolicy // Whether you have enabled the configuration for fetching access levels of groups // and users from an IAM Identity Center (successor to Single Sign-On) identity // source. UserGroupResolutionConfiguration *types.UserGroupResolutionConfiguration // The user token configuration for the Amazon Kendra index. UserTokenConfigurations []types.UserTokenConfiguration // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeIndexMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeIndex{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeIndex{}, 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 = addOpDescribeIndexValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeIndex(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_opDescribeIndex(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "DescribeIndex", } }
187
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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/kendra/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Describes the processing of PUT and DELETE actions for mapping users to their // groups. This includes information on the status of actions currently processing // or yet to be processed, when actions were last updated, when actions were // received by Amazon Kendra, the latest action that should process and apply after // other actions, and useful error messages if an action could not be processed. // DescribePrincipalMapping is currently not supported in the Amazon Web Services // GovCloud (US-West) region. func (c *Client) DescribePrincipalMapping(ctx context.Context, params *DescribePrincipalMappingInput, optFns ...func(*Options)) (*DescribePrincipalMappingOutput, error) { if params == nil { params = &DescribePrincipalMappingInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribePrincipalMapping", params, optFns, c.addOperationDescribePrincipalMappingMiddlewares) if err != nil { return nil, err } out := result.(*DescribePrincipalMappingOutput) out.ResultMetadata = metadata return out, nil } type DescribePrincipalMappingInput struct { // The identifier of the group required to check the processing of PUT and DELETE // actions for mapping users to their groups. // // This member is required. GroupId *string // The identifier of the index required to check the processing of PUT and DELETE // actions for mapping users to their groups. // // This member is required. IndexId *string // The identifier of the data source to check the processing of PUT and DELETE // actions for mapping users to their groups. DataSourceId *string noSmithyDocumentSerde } type DescribePrincipalMappingOutput struct { // Shows the identifier of the data source to see information on the processing of // PUT and DELETE actions for mapping users to their groups. DataSourceId *string // Shows the identifier of the group to see information on the processing of PUT // and DELETE actions for mapping users to their groups. GroupId *string // Shows the following information on the processing of PUT and DELETE actions for // mapping users to their groups: // - Status—the status can be either PROCESSING , SUCCEEDED , DELETING , DELETED // , or FAILED . // - Last updated—the last date-time an action was updated. // - Received—the last date-time an action was received or submitted. // - Ordering ID—the latest action that should process and apply after other // actions. // - Failure reason—the reason an action could not be processed. GroupOrderingIdSummaries []types.GroupOrderingIdSummary // Shows the identifier of the index to see information on the processing of PUT // and DELETE actions for mapping users to their groups. IndexId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribePrincipalMappingMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribePrincipalMapping{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribePrincipalMapping{}, 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 = addOpDescribePrincipalMappingValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribePrincipalMapping(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_opDescribePrincipalMapping(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "DescribePrincipalMapping", } }
162
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package kendra 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/kendra/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Gets information about a block list used for query suggestions for an index. // This is used to check the current settings that are applied to a block list. // DescribeQuerySuggestionsBlockList is currently not supported in the Amazon Web // Services GovCloud (US-West) region. func (c *Client) DescribeQuerySuggestionsBlockList(ctx context.Context, params *DescribeQuerySuggestionsBlockListInput, optFns ...func(*Options)) (*DescribeQuerySuggestionsBlockListOutput, error) { if params == nil { params = &DescribeQuerySuggestionsBlockListInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeQuerySuggestionsBlockList", params, optFns, c.addOperationDescribeQuerySuggestionsBlockListMiddlewares) if err != nil { return nil, err } out := result.(*DescribeQuerySuggestionsBlockListOutput) out.ResultMetadata = metadata return out, nil } type DescribeQuerySuggestionsBlockListInput struct { // The identifier of the block list you want to get information on. // // This member is required. Id *string // The identifier of the index for the block list. // // This member is required. IndexId *string noSmithyDocumentSerde } type DescribeQuerySuggestionsBlockListOutput struct { // The Unix timestamp when a block list for query suggestions was created. CreatedAt *time.Time // The description for the block list. Description *string // The error message containing details if there are issues processing the block // list. ErrorMessage *string // The current size of the block list text file in S3. FileSizeBytes *int64 // The identifier of the block list. Id *string // The identifier of the index for the block list. IndexId *string // The current number of valid, non-empty words or phrases in the block list text // file. ItemCount *int32 // The name of the block list. Name *string // The IAM (Identity and Access Management) role used by Amazon Kendra to access // the block list text file in S3. The role needs S3 read permissions to your file // in S3 and needs to give STS (Security Token Service) assume role permissions to // Amazon Kendra. RoleArn *string // Shows the current S3 path to your block list text file in your S3 bucket. Each // block word or phrase should be on a separate line in a text file. For // information on the current quota limits for block lists, see Quotas for Amazon // Kendra (https://docs.aws.amazon.com/kendra/latest/dg/quotas.html) . SourceS3Path *types.S3Path // The current status of the block list. When the value is ACTIVE , the block list // is ready for use. Status types.QuerySuggestionsBlockListStatus // The Unix timestamp when a block list for query suggestions was last updated. UpdatedAt *time.Time // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeQuerySuggestionsBlockListMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeQuerySuggestionsBlockList{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeQuerySuggestionsBlockList{}, 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 = addOpDescribeQuerySuggestionsBlockListValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeQuerySuggestionsBlockList(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_opDescribeQuerySuggestionsBlockList(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "kendra", OperationName: "DescribeQuerySuggestionsBlockList", } }
176