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 lambda
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/lambda/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists event source mappings. Specify an EventSourceArn to show only event
// source mappings for a single event source.
func (c *Client) ListEventSourceMappings(ctx context.Context, params *ListEventSourceMappingsInput, optFns ...func(*Options)) (*ListEventSourceMappingsOutput, error) {
if params == nil {
params = &ListEventSourceMappingsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListEventSourceMappings", params, optFns, c.addOperationListEventSourceMappingsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListEventSourceMappingsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListEventSourceMappingsInput struct {
// The Amazon Resource Name (ARN) of the event source.
// - Amazon Kinesis – The ARN of the data stream or a stream consumer.
// - Amazon DynamoDB Streams – The ARN of the stream.
// - Amazon Simple Queue Service – The ARN of the queue.
// - Amazon Managed Streaming for Apache Kafka – The ARN of the cluster.
// - Amazon MQ – The ARN of the broker.
// - Amazon DocumentDB – The ARN of the DocumentDB change stream.
EventSourceArn *string
// The name of the Lambda function. Name formats
// - Function name – MyFunction .
// - Function ARN – arn:aws:lambda:us-west-2:123456789012:function:MyFunction .
// - Version or Alias ARN –
// arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD .
// - Partial ARN – 123456789012:function:MyFunction .
// The length constraint applies only to the full ARN. If you specify only the
// function name, it's limited to 64 characters in length.
FunctionName *string
// A pagination token returned by a previous call.
Marker *string
// The maximum number of event source mappings to return. Note that
// ListEventSourceMappings returns a maximum of 100 items in each response, even if
// you set the number higher.
MaxItems *int32
noSmithyDocumentSerde
}
type ListEventSourceMappingsOutput struct {
// A list of event source mappings.
EventSourceMappings []types.EventSourceMappingConfiguration
// A pagination token that's returned when the response doesn't contain all event
// source mappings.
NextMarker *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListEventSourceMappingsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListEventSourceMappings{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListEventSourceMappings{}, 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_opListEventSourceMappings(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
}
// ListEventSourceMappingsAPIClient is a client that implements the
// ListEventSourceMappings operation.
type ListEventSourceMappingsAPIClient interface {
ListEventSourceMappings(context.Context, *ListEventSourceMappingsInput, ...func(*Options)) (*ListEventSourceMappingsOutput, error)
}
var _ ListEventSourceMappingsAPIClient = (*Client)(nil)
// ListEventSourceMappingsPaginatorOptions is the paginator options for
// ListEventSourceMappings
type ListEventSourceMappingsPaginatorOptions struct {
// The maximum number of event source mappings to return. Note that
// ListEventSourceMappings returns a maximum of 100 items in each response, even if
// you set the number higher.
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
}
// ListEventSourceMappingsPaginator is a paginator for ListEventSourceMappings
type ListEventSourceMappingsPaginator struct {
options ListEventSourceMappingsPaginatorOptions
client ListEventSourceMappingsAPIClient
params *ListEventSourceMappingsInput
nextToken *string
firstPage bool
}
// NewListEventSourceMappingsPaginator returns a new
// ListEventSourceMappingsPaginator
func NewListEventSourceMappingsPaginator(client ListEventSourceMappingsAPIClient, params *ListEventSourceMappingsInput, optFns ...func(*ListEventSourceMappingsPaginatorOptions)) *ListEventSourceMappingsPaginator {
if params == nil {
params = &ListEventSourceMappingsInput{}
}
options := ListEventSourceMappingsPaginatorOptions{}
if params.MaxItems != nil {
options.Limit = *params.MaxItems
}
for _, fn := range optFns {
fn(&options)
}
return &ListEventSourceMappingsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListEventSourceMappingsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListEventSourceMappings page.
func (p *ListEventSourceMappingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEventSourceMappingsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxItems = limit
result, err := p.client.ListEventSourceMappings(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextMarker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListEventSourceMappings(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lambda",
OperationName: "ListEventSourceMappings",
}
}
| 244 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
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/lambda/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves a list of configurations for asynchronous invocation for a function.
// To configure options for asynchronous invocation, use
// PutFunctionEventInvokeConfig .
func (c *Client) ListFunctionEventInvokeConfigs(ctx context.Context, params *ListFunctionEventInvokeConfigsInput, optFns ...func(*Options)) (*ListFunctionEventInvokeConfigsOutput, error) {
if params == nil {
params = &ListFunctionEventInvokeConfigsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListFunctionEventInvokeConfigs", params, optFns, c.addOperationListFunctionEventInvokeConfigsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListFunctionEventInvokeConfigsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListFunctionEventInvokeConfigsInput struct {
// The name of the Lambda function. Name formats
// - Function name - my-function .
// - Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function .
// - Partial ARN - 123456789012:function:my-function .
// The length constraint applies only to the full ARN. If you specify only the
// function name, it is limited to 64 characters in length.
//
// This member is required.
FunctionName *string
// Specify the pagination token that's returned by a previous request to retrieve
// the next page of results.
Marker *string
// The maximum number of configurations to return.
MaxItems *int32
noSmithyDocumentSerde
}
type ListFunctionEventInvokeConfigsOutput struct {
// A list of configurations.
FunctionEventInvokeConfigs []types.FunctionEventInvokeConfig
// The pagination token that's included if more results are available.
NextMarker *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListFunctionEventInvokeConfigsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListFunctionEventInvokeConfigs{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListFunctionEventInvokeConfigs{}, 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 = addOpListFunctionEventInvokeConfigsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListFunctionEventInvokeConfigs(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
}
// ListFunctionEventInvokeConfigsAPIClient is a client that implements the
// ListFunctionEventInvokeConfigs operation.
type ListFunctionEventInvokeConfigsAPIClient interface {
ListFunctionEventInvokeConfigs(context.Context, *ListFunctionEventInvokeConfigsInput, ...func(*Options)) (*ListFunctionEventInvokeConfigsOutput, error)
}
var _ ListFunctionEventInvokeConfigsAPIClient = (*Client)(nil)
// ListFunctionEventInvokeConfigsPaginatorOptions is the paginator options for
// ListFunctionEventInvokeConfigs
type ListFunctionEventInvokeConfigsPaginatorOptions struct {
// The maximum number of configurations to return.
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
}
// ListFunctionEventInvokeConfigsPaginator is a paginator for
// ListFunctionEventInvokeConfigs
type ListFunctionEventInvokeConfigsPaginator struct {
options ListFunctionEventInvokeConfigsPaginatorOptions
client ListFunctionEventInvokeConfigsAPIClient
params *ListFunctionEventInvokeConfigsInput
nextToken *string
firstPage bool
}
// NewListFunctionEventInvokeConfigsPaginator returns a new
// ListFunctionEventInvokeConfigsPaginator
func NewListFunctionEventInvokeConfigsPaginator(client ListFunctionEventInvokeConfigsAPIClient, params *ListFunctionEventInvokeConfigsInput, optFns ...func(*ListFunctionEventInvokeConfigsPaginatorOptions)) *ListFunctionEventInvokeConfigsPaginator {
if params == nil {
params = &ListFunctionEventInvokeConfigsInput{}
}
options := ListFunctionEventInvokeConfigsPaginatorOptions{}
if params.MaxItems != nil {
options.Limit = *params.MaxItems
}
for _, fn := range optFns {
fn(&options)
}
return &ListFunctionEventInvokeConfigsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListFunctionEventInvokeConfigsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListFunctionEventInvokeConfigs page.
func (p *ListFunctionEventInvokeConfigsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFunctionEventInvokeConfigsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxItems = limit
result, err := p.client.ListFunctionEventInvokeConfigs(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextMarker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListFunctionEventInvokeConfigs(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lambda",
OperationName: "ListFunctionEventInvokeConfigs",
}
}
| 236 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
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/lambda/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a list of Lambda functions, with the version-specific configuration of
// each. Lambda returns up to 50 functions per call. Set FunctionVersion to ALL to
// include all published versions of each function in addition to the unpublished
// version. The ListFunctions operation returns a subset of the
// FunctionConfiguration fields. To get the additional fields (State,
// StateReasonCode, StateReason, LastUpdateStatus, LastUpdateStatusReason,
// LastUpdateStatusReasonCode, RuntimeVersionConfig) for a function or version, use
// GetFunction .
func (c *Client) ListFunctions(ctx context.Context, params *ListFunctionsInput, optFns ...func(*Options)) (*ListFunctionsOutput, error) {
if params == nil {
params = &ListFunctionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListFunctions", params, optFns, c.addOperationListFunctionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListFunctionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListFunctionsInput struct {
// Set to ALL to include entries for all published versions of each function.
FunctionVersion types.FunctionVersion
// Specify the pagination token that's returned by a previous request to retrieve
// the next page of results.
Marker *string
// For Lambda@Edge functions, the Amazon Web Services Region of the master
// function. For example, us-east-1 filters the list of functions to include only
// Lambda@Edge functions replicated from a master function in US East (N.
// Virginia). If specified, you must set FunctionVersion to ALL .
MasterRegion *string
// The maximum number of functions to return in the response. Note that
// ListFunctions returns a maximum of 50 items in each response, even if you set
// the number higher.
MaxItems *int32
noSmithyDocumentSerde
}
// A list of Lambda functions.
type ListFunctionsOutput struct {
// A list of Lambda functions.
Functions []types.FunctionConfiguration
// The pagination token that's included if more results are available.
NextMarker *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListFunctionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListFunctions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListFunctions{}, 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_opListFunctions(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
}
// ListFunctionsAPIClient is a client that implements the ListFunctions operation.
type ListFunctionsAPIClient interface {
ListFunctions(context.Context, *ListFunctionsInput, ...func(*Options)) (*ListFunctionsOutput, error)
}
var _ ListFunctionsAPIClient = (*Client)(nil)
// ListFunctionsPaginatorOptions is the paginator options for ListFunctions
type ListFunctionsPaginatorOptions struct {
// The maximum number of functions to return in the response. Note that
// ListFunctions returns a maximum of 50 items in each response, even if you set
// the number higher.
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
}
// ListFunctionsPaginator is a paginator for ListFunctions
type ListFunctionsPaginator struct {
options ListFunctionsPaginatorOptions
client ListFunctionsAPIClient
params *ListFunctionsInput
nextToken *string
firstPage bool
}
// NewListFunctionsPaginator returns a new ListFunctionsPaginator
func NewListFunctionsPaginator(client ListFunctionsAPIClient, params *ListFunctionsInput, optFns ...func(*ListFunctionsPaginatorOptions)) *ListFunctionsPaginator {
if params == nil {
params = &ListFunctionsInput{}
}
options := ListFunctionsPaginatorOptions{}
if params.MaxItems != nil {
options.Limit = *params.MaxItems
}
for _, fn := range optFns {
fn(&options)
}
return &ListFunctionsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListFunctionsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListFunctions page.
func (p *ListFunctionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFunctionsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxItems = limit
result, err := p.client.ListFunctions(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextMarker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListFunctions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lambda",
OperationName: "ListFunctions",
}
}
| 238 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
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"
)
// List the functions that use the specified code signing configuration. You can
// use this method prior to deleting a code signing configuration, to verify that
// no functions are using it.
func (c *Client) ListFunctionsByCodeSigningConfig(ctx context.Context, params *ListFunctionsByCodeSigningConfigInput, optFns ...func(*Options)) (*ListFunctionsByCodeSigningConfigOutput, error) {
if params == nil {
params = &ListFunctionsByCodeSigningConfigInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListFunctionsByCodeSigningConfig", params, optFns, c.addOperationListFunctionsByCodeSigningConfigMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListFunctionsByCodeSigningConfigOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListFunctionsByCodeSigningConfigInput struct {
// The The Amazon Resource Name (ARN) of the code signing configuration.
//
// This member is required.
CodeSigningConfigArn *string
// Specify the pagination token that's returned by a previous request to retrieve
// the next page of results.
Marker *string
// Maximum number of items to return.
MaxItems *int32
noSmithyDocumentSerde
}
type ListFunctionsByCodeSigningConfigOutput struct {
// The function ARNs.
FunctionArns []string
// The pagination token that's included if more results are available.
NextMarker *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListFunctionsByCodeSigningConfigMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListFunctionsByCodeSigningConfig{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListFunctionsByCodeSigningConfig{}, 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 = addOpListFunctionsByCodeSigningConfigValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListFunctionsByCodeSigningConfig(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
}
// ListFunctionsByCodeSigningConfigAPIClient is a client that implements the
// ListFunctionsByCodeSigningConfig operation.
type ListFunctionsByCodeSigningConfigAPIClient interface {
ListFunctionsByCodeSigningConfig(context.Context, *ListFunctionsByCodeSigningConfigInput, ...func(*Options)) (*ListFunctionsByCodeSigningConfigOutput, error)
}
var _ ListFunctionsByCodeSigningConfigAPIClient = (*Client)(nil)
// ListFunctionsByCodeSigningConfigPaginatorOptions is the paginator options for
// ListFunctionsByCodeSigningConfig
type ListFunctionsByCodeSigningConfigPaginatorOptions struct {
// Maximum number of items to return.
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
}
// ListFunctionsByCodeSigningConfigPaginator is a paginator for
// ListFunctionsByCodeSigningConfig
type ListFunctionsByCodeSigningConfigPaginator struct {
options ListFunctionsByCodeSigningConfigPaginatorOptions
client ListFunctionsByCodeSigningConfigAPIClient
params *ListFunctionsByCodeSigningConfigInput
nextToken *string
firstPage bool
}
// NewListFunctionsByCodeSigningConfigPaginator returns a new
// ListFunctionsByCodeSigningConfigPaginator
func NewListFunctionsByCodeSigningConfigPaginator(client ListFunctionsByCodeSigningConfigAPIClient, params *ListFunctionsByCodeSigningConfigInput, optFns ...func(*ListFunctionsByCodeSigningConfigPaginatorOptions)) *ListFunctionsByCodeSigningConfigPaginator {
if params == nil {
params = &ListFunctionsByCodeSigningConfigInput{}
}
options := ListFunctionsByCodeSigningConfigPaginatorOptions{}
if params.MaxItems != nil {
options.Limit = *params.MaxItems
}
for _, fn := range optFns {
fn(&options)
}
return &ListFunctionsByCodeSigningConfigPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListFunctionsByCodeSigningConfigPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListFunctionsByCodeSigningConfig page.
func (p *ListFunctionsByCodeSigningConfigPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFunctionsByCodeSigningConfigOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxItems = limit
result, err := p.client.ListFunctionsByCodeSigningConfig(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextMarker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListFunctionsByCodeSigningConfig(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lambda",
OperationName: "ListFunctionsByCodeSigningConfig",
}
}
| 230 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
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/lambda/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a list of Lambda function URLs for the specified function.
func (c *Client) ListFunctionUrlConfigs(ctx context.Context, params *ListFunctionUrlConfigsInput, optFns ...func(*Options)) (*ListFunctionUrlConfigsOutput, error) {
if params == nil {
params = &ListFunctionUrlConfigsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListFunctionUrlConfigs", params, optFns, c.addOperationListFunctionUrlConfigsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListFunctionUrlConfigsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListFunctionUrlConfigsInput struct {
// The name of the Lambda function. Name formats
// - Function name – my-function .
// - Function ARN – arn:aws:lambda:us-west-2:123456789012:function:my-function .
// - Partial ARN – 123456789012:function:my-function .
// The length constraint applies only to the full ARN. If you specify only the
// function name, it is limited to 64 characters in length.
//
// This member is required.
FunctionName *string
// Specify the pagination token that's returned by a previous request to retrieve
// the next page of results.
Marker *string
// The maximum number of function URLs to return in the response. Note that
// ListFunctionUrlConfigs returns a maximum of 50 items in each response, even if
// you set the number higher.
MaxItems *int32
noSmithyDocumentSerde
}
type ListFunctionUrlConfigsOutput struct {
// A list of function URL configurations.
//
// This member is required.
FunctionUrlConfigs []types.FunctionUrlConfig
// The pagination token that's included if more results are available.
NextMarker *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListFunctionUrlConfigsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListFunctionUrlConfigs{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListFunctionUrlConfigs{}, 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 = addOpListFunctionUrlConfigsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListFunctionUrlConfigs(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
}
// ListFunctionUrlConfigsAPIClient is a client that implements the
// ListFunctionUrlConfigs operation.
type ListFunctionUrlConfigsAPIClient interface {
ListFunctionUrlConfigs(context.Context, *ListFunctionUrlConfigsInput, ...func(*Options)) (*ListFunctionUrlConfigsOutput, error)
}
var _ ListFunctionUrlConfigsAPIClient = (*Client)(nil)
// ListFunctionUrlConfigsPaginatorOptions is the paginator options for
// ListFunctionUrlConfigs
type ListFunctionUrlConfigsPaginatorOptions struct {
// The maximum number of function URLs to return in the response. Note that
// ListFunctionUrlConfigs returns a maximum of 50 items in each response, even if
// you set the number higher.
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
}
// ListFunctionUrlConfigsPaginator is a paginator for ListFunctionUrlConfigs
type ListFunctionUrlConfigsPaginator struct {
options ListFunctionUrlConfigsPaginatorOptions
client ListFunctionUrlConfigsAPIClient
params *ListFunctionUrlConfigsInput
nextToken *string
firstPage bool
}
// NewListFunctionUrlConfigsPaginator returns a new ListFunctionUrlConfigsPaginator
func NewListFunctionUrlConfigsPaginator(client ListFunctionUrlConfigsAPIClient, params *ListFunctionUrlConfigsInput, optFns ...func(*ListFunctionUrlConfigsPaginatorOptions)) *ListFunctionUrlConfigsPaginator {
if params == nil {
params = &ListFunctionUrlConfigsInput{}
}
options := ListFunctionUrlConfigsPaginatorOptions{}
if params.MaxItems != nil {
options.Limit = *params.MaxItems
}
for _, fn := range optFns {
fn(&options)
}
return &ListFunctionUrlConfigsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListFunctionUrlConfigsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListFunctionUrlConfigs page.
func (p *ListFunctionUrlConfigsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFunctionUrlConfigsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxItems = limit
result, err := p.client.ListFunctionUrlConfigs(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextMarker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListFunctionUrlConfigs(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lambda",
OperationName: "ListFunctionUrlConfigs",
}
}
| 238 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
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/lambda/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists Lambda layers (https://docs.aws.amazon.com/lambda/latest/dg/invocation-layers.html)
// and shows information about the latest version of each. Specify a runtime
// identifier (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)
// to list only layers that indicate that they're compatible with that runtime.
// Specify a compatible architecture to include only layers that are compatible
// with that instruction set architecture (https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)
// .
func (c *Client) ListLayers(ctx context.Context, params *ListLayersInput, optFns ...func(*Options)) (*ListLayersOutput, error) {
if params == nil {
params = &ListLayersInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListLayers", params, optFns, c.addOperationListLayersMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListLayersOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListLayersInput struct {
// The compatible instruction set architecture (https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)
// .
CompatibleArchitecture types.Architecture
// A runtime identifier. For example, go1.x . The following list includes
// deprecated runtimes. For more information, see Runtime deprecation policy (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy)
// .
CompatibleRuntime types.Runtime
// A pagination token returned by a previous call.
Marker *string
// The maximum number of layers to return.
MaxItems *int32
noSmithyDocumentSerde
}
type ListLayersOutput struct {
// A list of function layers.
Layers []types.LayersListItem
// A pagination token returned when the response doesn't contain all layers.
NextMarker *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListLayersMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListLayers{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListLayers{}, 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_opListLayers(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
}
// ListLayersAPIClient is a client that implements the ListLayers operation.
type ListLayersAPIClient interface {
ListLayers(context.Context, *ListLayersInput, ...func(*Options)) (*ListLayersOutput, error)
}
var _ ListLayersAPIClient = (*Client)(nil)
// ListLayersPaginatorOptions is the paginator options for ListLayers
type ListLayersPaginatorOptions struct {
// The maximum number of layers to return.
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
}
// ListLayersPaginator is a paginator for ListLayers
type ListLayersPaginator struct {
options ListLayersPaginatorOptions
client ListLayersAPIClient
params *ListLayersInput
nextToken *string
firstPage bool
}
// NewListLayersPaginator returns a new ListLayersPaginator
func NewListLayersPaginator(client ListLayersAPIClient, params *ListLayersInput, optFns ...func(*ListLayersPaginatorOptions)) *ListLayersPaginator {
if params == nil {
params = &ListLayersInput{}
}
options := ListLayersPaginatorOptions{}
if params.MaxItems != nil {
options.Limit = *params.MaxItems
}
for _, fn := range optFns {
fn(&options)
}
return &ListLayersPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListLayersPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListLayers page.
func (p *ListLayersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLayersOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxItems = limit
result, err := p.client.ListLayers(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextMarker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListLayers(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lambda",
OperationName: "ListLayers",
}
}
| 231 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
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/lambda/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the versions of an Lambda layer (https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)
// . Versions that have been deleted aren't listed. Specify a runtime identifier (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)
// to list only versions that indicate that they're compatible with that runtime.
// Specify a compatible architecture to include only layer versions that are
// compatible with that architecture.
func (c *Client) ListLayerVersions(ctx context.Context, params *ListLayerVersionsInput, optFns ...func(*Options)) (*ListLayerVersionsOutput, error) {
if params == nil {
params = &ListLayerVersionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListLayerVersions", params, optFns, c.addOperationListLayerVersionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListLayerVersionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListLayerVersionsInput struct {
// The name or Amazon Resource Name (ARN) of the layer.
//
// This member is required.
LayerName *string
// The compatible instruction set architecture (https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)
// .
CompatibleArchitecture types.Architecture
// A runtime identifier. For example, go1.x . The following list includes
// deprecated runtimes. For more information, see Runtime deprecation policy (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy)
// .
CompatibleRuntime types.Runtime
// A pagination token returned by a previous call.
Marker *string
// The maximum number of versions to return.
MaxItems *int32
noSmithyDocumentSerde
}
type ListLayerVersionsOutput struct {
// A list of versions.
LayerVersions []types.LayerVersionsListItem
// A pagination token returned when the response doesn't contain all versions.
NextMarker *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListLayerVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListLayerVersions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListLayerVersions{}, 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 = addOpListLayerVersionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListLayerVersions(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
}
// ListLayerVersionsAPIClient is a client that implements the ListLayerVersions
// operation.
type ListLayerVersionsAPIClient interface {
ListLayerVersions(context.Context, *ListLayerVersionsInput, ...func(*Options)) (*ListLayerVersionsOutput, error)
}
var _ ListLayerVersionsAPIClient = (*Client)(nil)
// ListLayerVersionsPaginatorOptions is the paginator options for ListLayerVersions
type ListLayerVersionsPaginatorOptions struct {
// The maximum number of versions to return.
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
}
// ListLayerVersionsPaginator is a paginator for ListLayerVersions
type ListLayerVersionsPaginator struct {
options ListLayerVersionsPaginatorOptions
client ListLayerVersionsAPIClient
params *ListLayerVersionsInput
nextToken *string
firstPage bool
}
// NewListLayerVersionsPaginator returns a new ListLayerVersionsPaginator
func NewListLayerVersionsPaginator(client ListLayerVersionsAPIClient, params *ListLayerVersionsInput, optFns ...func(*ListLayerVersionsPaginatorOptions)) *ListLayerVersionsPaginator {
if params == nil {
params = &ListLayerVersionsInput{}
}
options := ListLayerVersionsPaginatorOptions{}
if params.MaxItems != nil {
options.Limit = *params.MaxItems
}
for _, fn := range optFns {
fn(&options)
}
return &ListLayerVersionsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListLayerVersionsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListLayerVersions page.
func (p *ListLayerVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLayerVersionsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxItems = limit
result, err := p.client.ListLayerVersions(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextMarker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListLayerVersions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lambda",
OperationName: "ListLayerVersions",
}
}
| 238 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
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/lambda/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves a list of provisioned concurrency configurations for a function.
func (c *Client) ListProvisionedConcurrencyConfigs(ctx context.Context, params *ListProvisionedConcurrencyConfigsInput, optFns ...func(*Options)) (*ListProvisionedConcurrencyConfigsOutput, error) {
if params == nil {
params = &ListProvisionedConcurrencyConfigsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListProvisionedConcurrencyConfigs", params, optFns, c.addOperationListProvisionedConcurrencyConfigsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListProvisionedConcurrencyConfigsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListProvisionedConcurrencyConfigsInput struct {
// The name of the Lambda function. Name formats
// - Function name – my-function .
// - Function ARN – arn:aws:lambda:us-west-2:123456789012:function:my-function .
// - Partial ARN – 123456789012:function:my-function .
// The length constraint applies only to the full ARN. If you specify only the
// function name, it is limited to 64 characters in length.
//
// This member is required.
FunctionName *string
// Specify the pagination token that's returned by a previous request to retrieve
// the next page of results.
Marker *string
// Specify a number to limit the number of configurations returned.
MaxItems *int32
noSmithyDocumentSerde
}
type ListProvisionedConcurrencyConfigsOutput struct {
// The pagination token that's included if more results are available.
NextMarker *string
// A list of provisioned concurrency configurations.
ProvisionedConcurrencyConfigs []types.ProvisionedConcurrencyConfigListItem
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListProvisionedConcurrencyConfigsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListProvisionedConcurrencyConfigs{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListProvisionedConcurrencyConfigs{}, 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 = addOpListProvisionedConcurrencyConfigsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListProvisionedConcurrencyConfigs(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
}
// ListProvisionedConcurrencyConfigsAPIClient is a client that implements the
// ListProvisionedConcurrencyConfigs operation.
type ListProvisionedConcurrencyConfigsAPIClient interface {
ListProvisionedConcurrencyConfigs(context.Context, *ListProvisionedConcurrencyConfigsInput, ...func(*Options)) (*ListProvisionedConcurrencyConfigsOutput, error)
}
var _ ListProvisionedConcurrencyConfigsAPIClient = (*Client)(nil)
// ListProvisionedConcurrencyConfigsPaginatorOptions is the paginator options for
// ListProvisionedConcurrencyConfigs
type ListProvisionedConcurrencyConfigsPaginatorOptions struct {
// Specify a number to limit the number of configurations returned.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListProvisionedConcurrencyConfigsPaginator is a paginator for
// ListProvisionedConcurrencyConfigs
type ListProvisionedConcurrencyConfigsPaginator struct {
options ListProvisionedConcurrencyConfigsPaginatorOptions
client ListProvisionedConcurrencyConfigsAPIClient
params *ListProvisionedConcurrencyConfigsInput
nextToken *string
firstPage bool
}
// NewListProvisionedConcurrencyConfigsPaginator returns a new
// ListProvisionedConcurrencyConfigsPaginator
func NewListProvisionedConcurrencyConfigsPaginator(client ListProvisionedConcurrencyConfigsAPIClient, params *ListProvisionedConcurrencyConfigsInput, optFns ...func(*ListProvisionedConcurrencyConfigsPaginatorOptions)) *ListProvisionedConcurrencyConfigsPaginator {
if params == nil {
params = &ListProvisionedConcurrencyConfigsInput{}
}
options := ListProvisionedConcurrencyConfigsPaginatorOptions{}
if params.MaxItems != nil {
options.Limit = *params.MaxItems
}
for _, fn := range optFns {
fn(&options)
}
return &ListProvisionedConcurrencyConfigsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListProvisionedConcurrencyConfigsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListProvisionedConcurrencyConfigs page.
func (p *ListProvisionedConcurrencyConfigsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProvisionedConcurrencyConfigsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxItems = limit
result, err := p.client.ListProvisionedConcurrencyConfigs(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextMarker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListProvisionedConcurrencyConfigs(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lambda",
OperationName: "ListProvisionedConcurrencyConfigs",
}
}
| 234 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
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 function's tags (https://docs.aws.amazon.com/lambda/latest/dg/tagging.html)
// . You can also view tags with GetFunction .
func (c *Client) ListTags(ctx context.Context, params *ListTagsInput, optFns ...func(*Options)) (*ListTagsOutput, error) {
if params == nil {
params = &ListTagsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTags", params, optFns, c.addOperationListTagsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTagsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTagsInput struct {
// The function's Amazon Resource Name (ARN). Note: Lambda does not support adding
// tags to aliases or versions.
//
// This member is required.
Resource *string
noSmithyDocumentSerde
}
type ListTagsOutput struct {
// The function's tags.
Tags map[string]string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTagsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListTags{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTags{}, 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 = addOpListTagsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTags(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_opListTags(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lambda",
OperationName: "ListTags",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
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/lambda/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a list of versions (https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html)
// , with the version-specific configuration of each. Lambda returns up to 50
// versions per call.
func (c *Client) ListVersionsByFunction(ctx context.Context, params *ListVersionsByFunctionInput, optFns ...func(*Options)) (*ListVersionsByFunctionOutput, error) {
if params == nil {
params = &ListVersionsByFunctionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListVersionsByFunction", params, optFns, c.addOperationListVersionsByFunctionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListVersionsByFunctionOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListVersionsByFunctionInput struct {
// The name of the Lambda function. Name formats
// - Function name - MyFunction .
// - Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction .
// - Partial ARN - 123456789012:function:MyFunction .
// The length constraint applies only to the full ARN. If you specify only the
// function name, it is limited to 64 characters in length.
//
// This member is required.
FunctionName *string
// Specify the pagination token that's returned by a previous request to retrieve
// the next page of results.
Marker *string
// The maximum number of versions to return. Note that ListVersionsByFunction
// returns a maximum of 50 items in each response, even if you set the number
// higher.
MaxItems *int32
noSmithyDocumentSerde
}
type ListVersionsByFunctionOutput struct {
// The pagination token that's included if more results are available.
NextMarker *string
// A list of Lambda function versions.
Versions []types.FunctionConfiguration
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListVersionsByFunctionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListVersionsByFunction{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListVersionsByFunction{}, 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 = addOpListVersionsByFunctionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListVersionsByFunction(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
}
// ListVersionsByFunctionAPIClient is a client that implements the
// ListVersionsByFunction operation.
type ListVersionsByFunctionAPIClient interface {
ListVersionsByFunction(context.Context, *ListVersionsByFunctionInput, ...func(*Options)) (*ListVersionsByFunctionOutput, error)
}
var _ ListVersionsByFunctionAPIClient = (*Client)(nil)
// ListVersionsByFunctionPaginatorOptions is the paginator options for
// ListVersionsByFunction
type ListVersionsByFunctionPaginatorOptions struct {
// The maximum number of versions to return. Note that ListVersionsByFunction
// returns a maximum of 50 items in each response, even if you set the number
// higher.
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
}
// ListVersionsByFunctionPaginator is a paginator for ListVersionsByFunction
type ListVersionsByFunctionPaginator struct {
options ListVersionsByFunctionPaginatorOptions
client ListVersionsByFunctionAPIClient
params *ListVersionsByFunctionInput
nextToken *string
firstPage bool
}
// NewListVersionsByFunctionPaginator returns a new ListVersionsByFunctionPaginator
func NewListVersionsByFunctionPaginator(client ListVersionsByFunctionAPIClient, params *ListVersionsByFunctionInput, optFns ...func(*ListVersionsByFunctionPaginatorOptions)) *ListVersionsByFunctionPaginator {
if params == nil {
params = &ListVersionsByFunctionInput{}
}
options := ListVersionsByFunctionPaginatorOptions{}
if params.MaxItems != nil {
options.Limit = *params.MaxItems
}
for _, fn := range optFns {
fn(&options)
}
return &ListVersionsByFunctionPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.Marker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListVersionsByFunctionPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListVersionsByFunction page.
func (p *ListVersionsByFunctionPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVersionsByFunctionOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.Marker = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxItems = limit
result, err := p.client.ListVersionsByFunction(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextMarker
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListVersionsByFunction(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lambda",
OperationName: "ListVersionsByFunction",
}
}
| 238 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
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/lambda/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates an Lambda layer (https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)
// from a ZIP archive. Each time you call PublishLayerVersion with the same layer
// name, a new version is created. Add layers to your function with CreateFunction
// or UpdateFunctionConfiguration .
func (c *Client) PublishLayerVersion(ctx context.Context, params *PublishLayerVersionInput, optFns ...func(*Options)) (*PublishLayerVersionOutput, error) {
if params == nil {
params = &PublishLayerVersionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PublishLayerVersion", params, optFns, c.addOperationPublishLayerVersionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PublishLayerVersionOutput)
out.ResultMetadata = metadata
return out, nil
}
type PublishLayerVersionInput struct {
// The function layer archive.
//
// This member is required.
Content *types.LayerVersionContentInput
// The name or Amazon Resource Name (ARN) of the layer.
//
// This member is required.
LayerName *string
// A list of compatible instruction set architectures (https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)
// .
CompatibleArchitectures []types.Architecture
// A list of compatible function runtimes (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)
// . Used for filtering with ListLayers and ListLayerVersions . The following list
// includes deprecated runtimes. For more information, see Runtime deprecation
// policy (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy)
// .
CompatibleRuntimes []types.Runtime
// The description of the version.
Description *string
// The layer's software license. It can be any of the following:
// - An SPDX license identifier (https://spdx.org/licenses/) . For example, MIT .
// - The URL of a license hosted on the internet. For example,
// https://opensource.org/licenses/MIT .
// - The full text of the license.
LicenseInfo *string
noSmithyDocumentSerde
}
type PublishLayerVersionOutput struct {
// A list of compatible instruction set architectures (https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)
// .
CompatibleArchitectures []types.Architecture
// The layer's compatible runtimes. The following list includes deprecated
// runtimes. For more information, see Runtime deprecation policy (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy)
// .
CompatibleRuntimes []types.Runtime
// Details about the layer version.
Content *types.LayerVersionContentOutput
// The date that the layer version was created, in ISO-8601 format (https://www.w3.org/TR/NOTE-datetime)
// (YYYY-MM-DDThh:mm:ss.sTZD).
CreatedDate *string
// The description of the version.
Description *string
// The ARN of the layer.
LayerArn *string
// The ARN of the layer version.
LayerVersionArn *string
// The layer's software license.
LicenseInfo *string
// The version number.
Version int64
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPublishLayerVersionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPublishLayerVersion{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPublishLayerVersion{}, 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 = addOpPublishLayerVersionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPublishLayerVersion(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_opPublishLayerVersion(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lambda",
OperationName: "PublishLayerVersion",
}
}
| 182 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
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/lambda/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a version (https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html)
// from the current code and configuration of a function. Use versions to create a
// snapshot of your function code and configuration that doesn't change. Lambda
// doesn't publish a version if the function's configuration and code haven't
// changed since the last version. Use UpdateFunctionCode or
// UpdateFunctionConfiguration to update the function before publishing a version.
// Clients can invoke versions directly or with an alias. To create an alias, use
// CreateAlias .
func (c *Client) PublishVersion(ctx context.Context, params *PublishVersionInput, optFns ...func(*Options)) (*PublishVersionOutput, error) {
if params == nil {
params = &PublishVersionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PublishVersion", params, optFns, c.addOperationPublishVersionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PublishVersionOutput)
out.ResultMetadata = metadata
return out, nil
}
type PublishVersionInput struct {
// The name of the Lambda function. Name formats
// - Function name - MyFunction .
// - Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction .
// - Partial ARN - 123456789012:function:MyFunction .
// The length constraint applies only to the full ARN. If you specify only the
// function name, it is limited to 64 characters in length.
//
// This member is required.
FunctionName *string
// Only publish a version if the hash value matches the value that's specified.
// Use this option to avoid publishing a version if the function code has changed
// since you last updated it. You can get the hash for the version that you
// uploaded from the output of UpdateFunctionCode .
CodeSha256 *string
// A description for the version to override the description in the function
// configuration.
Description *string
// Only update the function if the revision ID matches the ID that's specified.
// Use this option to avoid publishing a version if the function configuration has
// changed since you last updated it.
RevisionId *string
noSmithyDocumentSerde
}
// Details about a function's configuration.
type PublishVersionOutput struct {
// The instruction set architecture that the function supports. Architecture is a
// string array with one of the valid values. The default architecture value is
// x86_64 .
Architectures []types.Architecture
// The SHA256 hash of the function's deployment package.
CodeSha256 *string
// The size of the function's deployment package, in bytes.
CodeSize int64
// The function's dead letter queue.
DeadLetterConfig *types.DeadLetterConfig
// The function's description.
Description *string
// The function's environment variables (https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)
// . Omitted from CloudTrail logs.
Environment *types.EnvironmentResponse
// The size of the function’s /tmp directory in MB. The default value is 512, but
// it can be any whole number between 512 and 10,240 MB.
EphemeralStorage *types.EphemeralStorage
// Connection settings for an Amazon EFS file system (https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)
// .
FileSystemConfigs []types.FileSystemConfig
// The function's Amazon Resource Name (ARN).
FunctionArn *string
// The name of the function.
FunctionName *string
// The function that Lambda calls to begin running your function.
Handler *string
// The function's image configuration values.
ImageConfigResponse *types.ImageConfigResponse
// The KMS key that's used to encrypt the function's environment variables (https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption)
// . When Lambda SnapStart (https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html)
// is activated, this key is also used to encrypt the function's snapshot. This key
// is returned only if you've configured a customer managed key.
KMSKeyArn *string
// The date and time that the function was last updated, in ISO-8601 format (https://www.w3.org/TR/NOTE-datetime)
// (YYYY-MM-DDThh:mm:ss.sTZD).
LastModified *string
// The status of the last update that was performed on the function. This is first
// set to Successful after function creation completes.
LastUpdateStatus types.LastUpdateStatus
// The reason for the last update that was performed on the function.
LastUpdateStatusReason *string
// The reason code for the last update that was performed on the function.
LastUpdateStatusReasonCode types.LastUpdateStatusReasonCode
// The function's layers (https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)
// .
Layers []types.Layer
// For Lambda@Edge functions, the ARN of the main function.
MasterArn *string
// The amount of memory available to the function at runtime.
MemorySize *int32
// The type of deployment package. Set to Image for container image and set Zip
// for .zip file archive.
PackageType types.PackageType
// The latest updated revision of the function or alias.
RevisionId *string
// The function's execution role.
Role *string
// The identifier of the function's runtime (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)
// . Runtime is required if the deployment package is a .zip file archive. The
// following list includes deprecated runtimes. For more information, see Runtime
// deprecation policy (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy)
// .
Runtime types.Runtime
// The ARN of the runtime and any errors that occured.
RuntimeVersionConfig *types.RuntimeVersionConfig
// The ARN of the signing job.
SigningJobArn *string
// The ARN of the signing profile version.
SigningProfileVersionArn *string
// Set ApplyOn to PublishedVersions to create a snapshot of the initialized
// execution environment when you publish a function version. For more information,
// see Improving startup performance with Lambda SnapStart (https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html)
// .
SnapStart *types.SnapStartResponse
// The current state of the function. When the state is Inactive , you can
// reactivate the function by invoking it.
State types.State
// The reason for the function's current state.
StateReason *string
// The reason code for the function's current state. When the code is Creating ,
// you can't invoke or modify the function.
StateReasonCode types.StateReasonCode
// The amount of time in seconds that Lambda allows a function to run before
// stopping it.
Timeout *int32
// The function's X-Ray tracing configuration.
TracingConfig *types.TracingConfigResponse
// The version of the Lambda function.
Version *string
// The function's networking configuration.
VpcConfig *types.VpcConfigResponse
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPublishVersionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPublishVersion{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPublishVersion{}, 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 = addOpPublishVersionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPublishVersion(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_opPublishVersion(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lambda",
OperationName: "PublishVersion",
}
}
| 277 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
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"
)
// Update the code signing configuration for the function. Changes to the code
// signing configuration take effect the next time a user tries to deploy a code
// package to the function.
func (c *Client) PutFunctionCodeSigningConfig(ctx context.Context, params *PutFunctionCodeSigningConfigInput, optFns ...func(*Options)) (*PutFunctionCodeSigningConfigOutput, error) {
if params == nil {
params = &PutFunctionCodeSigningConfigInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutFunctionCodeSigningConfig", params, optFns, c.addOperationPutFunctionCodeSigningConfigMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutFunctionCodeSigningConfigOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutFunctionCodeSigningConfigInput struct {
// The The Amazon Resource Name (ARN) of the code signing configuration.
//
// This member is required.
CodeSigningConfigArn *string
// The name of the Lambda function. Name formats
// - Function name - MyFunction .
// - Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction .
// - Partial ARN - 123456789012:function:MyFunction .
// The length constraint applies only to the full ARN. If you specify only the
// function name, it is limited to 64 characters in length.
//
// This member is required.
FunctionName *string
noSmithyDocumentSerde
}
type PutFunctionCodeSigningConfigOutput struct {
// The The Amazon Resource Name (ARN) of the code signing configuration.
//
// This member is required.
CodeSigningConfigArn *string
// The name of the Lambda function. Name formats
// - Function name - MyFunction .
// - Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction .
// - Partial ARN - 123456789012:function:MyFunction .
// The length constraint applies only to the full ARN. If you specify only the
// function name, it is limited to 64 characters in length.
//
// This member is required.
FunctionName *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutFunctionCodeSigningConfigMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutFunctionCodeSigningConfig{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutFunctionCodeSigningConfig{}, 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 = addOpPutFunctionCodeSigningConfigValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutFunctionCodeSigningConfig(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_opPutFunctionCodeSigningConfig(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lambda",
OperationName: "PutFunctionCodeSigningConfig",
}
}
| 148 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
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"
)
// Sets the maximum number of simultaneous executions for a function, and reserves
// capacity for that concurrency level. Concurrency settings apply to the function
// as a whole, including all published versions and the unpublished version.
// Reserving concurrency both ensures that your function has capacity to process
// the specified number of events simultaneously, and prevents it from scaling
// beyond that level. Use GetFunction to see the current setting for a function.
// Use GetAccountSettings to see your Regional concurrency limit. You can reserve
// concurrency for as many functions as you like, as long as you leave at least 100
// simultaneous executions unreserved for functions that aren't configured with a
// per-function limit. For more information, see Lambda function scaling (https://docs.aws.amazon.com/lambda/latest/dg/invocation-scaling.html)
// .
func (c *Client) PutFunctionConcurrency(ctx context.Context, params *PutFunctionConcurrencyInput, optFns ...func(*Options)) (*PutFunctionConcurrencyOutput, error) {
if params == nil {
params = &PutFunctionConcurrencyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutFunctionConcurrency", params, optFns, c.addOperationPutFunctionConcurrencyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutFunctionConcurrencyOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutFunctionConcurrencyInput struct {
// The name of the Lambda function. Name formats
// - Function name – my-function .
// - Function ARN – arn:aws:lambda:us-west-2:123456789012:function:my-function .
// - Partial ARN – 123456789012:function:my-function .
// The length constraint applies only to the full ARN. If you specify only the
// function name, it is limited to 64 characters in length.
//
// This member is required.
FunctionName *string
// The number of simultaneous executions to reserve for the function.
//
// This member is required.
ReservedConcurrentExecutions *int32
noSmithyDocumentSerde
}
type PutFunctionConcurrencyOutput struct {
// The number of concurrent executions that are reserved for this function. For
// more information, see Managing Lambda reserved concurrency (https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html)
// .
ReservedConcurrentExecutions *int32
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutFunctionConcurrencyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutFunctionConcurrency{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutFunctionConcurrency{}, 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 = addOpPutFunctionConcurrencyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutFunctionConcurrency(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_opPutFunctionConcurrency(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lambda",
OperationName: "PutFunctionConcurrency",
}
}
| 146 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
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/lambda/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Configures options for asynchronous invocation (https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html)
// on a function, version, or alias. If a configuration already exists for a
// function, version, or alias, this operation overwrites it. If you exclude any
// settings, they are removed. To set one option without affecting existing
// settings for other options, use UpdateFunctionEventInvokeConfig . By default,
// Lambda retries an asynchronous invocation twice if the function returns an
// error. It retains events in a queue for up to six hours. When an event fails all
// processing attempts or stays in the asynchronous invocation queue for too long,
// Lambda discards it. To retain discarded events, configure a dead-letter queue
// with UpdateFunctionConfiguration . To send an invocation record to a queue,
// topic, function, or event bus, specify a destination (https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations)
// . You can configure separate destinations for successful invocations
// (on-success) and events that fail all processing attempts (on-failure). You can
// configure destinations in addition to or instead of a dead-letter queue.
func (c *Client) PutFunctionEventInvokeConfig(ctx context.Context, params *PutFunctionEventInvokeConfigInput, optFns ...func(*Options)) (*PutFunctionEventInvokeConfigOutput, error) {
if params == nil {
params = &PutFunctionEventInvokeConfigInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutFunctionEventInvokeConfig", params, optFns, c.addOperationPutFunctionEventInvokeConfigMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutFunctionEventInvokeConfigOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutFunctionEventInvokeConfigInput struct {
// The name of the Lambda function, version, or alias. Name formats
// - Function name - my-function (name-only), my-function:v1 (with alias).
// - Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function .
// - Partial ARN - 123456789012:function:my-function .
// You can append a version number or alias to any of the formats. The length
// constraint applies only to the full ARN. If you specify only the function name,
// it is limited to 64 characters in length.
//
// This member is required.
FunctionName *string
// A destination for events after they have been sent to a function for
// processing. Destinations
// - Function - The Amazon Resource Name (ARN) of a Lambda function.
// - Queue - The ARN of a standard SQS queue.
// - Topic - The ARN of a standard SNS topic.
// - Event Bus - The ARN of an Amazon EventBridge event bus.
DestinationConfig *types.DestinationConfig
// The maximum age of a request that Lambda sends to a function for processing.
MaximumEventAgeInSeconds *int32
// The maximum number of times to retry when the function returns an error.
MaximumRetryAttempts *int32
// A version number or alias name.
Qualifier *string
noSmithyDocumentSerde
}
type PutFunctionEventInvokeConfigOutput struct {
// A destination for events after they have been sent to a function for
// processing. Destinations
// - Function - The Amazon Resource Name (ARN) of a Lambda function.
// - Queue - The ARN of a standard SQS queue.
// - Topic - The ARN of a standard SNS topic.
// - Event Bus - The ARN of an Amazon EventBridge event bus.
DestinationConfig *types.DestinationConfig
// The Amazon Resource Name (ARN) of the function.
FunctionArn *string
// The date and time that the configuration was last updated.
LastModified *time.Time
// The maximum age of a request that Lambda sends to a function for processing.
MaximumEventAgeInSeconds *int32
// The maximum number of times to retry when the function returns an error.
MaximumRetryAttempts *int32
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutFunctionEventInvokeConfigMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutFunctionEventInvokeConfig{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutFunctionEventInvokeConfig{}, 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 = addOpPutFunctionEventInvokeConfigValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutFunctionEventInvokeConfig(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_opPutFunctionEventInvokeConfig(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lambda",
OperationName: "PutFunctionEventInvokeConfig",
}
}
| 179 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
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/lambda/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds a provisioned concurrency configuration to a function's alias or version.
func (c *Client) PutProvisionedConcurrencyConfig(ctx context.Context, params *PutProvisionedConcurrencyConfigInput, optFns ...func(*Options)) (*PutProvisionedConcurrencyConfigOutput, error) {
if params == nil {
params = &PutProvisionedConcurrencyConfigInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutProvisionedConcurrencyConfig", params, optFns, c.addOperationPutProvisionedConcurrencyConfigMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutProvisionedConcurrencyConfigOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutProvisionedConcurrencyConfigInput struct {
// The name of the Lambda function. Name formats
// - Function name – my-function .
// - Function ARN – arn:aws:lambda:us-west-2:123456789012:function:my-function .
// - Partial ARN – 123456789012:function:my-function .
// The length constraint applies only to the full ARN. If you specify only the
// function name, it is limited to 64 characters in length.
//
// This member is required.
FunctionName *string
// The amount of provisioned concurrency to allocate for the version or alias.
//
// This member is required.
ProvisionedConcurrentExecutions *int32
// The version number or alias name.
//
// This member is required.
Qualifier *string
noSmithyDocumentSerde
}
type PutProvisionedConcurrencyConfigOutput struct {
// The amount of provisioned concurrency allocated. When a weighted alias is used
// during linear and canary deployments, this value fluctuates depending on the
// amount of concurrency that is provisioned for the function versions.
AllocatedProvisionedConcurrentExecutions *int32
// The amount of provisioned concurrency available.
AvailableProvisionedConcurrentExecutions *int32
// The date and time that a user last updated the configuration, in ISO 8601 format (https://www.iso.org/iso-8601-date-and-time-format.html)
// .
LastModified *string
// The amount of provisioned concurrency requested.
RequestedProvisionedConcurrentExecutions *int32
// The status of the allocation process.
Status types.ProvisionedConcurrencyStatusEnum
// For failed allocations, the reason that provisioned concurrency could not be
// allocated.
StatusReason *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutProvisionedConcurrencyConfigMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutProvisionedConcurrencyConfig{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutProvisionedConcurrencyConfig{}, 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 = addOpPutProvisionedConcurrencyConfigValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutProvisionedConcurrencyConfig(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_opPutProvisionedConcurrencyConfig(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lambda",
OperationName: "PutProvisionedConcurrencyConfig",
}
}
| 159 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
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/lambda/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Sets the runtime management configuration for a function's version. For more
// information, see Runtime updates (https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html)
// .
func (c *Client) PutRuntimeManagementConfig(ctx context.Context, params *PutRuntimeManagementConfigInput, optFns ...func(*Options)) (*PutRuntimeManagementConfigOutput, error) {
if params == nil {
params = &PutRuntimeManagementConfigInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutRuntimeManagementConfig", params, optFns, c.addOperationPutRuntimeManagementConfigMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutRuntimeManagementConfigOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutRuntimeManagementConfigInput struct {
// The name of the Lambda function. Name formats
// - Function name – my-function .
// - Function ARN – arn:aws:lambda:us-west-2:123456789012:function:my-function .
// - Partial ARN – 123456789012:function:my-function .
// The length constraint applies only to the full ARN. If you specify only the
// function name, it is limited to 64 characters in length.
//
// This member is required.
FunctionName *string
// Specify the runtime update mode.
// - Auto (default) - Automatically update to the most recent and secure runtime
// version using a Two-phase runtime version rollout (https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html#runtime-management-two-phase)
// . This is the best choice for most customers to ensure they always benefit from
// runtime updates.
// - Function update - Lambda updates the runtime of your function to the most
// recent and secure runtime version when you update your function. This approach
// synchronizes runtime updates with function deployments, giving you control over
// when runtime updates are applied and allowing you to detect and mitigate rare
// runtime update incompatibilities early. When using this setting, you need to
// regularly update your functions to keep their runtime up-to-date.
// - Manual - You specify a runtime version in your function configuration. The
// function will use this runtime version indefinitely. In the rare case where a
// new runtime version is incompatible with an existing function, this allows you
// to roll back your function to an earlier runtime version. For more information,
// see Roll back a runtime version (https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html#runtime-management-rollback)
// .
//
// This member is required.
UpdateRuntimeOn types.UpdateRuntimeOn
// Specify a version of the function. This can be $LATEST or a published version
// number. If no value is specified, the configuration for the $LATEST version is
// returned.
Qualifier *string
// The ARN of the runtime version you want the function to use. This is only
// required if you're using the Manual runtime update mode.
RuntimeVersionArn *string
noSmithyDocumentSerde
}
type PutRuntimeManagementConfigOutput struct {
// The ARN of the function
//
// This member is required.
FunctionArn *string
// The runtime update mode.
//
// This member is required.
UpdateRuntimeOn types.UpdateRuntimeOn
// The ARN of the runtime the function is configured to use. If the runtime update
// mode is manual, the ARN is returned, otherwise null is returned.
RuntimeVersionArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutRuntimeManagementConfigMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutRuntimeManagementConfig{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutRuntimeManagementConfig{}, 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 = addOpPutRuntimeManagementConfigValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutRuntimeManagementConfig(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_opPutRuntimeManagementConfig(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lambda",
OperationName: "PutRuntimeManagementConfig",
}
}
| 173 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
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 a statement from the permissions policy for a version of an Lambda layer (https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)
// . For more information, see AddLayerVersionPermission .
func (c *Client) RemoveLayerVersionPermission(ctx context.Context, params *RemoveLayerVersionPermissionInput, optFns ...func(*Options)) (*RemoveLayerVersionPermissionOutput, error) {
if params == nil {
params = &RemoveLayerVersionPermissionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "RemoveLayerVersionPermission", params, optFns, c.addOperationRemoveLayerVersionPermissionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*RemoveLayerVersionPermissionOutput)
out.ResultMetadata = metadata
return out, nil
}
type RemoveLayerVersionPermissionInput struct {
// The name or Amazon Resource Name (ARN) of the layer.
//
// This member is required.
LayerName *string
// The identifier that was specified when the statement was added.
//
// This member is required.
StatementId *string
// The version number.
//
// This member is required.
VersionNumber int64
// Only update the policy if the revision ID matches the ID specified. Use this
// option to avoid modifying a policy that has changed since you last read it.
RevisionId *string
noSmithyDocumentSerde
}
type RemoveLayerVersionPermissionOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationRemoveLayerVersionPermissionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpRemoveLayerVersionPermission{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRemoveLayerVersionPermission{}, 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 = addOpRemoveLayerVersionPermissionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveLayerVersionPermission(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_opRemoveLayerVersionPermission(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lambda",
OperationName: "RemoveLayerVersionPermission",
}
}
| 135 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
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"
)
// Revokes function-use permission from an Amazon Web Service or another Amazon
// Web Services account. You can get the ID of the statement from the output of
// GetPolicy .
func (c *Client) RemovePermission(ctx context.Context, params *RemovePermissionInput, optFns ...func(*Options)) (*RemovePermissionOutput, error) {
if params == nil {
params = &RemovePermissionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "RemovePermission", params, optFns, c.addOperationRemovePermissionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*RemovePermissionOutput)
out.ResultMetadata = metadata
return out, nil
}
type RemovePermissionInput struct {
// The name of the Lambda function, version, or alias. Name formats
// - Function name – my-function (name-only), my-function:v1 (with alias).
// - Function ARN – arn:aws:lambda:us-west-2:123456789012:function:my-function .
// - Partial ARN – 123456789012:function:my-function .
// You can append a version number or alias to any of the formats. The length
// constraint applies only to the full ARN. If you specify only the function name,
// it is limited to 64 characters in length.
//
// This member is required.
FunctionName *string
// Statement ID of the permission to remove.
//
// This member is required.
StatementId *string
// Specify a version or alias to remove permissions from a published version of
// the function.
Qualifier *string
// Update the policy only if the revision ID matches the ID that's specified. Use
// this option to avoid modifying a policy that has changed since you last read it.
RevisionId *string
noSmithyDocumentSerde
}
type RemovePermissionOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationRemovePermissionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpRemovePermission{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRemovePermission{}, 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 = addOpRemovePermissionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemovePermission(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_opRemovePermission(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lambda",
OperationName: "RemovePermission",
}
}
| 141 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
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 (https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) to a
// function.
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 function's Amazon Resource Name (ARN).
//
// This member is required.
Resource *string
// A list of tags to apply to the function.
//
// 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: "lambda",
OperationName: "TagResource",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
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 tags (https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) from a
// function.
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 function's Amazon Resource Name (ARN).
//
// This member is required.
Resource *string
// A list of tag keys to remove from the function.
//
// 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: "lambda",
OperationName: "UntagResource",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
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/lambda/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the configuration of a Lambda function alias (https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html)
// .
func (c *Client) UpdateAlias(ctx context.Context, params *UpdateAliasInput, optFns ...func(*Options)) (*UpdateAliasOutput, error) {
if params == nil {
params = &UpdateAliasInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateAlias", params, optFns, c.addOperationUpdateAliasMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateAliasOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateAliasInput struct {
// The name of the Lambda function. Name formats
// - Function name - MyFunction .
// - Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction .
// - Partial ARN - 123456789012:function:MyFunction .
// The length constraint applies only to the full ARN. If you specify only the
// function name, it is limited to 64 characters in length.
//
// This member is required.
FunctionName *string
// The name of the alias.
//
// This member is required.
Name *string
// A description of the alias.
Description *string
// The function version that the alias invokes.
FunctionVersion *string
// Only update the alias if the revision ID matches the ID that's specified. Use
// this option to avoid modifying an alias that has changed since you last read it.
RevisionId *string
// The routing configuration (https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html#configuring-alias-routing)
// of the alias.
RoutingConfig *types.AliasRoutingConfiguration
noSmithyDocumentSerde
}
// Provides configuration information about a Lambda function alias (https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html)
// .
type UpdateAliasOutput struct {
// The Amazon Resource Name (ARN) of the alias.
AliasArn *string
// A description of the alias.
Description *string
// The function version that the alias invokes.
FunctionVersion *string
// The name of the alias.
Name *string
// A unique identifier that changes when you update the alias.
RevisionId *string
// The routing configuration (https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html)
// of the alias.
RoutingConfig *types.AliasRoutingConfiguration
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateAliasMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateAlias{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateAlias{}, 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 = addOpUpdateAliasValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAlias(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_opUpdateAlias(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lambda",
OperationName: "UpdateAlias",
}
}
| 168 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
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/lambda/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Update the code signing configuration. Changes to the code signing
// configuration take effect the next time a user tries to deploy a code package to
// the function.
func (c *Client) UpdateCodeSigningConfig(ctx context.Context, params *UpdateCodeSigningConfigInput, optFns ...func(*Options)) (*UpdateCodeSigningConfigOutput, error) {
if params == nil {
params = &UpdateCodeSigningConfigInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateCodeSigningConfig", params, optFns, c.addOperationUpdateCodeSigningConfigMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateCodeSigningConfigOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateCodeSigningConfigInput struct {
// The The Amazon Resource Name (ARN) of the code signing configuration.
//
// This member is required.
CodeSigningConfigArn *string
// Signing profiles for this code signing configuration.
AllowedPublishers *types.AllowedPublishers
// The code signing policy.
CodeSigningPolicies *types.CodeSigningPolicies
// Descriptive name for this code signing configuration.
Description *string
noSmithyDocumentSerde
}
type UpdateCodeSigningConfigOutput struct {
// The code signing configuration
//
// This member is required.
CodeSigningConfig *types.CodeSigningConfig
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateCodeSigningConfigMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateCodeSigningConfig{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateCodeSigningConfig{}, 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 = addOpUpdateCodeSigningConfigValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateCodeSigningConfig(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_opUpdateCodeSigningConfig(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lambda",
OperationName: "UpdateCodeSigningConfig",
}
}
| 138 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
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/lambda/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Updates an event source mapping. You can change the function that Lambda
// invokes, or pause invocation and resume later from the same location. For
// details about how to configure different event sources, see the following
// topics.
// - Amazon DynamoDB Streams (https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-dynamodb-eventsourcemapping)
// - Amazon Kinesis (https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-eventsourcemapping)
// - Amazon SQS (https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-eventsource)
// - Amazon MQ and RabbitMQ (https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-eventsourcemapping)
// - Amazon MSK (https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html)
// - Apache Kafka (https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html)
// - Amazon DocumentDB (https://docs.aws.amazon.com/lambda/latest/dg/with-documentdb.html)
//
// The following error handling options are available only for stream sources
// (DynamoDB and Kinesis):
// - BisectBatchOnFunctionError – If the function returns an error, split the
// batch in two and retry.
// - DestinationConfig – Send discarded records to an Amazon SQS queue or Amazon
// SNS topic.
// - MaximumRecordAgeInSeconds – Discard records older than the specified age.
// The default value is infinite (-1). When set to infinite (-1), failed records
// are retried until the record expires
// - MaximumRetryAttempts – Discard records after the specified number of
// retries. The default value is infinite (-1). When set to infinite (-1), failed
// records are retried until the record expires.
// - ParallelizationFactor – Process multiple batches from each shard
// concurrently.
//
// For information about which configuration parameters apply to each event
// source, see the following topics.
// - Amazon DynamoDB Streams (https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-params)
// - Amazon Kinesis (https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-params)
// - Amazon SQS (https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#services-sqs-params)
// - Amazon MQ and RabbitMQ (https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-params)
// - Amazon MSK (https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-parms)
// - Apache Kafka (https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html#services-kafka-parms)
// - Amazon DocumentDB (https://docs.aws.amazon.com/lambda/latest/dg/with-documentdb.html#docdb-configuration)
func (c *Client) UpdateEventSourceMapping(ctx context.Context, params *UpdateEventSourceMappingInput, optFns ...func(*Options)) (*UpdateEventSourceMappingOutput, error) {
if params == nil {
params = &UpdateEventSourceMappingInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateEventSourceMapping", params, optFns, c.addOperationUpdateEventSourceMappingMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateEventSourceMappingOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateEventSourceMappingInput struct {
// The identifier of the event source mapping.
//
// This member is required.
UUID *string
// The maximum number of records in each batch that Lambda pulls from your stream
// or queue and sends to your function. Lambda passes all of the records in the
// batch to the function in a single call, up to the payload limit for synchronous
// invocation (6 MB).
// - Amazon Kinesis – Default 100. Max 10,000.
// - Amazon DynamoDB Streams – Default 100. Max 10,000.
// - Amazon Simple Queue Service – Default 10. For standard queues the max is
// 10,000. For FIFO queues the max is 10.
// - Amazon Managed Streaming for Apache Kafka – Default 100. Max 10,000.
// - Self-managed Apache Kafka – Default 100. Max 10,000.
// - Amazon MQ (ActiveMQ and RabbitMQ) – Default 100. Max 10,000.
// - DocumentDB – Default 100. Max 10,000.
BatchSize *int32
// (Kinesis and DynamoDB Streams only) If the function returns an error, split the
// batch in two and retry.
BisectBatchOnFunctionError *bool
// (Kinesis and DynamoDB Streams only) A standard Amazon SQS queue or standard
// Amazon SNS topic destination for discarded records.
DestinationConfig *types.DestinationConfig
// Specific configuration settings for a DocumentDB event source.
DocumentDBEventSourceConfig *types.DocumentDBEventSourceConfig
// When true, the event source mapping is active. When false, Lambda pauses
// polling and invocation. Default: True
Enabled *bool
// An object that defines the filter criteria that determine whether Lambda should
// process an event. For more information, see Lambda event filtering (https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)
// .
FilterCriteria *types.FilterCriteria
// The name of the Lambda function. Name formats
// - Function name – MyFunction .
// - Function ARN – arn:aws:lambda:us-west-2:123456789012:function:MyFunction .
// - Version or Alias ARN –
// arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD .
// - Partial ARN – 123456789012:function:MyFunction .
// The length constraint applies only to the full ARN. If you specify only the
// function name, it's limited to 64 characters in length.
FunctionName *string
// (Kinesis, DynamoDB Streams, and Amazon SQS) A list of current response type
// enums applied to the event source mapping.
FunctionResponseTypes []types.FunctionResponseType
// The maximum amount of time, in seconds, that Lambda spends gathering records
// before invoking the function. You can configure MaximumBatchingWindowInSeconds
// to any value from 0 seconds to 300 seconds in increments of seconds. For streams
// and Amazon SQS event sources, the default batching window is 0 seconds. For
// Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and DocumentDB event sources,
// the default batching window is 500 ms. Note that because you can only change
// MaximumBatchingWindowInSeconds in increments of seconds, you cannot revert back
// to the 500 ms default batching window after you have changed it. To restore the
// default batching window, you must create a new event source mapping. Related
// setting: For streams and Amazon SQS event sources, when you set BatchSize to a
// value greater than 10, you must set MaximumBatchingWindowInSeconds to at least
// 1.
MaximumBatchingWindowInSeconds *int32
// (Kinesis and DynamoDB Streams only) Discard records older than the specified
// age. The default value is infinite (-1).
MaximumRecordAgeInSeconds *int32
// (Kinesis and DynamoDB Streams only) Discard records after the specified number
// of retries. The default value is infinite (-1). When set to infinite (-1),
// failed records are retried until the record expires.
MaximumRetryAttempts *int32
// (Kinesis and DynamoDB Streams only) The number of batches to process from each
// shard concurrently.
ParallelizationFactor *int32
// (Amazon SQS only) The scaling configuration for the event source. For more
// information, see Configuring maximum concurrency for Amazon SQS event sources (https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency)
// .
ScalingConfig *types.ScalingConfig
// An array of authentication protocols or VPC components required to secure your
// event source.
SourceAccessConfigurations []types.SourceAccessConfiguration
// (Kinesis and DynamoDB Streams only) The duration in seconds of a processing
// window for DynamoDB and Kinesis Streams event sources. A value of 0 seconds
// indicates no tumbling window.
TumblingWindowInSeconds *int32
noSmithyDocumentSerde
}
// A mapping between an Amazon Web Services resource and a Lambda function. For
// details, see CreateEventSourceMapping .
type UpdateEventSourceMappingOutput struct {
// Specific configuration settings for an Amazon Managed Streaming for Apache
// Kafka (Amazon MSK) event source.
AmazonManagedKafkaEventSourceConfig *types.AmazonManagedKafkaEventSourceConfig
// The maximum number of records in each batch that Lambda pulls from your stream
// or queue and sends to your function. Lambda passes all of the records in the
// batch to the function in a single call, up to the payload limit for synchronous
// invocation (6 MB). Default value: Varies by service. For Amazon SQS, the default
// is 10. For all other services, the default is 100. Related setting: When you set
// BatchSize to a value greater than 10, you must set
// MaximumBatchingWindowInSeconds to at least 1.
BatchSize *int32
// (Kinesis and DynamoDB Streams only) If the function returns an error, split the
// batch in two and retry. The default value is false.
BisectBatchOnFunctionError *bool
// (Kinesis and DynamoDB Streams only) An Amazon SQS queue or Amazon SNS topic
// destination for discarded records.
DestinationConfig *types.DestinationConfig
// Specific configuration settings for a DocumentDB event source.
DocumentDBEventSourceConfig *types.DocumentDBEventSourceConfig
// The Amazon Resource Name (ARN) of the event source.
EventSourceArn *string
// An object that defines the filter criteria that determine whether Lambda should
// process an event. For more information, see Lambda event filtering (https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)
// .
FilterCriteria *types.FilterCriteria
// The ARN of the Lambda function.
FunctionArn *string
// (Kinesis, DynamoDB Streams, and Amazon SQS) A list of current response type
// enums applied to the event source mapping.
FunctionResponseTypes []types.FunctionResponseType
// The date that the event source mapping was last updated or that its state
// changed.
LastModified *time.Time
// The result of the last Lambda invocation of your function.
LastProcessingResult *string
// The maximum amount of time, in seconds, that Lambda spends gathering records
// before invoking the function. You can configure MaximumBatchingWindowInSeconds
// to any value from 0 seconds to 300 seconds in increments of seconds. For streams
// and Amazon SQS event sources, the default batching window is 0 seconds. For
// Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and DocumentDB event sources,
// the default batching window is 500 ms. Note that because you can only change
// MaximumBatchingWindowInSeconds in increments of seconds, you cannot revert back
// to the 500 ms default batching window after you have changed it. To restore the
// default batching window, you must create a new event source mapping. Related
// setting: For streams and Amazon SQS event sources, when you set BatchSize to a
// value greater than 10, you must set MaximumBatchingWindowInSeconds to at least
// 1.
MaximumBatchingWindowInSeconds *int32
// (Kinesis and DynamoDB Streams only) Discard records older than the specified
// age. The default value is -1, which sets the maximum age to infinite. When the
// value is set to infinite, Lambda never discards old records. The minimum valid
// value for maximum record age is 60s. Although values less than 60 and greater
// than -1 fall within the parameter's absolute range, they are not allowed
MaximumRecordAgeInSeconds *int32
// (Kinesis and DynamoDB Streams only) Discard records after the specified number
// of retries. The default value is -1, which sets the maximum number of retries to
// infinite. When MaximumRetryAttempts is infinite, Lambda retries failed records
// until the record expires in the event source.
MaximumRetryAttempts *int32
// (Kinesis and DynamoDB Streams only) The number of batches to process
// concurrently from each shard. The default value is 1.
ParallelizationFactor *int32
// (Amazon MQ) The name of the Amazon MQ broker destination queue to consume.
Queues []string
// (Amazon SQS only) The scaling configuration for the event source. For more
// information, see Configuring maximum concurrency for Amazon SQS event sources (https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency)
// .
ScalingConfig *types.ScalingConfig
// The self-managed Apache Kafka cluster for your event source.
SelfManagedEventSource *types.SelfManagedEventSource
// Specific configuration settings for a self-managed Apache Kafka event source.
SelfManagedKafkaEventSourceConfig *types.SelfManagedKafkaEventSourceConfig
// An array of the authentication protocol, VPC components, or virtual host to
// secure and define your event source.
SourceAccessConfigurations []types.SourceAccessConfiguration
// The position in a stream from which to start reading. Required for Amazon
// Kinesis and Amazon DynamoDB Stream event sources. AT_TIMESTAMP is supported
// only for Amazon Kinesis streams, Amazon DocumentDB, Amazon MSK, and self-managed
// Apache Kafka.
StartingPosition types.EventSourcePosition
// With StartingPosition set to AT_TIMESTAMP , the time from which to start
// reading. StartingPositionTimestamp cannot be in the future.
StartingPositionTimestamp *time.Time
// The state of the event source mapping. It can be one of the following: Creating
// , Enabling , Enabled , Disabling , Disabled , Updating , or Deleting .
State *string
// Indicates whether a user or Lambda made the last change to the event source
// mapping.
StateTransitionReason *string
// The name of the Kafka topic.
Topics []string
// (Kinesis and DynamoDB Streams only) The duration in seconds of a processing
// window for DynamoDB and Kinesis Streams event sources. A value of 0 seconds
// indicates no tumbling window.
TumblingWindowInSeconds *int32
// The identifier of the event source mapping.
UUID *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateEventSourceMappingMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateEventSourceMapping{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateEventSourceMapping{}, 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 = addOpUpdateEventSourceMappingValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateEventSourceMapping(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_opUpdateEventSourceMapping(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lambda",
OperationName: "UpdateEventSourceMapping",
}
}
| 373 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
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/lambda/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates a Lambda function's code. If code signing is enabled for the function,
// the code package must be signed by a trusted publisher. For more information,
// see Configuring code signing for Lambda (https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html)
// . If the function's package type is Image , then you must specify the code
// package in ImageUri as the URI of a container image (https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html)
// in the Amazon ECR registry. If the function's package type is Zip , then you
// must specify the deployment package as a .zip file archive (https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html#gettingstarted-package-zip)
// . Enter the Amazon S3 bucket and key of the code .zip file location. You can
// also provide the function code inline using the ZipFile field. The code in the
// deployment package must be compatible with the target instruction set
// architecture of the function ( x86-64 or arm64 ). The function's code is locked
// when you publish a version. You can't modify the code of a published version,
// only the unpublished version. For a function defined as a container image,
// Lambda resolves the image tag to an image digest. In Amazon ECR, if you update
// the image tag to a new image, Lambda does not automatically update the function.
func (c *Client) UpdateFunctionCode(ctx context.Context, params *UpdateFunctionCodeInput, optFns ...func(*Options)) (*UpdateFunctionCodeOutput, error) {
if params == nil {
params = &UpdateFunctionCodeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateFunctionCode", params, optFns, c.addOperationUpdateFunctionCodeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateFunctionCodeOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateFunctionCodeInput struct {
// The name of the Lambda function. Name formats
// - Function name – my-function .
// - Function ARN – arn:aws:lambda:us-west-2:123456789012:function:my-function .
// - Partial ARN – 123456789012:function:my-function .
// The length constraint applies only to the full ARN. If you specify only the
// function name, it is limited to 64 characters in length.
//
// This member is required.
FunctionName *string
// The instruction set architecture that the function supports. Enter a string
// array with one of the valid values (arm64 or x86_64). The default value is
// x86_64 .
Architectures []types.Architecture
// Set to true to validate the request parameters and access permissions without
// modifying the function code.
DryRun bool
// URI of a container image in the Amazon ECR registry. Do not use for a function
// defined with a .zip file archive.
ImageUri *string
// Set to true to publish a new version of the function after updating the code.
// This has the same effect as calling PublishVersion separately.
Publish bool
// Update the function only if the revision ID matches the ID that's specified.
// Use this option to avoid modifying a function that has changed since you last
// read it.
RevisionId *string
// An Amazon S3 bucket in the same Amazon Web Services Region as your function.
// The bucket can be in a different Amazon Web Services account. Use only with a
// function defined with a .zip file archive deployment package.
S3Bucket *string
// The Amazon S3 key of the deployment package. Use only with a function defined
// with a .zip file archive deployment package.
S3Key *string
// For versioned objects, the version of the deployment package object to use.
S3ObjectVersion *string
// The base64-encoded contents of the deployment package. Amazon Web Services SDK
// and CLI clients handle the encoding for you. Use only with a function defined
// with a .zip file archive deployment package.
ZipFile []byte
noSmithyDocumentSerde
}
// Details about a function's configuration.
type UpdateFunctionCodeOutput struct {
// The instruction set architecture that the function supports. Architecture is a
// string array with one of the valid values. The default architecture value is
// x86_64 .
Architectures []types.Architecture
// The SHA256 hash of the function's deployment package.
CodeSha256 *string
// The size of the function's deployment package, in bytes.
CodeSize int64
// The function's dead letter queue.
DeadLetterConfig *types.DeadLetterConfig
// The function's description.
Description *string
// The function's environment variables (https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)
// . Omitted from CloudTrail logs.
Environment *types.EnvironmentResponse
// The size of the function’s /tmp directory in MB. The default value is 512, but
// it can be any whole number between 512 and 10,240 MB.
EphemeralStorage *types.EphemeralStorage
// Connection settings for an Amazon EFS file system (https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)
// .
FileSystemConfigs []types.FileSystemConfig
// The function's Amazon Resource Name (ARN).
FunctionArn *string
// The name of the function.
FunctionName *string
// The function that Lambda calls to begin running your function.
Handler *string
// The function's image configuration values.
ImageConfigResponse *types.ImageConfigResponse
// The KMS key that's used to encrypt the function's environment variables (https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption)
// . When Lambda SnapStart (https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html)
// is activated, this key is also used to encrypt the function's snapshot. This key
// is returned only if you've configured a customer managed key.
KMSKeyArn *string
// The date and time that the function was last updated, in ISO-8601 format (https://www.w3.org/TR/NOTE-datetime)
// (YYYY-MM-DDThh:mm:ss.sTZD).
LastModified *string
// The status of the last update that was performed on the function. This is first
// set to Successful after function creation completes.
LastUpdateStatus types.LastUpdateStatus
// The reason for the last update that was performed on the function.
LastUpdateStatusReason *string
// The reason code for the last update that was performed on the function.
LastUpdateStatusReasonCode types.LastUpdateStatusReasonCode
// The function's layers (https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)
// .
Layers []types.Layer
// For Lambda@Edge functions, the ARN of the main function.
MasterArn *string
// The amount of memory available to the function at runtime.
MemorySize *int32
// The type of deployment package. Set to Image for container image and set Zip
// for .zip file archive.
PackageType types.PackageType
// The latest updated revision of the function or alias.
RevisionId *string
// The function's execution role.
Role *string
// The identifier of the function's runtime (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)
// . Runtime is required if the deployment package is a .zip file archive. The
// following list includes deprecated runtimes. For more information, see Runtime
// deprecation policy (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy)
// .
Runtime types.Runtime
// The ARN of the runtime and any errors that occured.
RuntimeVersionConfig *types.RuntimeVersionConfig
// The ARN of the signing job.
SigningJobArn *string
// The ARN of the signing profile version.
SigningProfileVersionArn *string
// Set ApplyOn to PublishedVersions to create a snapshot of the initialized
// execution environment when you publish a function version. For more information,
// see Improving startup performance with Lambda SnapStart (https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html)
// .
SnapStart *types.SnapStartResponse
// The current state of the function. When the state is Inactive , you can
// reactivate the function by invoking it.
State types.State
// The reason for the function's current state.
StateReason *string
// The reason code for the function's current state. When the code is Creating ,
// you can't invoke or modify the function.
StateReasonCode types.StateReasonCode
// The amount of time in seconds that Lambda allows a function to run before
// stopping it.
Timeout *int32
// The function's X-Ray tracing configuration.
TracingConfig *types.TracingConfigResponse
// The version of the Lambda function.
Version *string
// The function's networking configuration.
VpcConfig *types.VpcConfigResponse
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateFunctionCodeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateFunctionCode{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateFunctionCode{}, 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 = addOpUpdateFunctionCodeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateFunctionCode(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_opUpdateFunctionCode(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lambda",
OperationName: "UpdateFunctionCode",
}
}
| 308 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
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/lambda/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Modify the version-specific settings of a Lambda function. When you update a
// function, Lambda provisions an instance of the function and its supporting
// resources. If your function connects to a VPC, this process can take a minute.
// During this time, you can't modify the function, but you can still invoke it.
// The LastUpdateStatus , LastUpdateStatusReason , and LastUpdateStatusReasonCode
// fields in the response from GetFunctionConfiguration indicate when the update
// is complete and the function is processing events with the new configuration.
// For more information, see Lambda function states (https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)
// . These settings can vary between versions of a function and are locked when you
// publish a version. You can't modify the configuration of a published version,
// only the unpublished version. To configure function concurrency, use
// PutFunctionConcurrency . To grant invoke permissions to an Amazon Web Services
// account or Amazon Web Service, use AddPermission .
func (c *Client) UpdateFunctionConfiguration(ctx context.Context, params *UpdateFunctionConfigurationInput, optFns ...func(*Options)) (*UpdateFunctionConfigurationOutput, error) {
if params == nil {
params = &UpdateFunctionConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateFunctionConfiguration", params, optFns, c.addOperationUpdateFunctionConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateFunctionConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateFunctionConfigurationInput struct {
// The name of the Lambda function. Name formats
// - Function name – my-function .
// - Function ARN – arn:aws:lambda:us-west-2:123456789012:function:my-function .
// - Partial ARN – 123456789012:function:my-function .
// The length constraint applies only to the full ARN. If you specify only the
// function name, it is limited to 64 characters in length.
//
// This member is required.
FunctionName *string
// A dead-letter queue configuration that specifies the queue or topic where
// Lambda sends asynchronous events when they fail processing. For more
// information, see Dead-letter queues (https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-dlq)
// .
DeadLetterConfig *types.DeadLetterConfig
// A description of the function.
Description *string
// Environment variables that are accessible from function code during execution.
Environment *types.Environment
// The size of the function's /tmp directory in MB. The default value is 512, but
// can be any whole number between 512 and 10,240 MB.
EphemeralStorage *types.EphemeralStorage
// Connection settings for an Amazon EFS file system.
FileSystemConfigs []types.FileSystemConfig
// The name of the method within your code that Lambda calls to run your function.
// Handler is required if the deployment package is a .zip file archive. The format
// includes the file name. It can also include namespaces and other qualifiers,
// depending on the runtime. For more information, see Lambda programming model (https://docs.aws.amazon.com/lambda/latest/dg/foundation-progmodel.html)
// .
Handler *string
// Container image configuration values (https://docs.aws.amazon.com/lambda/latest/dg/images-parms.html)
// that override the values in the container image Docker file.
ImageConfig *types.ImageConfig
// The ARN of the Key Management Service (KMS) customer managed key that's used to
// encrypt your function's environment variables (https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption)
// . When Lambda SnapStart (https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html)
// is activated, Lambda also uses this key is to encrypt your function's snapshot.
// If you deploy your function using a container image, Lambda also uses this key
// to encrypt your function when it's deployed. Note that this is not the same key
// that's used to protect your container image in the Amazon Elastic Container
// Registry (Amazon ECR). If you don't provide a customer managed key, Lambda uses
// a default service key.
KMSKeyArn *string
// A list of function layers (https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)
// to add to the function's execution environment. Specify each layer by its ARN,
// including the version.
Layers []string
// The amount of memory available to the function (https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-memory-console)
// at runtime. Increasing the function memory also increases its CPU allocation.
// The default value is 128 MB. The value can be any multiple of 1 MB.
MemorySize *int32
// Update the function only if the revision ID matches the ID that's specified.
// Use this option to avoid modifying a function that has changed since you last
// read it.
RevisionId *string
// The Amazon Resource Name (ARN) of the function's execution role.
Role *string
// The identifier of the function's runtime (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)
// . Runtime is required if the deployment package is a .zip file archive. The
// following list includes deprecated runtimes. For more information, see Runtime
// deprecation policy (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy)
// .
Runtime types.Runtime
// The function's SnapStart (https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html)
// setting.
SnapStart *types.SnapStart
// The amount of time (in seconds) that Lambda allows a function to run before
// stopping it. The default is 3 seconds. The maximum allowed value is 900 seconds.
// For more information, see Lambda execution environment (https://docs.aws.amazon.com/lambda/latest/dg/runtimes-context.html)
// .
Timeout *int32
// Set Mode to Active to sample and trace a subset of incoming requests with X-Ray (https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html)
// .
TracingConfig *types.TracingConfig
// For network connectivity to Amazon Web Services resources in a VPC, specify a
// list of security groups and subnets in the VPC. When you connect a function to a
// VPC, it can access resources and the internet only through that VPC. For more
// information, see Configuring a Lambda function to access resources in a VPC (https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html)
// .
VpcConfig *types.VpcConfig
noSmithyDocumentSerde
}
// Details about a function's configuration.
type UpdateFunctionConfigurationOutput struct {
// The instruction set architecture that the function supports. Architecture is a
// string array with one of the valid values. The default architecture value is
// x86_64 .
Architectures []types.Architecture
// The SHA256 hash of the function's deployment package.
CodeSha256 *string
// The size of the function's deployment package, in bytes.
CodeSize int64
// The function's dead letter queue.
DeadLetterConfig *types.DeadLetterConfig
// The function's description.
Description *string
// The function's environment variables (https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)
// . Omitted from CloudTrail logs.
Environment *types.EnvironmentResponse
// The size of the function’s /tmp directory in MB. The default value is 512, but
// it can be any whole number between 512 and 10,240 MB.
EphemeralStorage *types.EphemeralStorage
// Connection settings for an Amazon EFS file system (https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)
// .
FileSystemConfigs []types.FileSystemConfig
// The function's Amazon Resource Name (ARN).
FunctionArn *string
// The name of the function.
FunctionName *string
// The function that Lambda calls to begin running your function.
Handler *string
// The function's image configuration values.
ImageConfigResponse *types.ImageConfigResponse
// The KMS key that's used to encrypt the function's environment variables (https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption)
// . When Lambda SnapStart (https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html)
// is activated, this key is also used to encrypt the function's snapshot. This key
// is returned only if you've configured a customer managed key.
KMSKeyArn *string
// The date and time that the function was last updated, in ISO-8601 format (https://www.w3.org/TR/NOTE-datetime)
// (YYYY-MM-DDThh:mm:ss.sTZD).
LastModified *string
// The status of the last update that was performed on the function. This is first
// set to Successful after function creation completes.
LastUpdateStatus types.LastUpdateStatus
// The reason for the last update that was performed on the function.
LastUpdateStatusReason *string
// The reason code for the last update that was performed on the function.
LastUpdateStatusReasonCode types.LastUpdateStatusReasonCode
// The function's layers (https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)
// .
Layers []types.Layer
// For Lambda@Edge functions, the ARN of the main function.
MasterArn *string
// The amount of memory available to the function at runtime.
MemorySize *int32
// The type of deployment package. Set to Image for container image and set Zip
// for .zip file archive.
PackageType types.PackageType
// The latest updated revision of the function or alias.
RevisionId *string
// The function's execution role.
Role *string
// The identifier of the function's runtime (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)
// . Runtime is required if the deployment package is a .zip file archive. The
// following list includes deprecated runtimes. For more information, see Runtime
// deprecation policy (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy)
// .
Runtime types.Runtime
// The ARN of the runtime and any errors that occured.
RuntimeVersionConfig *types.RuntimeVersionConfig
// The ARN of the signing job.
SigningJobArn *string
// The ARN of the signing profile version.
SigningProfileVersionArn *string
// Set ApplyOn to PublishedVersions to create a snapshot of the initialized
// execution environment when you publish a function version. For more information,
// see Improving startup performance with Lambda SnapStart (https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html)
// .
SnapStart *types.SnapStartResponse
// The current state of the function. When the state is Inactive , you can
// reactivate the function by invoking it.
State types.State
// The reason for the function's current state.
StateReason *string
// The reason code for the function's current state. When the code is Creating ,
// you can't invoke or modify the function.
StateReasonCode types.StateReasonCode
// The amount of time in seconds that Lambda allows a function to run before
// stopping it.
Timeout *int32
// The function's X-Ray tracing configuration.
TracingConfig *types.TracingConfigResponse
// The version of the Lambda function.
Version *string
// The function's networking configuration.
VpcConfig *types.VpcConfigResponse
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateFunctionConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateFunctionConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateFunctionConfiguration{}, 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 = addOpUpdateFunctionConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateFunctionConfiguration(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_opUpdateFunctionConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lambda",
OperationName: "UpdateFunctionConfiguration",
}
}
| 354 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
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/lambda/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Updates the configuration for asynchronous invocation for a function, version,
// or alias. To configure options for asynchronous invocation, use
// PutFunctionEventInvokeConfig .
func (c *Client) UpdateFunctionEventInvokeConfig(ctx context.Context, params *UpdateFunctionEventInvokeConfigInput, optFns ...func(*Options)) (*UpdateFunctionEventInvokeConfigOutput, error) {
if params == nil {
params = &UpdateFunctionEventInvokeConfigInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateFunctionEventInvokeConfig", params, optFns, c.addOperationUpdateFunctionEventInvokeConfigMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateFunctionEventInvokeConfigOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateFunctionEventInvokeConfigInput struct {
// The name of the Lambda function, version, or alias. Name formats
// - Function name - my-function (name-only), my-function:v1 (with alias).
// - Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function .
// - Partial ARN - 123456789012:function:my-function .
// You can append a version number or alias to any of the formats. The length
// constraint applies only to the full ARN. If you specify only the function name,
// it is limited to 64 characters in length.
//
// This member is required.
FunctionName *string
// A destination for events after they have been sent to a function for
// processing. Destinations
// - Function - The Amazon Resource Name (ARN) of a Lambda function.
// - Queue - The ARN of a standard SQS queue.
// - Topic - The ARN of a standard SNS topic.
// - Event Bus - The ARN of an Amazon EventBridge event bus.
DestinationConfig *types.DestinationConfig
// The maximum age of a request that Lambda sends to a function for processing.
MaximumEventAgeInSeconds *int32
// The maximum number of times to retry when the function returns an error.
MaximumRetryAttempts *int32
// A version number or alias name.
Qualifier *string
noSmithyDocumentSerde
}
type UpdateFunctionEventInvokeConfigOutput struct {
// A destination for events after they have been sent to a function for
// processing. Destinations
// - Function - The Amazon Resource Name (ARN) of a Lambda function.
// - Queue - The ARN of a standard SQS queue.
// - Topic - The ARN of a standard SNS topic.
// - Event Bus - The ARN of an Amazon EventBridge event bus.
DestinationConfig *types.DestinationConfig
// The Amazon Resource Name (ARN) of the function.
FunctionArn *string
// The date and time that the configuration was last updated.
LastModified *time.Time
// The maximum age of a request that Lambda sends to a function for processing.
MaximumEventAgeInSeconds *int32
// The maximum number of times to retry when the function returns an error.
MaximumRetryAttempts *int32
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateFunctionEventInvokeConfigMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateFunctionEventInvokeConfig{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateFunctionEventInvokeConfig{}, 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 = addOpUpdateFunctionEventInvokeConfigValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateFunctionEventInvokeConfig(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_opUpdateFunctionEventInvokeConfig(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lambda",
OperationName: "UpdateFunctionEventInvokeConfig",
}
}
| 168 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
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/lambda/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the configuration for a Lambda function URL.
func (c *Client) UpdateFunctionUrlConfig(ctx context.Context, params *UpdateFunctionUrlConfigInput, optFns ...func(*Options)) (*UpdateFunctionUrlConfigOutput, error) {
if params == nil {
params = &UpdateFunctionUrlConfigInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateFunctionUrlConfig", params, optFns, c.addOperationUpdateFunctionUrlConfigMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateFunctionUrlConfigOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateFunctionUrlConfigInput struct {
// The name of the Lambda function. Name formats
// - Function name – my-function .
// - Function ARN – arn:aws:lambda:us-west-2:123456789012:function:my-function .
// - Partial ARN – 123456789012:function:my-function .
// The length constraint applies only to the full ARN. If you specify only the
// function name, it is limited to 64 characters in length.
//
// This member is required.
FunctionName *string
// The type of authentication that your function URL uses. Set to AWS_IAM if you
// want to restrict access to authenticated users only. Set to NONE if you want to
// bypass IAM authentication to create a public endpoint. For more information, see
// Security and auth model for Lambda function URLs (https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html)
// .
AuthType types.FunctionUrlAuthType
// The cross-origin resource sharing (CORS) (https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)
// settings for your function URL.
Cors *types.Cors
// Use one of the following options:
// - BUFFERED – This is the default option. Lambda invokes your function using
// the Invoke API operation. Invocation results are available when the payload is
// complete. The maximum payload size is 6 MB.
// - RESPONSE_STREAM – Your function streams payload results as they become
// available. Lambda invokes your function using the InvokeWithResponseStream API
// operation. The maximum response payload size is 20 MB, however, you can
// request a quota increase (https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html)
// .
InvokeMode types.InvokeMode
// The alias name.
Qualifier *string
noSmithyDocumentSerde
}
type UpdateFunctionUrlConfigOutput struct {
// The type of authentication that your function URL uses. Set to AWS_IAM if you
// want to restrict access to authenticated users only. Set to NONE if you want to
// bypass IAM authentication to create a public endpoint. For more information, see
// Security and auth model for Lambda function URLs (https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html)
// .
//
// This member is required.
AuthType types.FunctionUrlAuthType
// When the function URL was created, in ISO-8601 format (https://www.w3.org/TR/NOTE-datetime)
// (YYYY-MM-DDThh:mm:ss.sTZD).
//
// This member is required.
CreationTime *string
// The Amazon Resource Name (ARN) of your function.
//
// This member is required.
FunctionArn *string
// The HTTP URL endpoint for your function.
//
// This member is required.
FunctionUrl *string
// When the function URL configuration was last updated, in ISO-8601 format (https://www.w3.org/TR/NOTE-datetime)
// (YYYY-MM-DDThh:mm:ss.sTZD).
//
// This member is required.
LastModifiedTime *string
// The cross-origin resource sharing (CORS) (https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)
// settings for your function URL.
Cors *types.Cors
// Use one of the following options:
// - BUFFERED – This is the default option. Lambda invokes your function using
// the Invoke API operation. Invocation results are available when the payload is
// complete. The maximum payload size is 6 MB.
// - RESPONSE_STREAM – Your function streams payload results as they become
// available. Lambda invokes your function using the InvokeWithResponseStream API
// operation. The maximum response payload size is 20 MB, however, you can
// request a quota increase (https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html)
// .
InvokeMode types.InvokeMode
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateFunctionUrlConfigMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateFunctionUrlConfig{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateFunctionUrlConfig{}, 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 = addOpUpdateFunctionUrlConfigValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateFunctionUrlConfig(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_opUpdateFunctionUrlConfig(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lambda",
OperationName: "UpdateFunctionUrlConfig",
}
}
| 198 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package lambda provides the API client, operations, and parameter types for AWS
// Lambda.
//
// Lambda Overview Lambda is a compute service that lets you run code without
// provisioning or managing servers. Lambda runs your code on a high-availability
// compute infrastructure and performs all of the administration of the compute
// resources, including server and operating system maintenance, capacity
// provisioning and automatic scaling, code monitoring and logging. With Lambda,
// you can run code for virtually any type of application or backend service. For
// more information about the Lambda service, see What is Lambda (https://docs.aws.amazon.com/lambda/latest/dg/welcome.html)
// in the Lambda Developer Guide. The Lambda API Reference provides information
// about each of the API methods, including details about the parameters in each
// API request and response. You can use Software Development Kits (SDKs),
// Integrated Development Environment (IDE) Toolkits, and command line tools to
// access the API. For installation instructions, see Tools for Amazon Web Services (http://aws.amazon.com/tools/)
// . For a list of Region-specific endpoints that Lambda supports, see Lambda
// endpoints and quotas (https://docs.aws.amazon.com/general/latest/gr/lambda-service.html/)
// in the Amazon Web Services General Reference.. When making the API calls, you
// will need to authenticate your request by providing a signature. Lambda supports
// signature version 4. For more information, see Signature Version 4 signing
// process (https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html)
// in the Amazon Web Services General Reference.. CA certificates Because Amazon
// Web Services SDKs use the CA certificates from your computer, changes to the
// certificates on the Amazon Web Services servers can cause connection failures
// when you attempt to use an SDK. You can prevent these failures by keeping your
// computer's CA certificates and operating system up-to-date. If you encounter
// this issue in a corporate environment and do not manage your own computer, you
// might need to ask an administrator to assist with the update process. The
// following list shows minimum operating system and Java versions:
// - Microsoft Windows versions that have updates from January 2005 or later
// installed contain at least one of the required CAs in their trust list.
// - Mac OS X 10.4 with Java for Mac OS X 10.4 Release 5 (February 2007), Mac OS
// X 10.5 (October 2007), and later versions contain at least one of the required
// CAs in their trust list.
// - Red Hat Enterprise Linux 5 (March 2007), 6, and 7 and CentOS 5, 6, and 7
// all contain at least one of the required CAs in their default trusted CA list.
// - Java 1.4.2_12 (May 2006), 5 Update 2 (March 2005), and all later versions,
// including Java 6 (December 2006), 7, and 8, contain at least one of the required
// CAs in their default trusted CA list.
//
// When accessing the Lambda management console or Lambda API endpoints, whether
// through browsers or programmatically, you will need to ensure your client
// machines support any of the following CAs:
// - Amazon Root CA 1
// - Starfield Services Root Certificate Authority - G2
// - Starfield Class 2 Certification Authority
//
// Root certificates from the first two authorities are available from Amazon
// trust services (https://www.amazontrust.com/repository/) , but keeping your
// computer up-to-date is the more straightforward solution. To learn more about
// ACM-provided certificates, see Amazon Web Services Certificate Manager FAQs. (http://aws.amazon.com/certificate-manager/faqs/#certificates)
package lambda
| 55 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
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/lambda/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 = "lambda"
}
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 smithy-go-codegen DO NOT EDIT.
package lambda
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream"
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/eventstreamapi"
"github.com/aws/aws-sdk-go-v2/service/lambda/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
smithysync "github.com/aws/smithy-go/sync"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
"io/ioutil"
"sync"
)
// InvokeWithResponseStreamResponseEventReader provides the interface for reading
// events from a stream.
//
// The writer's Close method must allow multiple concurrent calls.
type InvokeWithResponseStreamResponseEventReader interface {
Events() <-chan types.InvokeWithResponseStreamResponseEvent
Close() error
Err() error
}
type invokeWithResponseStreamResponseEventReader struct {
stream chan types.InvokeWithResponseStreamResponseEvent
decoder *eventstream.Decoder
eventStream io.ReadCloser
err *smithysync.OnceErr
payloadBuf []byte
done chan struct{}
closeOnce sync.Once
}
func newInvokeWithResponseStreamResponseEventReader(readCloser io.ReadCloser, decoder *eventstream.Decoder) *invokeWithResponseStreamResponseEventReader {
w := &invokeWithResponseStreamResponseEventReader{
stream: make(chan types.InvokeWithResponseStreamResponseEvent),
decoder: decoder,
eventStream: readCloser,
err: smithysync.NewOnceErr(),
done: make(chan struct{}),
payloadBuf: make([]byte, 10*1024),
}
go w.readEventStream()
return w
}
func (r *invokeWithResponseStreamResponseEventReader) Events() <-chan types.InvokeWithResponseStreamResponseEvent {
return r.stream
}
func (r *invokeWithResponseStreamResponseEventReader) readEventStream() {
defer r.Close()
defer close(r.stream)
for {
r.payloadBuf = r.payloadBuf[0:0]
decodedMessage, err := r.decoder.Decode(r.eventStream, r.payloadBuf)
if err != nil {
if err == io.EOF {
return
}
select {
case <-r.done:
return
default:
r.err.SetError(err)
return
}
}
event, err := r.deserializeEventMessage(&decodedMessage)
if err != nil {
r.err.SetError(err)
return
}
select {
case r.stream <- event:
case <-r.done:
return
}
}
}
func (r *invokeWithResponseStreamResponseEventReader) deserializeEventMessage(msg *eventstream.Message) (types.InvokeWithResponseStreamResponseEvent, error) {
messageType := msg.Headers.Get(eventstreamapi.MessageTypeHeader)
if messageType == nil {
return nil, fmt.Errorf("%s event header not present", eventstreamapi.MessageTypeHeader)
}
switch messageType.String() {
case eventstreamapi.EventMessageType:
var v types.InvokeWithResponseStreamResponseEvent
if err := awsRestjson1_deserializeEventStreamInvokeWithResponseStreamResponseEvent(&v, msg); err != nil {
return nil, err
}
return v, nil
case eventstreamapi.ExceptionMessageType:
return nil, awsRestjson1_deserializeEventStreamExceptionInvokeWithResponseStreamResponseEvent(msg)
case eventstreamapi.ErrorMessageType:
errorCode := "UnknownError"
errorMessage := errorCode
if header := msg.Headers.Get(eventstreamapi.ErrorCodeHeader); header != nil {
errorCode = header.String()
}
if header := msg.Headers.Get(eventstreamapi.ErrorMessageHeader); header != nil {
errorMessage = header.String()
}
return nil, &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
default:
mc := msg.Clone()
return nil, &UnknownEventMessageError{
Type: messageType.String(),
Message: &mc,
}
}
}
func (r *invokeWithResponseStreamResponseEventReader) ErrorSet() <-chan struct{} {
return r.err.ErrorSet()
}
func (r *invokeWithResponseStreamResponseEventReader) Close() error {
r.closeOnce.Do(r.safeClose)
return r.Err()
}
func (r *invokeWithResponseStreamResponseEventReader) safeClose() {
close(r.done)
r.eventStream.Close()
}
func (r *invokeWithResponseStreamResponseEventReader) Err() error {
return r.err.Err()
}
func (r *invokeWithResponseStreamResponseEventReader) Closed() <-chan struct{} {
return r.done
}
type awsRestjson1_deserializeOpEventStreamInvokeWithResponseStream struct {
LogEventStreamWrites bool
LogEventStreamReads bool
}
func (*awsRestjson1_deserializeOpEventStreamInvokeWithResponseStream) ID() string {
return "OperationEventStreamDeserializer"
}
func (m *awsRestjson1_deserializeOpEventStreamInvokeWithResponseStream) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
defer func() {
if err == nil {
return
}
m.closeResponseBody(out)
}()
logger := middleware.GetLogger(ctx)
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type: %T", in.Request)
}
_ = request
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
deserializeOutput, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type: %T", out.RawResponse)
}
_ = deserializeOutput
output, ok := out.Result.(*InvokeWithResponseStreamOutput)
if out.Result != nil && !ok {
return out, metadata, fmt.Errorf("unexpected output result type: %T", out.Result)
} else if out.Result == nil {
output = &InvokeWithResponseStreamOutput{}
out.Result = output
}
eventReader := newInvokeWithResponseStreamResponseEventReader(
deserializeOutput.Body,
eventstream.NewDecoder(func(options *eventstream.DecoderOptions) {
options.Logger = logger
options.LogMessages = m.LogEventStreamReads
}),
)
defer func() {
if err == nil {
return
}
_ = eventReader.Close()
}()
output.eventStream = NewInvokeWithResponseStreamEventStream(func(stream *InvokeWithResponseStreamEventStream) {
stream.Reader = eventReader
})
go output.eventStream.waitStreamClose()
return out, metadata, nil
}
func (*awsRestjson1_deserializeOpEventStreamInvokeWithResponseStream) closeResponseBody(out middleware.DeserializeOutput) {
if resp, ok := out.RawResponse.(*smithyhttp.Response); ok && resp != nil && resp.Body != nil {
_, _ = io.Copy(ioutil.Discard, resp.Body)
_ = resp.Body.Close()
}
}
func addEventStreamInvokeWithResponseStreamMiddleware(stack *middleware.Stack, options Options) error {
if err := stack.Deserialize.Insert(&awsRestjson1_deserializeOpEventStreamInvokeWithResponseStream{
LogEventStreamWrites: options.ClientLogMode.IsRequestEventMessage(),
LogEventStreamReads: options.ClientLogMode.IsResponseEventMessage(),
}, "OperationDeserializer", middleware.Before); err != nil {
return err
}
return nil
}
// UnknownEventMessageError provides an error when a message is received from the stream,
// but the reader is unable to determine what kind of message it is.
type UnknownEventMessageError struct {
Type string
Message *eventstream.Message
}
// Error retruns the error message string.
func (e *UnknownEventMessageError) Error() string {
return "unknown event stream message type, " + e.Type
}
func setSafeEventStreamClientLogMode(o *Options, operation string) {
switch operation {
case "InvokeWithResponseStream":
toggleEventStreamClientLogMode(o, false, true)
return
default:
return
}
}
func toggleEventStreamClientLogMode(o *Options, request, response bool) {
mode := o.ClientLogMode
if request && mode.IsRequestWithBody() {
mode.ClearRequestWithBody()
mode |= aws.LogRequest
}
if response && mode.IsResponseWithBody() {
mode.ClearResponseWithBody()
mode |= aws.LogResponse
}
o.ClientLogMode = mode
}
| 286 |
aws-sdk-go-v2 | aws | Go | // Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.
package lambda
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.37.0"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/lambda/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/encoding/httpbinding"
smithyjson "github.com/aws/smithy-go/encoding/json"
"github.com/aws/smithy-go/middleware"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
"math"
)
type awsRestjson1_serializeOpAddLayerVersionPermission struct {
}
func (*awsRestjson1_serializeOpAddLayerVersionPermission) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpAddLayerVersionPermission) 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.(*AddLayerVersionPermissionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy")
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_serializeOpHttpBindingsAddLayerVersionPermissionInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentAddLayerVersionPermissionInput(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_serializeOpHttpBindingsAddLayerVersionPermissionInput(v *AddLayerVersionPermissionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.LayerName == nil || len(*v.LayerName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member LayerName must not be empty")}
}
if v.LayerName != nil {
if err := encoder.SetURI("LayerName").String(*v.LayerName); err != nil {
return err
}
}
if v.RevisionId != nil {
encoder.SetQuery("RevisionId").String(*v.RevisionId)
}
{
if err := encoder.SetURI("VersionNumber").Long(v.VersionNumber); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentAddLayerVersionPermissionInput(v *AddLayerVersionPermissionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Action != nil {
ok := object.Key("Action")
ok.String(*v.Action)
}
if v.OrganizationId != nil {
ok := object.Key("OrganizationId")
ok.String(*v.OrganizationId)
}
if v.Principal != nil {
ok := object.Key("Principal")
ok.String(*v.Principal)
}
if v.StatementId != nil {
ok := object.Key("StatementId")
ok.String(*v.StatementId)
}
return nil
}
type awsRestjson1_serializeOpAddPermission struct {
}
func (*awsRestjson1_serializeOpAddPermission) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpAddPermission) 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.(*AddPermissionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2015-03-31/functions/{FunctionName}/policy")
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_serializeOpHttpBindingsAddPermissionInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentAddPermissionInput(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_serializeOpHttpBindingsAddPermissionInput(v *AddPermissionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if v.Qualifier != nil {
encoder.SetQuery("Qualifier").String(*v.Qualifier)
}
return nil
}
func awsRestjson1_serializeOpDocumentAddPermissionInput(v *AddPermissionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Action != nil {
ok := object.Key("Action")
ok.String(*v.Action)
}
if v.EventSourceToken != nil {
ok := object.Key("EventSourceToken")
ok.String(*v.EventSourceToken)
}
if len(v.FunctionUrlAuthType) > 0 {
ok := object.Key("FunctionUrlAuthType")
ok.String(string(v.FunctionUrlAuthType))
}
if v.Principal != nil {
ok := object.Key("Principal")
ok.String(*v.Principal)
}
if v.PrincipalOrgID != nil {
ok := object.Key("PrincipalOrgID")
ok.String(*v.PrincipalOrgID)
}
if v.RevisionId != nil {
ok := object.Key("RevisionId")
ok.String(*v.RevisionId)
}
if v.SourceAccount != nil {
ok := object.Key("SourceAccount")
ok.String(*v.SourceAccount)
}
if v.SourceArn != nil {
ok := object.Key("SourceArn")
ok.String(*v.SourceArn)
}
if v.StatementId != nil {
ok := object.Key("StatementId")
ok.String(*v.StatementId)
}
return nil
}
type awsRestjson1_serializeOpCreateAlias struct {
}
func (*awsRestjson1_serializeOpCreateAlias) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateAlias) 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.(*CreateAliasInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2015-03-31/functions/{FunctionName}/aliases")
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_serializeOpHttpBindingsCreateAliasInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateAliasInput(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_serializeOpHttpBindingsCreateAliasInput(v *CreateAliasInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateAliasInput(v *CreateAliasInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.FunctionVersion != nil {
ok := object.Key("FunctionVersion")
ok.String(*v.FunctionVersion)
}
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.RoutingConfig != nil {
ok := object.Key("RoutingConfig")
if err := awsRestjson1_serializeDocumentAliasRoutingConfiguration(v.RoutingConfig, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateCodeSigningConfig struct {
}
func (*awsRestjson1_serializeOpCreateCodeSigningConfig) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateCodeSigningConfig) 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.(*CreateCodeSigningConfigInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2020-04-22/code-signing-configs")
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_serializeOpDocumentCreateCodeSigningConfigInput(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_serializeOpHttpBindingsCreateCodeSigningConfigInput(v *CreateCodeSigningConfigInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateCodeSigningConfigInput(v *CreateCodeSigningConfigInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AllowedPublishers != nil {
ok := object.Key("AllowedPublishers")
if err := awsRestjson1_serializeDocumentAllowedPublishers(v.AllowedPublishers, ok); err != nil {
return err
}
}
if v.CodeSigningPolicies != nil {
ok := object.Key("CodeSigningPolicies")
if err := awsRestjson1_serializeDocumentCodeSigningPolicies(v.CodeSigningPolicies, ok); err != nil {
return err
}
}
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
return nil
}
type awsRestjson1_serializeOpCreateEventSourceMapping struct {
}
func (*awsRestjson1_serializeOpCreateEventSourceMapping) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateEventSourceMapping) 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.(*CreateEventSourceMappingInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2015-03-31/event-source-mappings")
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_serializeOpDocumentCreateEventSourceMappingInput(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_serializeOpHttpBindingsCreateEventSourceMappingInput(v *CreateEventSourceMappingInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateEventSourceMappingInput(v *CreateEventSourceMappingInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AmazonManagedKafkaEventSourceConfig != nil {
ok := object.Key("AmazonManagedKafkaEventSourceConfig")
if err := awsRestjson1_serializeDocumentAmazonManagedKafkaEventSourceConfig(v.AmazonManagedKafkaEventSourceConfig, ok); err != nil {
return err
}
}
if v.BatchSize != nil {
ok := object.Key("BatchSize")
ok.Integer(*v.BatchSize)
}
if v.BisectBatchOnFunctionError != nil {
ok := object.Key("BisectBatchOnFunctionError")
ok.Boolean(*v.BisectBatchOnFunctionError)
}
if v.DestinationConfig != nil {
ok := object.Key("DestinationConfig")
if err := awsRestjson1_serializeDocumentDestinationConfig(v.DestinationConfig, ok); err != nil {
return err
}
}
if v.DocumentDBEventSourceConfig != nil {
ok := object.Key("DocumentDBEventSourceConfig")
if err := awsRestjson1_serializeDocumentDocumentDBEventSourceConfig(v.DocumentDBEventSourceConfig, ok); err != nil {
return err
}
}
if v.Enabled != nil {
ok := object.Key("Enabled")
ok.Boolean(*v.Enabled)
}
if v.EventSourceArn != nil {
ok := object.Key("EventSourceArn")
ok.String(*v.EventSourceArn)
}
if v.FilterCriteria != nil {
ok := object.Key("FilterCriteria")
if err := awsRestjson1_serializeDocumentFilterCriteria(v.FilterCriteria, ok); err != nil {
return err
}
}
if v.FunctionName != nil {
ok := object.Key("FunctionName")
ok.String(*v.FunctionName)
}
if v.FunctionResponseTypes != nil {
ok := object.Key("FunctionResponseTypes")
if err := awsRestjson1_serializeDocumentFunctionResponseTypeList(v.FunctionResponseTypes, ok); err != nil {
return err
}
}
if v.MaximumBatchingWindowInSeconds != nil {
ok := object.Key("MaximumBatchingWindowInSeconds")
ok.Integer(*v.MaximumBatchingWindowInSeconds)
}
if v.MaximumRecordAgeInSeconds != nil {
ok := object.Key("MaximumRecordAgeInSeconds")
ok.Integer(*v.MaximumRecordAgeInSeconds)
}
if v.MaximumRetryAttempts != nil {
ok := object.Key("MaximumRetryAttempts")
ok.Integer(*v.MaximumRetryAttempts)
}
if v.ParallelizationFactor != nil {
ok := object.Key("ParallelizationFactor")
ok.Integer(*v.ParallelizationFactor)
}
if v.Queues != nil {
ok := object.Key("Queues")
if err := awsRestjson1_serializeDocumentQueues(v.Queues, ok); err != nil {
return err
}
}
if v.ScalingConfig != nil {
ok := object.Key("ScalingConfig")
if err := awsRestjson1_serializeDocumentScalingConfig(v.ScalingConfig, ok); err != nil {
return err
}
}
if v.SelfManagedEventSource != nil {
ok := object.Key("SelfManagedEventSource")
if err := awsRestjson1_serializeDocumentSelfManagedEventSource(v.SelfManagedEventSource, ok); err != nil {
return err
}
}
if v.SelfManagedKafkaEventSourceConfig != nil {
ok := object.Key("SelfManagedKafkaEventSourceConfig")
if err := awsRestjson1_serializeDocumentSelfManagedKafkaEventSourceConfig(v.SelfManagedKafkaEventSourceConfig, ok); err != nil {
return err
}
}
if v.SourceAccessConfigurations != nil {
ok := object.Key("SourceAccessConfigurations")
if err := awsRestjson1_serializeDocumentSourceAccessConfigurations(v.SourceAccessConfigurations, ok); err != nil {
return err
}
}
if len(v.StartingPosition) > 0 {
ok := object.Key("StartingPosition")
ok.String(string(v.StartingPosition))
}
if v.StartingPositionTimestamp != nil {
ok := object.Key("StartingPositionTimestamp")
ok.Double(smithytime.FormatEpochSeconds(*v.StartingPositionTimestamp))
}
if v.Topics != nil {
ok := object.Key("Topics")
if err := awsRestjson1_serializeDocumentTopics(v.Topics, ok); err != nil {
return err
}
}
if v.TumblingWindowInSeconds != nil {
ok := object.Key("TumblingWindowInSeconds")
ok.Integer(*v.TumblingWindowInSeconds)
}
return nil
}
type awsRestjson1_serializeOpCreateFunction struct {
}
func (*awsRestjson1_serializeOpCreateFunction) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateFunction) 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.(*CreateFunctionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2015-03-31/functions")
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_serializeOpDocumentCreateFunctionInput(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_serializeOpHttpBindingsCreateFunctionInput(v *CreateFunctionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateFunctionInput(v *CreateFunctionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Architectures != nil {
ok := object.Key("Architectures")
if err := awsRestjson1_serializeDocumentArchitecturesList(v.Architectures, ok); err != nil {
return err
}
}
if v.Code != nil {
ok := object.Key("Code")
if err := awsRestjson1_serializeDocumentFunctionCode(v.Code, ok); err != nil {
return err
}
}
if v.CodeSigningConfigArn != nil {
ok := object.Key("CodeSigningConfigArn")
ok.String(*v.CodeSigningConfigArn)
}
if v.DeadLetterConfig != nil {
ok := object.Key("DeadLetterConfig")
if err := awsRestjson1_serializeDocumentDeadLetterConfig(v.DeadLetterConfig, ok); err != nil {
return err
}
}
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.Environment != nil {
ok := object.Key("Environment")
if err := awsRestjson1_serializeDocumentEnvironment(v.Environment, ok); err != nil {
return err
}
}
if v.EphemeralStorage != nil {
ok := object.Key("EphemeralStorage")
if err := awsRestjson1_serializeDocumentEphemeralStorage(v.EphemeralStorage, ok); err != nil {
return err
}
}
if v.FileSystemConfigs != nil {
ok := object.Key("FileSystemConfigs")
if err := awsRestjson1_serializeDocumentFileSystemConfigList(v.FileSystemConfigs, ok); err != nil {
return err
}
}
if v.FunctionName != nil {
ok := object.Key("FunctionName")
ok.String(*v.FunctionName)
}
if v.Handler != nil {
ok := object.Key("Handler")
ok.String(*v.Handler)
}
if v.ImageConfig != nil {
ok := object.Key("ImageConfig")
if err := awsRestjson1_serializeDocumentImageConfig(v.ImageConfig, ok); err != nil {
return err
}
}
if v.KMSKeyArn != nil {
ok := object.Key("KMSKeyArn")
ok.String(*v.KMSKeyArn)
}
if v.Layers != nil {
ok := object.Key("Layers")
if err := awsRestjson1_serializeDocumentLayerList(v.Layers, ok); err != nil {
return err
}
}
if v.MemorySize != nil {
ok := object.Key("MemorySize")
ok.Integer(*v.MemorySize)
}
if len(v.PackageType) > 0 {
ok := object.Key("PackageType")
ok.String(string(v.PackageType))
}
if v.Publish {
ok := object.Key("Publish")
ok.Boolean(v.Publish)
}
if v.Role != nil {
ok := object.Key("Role")
ok.String(*v.Role)
}
if len(v.Runtime) > 0 {
ok := object.Key("Runtime")
ok.String(string(v.Runtime))
}
if v.SnapStart != nil {
ok := object.Key("SnapStart")
if err := awsRestjson1_serializeDocumentSnapStart(v.SnapStart, ok); err != nil {
return err
}
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsRestjson1_serializeDocumentTags(v.Tags, ok); err != nil {
return err
}
}
if v.Timeout != nil {
ok := object.Key("Timeout")
ok.Integer(*v.Timeout)
}
if v.TracingConfig != nil {
ok := object.Key("TracingConfig")
if err := awsRestjson1_serializeDocumentTracingConfig(v.TracingConfig, ok); err != nil {
return err
}
}
if v.VpcConfig != nil {
ok := object.Key("VpcConfig")
if err := awsRestjson1_serializeDocumentVpcConfig(v.VpcConfig, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateFunctionUrlConfig struct {
}
func (*awsRestjson1_serializeOpCreateFunctionUrlConfig) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateFunctionUrlConfig) 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.(*CreateFunctionUrlConfigInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2021-10-31/functions/{FunctionName}/url")
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_serializeOpHttpBindingsCreateFunctionUrlConfigInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateFunctionUrlConfigInput(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_serializeOpHttpBindingsCreateFunctionUrlConfigInput(v *CreateFunctionUrlConfigInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if v.Qualifier != nil {
encoder.SetQuery("Qualifier").String(*v.Qualifier)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateFunctionUrlConfigInput(v *CreateFunctionUrlConfigInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.AuthType) > 0 {
ok := object.Key("AuthType")
ok.String(string(v.AuthType))
}
if v.Cors != nil {
ok := object.Key("Cors")
if err := awsRestjson1_serializeDocumentCors(v.Cors, ok); err != nil {
return err
}
}
if len(v.InvokeMode) > 0 {
ok := object.Key("InvokeMode")
ok.String(string(v.InvokeMode))
}
return nil
}
type awsRestjson1_serializeOpDeleteAlias struct {
}
func (*awsRestjson1_serializeOpDeleteAlias) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteAlias) 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.(*DeleteAliasInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2015-03-31/functions/{FunctionName}/aliases/{Name}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteAliasInput(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_serializeOpHttpBindingsDeleteAliasInput(v *DeleteAliasInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("Name").String(*v.Name); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteCodeSigningConfig struct {
}
func (*awsRestjson1_serializeOpDeleteCodeSigningConfig) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteCodeSigningConfig) 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.(*DeleteCodeSigningConfigInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2020-04-22/code-signing-configs/{CodeSigningConfigArn}")
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_serializeOpHttpBindingsDeleteCodeSigningConfigInput(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_serializeOpHttpBindingsDeleteCodeSigningConfigInput(v *DeleteCodeSigningConfigInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.CodeSigningConfigArn == nil || len(*v.CodeSigningConfigArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member CodeSigningConfigArn must not be empty")}
}
if v.CodeSigningConfigArn != nil {
if err := encoder.SetURI("CodeSigningConfigArn").String(*v.CodeSigningConfigArn); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteEventSourceMapping struct {
}
func (*awsRestjson1_serializeOpDeleteEventSourceMapping) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteEventSourceMapping) 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.(*DeleteEventSourceMappingInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2015-03-31/event-source-mappings/{UUID}")
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_serializeOpHttpBindingsDeleteEventSourceMappingInput(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_serializeOpHttpBindingsDeleteEventSourceMappingInput(v *DeleteEventSourceMappingInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.UUID == nil || len(*v.UUID) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member UUID must not be empty")}
}
if v.UUID != nil {
if err := encoder.SetURI("UUID").String(*v.UUID); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteFunction struct {
}
func (*awsRestjson1_serializeOpDeleteFunction) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteFunction) 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.(*DeleteFunctionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2015-03-31/functions/{FunctionName}")
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_serializeOpHttpBindingsDeleteFunctionInput(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_serializeOpHttpBindingsDeleteFunctionInput(v *DeleteFunctionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if v.Qualifier != nil {
encoder.SetQuery("Qualifier").String(*v.Qualifier)
}
return nil
}
type awsRestjson1_serializeOpDeleteFunctionCodeSigningConfig struct {
}
func (*awsRestjson1_serializeOpDeleteFunctionCodeSigningConfig) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteFunctionCodeSigningConfig) 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.(*DeleteFunctionCodeSigningConfigInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2020-06-30/functions/{FunctionName}/code-signing-config")
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_serializeOpHttpBindingsDeleteFunctionCodeSigningConfigInput(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_serializeOpHttpBindingsDeleteFunctionCodeSigningConfigInput(v *DeleteFunctionCodeSigningConfigInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteFunctionConcurrency struct {
}
func (*awsRestjson1_serializeOpDeleteFunctionConcurrency) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteFunctionConcurrency) 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.(*DeleteFunctionConcurrencyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2017-10-31/functions/{FunctionName}/concurrency")
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_serializeOpHttpBindingsDeleteFunctionConcurrencyInput(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_serializeOpHttpBindingsDeleteFunctionConcurrencyInput(v *DeleteFunctionConcurrencyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteFunctionEventInvokeConfig struct {
}
func (*awsRestjson1_serializeOpDeleteFunctionEventInvokeConfig) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteFunctionEventInvokeConfig) 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.(*DeleteFunctionEventInvokeConfigInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2019-09-25/functions/{FunctionName}/event-invoke-config")
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_serializeOpHttpBindingsDeleteFunctionEventInvokeConfigInput(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_serializeOpHttpBindingsDeleteFunctionEventInvokeConfigInput(v *DeleteFunctionEventInvokeConfigInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if v.Qualifier != nil {
encoder.SetQuery("Qualifier").String(*v.Qualifier)
}
return nil
}
type awsRestjson1_serializeOpDeleteFunctionUrlConfig struct {
}
func (*awsRestjson1_serializeOpDeleteFunctionUrlConfig) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteFunctionUrlConfig) 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.(*DeleteFunctionUrlConfigInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2021-10-31/functions/{FunctionName}/url")
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_serializeOpHttpBindingsDeleteFunctionUrlConfigInput(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_serializeOpHttpBindingsDeleteFunctionUrlConfigInput(v *DeleteFunctionUrlConfigInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if v.Qualifier != nil {
encoder.SetQuery("Qualifier").String(*v.Qualifier)
}
return nil
}
type awsRestjson1_serializeOpDeleteLayerVersion struct {
}
func (*awsRestjson1_serializeOpDeleteLayerVersion) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteLayerVersion) 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.(*DeleteLayerVersionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2018-10-31/layers/{LayerName}/versions/{VersionNumber}")
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_serializeOpHttpBindingsDeleteLayerVersionInput(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_serializeOpHttpBindingsDeleteLayerVersionInput(v *DeleteLayerVersionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.LayerName == nil || len(*v.LayerName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member LayerName must not be empty")}
}
if v.LayerName != nil {
if err := encoder.SetURI("LayerName").String(*v.LayerName); err != nil {
return err
}
}
{
if err := encoder.SetURI("VersionNumber").Long(v.VersionNumber); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteProvisionedConcurrencyConfig struct {
}
func (*awsRestjson1_serializeOpDeleteProvisionedConcurrencyConfig) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteProvisionedConcurrencyConfig) 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.(*DeleteProvisionedConcurrencyConfigInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2019-09-30/functions/{FunctionName}/provisioned-concurrency")
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_serializeOpHttpBindingsDeleteProvisionedConcurrencyConfigInput(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_serializeOpHttpBindingsDeleteProvisionedConcurrencyConfigInput(v *DeleteProvisionedConcurrencyConfigInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if v.Qualifier != nil {
encoder.SetQuery("Qualifier").String(*v.Qualifier)
}
return nil
}
type awsRestjson1_serializeOpGetAccountSettings struct {
}
func (*awsRestjson1_serializeOpGetAccountSettings) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetAccountSettings) 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.(*GetAccountSettingsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2016-08-19/account-settings")
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 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_serializeOpHttpBindingsGetAccountSettingsInput(v *GetAccountSettingsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpGetAlias struct {
}
func (*awsRestjson1_serializeOpGetAlias) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetAlias) 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.(*GetAliasInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2015-03-31/functions/{FunctionName}/aliases/{Name}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetAliasInput(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_serializeOpHttpBindingsGetAliasInput(v *GetAliasInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("Name").String(*v.Name); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetCodeSigningConfig struct {
}
func (*awsRestjson1_serializeOpGetCodeSigningConfig) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetCodeSigningConfig) 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.(*GetCodeSigningConfigInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2020-04-22/code-signing-configs/{CodeSigningConfigArn}")
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_serializeOpHttpBindingsGetCodeSigningConfigInput(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_serializeOpHttpBindingsGetCodeSigningConfigInput(v *GetCodeSigningConfigInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.CodeSigningConfigArn == nil || len(*v.CodeSigningConfigArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member CodeSigningConfigArn must not be empty")}
}
if v.CodeSigningConfigArn != nil {
if err := encoder.SetURI("CodeSigningConfigArn").String(*v.CodeSigningConfigArn); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetEventSourceMapping struct {
}
func (*awsRestjson1_serializeOpGetEventSourceMapping) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetEventSourceMapping) 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.(*GetEventSourceMappingInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2015-03-31/event-source-mappings/{UUID}")
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_serializeOpHttpBindingsGetEventSourceMappingInput(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_serializeOpHttpBindingsGetEventSourceMappingInput(v *GetEventSourceMappingInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.UUID == nil || len(*v.UUID) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member UUID must not be empty")}
}
if v.UUID != nil {
if err := encoder.SetURI("UUID").String(*v.UUID); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetFunction struct {
}
func (*awsRestjson1_serializeOpGetFunction) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetFunction) 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.(*GetFunctionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2015-03-31/functions/{FunctionName}")
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_serializeOpHttpBindingsGetFunctionInput(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_serializeOpHttpBindingsGetFunctionInput(v *GetFunctionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if v.Qualifier != nil {
encoder.SetQuery("Qualifier").String(*v.Qualifier)
}
return nil
}
type awsRestjson1_serializeOpGetFunctionCodeSigningConfig struct {
}
func (*awsRestjson1_serializeOpGetFunctionCodeSigningConfig) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetFunctionCodeSigningConfig) 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.(*GetFunctionCodeSigningConfigInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2020-06-30/functions/{FunctionName}/code-signing-config")
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_serializeOpHttpBindingsGetFunctionCodeSigningConfigInput(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_serializeOpHttpBindingsGetFunctionCodeSigningConfigInput(v *GetFunctionCodeSigningConfigInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetFunctionConcurrency struct {
}
func (*awsRestjson1_serializeOpGetFunctionConcurrency) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetFunctionConcurrency) 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.(*GetFunctionConcurrencyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2019-09-30/functions/{FunctionName}/concurrency")
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_serializeOpHttpBindingsGetFunctionConcurrencyInput(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_serializeOpHttpBindingsGetFunctionConcurrencyInput(v *GetFunctionConcurrencyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetFunctionConfiguration struct {
}
func (*awsRestjson1_serializeOpGetFunctionConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetFunctionConfiguration) 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.(*GetFunctionConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2015-03-31/functions/{FunctionName}/configuration")
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_serializeOpHttpBindingsGetFunctionConfigurationInput(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_serializeOpHttpBindingsGetFunctionConfigurationInput(v *GetFunctionConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if v.Qualifier != nil {
encoder.SetQuery("Qualifier").String(*v.Qualifier)
}
return nil
}
type awsRestjson1_serializeOpGetFunctionEventInvokeConfig struct {
}
func (*awsRestjson1_serializeOpGetFunctionEventInvokeConfig) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetFunctionEventInvokeConfig) 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.(*GetFunctionEventInvokeConfigInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2019-09-25/functions/{FunctionName}/event-invoke-config")
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_serializeOpHttpBindingsGetFunctionEventInvokeConfigInput(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_serializeOpHttpBindingsGetFunctionEventInvokeConfigInput(v *GetFunctionEventInvokeConfigInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if v.Qualifier != nil {
encoder.SetQuery("Qualifier").String(*v.Qualifier)
}
return nil
}
type awsRestjson1_serializeOpGetFunctionUrlConfig struct {
}
func (*awsRestjson1_serializeOpGetFunctionUrlConfig) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetFunctionUrlConfig) 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.(*GetFunctionUrlConfigInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2021-10-31/functions/{FunctionName}/url")
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_serializeOpHttpBindingsGetFunctionUrlConfigInput(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_serializeOpHttpBindingsGetFunctionUrlConfigInput(v *GetFunctionUrlConfigInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if v.Qualifier != nil {
encoder.SetQuery("Qualifier").String(*v.Qualifier)
}
return nil
}
type awsRestjson1_serializeOpGetLayerVersion struct {
}
func (*awsRestjson1_serializeOpGetLayerVersion) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetLayerVersion) 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.(*GetLayerVersionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2018-10-31/layers/{LayerName}/versions/{VersionNumber}")
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_serializeOpHttpBindingsGetLayerVersionInput(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_serializeOpHttpBindingsGetLayerVersionInput(v *GetLayerVersionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.LayerName == nil || len(*v.LayerName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member LayerName must not be empty")}
}
if v.LayerName != nil {
if err := encoder.SetURI("LayerName").String(*v.LayerName); err != nil {
return err
}
}
{
if err := encoder.SetURI("VersionNumber").Long(v.VersionNumber); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetLayerVersionByArn struct {
}
func (*awsRestjson1_serializeOpGetLayerVersionByArn) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetLayerVersionByArn) 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.(*GetLayerVersionByArnInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2018-10-31/layers?find=LayerVersion")
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_serializeOpHttpBindingsGetLayerVersionByArnInput(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_serializeOpHttpBindingsGetLayerVersionByArnInput(v *GetLayerVersionByArnInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Arn != nil {
encoder.SetQuery("Arn").String(*v.Arn)
}
return nil
}
type awsRestjson1_serializeOpGetLayerVersionPolicy struct {
}
func (*awsRestjson1_serializeOpGetLayerVersionPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetLayerVersionPolicy) 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.(*GetLayerVersionPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2018-10-31/layers/{LayerName}/versions/{VersionNumber}/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_serializeOpHttpBindingsGetLayerVersionPolicyInput(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_serializeOpHttpBindingsGetLayerVersionPolicyInput(v *GetLayerVersionPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.LayerName == nil || len(*v.LayerName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member LayerName must not be empty")}
}
if v.LayerName != nil {
if err := encoder.SetURI("LayerName").String(*v.LayerName); err != nil {
return err
}
}
{
if err := encoder.SetURI("VersionNumber").Long(v.VersionNumber); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetPolicy struct {
}
func (*awsRestjson1_serializeOpGetPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetPolicy) 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.(*GetPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2015-03-31/functions/{FunctionName}/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_serializeOpHttpBindingsGetPolicyInput(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_serializeOpHttpBindingsGetPolicyInput(v *GetPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if v.Qualifier != nil {
encoder.SetQuery("Qualifier").String(*v.Qualifier)
}
return nil
}
type awsRestjson1_serializeOpGetProvisionedConcurrencyConfig struct {
}
func (*awsRestjson1_serializeOpGetProvisionedConcurrencyConfig) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetProvisionedConcurrencyConfig) 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.(*GetProvisionedConcurrencyConfigInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2019-09-30/functions/{FunctionName}/provisioned-concurrency")
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_serializeOpHttpBindingsGetProvisionedConcurrencyConfigInput(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_serializeOpHttpBindingsGetProvisionedConcurrencyConfigInput(v *GetProvisionedConcurrencyConfigInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if v.Qualifier != nil {
encoder.SetQuery("Qualifier").String(*v.Qualifier)
}
return nil
}
type awsRestjson1_serializeOpGetRuntimeManagementConfig struct {
}
func (*awsRestjson1_serializeOpGetRuntimeManagementConfig) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetRuntimeManagementConfig) 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.(*GetRuntimeManagementConfigInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2021-07-20/functions/{FunctionName}/runtime-management-config")
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_serializeOpHttpBindingsGetRuntimeManagementConfigInput(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_serializeOpHttpBindingsGetRuntimeManagementConfigInput(v *GetRuntimeManagementConfigInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if v.Qualifier != nil {
encoder.SetQuery("Qualifier").String(*v.Qualifier)
}
return nil
}
type awsRestjson1_serializeOpInvoke struct {
}
func (*awsRestjson1_serializeOpInvoke) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpInvoke) 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.(*InvokeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2015-03-31/functions/{FunctionName}/invocations")
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_serializeOpHttpBindingsInvokeInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if !restEncoder.HasHeader("Content-Type") {
ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
restEncoder.SetHeader("Content-Type").String("application/octet-stream")
}
if input.Payload != nil {
payload := bytes.NewReader(input.Payload)
if request, err = request.SetStream(payload); 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_serializeOpHttpBindingsInvokeInput(v *InvokeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ClientContext != nil && len(*v.ClientContext) > 0 {
locationName := "X-Amz-Client-Context"
encoder.SetHeader(locationName).String(*v.ClientContext)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if len(v.InvocationType) > 0 {
locationName := "X-Amz-Invocation-Type"
encoder.SetHeader(locationName).String(string(v.InvocationType))
}
if len(v.LogType) > 0 {
locationName := "X-Amz-Log-Type"
encoder.SetHeader(locationName).String(string(v.LogType))
}
if v.Qualifier != nil {
encoder.SetQuery("Qualifier").String(*v.Qualifier)
}
return nil
}
type awsRestjson1_serializeOpInvokeAsync struct {
}
func (*awsRestjson1_serializeOpInvokeAsync) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpInvokeAsync) 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.(*InvokeAsyncInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2014-11-13/functions/{FunctionName}/invoke-async")
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_serializeOpHttpBindingsInvokeAsyncInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if !restEncoder.HasHeader("Content-Type") {
ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
restEncoder.SetHeader("Content-Type").String("application/octet-stream")
}
if input.InvokeArgs != nil {
payload := input.InvokeArgs
if request, err = request.SetStream(payload); 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_serializeOpHttpBindingsInvokeAsyncInput(v *InvokeAsyncInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpInvokeWithResponseStream struct {
}
func (*awsRestjson1_serializeOpInvokeWithResponseStream) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpInvokeWithResponseStream) 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.(*InvokeWithResponseStreamInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2021-11-15/functions/{FunctionName}/response-streaming-invocations")
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_serializeOpHttpBindingsInvokeWithResponseStreamInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if !restEncoder.HasHeader("Content-Type") {
ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true)
restEncoder.SetHeader("Content-Type").String("application/octet-stream")
}
if input.Payload != nil {
payload := bytes.NewReader(input.Payload)
if request, err = request.SetStream(payload); 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_serializeOpHttpBindingsInvokeWithResponseStreamInput(v *InvokeWithResponseStreamInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ClientContext != nil && len(*v.ClientContext) > 0 {
locationName := "X-Amz-Client-Context"
encoder.SetHeader(locationName).String(*v.ClientContext)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if len(v.InvocationType) > 0 {
locationName := "X-Amz-Invocation-Type"
encoder.SetHeader(locationName).String(string(v.InvocationType))
}
if len(v.LogType) > 0 {
locationName := "X-Amz-Log-Type"
encoder.SetHeader(locationName).String(string(v.LogType))
}
if v.Qualifier != nil {
encoder.SetQuery("Qualifier").String(*v.Qualifier)
}
return nil
}
type awsRestjson1_serializeOpListAliases struct {
}
func (*awsRestjson1_serializeOpListAliases) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListAliases) 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.(*ListAliasesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2015-03-31/functions/{FunctionName}/aliases")
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_serializeOpHttpBindingsListAliasesInput(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_serializeOpHttpBindingsListAliasesInput(v *ListAliasesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if v.FunctionVersion != nil {
encoder.SetQuery("FunctionVersion").String(*v.FunctionVersion)
}
if v.Marker != nil {
encoder.SetQuery("Marker").String(*v.Marker)
}
if v.MaxItems != nil {
encoder.SetQuery("MaxItems").Integer(*v.MaxItems)
}
return nil
}
type awsRestjson1_serializeOpListCodeSigningConfigs struct {
}
func (*awsRestjson1_serializeOpListCodeSigningConfigs) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListCodeSigningConfigs) 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.(*ListCodeSigningConfigsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2020-04-22/code-signing-configs")
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_serializeOpHttpBindingsListCodeSigningConfigsInput(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_serializeOpHttpBindingsListCodeSigningConfigsInput(v *ListCodeSigningConfigsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Marker != nil {
encoder.SetQuery("Marker").String(*v.Marker)
}
if v.MaxItems != nil {
encoder.SetQuery("MaxItems").Integer(*v.MaxItems)
}
return nil
}
type awsRestjson1_serializeOpListEventSourceMappings struct {
}
func (*awsRestjson1_serializeOpListEventSourceMappings) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListEventSourceMappings) 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.(*ListEventSourceMappingsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2015-03-31/event-source-mappings")
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_serializeOpHttpBindingsListEventSourceMappingsInput(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_serializeOpHttpBindingsListEventSourceMappingsInput(v *ListEventSourceMappingsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.EventSourceArn != nil {
encoder.SetQuery("EventSourceArn").String(*v.EventSourceArn)
}
if v.FunctionName != nil {
encoder.SetQuery("FunctionName").String(*v.FunctionName)
}
if v.Marker != nil {
encoder.SetQuery("Marker").String(*v.Marker)
}
if v.MaxItems != nil {
encoder.SetQuery("MaxItems").Integer(*v.MaxItems)
}
return nil
}
type awsRestjson1_serializeOpListFunctionEventInvokeConfigs struct {
}
func (*awsRestjson1_serializeOpListFunctionEventInvokeConfigs) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListFunctionEventInvokeConfigs) 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.(*ListFunctionEventInvokeConfigsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2019-09-25/functions/{FunctionName}/event-invoke-config/list")
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_serializeOpHttpBindingsListFunctionEventInvokeConfigsInput(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_serializeOpHttpBindingsListFunctionEventInvokeConfigsInput(v *ListFunctionEventInvokeConfigsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if v.Marker != nil {
encoder.SetQuery("Marker").String(*v.Marker)
}
if v.MaxItems != nil {
encoder.SetQuery("MaxItems").Integer(*v.MaxItems)
}
return nil
}
type awsRestjson1_serializeOpListFunctions struct {
}
func (*awsRestjson1_serializeOpListFunctions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListFunctions) 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.(*ListFunctionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2015-03-31/functions")
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_serializeOpHttpBindingsListFunctionsInput(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_serializeOpHttpBindingsListFunctionsInput(v *ListFunctionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if len(v.FunctionVersion) > 0 {
encoder.SetQuery("FunctionVersion").String(string(v.FunctionVersion))
}
if v.Marker != nil {
encoder.SetQuery("Marker").String(*v.Marker)
}
if v.MasterRegion != nil {
encoder.SetQuery("MasterRegion").String(*v.MasterRegion)
}
if v.MaxItems != nil {
encoder.SetQuery("MaxItems").Integer(*v.MaxItems)
}
return nil
}
type awsRestjson1_serializeOpListFunctionsByCodeSigningConfig struct {
}
func (*awsRestjson1_serializeOpListFunctionsByCodeSigningConfig) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListFunctionsByCodeSigningConfig) 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.(*ListFunctionsByCodeSigningConfigInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2020-04-22/code-signing-configs/{CodeSigningConfigArn}/functions")
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_serializeOpHttpBindingsListFunctionsByCodeSigningConfigInput(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_serializeOpHttpBindingsListFunctionsByCodeSigningConfigInput(v *ListFunctionsByCodeSigningConfigInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.CodeSigningConfigArn == nil || len(*v.CodeSigningConfigArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member CodeSigningConfigArn must not be empty")}
}
if v.CodeSigningConfigArn != nil {
if err := encoder.SetURI("CodeSigningConfigArn").String(*v.CodeSigningConfigArn); err != nil {
return err
}
}
if v.Marker != nil {
encoder.SetQuery("Marker").String(*v.Marker)
}
if v.MaxItems != nil {
encoder.SetQuery("MaxItems").Integer(*v.MaxItems)
}
return nil
}
type awsRestjson1_serializeOpListFunctionUrlConfigs struct {
}
func (*awsRestjson1_serializeOpListFunctionUrlConfigs) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListFunctionUrlConfigs) 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.(*ListFunctionUrlConfigsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2021-10-31/functions/{FunctionName}/urls")
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_serializeOpHttpBindingsListFunctionUrlConfigsInput(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_serializeOpHttpBindingsListFunctionUrlConfigsInput(v *ListFunctionUrlConfigsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if v.Marker != nil {
encoder.SetQuery("Marker").String(*v.Marker)
}
if v.MaxItems != nil {
encoder.SetQuery("MaxItems").Integer(*v.MaxItems)
}
return nil
}
type awsRestjson1_serializeOpListLayers struct {
}
func (*awsRestjson1_serializeOpListLayers) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListLayers) 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.(*ListLayersInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2018-10-31/layers")
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_serializeOpHttpBindingsListLayersInput(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_serializeOpHttpBindingsListLayersInput(v *ListLayersInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if len(v.CompatibleArchitecture) > 0 {
encoder.SetQuery("CompatibleArchitecture").String(string(v.CompatibleArchitecture))
}
if len(v.CompatibleRuntime) > 0 {
encoder.SetQuery("CompatibleRuntime").String(string(v.CompatibleRuntime))
}
if v.Marker != nil {
encoder.SetQuery("Marker").String(*v.Marker)
}
if v.MaxItems != nil {
encoder.SetQuery("MaxItems").Integer(*v.MaxItems)
}
return nil
}
type awsRestjson1_serializeOpListLayerVersions struct {
}
func (*awsRestjson1_serializeOpListLayerVersions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListLayerVersions) 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.(*ListLayerVersionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2018-10-31/layers/{LayerName}/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_serializeOpHttpBindingsListLayerVersionsInput(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_serializeOpHttpBindingsListLayerVersionsInput(v *ListLayerVersionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if len(v.CompatibleArchitecture) > 0 {
encoder.SetQuery("CompatibleArchitecture").String(string(v.CompatibleArchitecture))
}
if len(v.CompatibleRuntime) > 0 {
encoder.SetQuery("CompatibleRuntime").String(string(v.CompatibleRuntime))
}
if v.LayerName == nil || len(*v.LayerName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member LayerName must not be empty")}
}
if v.LayerName != nil {
if err := encoder.SetURI("LayerName").String(*v.LayerName); err != nil {
return err
}
}
if v.Marker != nil {
encoder.SetQuery("Marker").String(*v.Marker)
}
if v.MaxItems != nil {
encoder.SetQuery("MaxItems").Integer(*v.MaxItems)
}
return nil
}
type awsRestjson1_serializeOpListProvisionedConcurrencyConfigs struct {
}
func (*awsRestjson1_serializeOpListProvisionedConcurrencyConfigs) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListProvisionedConcurrencyConfigs) 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.(*ListProvisionedConcurrencyConfigsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2019-09-30/functions/{FunctionName}/provisioned-concurrency?List=ALL")
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_serializeOpHttpBindingsListProvisionedConcurrencyConfigsInput(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_serializeOpHttpBindingsListProvisionedConcurrencyConfigsInput(v *ListProvisionedConcurrencyConfigsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if v.Marker != nil {
encoder.SetQuery("Marker").String(*v.Marker)
}
if v.MaxItems != nil {
encoder.SetQuery("MaxItems").Integer(*v.MaxItems)
}
return nil
}
type awsRestjson1_serializeOpListTags struct {
}
func (*awsRestjson1_serializeOpListTags) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListTags) 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.(*ListTagsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2017-03-31/tags/{Resource}")
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_serializeOpHttpBindingsListTagsInput(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_serializeOpHttpBindingsListTagsInput(v *ListTagsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Resource == nil || len(*v.Resource) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Resource must not be empty")}
}
if v.Resource != nil {
if err := encoder.SetURI("Resource").String(*v.Resource); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListVersionsByFunction struct {
}
func (*awsRestjson1_serializeOpListVersionsByFunction) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListVersionsByFunction) 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.(*ListVersionsByFunctionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2015-03-31/functions/{FunctionName}/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_serializeOpHttpBindingsListVersionsByFunctionInput(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_serializeOpHttpBindingsListVersionsByFunctionInput(v *ListVersionsByFunctionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if v.Marker != nil {
encoder.SetQuery("Marker").String(*v.Marker)
}
if v.MaxItems != nil {
encoder.SetQuery("MaxItems").Integer(*v.MaxItems)
}
return nil
}
type awsRestjson1_serializeOpPublishLayerVersion struct {
}
func (*awsRestjson1_serializeOpPublishLayerVersion) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPublishLayerVersion) 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.(*PublishLayerVersionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2018-10-31/layers/{LayerName}/versions")
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_serializeOpHttpBindingsPublishLayerVersionInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPublishLayerVersionInput(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_serializeOpHttpBindingsPublishLayerVersionInput(v *PublishLayerVersionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.LayerName == nil || len(*v.LayerName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member LayerName must not be empty")}
}
if v.LayerName != nil {
if err := encoder.SetURI("LayerName").String(*v.LayerName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentPublishLayerVersionInput(v *PublishLayerVersionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CompatibleArchitectures != nil {
ok := object.Key("CompatibleArchitectures")
if err := awsRestjson1_serializeDocumentCompatibleArchitectures(v.CompatibleArchitectures, ok); err != nil {
return err
}
}
if v.CompatibleRuntimes != nil {
ok := object.Key("CompatibleRuntimes")
if err := awsRestjson1_serializeDocumentCompatibleRuntimes(v.CompatibleRuntimes, ok); err != nil {
return err
}
}
if v.Content != nil {
ok := object.Key("Content")
if err := awsRestjson1_serializeDocumentLayerVersionContentInput(v.Content, ok); err != nil {
return err
}
}
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.LicenseInfo != nil {
ok := object.Key("LicenseInfo")
ok.String(*v.LicenseInfo)
}
return nil
}
type awsRestjson1_serializeOpPublishVersion struct {
}
func (*awsRestjson1_serializeOpPublishVersion) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPublishVersion) 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.(*PublishVersionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2015-03-31/functions/{FunctionName}/versions")
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_serializeOpHttpBindingsPublishVersionInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPublishVersionInput(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_serializeOpHttpBindingsPublishVersionInput(v *PublishVersionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentPublishVersionInput(v *PublishVersionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CodeSha256 != nil {
ok := object.Key("CodeSha256")
ok.String(*v.CodeSha256)
}
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.RevisionId != nil {
ok := object.Key("RevisionId")
ok.String(*v.RevisionId)
}
return nil
}
type awsRestjson1_serializeOpPutFunctionCodeSigningConfig struct {
}
func (*awsRestjson1_serializeOpPutFunctionCodeSigningConfig) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutFunctionCodeSigningConfig) 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.(*PutFunctionCodeSigningConfigInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2020-06-30/functions/{FunctionName}/code-signing-config")
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_serializeOpHttpBindingsPutFunctionCodeSigningConfigInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutFunctionCodeSigningConfigInput(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_serializeOpHttpBindingsPutFunctionCodeSigningConfigInput(v *PutFunctionCodeSigningConfigInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentPutFunctionCodeSigningConfigInput(v *PutFunctionCodeSigningConfigInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CodeSigningConfigArn != nil {
ok := object.Key("CodeSigningConfigArn")
ok.String(*v.CodeSigningConfigArn)
}
return nil
}
type awsRestjson1_serializeOpPutFunctionConcurrency struct {
}
func (*awsRestjson1_serializeOpPutFunctionConcurrency) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutFunctionConcurrency) 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.(*PutFunctionConcurrencyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2017-10-31/functions/{FunctionName}/concurrency")
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_serializeOpHttpBindingsPutFunctionConcurrencyInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutFunctionConcurrencyInput(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_serializeOpHttpBindingsPutFunctionConcurrencyInput(v *PutFunctionConcurrencyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentPutFunctionConcurrencyInput(v *PutFunctionConcurrencyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ReservedConcurrentExecutions != nil {
ok := object.Key("ReservedConcurrentExecutions")
ok.Integer(*v.ReservedConcurrentExecutions)
}
return nil
}
type awsRestjson1_serializeOpPutFunctionEventInvokeConfig struct {
}
func (*awsRestjson1_serializeOpPutFunctionEventInvokeConfig) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutFunctionEventInvokeConfig) 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.(*PutFunctionEventInvokeConfigInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2019-09-25/functions/{FunctionName}/event-invoke-config")
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_serializeOpHttpBindingsPutFunctionEventInvokeConfigInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutFunctionEventInvokeConfigInput(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_serializeOpHttpBindingsPutFunctionEventInvokeConfigInput(v *PutFunctionEventInvokeConfigInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if v.Qualifier != nil {
encoder.SetQuery("Qualifier").String(*v.Qualifier)
}
return nil
}
func awsRestjson1_serializeOpDocumentPutFunctionEventInvokeConfigInput(v *PutFunctionEventInvokeConfigInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DestinationConfig != nil {
ok := object.Key("DestinationConfig")
if err := awsRestjson1_serializeDocumentDestinationConfig(v.DestinationConfig, ok); err != nil {
return err
}
}
if v.MaximumEventAgeInSeconds != nil {
ok := object.Key("MaximumEventAgeInSeconds")
ok.Integer(*v.MaximumEventAgeInSeconds)
}
if v.MaximumRetryAttempts != nil {
ok := object.Key("MaximumRetryAttempts")
ok.Integer(*v.MaximumRetryAttempts)
}
return nil
}
type awsRestjson1_serializeOpPutProvisionedConcurrencyConfig struct {
}
func (*awsRestjson1_serializeOpPutProvisionedConcurrencyConfig) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutProvisionedConcurrencyConfig) 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.(*PutProvisionedConcurrencyConfigInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2019-09-30/functions/{FunctionName}/provisioned-concurrency")
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_serializeOpHttpBindingsPutProvisionedConcurrencyConfigInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutProvisionedConcurrencyConfigInput(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_serializeOpHttpBindingsPutProvisionedConcurrencyConfigInput(v *PutProvisionedConcurrencyConfigInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if v.Qualifier != nil {
encoder.SetQuery("Qualifier").String(*v.Qualifier)
}
return nil
}
func awsRestjson1_serializeOpDocumentPutProvisionedConcurrencyConfigInput(v *PutProvisionedConcurrencyConfigInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ProvisionedConcurrentExecutions != nil {
ok := object.Key("ProvisionedConcurrentExecutions")
ok.Integer(*v.ProvisionedConcurrentExecutions)
}
return nil
}
type awsRestjson1_serializeOpPutRuntimeManagementConfig struct {
}
func (*awsRestjson1_serializeOpPutRuntimeManagementConfig) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutRuntimeManagementConfig) 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.(*PutRuntimeManagementConfigInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2021-07-20/functions/{FunctionName}/runtime-management-config")
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_serializeOpHttpBindingsPutRuntimeManagementConfigInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutRuntimeManagementConfigInput(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_serializeOpHttpBindingsPutRuntimeManagementConfigInput(v *PutRuntimeManagementConfigInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if v.Qualifier != nil {
encoder.SetQuery("Qualifier").String(*v.Qualifier)
}
return nil
}
func awsRestjson1_serializeOpDocumentPutRuntimeManagementConfigInput(v *PutRuntimeManagementConfigInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RuntimeVersionArn != nil {
ok := object.Key("RuntimeVersionArn")
ok.String(*v.RuntimeVersionArn)
}
if len(v.UpdateRuntimeOn) > 0 {
ok := object.Key("UpdateRuntimeOn")
ok.String(string(v.UpdateRuntimeOn))
}
return nil
}
type awsRestjson1_serializeOpRemoveLayerVersionPermission struct {
}
func (*awsRestjson1_serializeOpRemoveLayerVersionPermission) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpRemoveLayerVersionPermission) 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.(*RemoveLayerVersionPermissionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy/{StatementId}")
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_serializeOpHttpBindingsRemoveLayerVersionPermissionInput(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_serializeOpHttpBindingsRemoveLayerVersionPermissionInput(v *RemoveLayerVersionPermissionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.LayerName == nil || len(*v.LayerName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member LayerName must not be empty")}
}
if v.LayerName != nil {
if err := encoder.SetURI("LayerName").String(*v.LayerName); err != nil {
return err
}
}
if v.RevisionId != nil {
encoder.SetQuery("RevisionId").String(*v.RevisionId)
}
if v.StatementId == nil || len(*v.StatementId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member StatementId must not be empty")}
}
if v.StatementId != nil {
if err := encoder.SetURI("StatementId").String(*v.StatementId); err != nil {
return err
}
}
{
if err := encoder.SetURI("VersionNumber").Long(v.VersionNumber); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpRemovePermission struct {
}
func (*awsRestjson1_serializeOpRemovePermission) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpRemovePermission) 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.(*RemovePermissionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2015-03-31/functions/{FunctionName}/policy/{StatementId}")
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_serializeOpHttpBindingsRemovePermissionInput(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_serializeOpHttpBindingsRemovePermissionInput(v *RemovePermissionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if v.Qualifier != nil {
encoder.SetQuery("Qualifier").String(*v.Qualifier)
}
if v.RevisionId != nil {
encoder.SetQuery("RevisionId").String(*v.RevisionId)
}
if v.StatementId == nil || len(*v.StatementId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member StatementId must not be empty")}
}
if v.StatementId != nil {
if err := encoder.SetURI("StatementId").String(*v.StatementId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpTagResource struct {
}
func (*awsRestjson1_serializeOpTagResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*TagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2017-03-31/tags/{Resource}")
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.Resource == nil || len(*v.Resource) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Resource must not be empty")}
}
if v.Resource != nil {
if err := encoder.SetURI("Resource").String(*v.Resource); 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_serializeDocumentTags(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("/2017-03-31/tags/{Resource}")
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.Resource == nil || len(*v.Resource) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Resource must not be empty")}
}
if v.Resource != nil {
if err := encoder.SetURI("Resource").String(*v.Resource); err != nil {
return err
}
}
if v.TagKeys != nil {
for i := range v.TagKeys {
encoder.AddQuery("tagKeys").String(v.TagKeys[i])
}
}
return nil
}
type awsRestjson1_serializeOpUpdateAlias struct {
}
func (*awsRestjson1_serializeOpUpdateAlias) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateAlias) 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.(*UpdateAliasInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2015-03-31/functions/{FunctionName}/aliases/{Name}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUpdateAliasInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateAliasInput(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_serializeOpHttpBindingsUpdateAliasInput(v *UpdateAliasInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("Name").String(*v.Name); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateAliasInput(v *UpdateAliasInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.FunctionVersion != nil {
ok := object.Key("FunctionVersion")
ok.String(*v.FunctionVersion)
}
if v.RevisionId != nil {
ok := object.Key("RevisionId")
ok.String(*v.RevisionId)
}
if v.RoutingConfig != nil {
ok := object.Key("RoutingConfig")
if err := awsRestjson1_serializeDocumentAliasRoutingConfiguration(v.RoutingConfig, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpUpdateCodeSigningConfig struct {
}
func (*awsRestjson1_serializeOpUpdateCodeSigningConfig) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateCodeSigningConfig) 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.(*UpdateCodeSigningConfigInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2020-04-22/code-signing-configs/{CodeSigningConfigArn}")
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_serializeOpHttpBindingsUpdateCodeSigningConfigInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateCodeSigningConfigInput(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_serializeOpHttpBindingsUpdateCodeSigningConfigInput(v *UpdateCodeSigningConfigInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.CodeSigningConfigArn == nil || len(*v.CodeSigningConfigArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member CodeSigningConfigArn must not be empty")}
}
if v.CodeSigningConfigArn != nil {
if err := encoder.SetURI("CodeSigningConfigArn").String(*v.CodeSigningConfigArn); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateCodeSigningConfigInput(v *UpdateCodeSigningConfigInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AllowedPublishers != nil {
ok := object.Key("AllowedPublishers")
if err := awsRestjson1_serializeDocumentAllowedPublishers(v.AllowedPublishers, ok); err != nil {
return err
}
}
if v.CodeSigningPolicies != nil {
ok := object.Key("CodeSigningPolicies")
if err := awsRestjson1_serializeDocumentCodeSigningPolicies(v.CodeSigningPolicies, ok); err != nil {
return err
}
}
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
return nil
}
type awsRestjson1_serializeOpUpdateEventSourceMapping struct {
}
func (*awsRestjson1_serializeOpUpdateEventSourceMapping) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateEventSourceMapping) 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.(*UpdateEventSourceMappingInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2015-03-31/event-source-mappings/{UUID}")
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_serializeOpHttpBindingsUpdateEventSourceMappingInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateEventSourceMappingInput(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_serializeOpHttpBindingsUpdateEventSourceMappingInput(v *UpdateEventSourceMappingInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.UUID == nil || len(*v.UUID) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member UUID must not be empty")}
}
if v.UUID != nil {
if err := encoder.SetURI("UUID").String(*v.UUID); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateEventSourceMappingInput(v *UpdateEventSourceMappingInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BatchSize != nil {
ok := object.Key("BatchSize")
ok.Integer(*v.BatchSize)
}
if v.BisectBatchOnFunctionError != nil {
ok := object.Key("BisectBatchOnFunctionError")
ok.Boolean(*v.BisectBatchOnFunctionError)
}
if v.DestinationConfig != nil {
ok := object.Key("DestinationConfig")
if err := awsRestjson1_serializeDocumentDestinationConfig(v.DestinationConfig, ok); err != nil {
return err
}
}
if v.DocumentDBEventSourceConfig != nil {
ok := object.Key("DocumentDBEventSourceConfig")
if err := awsRestjson1_serializeDocumentDocumentDBEventSourceConfig(v.DocumentDBEventSourceConfig, ok); err != nil {
return err
}
}
if v.Enabled != nil {
ok := object.Key("Enabled")
ok.Boolean(*v.Enabled)
}
if v.FilterCriteria != nil {
ok := object.Key("FilterCriteria")
if err := awsRestjson1_serializeDocumentFilterCriteria(v.FilterCriteria, ok); err != nil {
return err
}
}
if v.FunctionName != nil {
ok := object.Key("FunctionName")
ok.String(*v.FunctionName)
}
if v.FunctionResponseTypes != nil {
ok := object.Key("FunctionResponseTypes")
if err := awsRestjson1_serializeDocumentFunctionResponseTypeList(v.FunctionResponseTypes, ok); err != nil {
return err
}
}
if v.MaximumBatchingWindowInSeconds != nil {
ok := object.Key("MaximumBatchingWindowInSeconds")
ok.Integer(*v.MaximumBatchingWindowInSeconds)
}
if v.MaximumRecordAgeInSeconds != nil {
ok := object.Key("MaximumRecordAgeInSeconds")
ok.Integer(*v.MaximumRecordAgeInSeconds)
}
if v.MaximumRetryAttempts != nil {
ok := object.Key("MaximumRetryAttempts")
ok.Integer(*v.MaximumRetryAttempts)
}
if v.ParallelizationFactor != nil {
ok := object.Key("ParallelizationFactor")
ok.Integer(*v.ParallelizationFactor)
}
if v.ScalingConfig != nil {
ok := object.Key("ScalingConfig")
if err := awsRestjson1_serializeDocumentScalingConfig(v.ScalingConfig, ok); err != nil {
return err
}
}
if v.SourceAccessConfigurations != nil {
ok := object.Key("SourceAccessConfigurations")
if err := awsRestjson1_serializeDocumentSourceAccessConfigurations(v.SourceAccessConfigurations, ok); err != nil {
return err
}
}
if v.TumblingWindowInSeconds != nil {
ok := object.Key("TumblingWindowInSeconds")
ok.Integer(*v.TumblingWindowInSeconds)
}
return nil
}
type awsRestjson1_serializeOpUpdateFunctionCode struct {
}
func (*awsRestjson1_serializeOpUpdateFunctionCode) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateFunctionCode) 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.(*UpdateFunctionCodeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2015-03-31/functions/{FunctionName}/code")
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_serializeOpHttpBindingsUpdateFunctionCodeInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateFunctionCodeInput(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_serializeOpHttpBindingsUpdateFunctionCodeInput(v *UpdateFunctionCodeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateFunctionCodeInput(v *UpdateFunctionCodeInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Architectures != nil {
ok := object.Key("Architectures")
if err := awsRestjson1_serializeDocumentArchitecturesList(v.Architectures, ok); err != nil {
return err
}
}
if v.DryRun {
ok := object.Key("DryRun")
ok.Boolean(v.DryRun)
}
if v.ImageUri != nil {
ok := object.Key("ImageUri")
ok.String(*v.ImageUri)
}
if v.Publish {
ok := object.Key("Publish")
ok.Boolean(v.Publish)
}
if v.RevisionId != nil {
ok := object.Key("RevisionId")
ok.String(*v.RevisionId)
}
if v.S3Bucket != nil {
ok := object.Key("S3Bucket")
ok.String(*v.S3Bucket)
}
if v.S3Key != nil {
ok := object.Key("S3Key")
ok.String(*v.S3Key)
}
if v.S3ObjectVersion != nil {
ok := object.Key("S3ObjectVersion")
ok.String(*v.S3ObjectVersion)
}
if v.ZipFile != nil {
ok := object.Key("ZipFile")
ok.Base64EncodeBytes(v.ZipFile)
}
return nil
}
type awsRestjson1_serializeOpUpdateFunctionConfiguration struct {
}
func (*awsRestjson1_serializeOpUpdateFunctionConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateFunctionConfiguration) 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.(*UpdateFunctionConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2015-03-31/functions/{FunctionName}/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_serializeOpHttpBindingsUpdateFunctionConfigurationInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateFunctionConfigurationInput(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_serializeOpHttpBindingsUpdateFunctionConfigurationInput(v *UpdateFunctionConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateFunctionConfigurationInput(v *UpdateFunctionConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DeadLetterConfig != nil {
ok := object.Key("DeadLetterConfig")
if err := awsRestjson1_serializeDocumentDeadLetterConfig(v.DeadLetterConfig, ok); err != nil {
return err
}
}
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.Environment != nil {
ok := object.Key("Environment")
if err := awsRestjson1_serializeDocumentEnvironment(v.Environment, ok); err != nil {
return err
}
}
if v.EphemeralStorage != nil {
ok := object.Key("EphemeralStorage")
if err := awsRestjson1_serializeDocumentEphemeralStorage(v.EphemeralStorage, ok); err != nil {
return err
}
}
if v.FileSystemConfigs != nil {
ok := object.Key("FileSystemConfigs")
if err := awsRestjson1_serializeDocumentFileSystemConfigList(v.FileSystemConfigs, ok); err != nil {
return err
}
}
if v.Handler != nil {
ok := object.Key("Handler")
ok.String(*v.Handler)
}
if v.ImageConfig != nil {
ok := object.Key("ImageConfig")
if err := awsRestjson1_serializeDocumentImageConfig(v.ImageConfig, ok); err != nil {
return err
}
}
if v.KMSKeyArn != nil {
ok := object.Key("KMSKeyArn")
ok.String(*v.KMSKeyArn)
}
if v.Layers != nil {
ok := object.Key("Layers")
if err := awsRestjson1_serializeDocumentLayerList(v.Layers, ok); err != nil {
return err
}
}
if v.MemorySize != nil {
ok := object.Key("MemorySize")
ok.Integer(*v.MemorySize)
}
if v.RevisionId != nil {
ok := object.Key("RevisionId")
ok.String(*v.RevisionId)
}
if v.Role != nil {
ok := object.Key("Role")
ok.String(*v.Role)
}
if len(v.Runtime) > 0 {
ok := object.Key("Runtime")
ok.String(string(v.Runtime))
}
if v.SnapStart != nil {
ok := object.Key("SnapStart")
if err := awsRestjson1_serializeDocumentSnapStart(v.SnapStart, ok); err != nil {
return err
}
}
if v.Timeout != nil {
ok := object.Key("Timeout")
ok.Integer(*v.Timeout)
}
if v.TracingConfig != nil {
ok := object.Key("TracingConfig")
if err := awsRestjson1_serializeDocumentTracingConfig(v.TracingConfig, ok); err != nil {
return err
}
}
if v.VpcConfig != nil {
ok := object.Key("VpcConfig")
if err := awsRestjson1_serializeDocumentVpcConfig(v.VpcConfig, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpUpdateFunctionEventInvokeConfig struct {
}
func (*awsRestjson1_serializeOpUpdateFunctionEventInvokeConfig) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateFunctionEventInvokeConfig) 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.(*UpdateFunctionEventInvokeConfigInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2019-09-25/functions/{FunctionName}/event-invoke-config")
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_serializeOpHttpBindingsUpdateFunctionEventInvokeConfigInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateFunctionEventInvokeConfigInput(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_serializeOpHttpBindingsUpdateFunctionEventInvokeConfigInput(v *UpdateFunctionEventInvokeConfigInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if v.Qualifier != nil {
encoder.SetQuery("Qualifier").String(*v.Qualifier)
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateFunctionEventInvokeConfigInput(v *UpdateFunctionEventInvokeConfigInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DestinationConfig != nil {
ok := object.Key("DestinationConfig")
if err := awsRestjson1_serializeDocumentDestinationConfig(v.DestinationConfig, ok); err != nil {
return err
}
}
if v.MaximumEventAgeInSeconds != nil {
ok := object.Key("MaximumEventAgeInSeconds")
ok.Integer(*v.MaximumEventAgeInSeconds)
}
if v.MaximumRetryAttempts != nil {
ok := object.Key("MaximumRetryAttempts")
ok.Integer(*v.MaximumRetryAttempts)
}
return nil
}
type awsRestjson1_serializeOpUpdateFunctionUrlConfig struct {
}
func (*awsRestjson1_serializeOpUpdateFunctionUrlConfig) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateFunctionUrlConfig) 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.(*UpdateFunctionUrlConfigInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/2021-10-31/functions/{FunctionName}/url")
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_serializeOpHttpBindingsUpdateFunctionUrlConfigInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateFunctionUrlConfigInput(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_serializeOpHttpBindingsUpdateFunctionUrlConfigInput(v *UpdateFunctionUrlConfigInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.FunctionName == nil || len(*v.FunctionName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member FunctionName must not be empty")}
}
if v.FunctionName != nil {
if err := encoder.SetURI("FunctionName").String(*v.FunctionName); err != nil {
return err
}
}
if v.Qualifier != nil {
encoder.SetQuery("Qualifier").String(*v.Qualifier)
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateFunctionUrlConfigInput(v *UpdateFunctionUrlConfigInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.AuthType) > 0 {
ok := object.Key("AuthType")
ok.String(string(v.AuthType))
}
if v.Cors != nil {
ok := object.Key("Cors")
if err := awsRestjson1_serializeDocumentCors(v.Cors, ok); err != nil {
return err
}
}
if len(v.InvokeMode) > 0 {
ok := object.Key("InvokeMode")
ok.String(string(v.InvokeMode))
}
return nil
}
func awsRestjson1_serializeDocumentAdditionalVersionWeights(v map[string]float64, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
switch {
case math.IsNaN(v[key]):
om.String("NaN")
case math.IsInf(v[key], 1):
om.String("Infinity")
case math.IsInf(v[key], -1):
om.String("-Infinity")
default:
om.Double(v[key])
}
}
return nil
}
func awsRestjson1_serializeDocumentAliasRoutingConfiguration(v *types.AliasRoutingConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AdditionalVersionWeights != nil {
ok := object.Key("AdditionalVersionWeights")
if err := awsRestjson1_serializeDocumentAdditionalVersionWeights(v.AdditionalVersionWeights, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAllowedPublishers(v *types.AllowedPublishers, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SigningProfileVersionArns != nil {
ok := object.Key("SigningProfileVersionArns")
if err := awsRestjson1_serializeDocumentSigningProfileVersionArns(v.SigningProfileVersionArns, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAllowMethodsList(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_serializeDocumentAllowOriginsList(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_serializeDocumentAmazonManagedKafkaEventSourceConfig(v *types.AmazonManagedKafkaEventSourceConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ConsumerGroupId != nil {
ok := object.Key("ConsumerGroupId")
ok.String(*v.ConsumerGroupId)
}
return nil
}
func awsRestjson1_serializeDocumentArchitecturesList(v []types.Architecture, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsRestjson1_serializeDocumentCodeSigningPolicies(v *types.CodeSigningPolicies, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.UntrustedArtifactOnDeployment) > 0 {
ok := object.Key("UntrustedArtifactOnDeployment")
ok.String(string(v.UntrustedArtifactOnDeployment))
}
return nil
}
func awsRestjson1_serializeDocumentCompatibleArchitectures(v []types.Architecture, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsRestjson1_serializeDocumentCompatibleRuntimes(v []types.Runtime, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsRestjson1_serializeDocumentCors(v *types.Cors, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AllowCredentials != nil {
ok := object.Key("AllowCredentials")
ok.Boolean(*v.AllowCredentials)
}
if v.AllowHeaders != nil {
ok := object.Key("AllowHeaders")
if err := awsRestjson1_serializeDocumentHeadersList(v.AllowHeaders, ok); err != nil {
return err
}
}
if v.AllowMethods != nil {
ok := object.Key("AllowMethods")
if err := awsRestjson1_serializeDocumentAllowMethodsList(v.AllowMethods, ok); err != nil {
return err
}
}
if v.AllowOrigins != nil {
ok := object.Key("AllowOrigins")
if err := awsRestjson1_serializeDocumentAllowOriginsList(v.AllowOrigins, ok); err != nil {
return err
}
}
if v.ExposeHeaders != nil {
ok := object.Key("ExposeHeaders")
if err := awsRestjson1_serializeDocumentHeadersList(v.ExposeHeaders, ok); err != nil {
return err
}
}
if v.MaxAge != nil {
ok := object.Key("MaxAge")
ok.Integer(*v.MaxAge)
}
return nil
}
func awsRestjson1_serializeDocumentDeadLetterConfig(v *types.DeadLetterConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.TargetArn != nil {
ok := object.Key("TargetArn")
ok.String(*v.TargetArn)
}
return nil
}
func awsRestjson1_serializeDocumentDestinationConfig(v *types.DestinationConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.OnFailure != nil {
ok := object.Key("OnFailure")
if err := awsRestjson1_serializeDocumentOnFailure(v.OnFailure, ok); err != nil {
return err
}
}
if v.OnSuccess != nil {
ok := object.Key("OnSuccess")
if err := awsRestjson1_serializeDocumentOnSuccess(v.OnSuccess, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentDocumentDBEventSourceConfig(v *types.DocumentDBEventSourceConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CollectionName != nil {
ok := object.Key("CollectionName")
ok.String(*v.CollectionName)
}
if v.DatabaseName != nil {
ok := object.Key("DatabaseName")
ok.String(*v.DatabaseName)
}
if len(v.FullDocument) > 0 {
ok := object.Key("FullDocument")
ok.String(string(v.FullDocument))
}
return nil
}
func awsRestjson1_serializeDocumentEndpointLists(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_serializeDocumentEndpoints(v map[string][]string, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
for key := range v {
om := object.Key(key)
if vv := v[key]; vv == nil {
continue
}
if err := awsRestjson1_serializeDocumentEndpointLists(v[key], om); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentEnvironment(v *types.Environment, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Variables != nil {
ok := object.Key("Variables")
if err := awsRestjson1_serializeDocumentEnvironmentVariables(v.Variables, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentEnvironmentVariables(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_serializeDocumentEphemeralStorage(v *types.EphemeralStorage, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Size != nil {
ok := object.Key("Size")
ok.Integer(*v.Size)
}
return nil
}
func awsRestjson1_serializeDocumentFileSystemConfig(v *types.FileSystemConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Arn != nil {
ok := object.Key("Arn")
ok.String(*v.Arn)
}
if v.LocalMountPath != nil {
ok := object.Key("LocalMountPath")
ok.String(*v.LocalMountPath)
}
return nil
}
func awsRestjson1_serializeDocumentFileSystemConfigList(v []types.FileSystemConfig, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentFileSystemConfig(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentFilter(v *types.Filter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Pattern != nil {
ok := object.Key("Pattern")
ok.String(*v.Pattern)
}
return nil
}
func awsRestjson1_serializeDocumentFilterCriteria(v *types.FilterCriteria, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filters != nil {
ok := object.Key("Filters")
if err := awsRestjson1_serializeDocumentFilterList(v.Filters, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentFilterList(v []types.Filter, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentFilter(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentFunctionCode(v *types.FunctionCode, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ImageUri != nil {
ok := object.Key("ImageUri")
ok.String(*v.ImageUri)
}
if v.S3Bucket != nil {
ok := object.Key("S3Bucket")
ok.String(*v.S3Bucket)
}
if v.S3Key != nil {
ok := object.Key("S3Key")
ok.String(*v.S3Key)
}
if v.S3ObjectVersion != nil {
ok := object.Key("S3ObjectVersion")
ok.String(*v.S3ObjectVersion)
}
if v.ZipFile != nil {
ok := object.Key("ZipFile")
ok.Base64EncodeBytes(v.ZipFile)
}
return nil
}
func awsRestjson1_serializeDocumentFunctionResponseTypeList(v []types.FunctionResponseType, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsRestjson1_serializeDocumentHeadersList(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_serializeDocumentImageConfig(v *types.ImageConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Command != nil {
ok := object.Key("Command")
if err := awsRestjson1_serializeDocumentStringList(v.Command, ok); err != nil {
return err
}
}
if v.EntryPoint != nil {
ok := object.Key("EntryPoint")
if err := awsRestjson1_serializeDocumentStringList(v.EntryPoint, ok); err != nil {
return err
}
}
if v.WorkingDirectory != nil {
ok := object.Key("WorkingDirectory")
ok.String(*v.WorkingDirectory)
}
return nil
}
func awsRestjson1_serializeDocumentLayerList(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_serializeDocumentLayerVersionContentInput(v *types.LayerVersionContentInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.S3Bucket != nil {
ok := object.Key("S3Bucket")
ok.String(*v.S3Bucket)
}
if v.S3Key != nil {
ok := object.Key("S3Key")
ok.String(*v.S3Key)
}
if v.S3ObjectVersion != nil {
ok := object.Key("S3ObjectVersion")
ok.String(*v.S3ObjectVersion)
}
if v.ZipFile != nil {
ok := object.Key("ZipFile")
ok.Base64EncodeBytes(v.ZipFile)
}
return nil
}
func awsRestjson1_serializeDocumentOnFailure(v *types.OnFailure, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Destination != nil {
ok := object.Key("Destination")
ok.String(*v.Destination)
}
return nil
}
func awsRestjson1_serializeDocumentOnSuccess(v *types.OnSuccess, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Destination != nil {
ok := object.Key("Destination")
ok.String(*v.Destination)
}
return nil
}
func awsRestjson1_serializeDocumentQueues(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_serializeDocumentScalingConfig(v *types.ScalingConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaximumConcurrency != nil {
ok := object.Key("MaximumConcurrency")
ok.Integer(*v.MaximumConcurrency)
}
return nil
}
func awsRestjson1_serializeDocumentSecurityGroupIds(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_serializeDocumentSelfManagedEventSource(v *types.SelfManagedEventSource, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Endpoints != nil {
ok := object.Key("Endpoints")
if err := awsRestjson1_serializeDocumentEndpoints(v.Endpoints, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSelfManagedKafkaEventSourceConfig(v *types.SelfManagedKafkaEventSourceConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ConsumerGroupId != nil {
ok := object.Key("ConsumerGroupId")
ok.String(*v.ConsumerGroupId)
}
return nil
}
func awsRestjson1_serializeDocumentSigningProfileVersionArns(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_serializeDocumentSnapStart(v *types.SnapStart, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.ApplyOn) > 0 {
ok := object.Key("ApplyOn")
ok.String(string(v.ApplyOn))
}
return nil
}
func awsRestjson1_serializeDocumentSourceAccessConfiguration(v *types.SourceAccessConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Type) > 0 {
ok := object.Key("Type")
ok.String(string(v.Type))
}
if v.URI != nil {
ok := object.Key("URI")
ok.String(*v.URI)
}
return nil
}
func awsRestjson1_serializeDocumentSourceAccessConfigurations(v []types.SourceAccessConfiguration, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentSourceAccessConfiguration(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentStringList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsRestjson1_serializeDocumentSubnetIds(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_serializeDocumentTags(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_serializeDocumentTopics(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_serializeDocumentTracingConfig(v *types.TracingConfig, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Mode) > 0 {
ok := object.Key("Mode")
ok.String(string(v.Mode))
}
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_serializeDocumentSecurityGroupIds(v.SecurityGroupIds, ok); err != nil {
return err
}
}
if v.SubnetIds != nil {
ok := object.Key("SubnetIds")
if err := awsRestjson1_serializeDocumentSubnetIds(v.SubnetIds, ok); err != nil {
return err
}
}
return nil
}
| 6,018 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lambda
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/lambda/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpAddLayerVersionPermission struct {
}
func (*validateOpAddLayerVersionPermission) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAddLayerVersionPermission) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AddLayerVersionPermissionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAddLayerVersionPermissionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpAddPermission struct {
}
func (*validateOpAddPermission) ID() string {
return "OperationInputValidation"
}
func (m *validateOpAddPermission) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*AddPermissionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpAddPermissionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateAlias struct {
}
func (*validateOpCreateAlias) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateAlias) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateAliasInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateAliasInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateCodeSigningConfig struct {
}
func (*validateOpCreateCodeSigningConfig) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateCodeSigningConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateCodeSigningConfigInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateCodeSigningConfigInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateEventSourceMapping struct {
}
func (*validateOpCreateEventSourceMapping) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateEventSourceMapping) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateEventSourceMappingInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateEventSourceMappingInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateFunction struct {
}
func (*validateOpCreateFunction) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateFunction) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateFunctionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateFunctionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateFunctionUrlConfig struct {
}
func (*validateOpCreateFunctionUrlConfig) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateFunctionUrlConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateFunctionUrlConfigInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateFunctionUrlConfigInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteAlias struct {
}
func (*validateOpDeleteAlias) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteAlias) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteAliasInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteAliasInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteCodeSigningConfig struct {
}
func (*validateOpDeleteCodeSigningConfig) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteCodeSigningConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteCodeSigningConfigInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteCodeSigningConfigInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteEventSourceMapping struct {
}
func (*validateOpDeleteEventSourceMapping) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteEventSourceMapping) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteEventSourceMappingInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteEventSourceMappingInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteFunctionCodeSigningConfig struct {
}
func (*validateOpDeleteFunctionCodeSigningConfig) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteFunctionCodeSigningConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteFunctionCodeSigningConfigInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteFunctionCodeSigningConfigInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteFunctionConcurrency struct {
}
func (*validateOpDeleteFunctionConcurrency) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteFunctionConcurrency) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteFunctionConcurrencyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteFunctionConcurrencyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteFunctionEventInvokeConfig struct {
}
func (*validateOpDeleteFunctionEventInvokeConfig) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteFunctionEventInvokeConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteFunctionEventInvokeConfigInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteFunctionEventInvokeConfigInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteFunction struct {
}
func (*validateOpDeleteFunction) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteFunction) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteFunctionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteFunctionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteFunctionUrlConfig struct {
}
func (*validateOpDeleteFunctionUrlConfig) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteFunctionUrlConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteFunctionUrlConfigInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteFunctionUrlConfigInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteLayerVersion struct {
}
func (*validateOpDeleteLayerVersion) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteLayerVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteLayerVersionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteLayerVersionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteProvisionedConcurrencyConfig struct {
}
func (*validateOpDeleteProvisionedConcurrencyConfig) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteProvisionedConcurrencyConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteProvisionedConcurrencyConfigInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteProvisionedConcurrencyConfigInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetAlias struct {
}
func (*validateOpGetAlias) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetAlias) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetAliasInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetAliasInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetCodeSigningConfig struct {
}
func (*validateOpGetCodeSigningConfig) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetCodeSigningConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetCodeSigningConfigInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetCodeSigningConfigInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetEventSourceMapping struct {
}
func (*validateOpGetEventSourceMapping) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetEventSourceMapping) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetEventSourceMappingInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetEventSourceMappingInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetFunctionCodeSigningConfig struct {
}
func (*validateOpGetFunctionCodeSigningConfig) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetFunctionCodeSigningConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetFunctionCodeSigningConfigInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetFunctionCodeSigningConfigInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetFunctionConcurrency struct {
}
func (*validateOpGetFunctionConcurrency) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetFunctionConcurrency) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetFunctionConcurrencyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetFunctionConcurrencyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetFunctionConfiguration struct {
}
func (*validateOpGetFunctionConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetFunctionConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetFunctionConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetFunctionConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetFunctionEventInvokeConfig struct {
}
func (*validateOpGetFunctionEventInvokeConfig) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetFunctionEventInvokeConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetFunctionEventInvokeConfigInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetFunctionEventInvokeConfigInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetFunction struct {
}
func (*validateOpGetFunction) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetFunction) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetFunctionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetFunctionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetFunctionUrlConfig struct {
}
func (*validateOpGetFunctionUrlConfig) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetFunctionUrlConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetFunctionUrlConfigInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetFunctionUrlConfigInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetLayerVersionByArn struct {
}
func (*validateOpGetLayerVersionByArn) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetLayerVersionByArn) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetLayerVersionByArnInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetLayerVersionByArnInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetLayerVersion struct {
}
func (*validateOpGetLayerVersion) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetLayerVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetLayerVersionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetLayerVersionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetLayerVersionPolicy struct {
}
func (*validateOpGetLayerVersionPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetLayerVersionPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetLayerVersionPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetLayerVersionPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetPolicy struct {
}
func (*validateOpGetPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetProvisionedConcurrencyConfig struct {
}
func (*validateOpGetProvisionedConcurrencyConfig) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetProvisionedConcurrencyConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetProvisionedConcurrencyConfigInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetProvisionedConcurrencyConfigInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetRuntimeManagementConfig struct {
}
func (*validateOpGetRuntimeManagementConfig) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetRuntimeManagementConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetRuntimeManagementConfigInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetRuntimeManagementConfigInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpInvokeAsync struct {
}
func (*validateOpInvokeAsync) ID() string {
return "OperationInputValidation"
}
func (m *validateOpInvokeAsync) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*InvokeAsyncInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpInvokeAsyncInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpInvoke struct {
}
func (*validateOpInvoke) ID() string {
return "OperationInputValidation"
}
func (m *validateOpInvoke) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*InvokeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpInvokeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpInvokeWithResponseStream struct {
}
func (*validateOpInvokeWithResponseStream) ID() string {
return "OperationInputValidation"
}
func (m *validateOpInvokeWithResponseStream) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*InvokeWithResponseStreamInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpInvokeWithResponseStreamInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListAliases struct {
}
func (*validateOpListAliases) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListAliases) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListAliasesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListAliasesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListFunctionEventInvokeConfigs struct {
}
func (*validateOpListFunctionEventInvokeConfigs) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListFunctionEventInvokeConfigs) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListFunctionEventInvokeConfigsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListFunctionEventInvokeConfigsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListFunctionsByCodeSigningConfig struct {
}
func (*validateOpListFunctionsByCodeSigningConfig) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListFunctionsByCodeSigningConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListFunctionsByCodeSigningConfigInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListFunctionsByCodeSigningConfigInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListFunctionUrlConfigs struct {
}
func (*validateOpListFunctionUrlConfigs) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListFunctionUrlConfigs) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListFunctionUrlConfigsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListFunctionUrlConfigsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListLayerVersions struct {
}
func (*validateOpListLayerVersions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListLayerVersions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListLayerVersionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListLayerVersionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListProvisionedConcurrencyConfigs struct {
}
func (*validateOpListProvisionedConcurrencyConfigs) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListProvisionedConcurrencyConfigs) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListProvisionedConcurrencyConfigsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListProvisionedConcurrencyConfigsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListTags struct {
}
func (*validateOpListTags) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListTags) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListTagsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListTagsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListVersionsByFunction struct {
}
func (*validateOpListVersionsByFunction) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListVersionsByFunction) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListVersionsByFunctionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListVersionsByFunctionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPublishLayerVersion struct {
}
func (*validateOpPublishLayerVersion) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPublishLayerVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PublishLayerVersionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPublishLayerVersionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPublishVersion struct {
}
func (*validateOpPublishVersion) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPublishVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PublishVersionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPublishVersionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutFunctionCodeSigningConfig struct {
}
func (*validateOpPutFunctionCodeSigningConfig) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutFunctionCodeSigningConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutFunctionCodeSigningConfigInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutFunctionCodeSigningConfigInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutFunctionConcurrency struct {
}
func (*validateOpPutFunctionConcurrency) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutFunctionConcurrency) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutFunctionConcurrencyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutFunctionConcurrencyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutFunctionEventInvokeConfig struct {
}
func (*validateOpPutFunctionEventInvokeConfig) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutFunctionEventInvokeConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutFunctionEventInvokeConfigInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutFunctionEventInvokeConfigInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutProvisionedConcurrencyConfig struct {
}
func (*validateOpPutProvisionedConcurrencyConfig) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutProvisionedConcurrencyConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutProvisionedConcurrencyConfigInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutProvisionedConcurrencyConfigInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutRuntimeManagementConfig struct {
}
func (*validateOpPutRuntimeManagementConfig) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutRuntimeManagementConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutRuntimeManagementConfigInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutRuntimeManagementConfigInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRemoveLayerVersionPermission struct {
}
func (*validateOpRemoveLayerVersionPermission) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRemoveLayerVersionPermission) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RemoveLayerVersionPermissionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRemoveLayerVersionPermissionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRemovePermission struct {
}
func (*validateOpRemovePermission) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRemovePermission) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RemovePermissionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRemovePermissionInput(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 validateOpUpdateAlias struct {
}
func (*validateOpUpdateAlias) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateAlias) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateAliasInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateAliasInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateCodeSigningConfig struct {
}
func (*validateOpUpdateCodeSigningConfig) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateCodeSigningConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateCodeSigningConfigInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateCodeSigningConfigInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateEventSourceMapping struct {
}
func (*validateOpUpdateEventSourceMapping) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateEventSourceMapping) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateEventSourceMappingInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateEventSourceMappingInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateFunctionCode struct {
}
func (*validateOpUpdateFunctionCode) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateFunctionCode) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateFunctionCodeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateFunctionCodeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateFunctionConfiguration struct {
}
func (*validateOpUpdateFunctionConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateFunctionConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateFunctionConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateFunctionConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateFunctionEventInvokeConfig struct {
}
func (*validateOpUpdateFunctionEventInvokeConfig) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateFunctionEventInvokeConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateFunctionEventInvokeConfigInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateFunctionEventInvokeConfigInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateFunctionUrlConfig struct {
}
func (*validateOpUpdateFunctionUrlConfig) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateFunctionUrlConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateFunctionUrlConfigInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateFunctionUrlConfigInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpAddLayerVersionPermissionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAddLayerVersionPermission{}, middleware.After)
}
func addOpAddPermissionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpAddPermission{}, middleware.After)
}
func addOpCreateAliasValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateAlias{}, middleware.After)
}
func addOpCreateCodeSigningConfigValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateCodeSigningConfig{}, middleware.After)
}
func addOpCreateEventSourceMappingValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateEventSourceMapping{}, middleware.After)
}
func addOpCreateFunctionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateFunction{}, middleware.After)
}
func addOpCreateFunctionUrlConfigValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateFunctionUrlConfig{}, middleware.After)
}
func addOpDeleteAliasValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteAlias{}, middleware.After)
}
func addOpDeleteCodeSigningConfigValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteCodeSigningConfig{}, middleware.After)
}
func addOpDeleteEventSourceMappingValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteEventSourceMapping{}, middleware.After)
}
func addOpDeleteFunctionCodeSigningConfigValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteFunctionCodeSigningConfig{}, middleware.After)
}
func addOpDeleteFunctionConcurrencyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteFunctionConcurrency{}, middleware.After)
}
func addOpDeleteFunctionEventInvokeConfigValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteFunctionEventInvokeConfig{}, middleware.After)
}
func addOpDeleteFunctionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteFunction{}, middleware.After)
}
func addOpDeleteFunctionUrlConfigValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteFunctionUrlConfig{}, middleware.After)
}
func addOpDeleteLayerVersionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteLayerVersion{}, middleware.After)
}
func addOpDeleteProvisionedConcurrencyConfigValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteProvisionedConcurrencyConfig{}, middleware.After)
}
func addOpGetAliasValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetAlias{}, middleware.After)
}
func addOpGetCodeSigningConfigValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetCodeSigningConfig{}, middleware.After)
}
func addOpGetEventSourceMappingValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetEventSourceMapping{}, middleware.After)
}
func addOpGetFunctionCodeSigningConfigValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetFunctionCodeSigningConfig{}, middleware.After)
}
func addOpGetFunctionConcurrencyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetFunctionConcurrency{}, middleware.After)
}
func addOpGetFunctionConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetFunctionConfiguration{}, middleware.After)
}
func addOpGetFunctionEventInvokeConfigValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetFunctionEventInvokeConfig{}, middleware.After)
}
func addOpGetFunctionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetFunction{}, middleware.After)
}
func addOpGetFunctionUrlConfigValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetFunctionUrlConfig{}, middleware.After)
}
func addOpGetLayerVersionByArnValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetLayerVersionByArn{}, middleware.After)
}
func addOpGetLayerVersionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetLayerVersion{}, middleware.After)
}
func addOpGetLayerVersionPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetLayerVersionPolicy{}, middleware.After)
}
func addOpGetPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetPolicy{}, middleware.After)
}
func addOpGetProvisionedConcurrencyConfigValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetProvisionedConcurrencyConfig{}, middleware.After)
}
func addOpGetRuntimeManagementConfigValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetRuntimeManagementConfig{}, middleware.After)
}
func addOpInvokeAsyncValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpInvokeAsync{}, middleware.After)
}
func addOpInvokeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpInvoke{}, middleware.After)
}
func addOpInvokeWithResponseStreamValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpInvokeWithResponseStream{}, middleware.After)
}
func addOpListAliasesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListAliases{}, middleware.After)
}
func addOpListFunctionEventInvokeConfigsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListFunctionEventInvokeConfigs{}, middleware.After)
}
func addOpListFunctionsByCodeSigningConfigValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListFunctionsByCodeSigningConfig{}, middleware.After)
}
func addOpListFunctionUrlConfigsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListFunctionUrlConfigs{}, middleware.After)
}
func addOpListLayerVersionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListLayerVersions{}, middleware.After)
}
func addOpListProvisionedConcurrencyConfigsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListProvisionedConcurrencyConfigs{}, middleware.After)
}
func addOpListTagsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTags{}, middleware.After)
}
func addOpListVersionsByFunctionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListVersionsByFunction{}, middleware.After)
}
func addOpPublishLayerVersionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPublishLayerVersion{}, middleware.After)
}
func addOpPublishVersionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPublishVersion{}, middleware.After)
}
func addOpPutFunctionCodeSigningConfigValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutFunctionCodeSigningConfig{}, middleware.After)
}
func addOpPutFunctionConcurrencyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutFunctionConcurrency{}, middleware.After)
}
func addOpPutFunctionEventInvokeConfigValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutFunctionEventInvokeConfig{}, middleware.After)
}
func addOpPutProvisionedConcurrencyConfigValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutProvisionedConcurrencyConfig{}, middleware.After)
}
func addOpPutRuntimeManagementConfigValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutRuntimeManagementConfig{}, middleware.After)
}
func addOpRemoveLayerVersionPermissionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRemoveLayerVersionPermission{}, middleware.After)
}
func addOpRemovePermissionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRemovePermission{}, 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 addOpUpdateAliasValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateAlias{}, middleware.After)
}
func addOpUpdateCodeSigningConfigValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateCodeSigningConfig{}, middleware.After)
}
func addOpUpdateEventSourceMappingValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateEventSourceMapping{}, middleware.After)
}
func addOpUpdateFunctionCodeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateFunctionCode{}, middleware.After)
}
func addOpUpdateFunctionConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateFunctionConfiguration{}, middleware.After)
}
func addOpUpdateFunctionEventInvokeConfigValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateFunctionEventInvokeConfig{}, middleware.After)
}
func addOpUpdateFunctionUrlConfigValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateFunctionUrlConfig{}, middleware.After)
}
func validateAllowedPublishers(v *types.AllowedPublishers) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AllowedPublishers"}
if v.SigningProfileVersionArns == nil {
invalidParams.Add(smithy.NewErrParamRequired("SigningProfileVersionArns"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateEphemeralStorage(v *types.EphemeralStorage) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "EphemeralStorage"}
if v.Size == nil {
invalidParams.Add(smithy.NewErrParamRequired("Size"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateFileSystemConfig(v *types.FileSystemConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "FileSystemConfig"}
if v.Arn == nil {
invalidParams.Add(smithy.NewErrParamRequired("Arn"))
}
if v.LocalMountPath == nil {
invalidParams.Add(smithy.NewErrParamRequired("LocalMountPath"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateFileSystemConfigList(v []types.FileSystemConfig) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "FileSystemConfigList"}
for i := range v {
if err := validateFileSystemConfig(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAddLayerVersionPermissionInput(v *AddLayerVersionPermissionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AddLayerVersionPermissionInput"}
if v.LayerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("LayerName"))
}
if v.StatementId == nil {
invalidParams.Add(smithy.NewErrParamRequired("StatementId"))
}
if v.Action == nil {
invalidParams.Add(smithy.NewErrParamRequired("Action"))
}
if v.Principal == nil {
invalidParams.Add(smithy.NewErrParamRequired("Principal"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpAddPermissionInput(v *AddPermissionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AddPermissionInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if v.StatementId == nil {
invalidParams.Add(smithy.NewErrParamRequired("StatementId"))
}
if v.Action == nil {
invalidParams.Add(smithy.NewErrParamRequired("Action"))
}
if v.Principal == nil {
invalidParams.Add(smithy.NewErrParamRequired("Principal"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateAliasInput(v *CreateAliasInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateAliasInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.FunctionVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionVersion"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateCodeSigningConfigInput(v *CreateCodeSigningConfigInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateCodeSigningConfigInput"}
if v.AllowedPublishers == nil {
invalidParams.Add(smithy.NewErrParamRequired("AllowedPublishers"))
} else if v.AllowedPublishers != nil {
if err := validateAllowedPublishers(v.AllowedPublishers); err != nil {
invalidParams.AddNested("AllowedPublishers", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateEventSourceMappingInput(v *CreateEventSourceMappingInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateEventSourceMappingInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateFunctionInput(v *CreateFunctionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateFunctionInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if v.Role == nil {
invalidParams.Add(smithy.NewErrParamRequired("Role"))
}
if v.Code == nil {
invalidParams.Add(smithy.NewErrParamRequired("Code"))
}
if v.FileSystemConfigs != nil {
if err := validateFileSystemConfigList(v.FileSystemConfigs); err != nil {
invalidParams.AddNested("FileSystemConfigs", err.(smithy.InvalidParamsError))
}
}
if v.EphemeralStorage != nil {
if err := validateEphemeralStorage(v.EphemeralStorage); err != nil {
invalidParams.AddNested("EphemeralStorage", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateFunctionUrlConfigInput(v *CreateFunctionUrlConfigInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateFunctionUrlConfigInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if len(v.AuthType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("AuthType"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteAliasInput(v *DeleteAliasInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteAliasInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteCodeSigningConfigInput(v *DeleteCodeSigningConfigInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteCodeSigningConfigInput"}
if v.CodeSigningConfigArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("CodeSigningConfigArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteEventSourceMappingInput(v *DeleteEventSourceMappingInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteEventSourceMappingInput"}
if v.UUID == nil {
invalidParams.Add(smithy.NewErrParamRequired("UUID"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteFunctionCodeSigningConfigInput(v *DeleteFunctionCodeSigningConfigInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteFunctionCodeSigningConfigInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteFunctionConcurrencyInput(v *DeleteFunctionConcurrencyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteFunctionConcurrencyInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteFunctionEventInvokeConfigInput(v *DeleteFunctionEventInvokeConfigInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteFunctionEventInvokeConfigInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteFunctionInput(v *DeleteFunctionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteFunctionInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteFunctionUrlConfigInput(v *DeleteFunctionUrlConfigInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteFunctionUrlConfigInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteLayerVersionInput(v *DeleteLayerVersionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteLayerVersionInput"}
if v.LayerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("LayerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteProvisionedConcurrencyConfigInput(v *DeleteProvisionedConcurrencyConfigInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteProvisionedConcurrencyConfigInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if v.Qualifier == nil {
invalidParams.Add(smithy.NewErrParamRequired("Qualifier"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetAliasInput(v *GetAliasInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetAliasInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetCodeSigningConfigInput(v *GetCodeSigningConfigInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetCodeSigningConfigInput"}
if v.CodeSigningConfigArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("CodeSigningConfigArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetEventSourceMappingInput(v *GetEventSourceMappingInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetEventSourceMappingInput"}
if v.UUID == nil {
invalidParams.Add(smithy.NewErrParamRequired("UUID"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetFunctionCodeSigningConfigInput(v *GetFunctionCodeSigningConfigInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetFunctionCodeSigningConfigInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetFunctionConcurrencyInput(v *GetFunctionConcurrencyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetFunctionConcurrencyInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetFunctionConfigurationInput(v *GetFunctionConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetFunctionConfigurationInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetFunctionEventInvokeConfigInput(v *GetFunctionEventInvokeConfigInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetFunctionEventInvokeConfigInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetFunctionInput(v *GetFunctionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetFunctionInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetFunctionUrlConfigInput(v *GetFunctionUrlConfigInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetFunctionUrlConfigInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetLayerVersionByArnInput(v *GetLayerVersionByArnInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetLayerVersionByArnInput"}
if v.Arn == nil {
invalidParams.Add(smithy.NewErrParamRequired("Arn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetLayerVersionInput(v *GetLayerVersionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetLayerVersionInput"}
if v.LayerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("LayerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetLayerVersionPolicyInput(v *GetLayerVersionPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetLayerVersionPolicyInput"}
if v.LayerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("LayerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetPolicyInput(v *GetPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetPolicyInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetProvisionedConcurrencyConfigInput(v *GetProvisionedConcurrencyConfigInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetProvisionedConcurrencyConfigInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if v.Qualifier == nil {
invalidParams.Add(smithy.NewErrParamRequired("Qualifier"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetRuntimeManagementConfigInput(v *GetRuntimeManagementConfigInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetRuntimeManagementConfigInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpInvokeAsyncInput(v *InvokeAsyncInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InvokeAsyncInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if v.InvokeArgs == nil {
invalidParams.Add(smithy.NewErrParamRequired("InvokeArgs"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpInvokeInput(v *InvokeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InvokeInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpInvokeWithResponseStreamInput(v *InvokeWithResponseStreamInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InvokeWithResponseStreamInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListAliasesInput(v *ListAliasesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListAliasesInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListFunctionEventInvokeConfigsInput(v *ListFunctionEventInvokeConfigsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListFunctionEventInvokeConfigsInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListFunctionsByCodeSigningConfigInput(v *ListFunctionsByCodeSigningConfigInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListFunctionsByCodeSigningConfigInput"}
if v.CodeSigningConfigArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("CodeSigningConfigArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListFunctionUrlConfigsInput(v *ListFunctionUrlConfigsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListFunctionUrlConfigsInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListLayerVersionsInput(v *ListLayerVersionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListLayerVersionsInput"}
if v.LayerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("LayerName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListProvisionedConcurrencyConfigsInput(v *ListProvisionedConcurrencyConfigsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListProvisionedConcurrencyConfigsInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListTagsInput(v *ListTagsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListTagsInput"}
if v.Resource == nil {
invalidParams.Add(smithy.NewErrParamRequired("Resource"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListVersionsByFunctionInput(v *ListVersionsByFunctionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListVersionsByFunctionInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPublishLayerVersionInput(v *PublishLayerVersionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PublishLayerVersionInput"}
if v.LayerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("LayerName"))
}
if v.Content == nil {
invalidParams.Add(smithy.NewErrParamRequired("Content"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPublishVersionInput(v *PublishVersionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PublishVersionInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutFunctionCodeSigningConfigInput(v *PutFunctionCodeSigningConfigInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutFunctionCodeSigningConfigInput"}
if v.CodeSigningConfigArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("CodeSigningConfigArn"))
}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutFunctionConcurrencyInput(v *PutFunctionConcurrencyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutFunctionConcurrencyInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if v.ReservedConcurrentExecutions == nil {
invalidParams.Add(smithy.NewErrParamRequired("ReservedConcurrentExecutions"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutFunctionEventInvokeConfigInput(v *PutFunctionEventInvokeConfigInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutFunctionEventInvokeConfigInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutProvisionedConcurrencyConfigInput(v *PutProvisionedConcurrencyConfigInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutProvisionedConcurrencyConfigInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if v.Qualifier == nil {
invalidParams.Add(smithy.NewErrParamRequired("Qualifier"))
}
if v.ProvisionedConcurrentExecutions == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProvisionedConcurrentExecutions"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutRuntimeManagementConfigInput(v *PutRuntimeManagementConfigInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutRuntimeManagementConfigInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if len(v.UpdateRuntimeOn) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("UpdateRuntimeOn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRemoveLayerVersionPermissionInput(v *RemoveLayerVersionPermissionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RemoveLayerVersionPermissionInput"}
if v.LayerName == nil {
invalidParams.Add(smithy.NewErrParamRequired("LayerName"))
}
if v.StatementId == nil {
invalidParams.Add(smithy.NewErrParamRequired("StatementId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRemovePermissionInput(v *RemovePermissionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RemovePermissionInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if v.StatementId == nil {
invalidParams.Add(smithy.NewErrParamRequired("StatementId"))
}
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.Resource == nil {
invalidParams.Add(smithy.NewErrParamRequired("Resource"))
}
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.Resource == nil {
invalidParams.Add(smithy.NewErrParamRequired("Resource"))
}
if v.TagKeys == nil {
invalidParams.Add(smithy.NewErrParamRequired("TagKeys"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateAliasInput(v *UpdateAliasInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateAliasInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateCodeSigningConfigInput(v *UpdateCodeSigningConfigInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateCodeSigningConfigInput"}
if v.CodeSigningConfigArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("CodeSigningConfigArn"))
}
if v.AllowedPublishers != nil {
if err := validateAllowedPublishers(v.AllowedPublishers); err != nil {
invalidParams.AddNested("AllowedPublishers", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateEventSourceMappingInput(v *UpdateEventSourceMappingInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateEventSourceMappingInput"}
if v.UUID == nil {
invalidParams.Add(smithy.NewErrParamRequired("UUID"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateFunctionCodeInput(v *UpdateFunctionCodeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateFunctionCodeInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateFunctionConfigurationInput(v *UpdateFunctionConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateFunctionConfigurationInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if v.FileSystemConfigs != nil {
if err := validateFileSystemConfigList(v.FileSystemConfigs); err != nil {
invalidParams.AddNested("FileSystemConfigs", err.(smithy.InvalidParamsError))
}
}
if v.EphemeralStorage != nil {
if err := validateEphemeralStorage(v.EphemeralStorage); err != nil {
invalidParams.AddNested("EphemeralStorage", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateFunctionEventInvokeConfigInput(v *UpdateFunctionEventInvokeConfigInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateFunctionEventInvokeConfigInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateFunctionUrlConfigInput(v *UpdateFunctionUrlConfigInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateFunctionUrlConfigInput"}
if v.FunctionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("FunctionName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 2,566 |
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 Lambda 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: "lambda.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "lambda-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "lambda-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "lambda.{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: "af-south-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.af-south-1.api.aws",
},
endpoints.EndpointKey{
Region: "ap-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-east-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.ap-east-1.api.aws",
},
endpoints.EndpointKey{
Region: "ap-northeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.ap-northeast-1.api.aws",
},
endpoints.EndpointKey{
Region: "ap-northeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-2",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.ap-northeast-2.api.aws",
},
endpoints.EndpointKey{
Region: "ap-northeast-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-3",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.ap-northeast-3.api.aws",
},
endpoints.EndpointKey{
Region: "ap-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-south-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.ap-south-1.api.aws",
},
endpoints.EndpointKey{
Region: "ap-south-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-south-2",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.ap-south-2.api.aws",
},
endpoints.EndpointKey{
Region: "ap-southeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.ap-southeast-1.api.aws",
},
endpoints.EndpointKey{
Region: "ap-southeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-2",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.ap-southeast-2.api.aws",
},
endpoints.EndpointKey{
Region: "ap-southeast-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-3",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.ap-southeast-3.api.aws",
},
endpoints.EndpointKey{
Region: "ap-southeast-4",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-4",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.ap-southeast-4.api.aws",
},
endpoints.EndpointKey{
Region: "ca-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ca-central-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.ca-central-1.api.aws",
},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-central-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.eu-central-1.api.aws",
},
endpoints.EndpointKey{
Region: "eu-central-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-central-2",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.eu-central-2.api.aws",
},
endpoints.EndpointKey{
Region: "eu-north-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-north-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.eu-north-1.api.aws",
},
endpoints.EndpointKey{
Region: "eu-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-south-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.eu-south-1.api.aws",
},
endpoints.EndpointKey{
Region: "eu-south-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-south-2",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.eu-south-2.api.aws",
},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.eu-west-1.api.aws",
},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-2",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.eu-west-2.api.aws",
},
endpoints.EndpointKey{
Region: "eu-west-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-3",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.eu-west-3.api.aws",
},
endpoints.EndpointKey{
Region: "fips-us-east-1",
}: endpoints.Endpoint{
Hostname: "lambda-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: "lambda-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: "lambda-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: "lambda-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-central-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.me-central-1.api.aws",
},
endpoints.EndpointKey{
Region: "me-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "me-south-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.me-south-1.api.aws",
},
endpoints.EndpointKey{
Region: "sa-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "sa-east-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.sa-east-1.api.aws",
},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "lambda-fips.us-east-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-east-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.us-east-1.api.aws",
},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "lambda-fips.us-east-2.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-east-2",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.us-east-2.api.aws",
},
endpoints.EndpointKey{
Region: "us-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "lambda-fips.us-west-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.us-west-1.api.aws",
},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "lambda-fips.us-west-2.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-2",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.us-west-2.api.aws",
},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "lambda-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "lambda-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "lambda.{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-north-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.cn-north-1.api.amazonwebservices.com.cn",
},
endpoints.EndpointKey{
Region: "cn-northwest-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "cn-northwest-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.cn-northwest-1.api.amazonwebservices.com.cn",
},
},
},
{
ID: "aws-iso",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "lambda-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "lambda.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIso,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "us-iso-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-iso-west-1",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-iso-b",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "lambda-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "lambda.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoB,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "us-isob-east-1",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-iso-e",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "lambda-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "lambda.{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: "lambda-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "lambda.{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: "lambda.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "lambda-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "lambda-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "lambda.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "fips-us-gov-east-1",
}: endpoints.Endpoint{
Hostname: "lambda-fips.us-gov-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-gov-west-1",
}: endpoints.Endpoint{
Hostname: "lambda-fips.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-gov-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-gov-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "lambda-fips.us-gov-east-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-gov-east-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.us-gov-east-1.api.aws",
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-gov-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "lambda-fips.us-gov-west-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
Variant: endpoints.DualStackVariant,
}: {
Hostname: "lambda.us-gov-west-1.api.aws",
},
},
},
}
| 685 |
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 Architecture string
// Enum values for Architecture
const (
ArchitectureX8664 Architecture = "x86_64"
ArchitectureArm64 Architecture = "arm64"
)
// Values returns all known values for Architecture. 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 (Architecture) Values() []Architecture {
return []Architecture{
"x86_64",
"arm64",
}
}
type CodeSigningPolicy string
// Enum values for CodeSigningPolicy
const (
CodeSigningPolicyWarn CodeSigningPolicy = "Warn"
CodeSigningPolicyEnforce CodeSigningPolicy = "Enforce"
)
// Values returns all known values for CodeSigningPolicy. 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 (CodeSigningPolicy) Values() []CodeSigningPolicy {
return []CodeSigningPolicy{
"Warn",
"Enforce",
}
}
type EndPointType string
// Enum values for EndPointType
const (
EndPointTypeKafkaBootstrapServers EndPointType = "KAFKA_BOOTSTRAP_SERVERS"
)
// Values returns all known values for EndPointType. 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 (EndPointType) Values() []EndPointType {
return []EndPointType{
"KAFKA_BOOTSTRAP_SERVERS",
}
}
type EventSourcePosition string
// Enum values for EventSourcePosition
const (
EventSourcePositionTrimHorizon EventSourcePosition = "TRIM_HORIZON"
EventSourcePositionLatest EventSourcePosition = "LATEST"
EventSourcePositionAtTimestamp EventSourcePosition = "AT_TIMESTAMP"
)
// Values returns all known values for EventSourcePosition. 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 (EventSourcePosition) Values() []EventSourcePosition {
return []EventSourcePosition{
"TRIM_HORIZON",
"LATEST",
"AT_TIMESTAMP",
}
}
type FullDocument string
// Enum values for FullDocument
const (
FullDocumentUpdateLookup FullDocument = "UpdateLookup"
FullDocumentDefault FullDocument = "Default"
)
// Values returns all known values for FullDocument. 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 (FullDocument) Values() []FullDocument {
return []FullDocument{
"UpdateLookup",
"Default",
}
}
type FunctionResponseType string
// Enum values for FunctionResponseType
const (
FunctionResponseTypeReportBatchItemFailures FunctionResponseType = "ReportBatchItemFailures"
)
// Values returns all known values for FunctionResponseType. 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 (FunctionResponseType) Values() []FunctionResponseType {
return []FunctionResponseType{
"ReportBatchItemFailures",
}
}
type FunctionUrlAuthType string
// Enum values for FunctionUrlAuthType
const (
FunctionUrlAuthTypeNone FunctionUrlAuthType = "NONE"
FunctionUrlAuthTypeAwsIam FunctionUrlAuthType = "AWS_IAM"
)
// Values returns all known values for FunctionUrlAuthType. 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 (FunctionUrlAuthType) Values() []FunctionUrlAuthType {
return []FunctionUrlAuthType{
"NONE",
"AWS_IAM",
}
}
type FunctionVersion string
// Enum values for FunctionVersion
const (
FunctionVersionAll FunctionVersion = "ALL"
)
// Values returns all known values for FunctionVersion. 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 (FunctionVersion) Values() []FunctionVersion {
return []FunctionVersion{
"ALL",
}
}
type InvocationType string
// Enum values for InvocationType
const (
InvocationTypeEvent InvocationType = "Event"
InvocationTypeRequestResponse InvocationType = "RequestResponse"
InvocationTypeDryRun InvocationType = "DryRun"
)
// Values returns all known values for InvocationType. 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 (InvocationType) Values() []InvocationType {
return []InvocationType{
"Event",
"RequestResponse",
"DryRun",
}
}
type InvokeMode string
// Enum values for InvokeMode
const (
InvokeModeBuffered InvokeMode = "BUFFERED"
InvokeModeResponseStream InvokeMode = "RESPONSE_STREAM"
)
// Values returns all known values for InvokeMode. 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 (InvokeMode) Values() []InvokeMode {
return []InvokeMode{
"BUFFERED",
"RESPONSE_STREAM",
}
}
type LastUpdateStatus string
// Enum values for LastUpdateStatus
const (
LastUpdateStatusSuccessful LastUpdateStatus = "Successful"
LastUpdateStatusFailed LastUpdateStatus = "Failed"
LastUpdateStatusInProgress LastUpdateStatus = "InProgress"
)
// Values returns all known values for LastUpdateStatus. 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 (LastUpdateStatus) Values() []LastUpdateStatus {
return []LastUpdateStatus{
"Successful",
"Failed",
"InProgress",
}
}
type LastUpdateStatusReasonCode string
// Enum values for LastUpdateStatusReasonCode
const (
LastUpdateStatusReasonCodeEniLimitExceeded LastUpdateStatusReasonCode = "EniLimitExceeded"
LastUpdateStatusReasonCodeInsufficientRolePermissions LastUpdateStatusReasonCode = "InsufficientRolePermissions"
LastUpdateStatusReasonCodeInvalidConfiguration LastUpdateStatusReasonCode = "InvalidConfiguration"
LastUpdateStatusReasonCodeInternalError LastUpdateStatusReasonCode = "InternalError"
LastUpdateStatusReasonCodeSubnetOutOfIPAddresses LastUpdateStatusReasonCode = "SubnetOutOfIPAddresses"
LastUpdateStatusReasonCodeInvalidSubnet LastUpdateStatusReasonCode = "InvalidSubnet"
LastUpdateStatusReasonCodeInvalidSecurityGroup LastUpdateStatusReasonCode = "InvalidSecurityGroup"
LastUpdateStatusReasonCodeImageDeleted LastUpdateStatusReasonCode = "ImageDeleted"
LastUpdateStatusReasonCodeImageAccessDenied LastUpdateStatusReasonCode = "ImageAccessDenied"
LastUpdateStatusReasonCodeInvalidImage LastUpdateStatusReasonCode = "InvalidImage"
LastUpdateStatusReasonCodeKMSKeyAccessDenied LastUpdateStatusReasonCode = "KMSKeyAccessDenied"
LastUpdateStatusReasonCodeKMSKeyNotFound LastUpdateStatusReasonCode = "KMSKeyNotFound"
LastUpdateStatusReasonCodeInvalidStateKMSKey LastUpdateStatusReasonCode = "InvalidStateKMSKey"
LastUpdateStatusReasonCodeDisabledKMSKey LastUpdateStatusReasonCode = "DisabledKMSKey"
LastUpdateStatusReasonCodeEFSIOError LastUpdateStatusReasonCode = "EFSIOError"
LastUpdateStatusReasonCodeEFSMountConnectivityError LastUpdateStatusReasonCode = "EFSMountConnectivityError"
LastUpdateStatusReasonCodeEFSMountFailure LastUpdateStatusReasonCode = "EFSMountFailure"
LastUpdateStatusReasonCodeEFSMountTimeout LastUpdateStatusReasonCode = "EFSMountTimeout"
LastUpdateStatusReasonCodeInvalidRuntime LastUpdateStatusReasonCode = "InvalidRuntime"
LastUpdateStatusReasonCodeInvalidZipFileException LastUpdateStatusReasonCode = "InvalidZipFileException"
LastUpdateStatusReasonCodeFunctionError LastUpdateStatusReasonCode = "FunctionError"
)
// Values returns all known values for LastUpdateStatusReasonCode. 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 (LastUpdateStatusReasonCode) Values() []LastUpdateStatusReasonCode {
return []LastUpdateStatusReasonCode{
"EniLimitExceeded",
"InsufficientRolePermissions",
"InvalidConfiguration",
"InternalError",
"SubnetOutOfIPAddresses",
"InvalidSubnet",
"InvalidSecurityGroup",
"ImageDeleted",
"ImageAccessDenied",
"InvalidImage",
"KMSKeyAccessDenied",
"KMSKeyNotFound",
"InvalidStateKMSKey",
"DisabledKMSKey",
"EFSIOError",
"EFSMountConnectivityError",
"EFSMountFailure",
"EFSMountTimeout",
"InvalidRuntime",
"InvalidZipFileException",
"FunctionError",
}
}
type LogType string
// Enum values for LogType
const (
LogTypeNone LogType = "None"
LogTypeTail LogType = "Tail"
)
// Values returns all known values for LogType. 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 (LogType) Values() []LogType {
return []LogType{
"None",
"Tail",
}
}
type PackageType string
// Enum values for PackageType
const (
PackageTypeZip PackageType = "Zip"
PackageTypeImage PackageType = "Image"
)
// Values returns all known values for PackageType. 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 (PackageType) Values() []PackageType {
return []PackageType{
"Zip",
"Image",
}
}
type ProvisionedConcurrencyStatusEnum string
// Enum values for ProvisionedConcurrencyStatusEnum
const (
ProvisionedConcurrencyStatusEnumInProgress ProvisionedConcurrencyStatusEnum = "IN_PROGRESS"
ProvisionedConcurrencyStatusEnumReady ProvisionedConcurrencyStatusEnum = "READY"
ProvisionedConcurrencyStatusEnumFailed ProvisionedConcurrencyStatusEnum = "FAILED"
)
// Values returns all known values for ProvisionedConcurrencyStatusEnum. 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 (ProvisionedConcurrencyStatusEnum) Values() []ProvisionedConcurrencyStatusEnum {
return []ProvisionedConcurrencyStatusEnum{
"IN_PROGRESS",
"READY",
"FAILED",
}
}
type ResponseStreamingInvocationType string
// Enum values for ResponseStreamingInvocationType
const (
ResponseStreamingInvocationTypeRequestResponse ResponseStreamingInvocationType = "RequestResponse"
ResponseStreamingInvocationTypeDryRun ResponseStreamingInvocationType = "DryRun"
)
// Values returns all known values for ResponseStreamingInvocationType. 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 (ResponseStreamingInvocationType) Values() []ResponseStreamingInvocationType {
return []ResponseStreamingInvocationType{
"RequestResponse",
"DryRun",
}
}
type Runtime string
// Enum values for Runtime
const (
RuntimeNodejs Runtime = "nodejs"
RuntimeNodejs43 Runtime = "nodejs4.3"
RuntimeNodejs610 Runtime = "nodejs6.10"
RuntimeNodejs810 Runtime = "nodejs8.10"
RuntimeNodejs10x Runtime = "nodejs10.x"
RuntimeNodejs12x Runtime = "nodejs12.x"
RuntimeNodejs14x Runtime = "nodejs14.x"
RuntimeNodejs16x Runtime = "nodejs16.x"
RuntimeJava8 Runtime = "java8"
RuntimeJava8al2 Runtime = "java8.al2"
RuntimeJava11 Runtime = "java11"
RuntimePython27 Runtime = "python2.7"
RuntimePython36 Runtime = "python3.6"
RuntimePython37 Runtime = "python3.7"
RuntimePython38 Runtime = "python3.8"
RuntimePython39 Runtime = "python3.9"
RuntimeDotnetcore10 Runtime = "dotnetcore1.0"
RuntimeDotnetcore20 Runtime = "dotnetcore2.0"
RuntimeDotnetcore21 Runtime = "dotnetcore2.1"
RuntimeDotnetcore31 Runtime = "dotnetcore3.1"
RuntimeDotnet6 Runtime = "dotnet6"
RuntimeNodejs43edge Runtime = "nodejs4.3-edge"
RuntimeGo1x Runtime = "go1.x"
RuntimeRuby25 Runtime = "ruby2.5"
RuntimeRuby27 Runtime = "ruby2.7"
RuntimeProvided Runtime = "provided"
RuntimeProvidedal2 Runtime = "provided.al2"
RuntimeNodejs18x Runtime = "nodejs18.x"
RuntimePython310 Runtime = "python3.10"
RuntimeJava17 Runtime = "java17"
RuntimeRuby32 Runtime = "ruby3.2"
)
// Values returns all known values for Runtime. 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 (Runtime) Values() []Runtime {
return []Runtime{
"nodejs",
"nodejs4.3",
"nodejs6.10",
"nodejs8.10",
"nodejs10.x",
"nodejs12.x",
"nodejs14.x",
"nodejs16.x",
"java8",
"java8.al2",
"java11",
"python2.7",
"python3.6",
"python3.7",
"python3.8",
"python3.9",
"dotnetcore1.0",
"dotnetcore2.0",
"dotnetcore2.1",
"dotnetcore3.1",
"dotnet6",
"nodejs4.3-edge",
"go1.x",
"ruby2.5",
"ruby2.7",
"provided",
"provided.al2",
"nodejs18.x",
"python3.10",
"java17",
"ruby3.2",
}
}
type SnapStartApplyOn string
// Enum values for SnapStartApplyOn
const (
SnapStartApplyOnPublishedVersions SnapStartApplyOn = "PublishedVersions"
SnapStartApplyOnNone SnapStartApplyOn = "None"
)
// Values returns all known values for SnapStartApplyOn. 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 (SnapStartApplyOn) Values() []SnapStartApplyOn {
return []SnapStartApplyOn{
"PublishedVersions",
"None",
}
}
type SnapStartOptimizationStatus string
// Enum values for SnapStartOptimizationStatus
const (
SnapStartOptimizationStatusOn SnapStartOptimizationStatus = "On"
SnapStartOptimizationStatusOff SnapStartOptimizationStatus = "Off"
)
// Values returns all known values for SnapStartOptimizationStatus. 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 (SnapStartOptimizationStatus) Values() []SnapStartOptimizationStatus {
return []SnapStartOptimizationStatus{
"On",
"Off",
}
}
type SourceAccessType string
// Enum values for SourceAccessType
const (
SourceAccessTypeBasicAuth SourceAccessType = "BASIC_AUTH"
SourceAccessTypeVpcSubnet SourceAccessType = "VPC_SUBNET"
SourceAccessTypeVpcSecurityGroup SourceAccessType = "VPC_SECURITY_GROUP"
SourceAccessTypeSaslScram512Auth SourceAccessType = "SASL_SCRAM_512_AUTH"
SourceAccessTypeSaslScram256Auth SourceAccessType = "SASL_SCRAM_256_AUTH"
SourceAccessTypeVirtualHost SourceAccessType = "VIRTUAL_HOST"
SourceAccessTypeClientCertificateTlsAuth SourceAccessType = "CLIENT_CERTIFICATE_TLS_AUTH"
SourceAccessTypeServerRootCaCertificate SourceAccessType = "SERVER_ROOT_CA_CERTIFICATE"
)
// Values returns all known values for SourceAccessType. 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 (SourceAccessType) Values() []SourceAccessType {
return []SourceAccessType{
"BASIC_AUTH",
"VPC_SUBNET",
"VPC_SECURITY_GROUP",
"SASL_SCRAM_512_AUTH",
"SASL_SCRAM_256_AUTH",
"VIRTUAL_HOST",
"CLIENT_CERTIFICATE_TLS_AUTH",
"SERVER_ROOT_CA_CERTIFICATE",
}
}
type State string
// Enum values for State
const (
StatePending State = "Pending"
StateActive State = "Active"
StateInactive State = "Inactive"
StateFailed State = "Failed"
)
// Values returns all known values for State. 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 (State) Values() []State {
return []State{
"Pending",
"Active",
"Inactive",
"Failed",
}
}
type StateReasonCode string
// Enum values for StateReasonCode
const (
StateReasonCodeIdle StateReasonCode = "Idle"
StateReasonCodeCreating StateReasonCode = "Creating"
StateReasonCodeRestoring StateReasonCode = "Restoring"
StateReasonCodeEniLimitExceeded StateReasonCode = "EniLimitExceeded"
StateReasonCodeInsufficientRolePermissions StateReasonCode = "InsufficientRolePermissions"
StateReasonCodeInvalidConfiguration StateReasonCode = "InvalidConfiguration"
StateReasonCodeInternalError StateReasonCode = "InternalError"
StateReasonCodeSubnetOutOfIPAddresses StateReasonCode = "SubnetOutOfIPAddresses"
StateReasonCodeInvalidSubnet StateReasonCode = "InvalidSubnet"
StateReasonCodeInvalidSecurityGroup StateReasonCode = "InvalidSecurityGroup"
StateReasonCodeImageDeleted StateReasonCode = "ImageDeleted"
StateReasonCodeImageAccessDenied StateReasonCode = "ImageAccessDenied"
StateReasonCodeInvalidImage StateReasonCode = "InvalidImage"
StateReasonCodeKMSKeyAccessDenied StateReasonCode = "KMSKeyAccessDenied"
StateReasonCodeKMSKeyNotFound StateReasonCode = "KMSKeyNotFound"
StateReasonCodeInvalidStateKMSKey StateReasonCode = "InvalidStateKMSKey"
StateReasonCodeDisabledKMSKey StateReasonCode = "DisabledKMSKey"
StateReasonCodeEFSIOError StateReasonCode = "EFSIOError"
StateReasonCodeEFSMountConnectivityError StateReasonCode = "EFSMountConnectivityError"
StateReasonCodeEFSMountFailure StateReasonCode = "EFSMountFailure"
StateReasonCodeEFSMountTimeout StateReasonCode = "EFSMountTimeout"
StateReasonCodeInvalidRuntime StateReasonCode = "InvalidRuntime"
StateReasonCodeInvalidZipFileException StateReasonCode = "InvalidZipFileException"
StateReasonCodeFunctionError StateReasonCode = "FunctionError"
)
// Values returns all known values for StateReasonCode. 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 (StateReasonCode) Values() []StateReasonCode {
return []StateReasonCode{
"Idle",
"Creating",
"Restoring",
"EniLimitExceeded",
"InsufficientRolePermissions",
"InvalidConfiguration",
"InternalError",
"SubnetOutOfIPAddresses",
"InvalidSubnet",
"InvalidSecurityGroup",
"ImageDeleted",
"ImageAccessDenied",
"InvalidImage",
"KMSKeyAccessDenied",
"KMSKeyNotFound",
"InvalidStateKMSKey",
"DisabledKMSKey",
"EFSIOError",
"EFSMountConnectivityError",
"EFSMountFailure",
"EFSMountTimeout",
"InvalidRuntime",
"InvalidZipFileException",
"FunctionError",
}
}
type ThrottleReason string
// Enum values for ThrottleReason
const (
ThrottleReasonConcurrentInvocationLimitExceeded ThrottleReason = "ConcurrentInvocationLimitExceeded"
ThrottleReasonFunctionInvocationRateLimitExceeded ThrottleReason = "FunctionInvocationRateLimitExceeded"
ThrottleReasonReservedFunctionConcurrentInvocationLimitExceeded ThrottleReason = "ReservedFunctionConcurrentInvocationLimitExceeded"
ThrottleReasonReservedFunctionInvocationRateLimitExceeded ThrottleReason = "ReservedFunctionInvocationRateLimitExceeded"
ThrottleReasonCallerRateLimitExceeded ThrottleReason = "CallerRateLimitExceeded"
ThrottleReasonConcurrentSnapshotCreateLimitExceeded ThrottleReason = "ConcurrentSnapshotCreateLimitExceeded"
)
// Values returns all known values for ThrottleReason. 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 (ThrottleReason) Values() []ThrottleReason {
return []ThrottleReason{
"ConcurrentInvocationLimitExceeded",
"FunctionInvocationRateLimitExceeded",
"ReservedFunctionConcurrentInvocationLimitExceeded",
"ReservedFunctionInvocationRateLimitExceeded",
"CallerRateLimitExceeded",
"ConcurrentSnapshotCreateLimitExceeded",
}
}
type TracingMode string
// Enum values for TracingMode
const (
TracingModeActive TracingMode = "Active"
TracingModePassThrough TracingMode = "PassThrough"
)
// Values returns all known values for TracingMode. 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 (TracingMode) Values() []TracingMode {
return []TracingMode{
"Active",
"PassThrough",
}
}
type UpdateRuntimeOn string
// Enum values for UpdateRuntimeOn
const (
UpdateRuntimeOnAuto UpdateRuntimeOn = "Auto"
UpdateRuntimeOnManual UpdateRuntimeOn = "Manual"
UpdateRuntimeOnFunctionUpdate UpdateRuntimeOn = "FunctionUpdate"
)
// Values returns all known values for UpdateRuntimeOn. 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 (UpdateRuntimeOn) Values() []UpdateRuntimeOn {
return []UpdateRuntimeOn{
"Auto",
"Manual",
"FunctionUpdate",
}
}
| 624 |
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"
)
// The specified code signing configuration does not exist.
type CodeSigningConfigNotFoundException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *CodeSigningConfigNotFoundException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *CodeSigningConfigNotFoundException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *CodeSigningConfigNotFoundException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "CodeSigningConfigNotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *CodeSigningConfigNotFoundException) ErrorFault() smithy.ErrorFault {
return smithy.FaultClient
}
// Your Amazon Web Services account has exceeded its maximum total code size. For
// more information, see Lambda quotas (https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html)
// .
type CodeStorageExceededException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *CodeStorageExceededException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *CodeStorageExceededException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *CodeStorageExceededException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "CodeStorageExceededException"
}
return *e.ErrorCodeOverride
}
func (e *CodeStorageExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The code signature failed one or more of the validation checks for signature
// mismatch or expiry, and the code signing policy is set to ENFORCE. Lambda blocks
// the deployment.
type CodeVerificationFailedException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *CodeVerificationFailedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *CodeVerificationFailedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *CodeVerificationFailedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "CodeVerificationFailedException"
}
return *e.ErrorCodeOverride
}
func (e *CodeVerificationFailedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Need additional permissions to configure VPC settings.
type EC2AccessDeniedException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *EC2AccessDeniedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *EC2AccessDeniedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *EC2AccessDeniedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "EC2AccessDeniedException"
}
return *e.ErrorCodeOverride
}
func (e *EC2AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// Amazon EC2 throttled Lambda during Lambda function initialization using the
// execution role provided for the function.
type EC2ThrottledException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *EC2ThrottledException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *EC2ThrottledException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *EC2ThrottledException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "EC2ThrottledException"
}
return *e.ErrorCodeOverride
}
func (e *EC2ThrottledException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// Lambda received an unexpected Amazon EC2 client exception while setting up for
// the Lambda function.
type EC2UnexpectedException struct {
Message *string
ErrorCodeOverride *string
Type *string
EC2ErrorCode *string
noSmithyDocumentSerde
}
func (e *EC2UnexpectedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *EC2UnexpectedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *EC2UnexpectedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "EC2UnexpectedException"
}
return *e.ErrorCodeOverride
}
func (e *EC2UnexpectedException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// An error occurred when reading from or writing to a connected file system.
type EFSIOException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *EFSIOException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *EFSIOException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *EFSIOException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "EFSIOException"
}
return *e.ErrorCodeOverride
}
func (e *EFSIOException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The Lambda function couldn't make a network connection to the configured file
// system.
type EFSMountConnectivityException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *EFSMountConnectivityException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *EFSMountConnectivityException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *EFSMountConnectivityException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "EFSMountConnectivityException"
}
return *e.ErrorCodeOverride
}
func (e *EFSMountConnectivityException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The Lambda function couldn't mount the configured file system due to a
// permission or configuration issue.
type EFSMountFailureException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *EFSMountFailureException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *EFSMountFailureException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *EFSMountFailureException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "EFSMountFailureException"
}
return *e.ErrorCodeOverride
}
func (e *EFSMountFailureException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The Lambda function made a network connection to the configured file system,
// but the mount operation timed out.
type EFSMountTimeoutException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *EFSMountTimeoutException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *EFSMountTimeoutException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *EFSMountTimeoutException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "EFSMountTimeoutException"
}
return *e.ErrorCodeOverride
}
func (e *EFSMountTimeoutException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Lambda couldn't create an elastic network interface in the VPC, specified as
// part of Lambda function configuration, because the limit for network interfaces
// has been reached. For more information, see Lambda quotas (https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html)
// .
type ENILimitReachedException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *ENILimitReachedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ENILimitReachedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ENILimitReachedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ENILimitReachedException"
}
return *e.ErrorCodeOverride
}
func (e *ENILimitReachedException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// The code signature failed the integrity check. If the integrity check fails,
// then Lambda blocks deployment, even if the code signing policy is set to WARN.
type InvalidCodeSignatureException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *InvalidCodeSignatureException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidCodeSignatureException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidCodeSignatureException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidCodeSignatureException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidCodeSignatureException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// One of the parameters in the request is not valid.
type InvalidParameterValueException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *InvalidParameterValueException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidParameterValueException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidParameterValueException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidParameterValueException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidParameterValueException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The request body could not be parsed as JSON.
type InvalidRequestContentException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *InvalidRequestContentException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidRequestContentException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidRequestContentException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidRequestContentException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidRequestContentException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The runtime or runtime version specified is not supported.
type InvalidRuntimeException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *InvalidRuntimeException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidRuntimeException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidRuntimeException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidRuntimeException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidRuntimeException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// The security group ID provided in the Lambda function VPC configuration is not
// valid.
type InvalidSecurityGroupIDException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *InvalidSecurityGroupIDException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidSecurityGroupIDException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidSecurityGroupIDException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidSecurityGroupIDException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidSecurityGroupIDException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// The subnet ID provided in the Lambda function VPC configuration is not valid.
type InvalidSubnetIDException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *InvalidSubnetIDException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidSubnetIDException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidSubnetIDException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidSubnetIDException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidSubnetIDException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// Lambda could not unzip the deployment package.
type InvalidZipFileException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *InvalidZipFileException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidZipFileException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidZipFileException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidZipFileException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidZipFileException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// Lambda couldn't decrypt the environment variables because KMS access was
// denied. Check the Lambda function's KMS permissions.
type KMSAccessDeniedException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *KMSAccessDeniedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *KMSAccessDeniedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *KMSAccessDeniedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "KMSAccessDeniedException"
}
return *e.ErrorCodeOverride
}
func (e *KMSAccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// Lambda couldn't decrypt the environment variables because the KMS key used is
// disabled. Check the Lambda function's KMS key settings.
type KMSDisabledException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *KMSDisabledException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *KMSDisabledException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *KMSDisabledException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "KMSDisabledException"
}
return *e.ErrorCodeOverride
}
func (e *KMSDisabledException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// Lambda couldn't decrypt the environment variables because the state of the KMS
// key used is not valid for Decrypt. Check the function's KMS key settings.
type KMSInvalidStateException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *KMSInvalidStateException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *KMSInvalidStateException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *KMSInvalidStateException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "KMSInvalidStateException"
}
return *e.ErrorCodeOverride
}
func (e *KMSInvalidStateException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// Lambda couldn't decrypt the environment variables because the KMS key was not
// found. Check the function's KMS key settings.
type KMSNotFoundException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *KMSNotFoundException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *KMSNotFoundException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *KMSNotFoundException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "KMSNotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *KMSNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// The permissions policy for the resource is too large. For more information, see
// Lambda quotas (https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html)
// .
type PolicyLengthExceededException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *PolicyLengthExceededException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *PolicyLengthExceededException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *PolicyLengthExceededException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "PolicyLengthExceededException"
}
return *e.ErrorCodeOverride
}
func (e *PolicyLengthExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The RevisionId provided does not match the latest RevisionId for the Lambda
// function or alias. Call the GetFunction or the GetAlias API operation to
// retrieve the latest RevisionId for your resource.
type PreconditionFailedException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *PreconditionFailedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *PreconditionFailedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *PreconditionFailedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "PreconditionFailedException"
}
return *e.ErrorCodeOverride
}
func (e *PreconditionFailedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The specified configuration does not exist.
type ProvisionedConcurrencyConfigNotFoundException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *ProvisionedConcurrencyConfigNotFoundException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ProvisionedConcurrencyConfigNotFoundException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ProvisionedConcurrencyConfigNotFoundException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ProvisionedConcurrencyConfigNotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *ProvisionedConcurrencyConfigNotFoundException) ErrorFault() smithy.ErrorFault {
return smithy.FaultClient
}
// Lambda has detected your function being invoked in a recursive loop with other
// Amazon Web Services resources and stopped your function's invocation.
type RecursiveInvocationException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *RecursiveInvocationException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *RecursiveInvocationException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *RecursiveInvocationException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "RecursiveInvocationException"
}
return *e.ErrorCodeOverride
}
func (e *RecursiveInvocationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The request payload exceeded the Invoke request body JSON input quota. For more
// information, see Lambda quotas (https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html)
// .
type RequestTooLargeException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *RequestTooLargeException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *RequestTooLargeException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *RequestTooLargeException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "RequestTooLargeException"
}
return *e.ErrorCodeOverride
}
func (e *RequestTooLargeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The resource already exists, or another operation is in progress.
type ResourceConflictException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *ResourceConflictException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ResourceConflictException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ResourceConflictException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ResourceConflictException"
}
return *e.ErrorCodeOverride
}
func (e *ResourceConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The operation conflicts with the resource's availability. For example, you
// tried to update an event source mapping in the CREATING state, or you tried to
// delete an event source mapping currently UPDATING.
type ResourceInUseException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *ResourceInUseException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ResourceInUseException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ResourceInUseException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ResourceInUseException"
}
return *e.ErrorCodeOverride
}
func (e *ResourceInUseException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The resource specified in the request does not exist.
type ResourceNotFoundException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *ResourceNotFoundException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ResourceNotFoundException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ResourceNotFoundException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ResourceNotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The function is inactive and its VPC connection is no longer available. Wait
// for the VPC connection to reestablish and try again.
type ResourceNotReadyException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *ResourceNotReadyException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ResourceNotReadyException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ResourceNotReadyException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ResourceNotReadyException"
}
return *e.ErrorCodeOverride
}
func (e *ResourceNotReadyException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// The Lambda service encountered an internal error.
type ServiceException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *ServiceException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ServiceException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ServiceException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ServiceException"
}
return *e.ErrorCodeOverride
}
func (e *ServiceException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// The afterRestore() runtime hook (https://docs.aws.amazon.com/lambda/latest/dg/snapstart-runtime-hooks.html)
// encountered an error. For more information, check the Amazon CloudWatch logs.
type SnapStartException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *SnapStartException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *SnapStartException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *SnapStartException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "SnapStartException"
}
return *e.ErrorCodeOverride
}
func (e *SnapStartException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Lambda is initializing your function. You can invoke the function when the
// function state (https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html)
// becomes Active .
type SnapStartNotReadyException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *SnapStartNotReadyException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *SnapStartNotReadyException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *SnapStartNotReadyException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "SnapStartNotReadyException"
}
return *e.ErrorCodeOverride
}
func (e *SnapStartNotReadyException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Lambda couldn't restore the snapshot within the timeout limit.
type SnapStartTimeoutException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *SnapStartTimeoutException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *SnapStartTimeoutException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *SnapStartTimeoutException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "SnapStartTimeoutException"
}
return *e.ErrorCodeOverride
}
func (e *SnapStartTimeoutException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Lambda couldn't set up VPC access for the Lambda function because one or more
// configured subnets has no available IP addresses.
type SubnetIPAddressLimitReachedException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *SubnetIPAddressLimitReachedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *SubnetIPAddressLimitReachedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *SubnetIPAddressLimitReachedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "SubnetIPAddressLimitReachedException"
}
return *e.ErrorCodeOverride
}
func (e *SubnetIPAddressLimitReachedException) ErrorFault() smithy.ErrorFault {
return smithy.FaultServer
}
// The request throughput limit was exceeded. For more information, see Lambda
// quotas (https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html#api-requests)
// .
type TooManyRequestsException struct {
Message *string
ErrorCodeOverride *string
RetryAfterSeconds *string
Type *string
Reason ThrottleReason
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 }
// The content type of the Invoke request body is not JSON.
type UnsupportedMediaTypeException struct {
Message *string
ErrorCodeOverride *string
Type *string
noSmithyDocumentSerde
}
func (e *UnsupportedMediaTypeException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *UnsupportedMediaTypeException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *UnsupportedMediaTypeException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "UnsupportedMediaTypeException"
}
return *e.ErrorCodeOverride
}
func (e *UnsupportedMediaTypeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
| 1,116 |
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"
)
// Limits that are related to concurrency and storage. All file and storage sizes
// are in bytes.
type AccountLimit struct {
// The maximum size of a function's deployment package and layers when they're
// extracted.
CodeSizeUnzipped int64
// The maximum size of a deployment package when it's uploaded directly to Lambda.
// Use Amazon S3 for larger files.
CodeSizeZipped int64
// The maximum number of simultaneous function executions.
ConcurrentExecutions int32
// The amount of storage space that you can use for all deployment packages and
// layer archives.
TotalCodeSize int64
// The maximum number of simultaneous function executions, minus the capacity
// that's reserved for individual functions with PutFunctionConcurrency .
UnreservedConcurrentExecutions *int32
noSmithyDocumentSerde
}
// The number of functions and amount of storage in use.
type AccountUsage struct {
// The number of Lambda functions.
FunctionCount int64
// The amount of storage space, in bytes, that's being used by deployment packages
// and layer archives.
TotalCodeSize int64
noSmithyDocumentSerde
}
// Provides configuration information about a Lambda function alias (https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html)
// .
type AliasConfiguration struct {
// The Amazon Resource Name (ARN) of the alias.
AliasArn *string
// A description of the alias.
Description *string
// The function version that the alias invokes.
FunctionVersion *string
// The name of the alias.
Name *string
// A unique identifier that changes when you update the alias.
RevisionId *string
// The routing configuration (https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html)
// of the alias.
RoutingConfig *AliasRoutingConfiguration
noSmithyDocumentSerde
}
// The traffic-shifting (https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html)
// configuration of a Lambda function alias.
type AliasRoutingConfiguration struct {
// The second version, and the percentage of traffic that's routed to it.
AdditionalVersionWeights map[string]float64
noSmithyDocumentSerde
}
// List of signing profiles that can sign a code package.
type AllowedPublishers struct {
// The Amazon Resource Name (ARN) for each of the signing profiles. A signing
// profile defines a trusted user who can sign a code package.
//
// This member is required.
SigningProfileVersionArns []string
noSmithyDocumentSerde
}
// Specific configuration settings for an Amazon Managed Streaming for Apache
// Kafka (Amazon MSK) event source.
type AmazonManagedKafkaEventSourceConfig struct {
// The identifier for the Kafka consumer group to join. The consumer group ID must
// be unique among all your Kafka event sources. After creating a Kafka event
// source mapping with the consumer group ID specified, you cannot update this
// value. For more information, see Customizable consumer group ID (https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-consumer-group-id)
// .
ConsumerGroupId *string
noSmithyDocumentSerde
}
// Details about a Code signing configuration (https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html)
// .
type CodeSigningConfig struct {
// List of allowed publishers.
//
// This member is required.
AllowedPublishers *AllowedPublishers
// The Amazon Resource Name (ARN) of the Code signing configuration.
//
// This member is required.
CodeSigningConfigArn *string
// Unique identifer for the Code signing configuration.
//
// This member is required.
CodeSigningConfigId *string
// The code signing policy controls the validation failure action for signature
// mismatch or expiry.
//
// This member is required.
CodeSigningPolicies *CodeSigningPolicies
// The date and time that the Code signing configuration was last modified, in
// ISO-8601 format (YYYY-MM-DDThh:mm:ss.sTZD).
//
// This member is required.
LastModified *string
// Code signing configuration description.
Description *string
noSmithyDocumentSerde
}
// Code signing configuration policies (https://docs.aws.amazon.com/lambda/latest/dg/configuration-codesigning.html#config-codesigning-policies)
// specify the validation failure action for signature mismatch or expiry.
type CodeSigningPolicies struct {
// Code signing configuration policy for deployment validation failure. If you set
// the policy to Enforce , Lambda blocks the deployment request if signature
// validation checks fail. If you set the policy to Warn , Lambda allows the
// deployment and creates a CloudWatch log. Default value: Warn
UntrustedArtifactOnDeployment CodeSigningPolicy
noSmithyDocumentSerde
}
type Concurrency struct {
// The number of concurrent executions that are reserved for this function. For
// more information, see Managing Lambda reserved concurrency (https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html)
// .
ReservedConcurrentExecutions *int32
noSmithyDocumentSerde
}
// The cross-origin resource sharing (CORS) (https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)
// settings for your Lambda function URL. Use CORS to grant access to your function
// URL from any origin. You can also use CORS to control access for specific HTTP
// headers and methods in requests to your function URL.
type Cors struct {
// Whether to allow cookies or other credentials in requests to your function URL.
// The default is false .
AllowCredentials *bool
// The HTTP headers that origins can include in requests to your function URL. For
// example: Date , Keep-Alive , X-Custom-Header .
AllowHeaders []string
// The HTTP methods that are allowed when calling your function URL. For example:
// GET , POST , DELETE , or the wildcard character ( * ).
AllowMethods []string
// The origins that can access your function URL. You can list any number of
// specific origins, separated by a comma. For example: https://www.example.com ,
// http://localhost:60905 . Alternatively, you can grant access to all origins
// using the wildcard character ( * ).
AllowOrigins []string
// The HTTP headers in your function response that you want to expose to origins
// that call your function URL. For example: Date , Keep-Alive , X-Custom-Header .
ExposeHeaders []string
// The maximum amount of time, in seconds, that web browsers can cache results of
// a preflight request. By default, this is set to 0 , which means that the browser
// doesn't cache results.
MaxAge *int32
noSmithyDocumentSerde
}
// The dead-letter queue (https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq)
// for failed asynchronous invocations.
type DeadLetterConfig struct {
// The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic.
TargetArn *string
noSmithyDocumentSerde
}
// A configuration object that specifies the destination of an event after Lambda
// processes it.
type DestinationConfig struct {
// The destination configuration for failed invocations.
OnFailure *OnFailure
// The destination configuration for successful invocations.
OnSuccess *OnSuccess
noSmithyDocumentSerde
}
// Specific configuration settings for a DocumentDB event source.
type DocumentDBEventSourceConfig struct {
// The name of the collection to consume within the database. If you do not
// specify a collection, Lambda consumes all collections.
CollectionName *string
// The name of the database to consume within the DocumentDB cluster.
DatabaseName *string
// Determines what DocumentDB sends to your event stream during document update
// operations. If set to UpdateLookup, DocumentDB sends a delta describing the
// changes, along with a copy of the entire document. Otherwise, DocumentDB sends
// only a partial document that contains the changes.
FullDocument FullDocument
noSmithyDocumentSerde
}
// A function's environment variable settings. You can use environment variables
// to adjust your function's behavior without updating code. An environment
// variable is a pair of strings that are stored in a function's version-specific
// configuration.
type Environment struct {
// Environment variable key-value pairs. For more information, see Using Lambda
// environment variables (https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)
// .
Variables map[string]string
noSmithyDocumentSerde
}
// Error messages for environment variables that couldn't be applied.
type EnvironmentError struct {
// The error code.
ErrorCode *string
// The error message.
Message *string
noSmithyDocumentSerde
}
// The results of an operation to update or read environment variables. If the
// operation succeeds, the response contains the environment variables. If it
// fails, the response contains details about the error.
type EnvironmentResponse struct {
// Error messages for environment variables that couldn't be applied.
Error *EnvironmentError
// Environment variable key-value pairs. Omitted from CloudTrail logs.
Variables map[string]string
noSmithyDocumentSerde
}
// The size of the function's /tmp directory in MB. The default value is 512, but
// it can be any whole number between 512 and 10,240 MB.
type EphemeralStorage struct {
// The size of the function's /tmp directory.
//
// This member is required.
Size *int32
noSmithyDocumentSerde
}
// A mapping between an Amazon Web Services resource and a Lambda function. For
// details, see CreateEventSourceMapping .
type EventSourceMappingConfiguration struct {
// Specific configuration settings for an Amazon Managed Streaming for Apache
// Kafka (Amazon MSK) event source.
AmazonManagedKafkaEventSourceConfig *AmazonManagedKafkaEventSourceConfig
// The maximum number of records in each batch that Lambda pulls from your stream
// or queue and sends to your function. Lambda passes all of the records in the
// batch to the function in a single call, up to the payload limit for synchronous
// invocation (6 MB). Default value: Varies by service. For Amazon SQS, the default
// is 10. For all other services, the default is 100. Related setting: When you set
// BatchSize to a value greater than 10, you must set
// MaximumBatchingWindowInSeconds to at least 1.
BatchSize *int32
// (Kinesis and DynamoDB Streams only) If the function returns an error, split the
// batch in two and retry. The default value is false.
BisectBatchOnFunctionError *bool
// (Kinesis and DynamoDB Streams only) An Amazon SQS queue or Amazon SNS topic
// destination for discarded records.
DestinationConfig *DestinationConfig
// Specific configuration settings for a DocumentDB event source.
DocumentDBEventSourceConfig *DocumentDBEventSourceConfig
// The Amazon Resource Name (ARN) of the event source.
EventSourceArn *string
// An object that defines the filter criteria that determine whether Lambda should
// process an event. For more information, see Lambda event filtering (https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html)
// .
FilterCriteria *FilterCriteria
// The ARN of the Lambda function.
FunctionArn *string
// (Kinesis, DynamoDB Streams, and Amazon SQS) A list of current response type
// enums applied to the event source mapping.
FunctionResponseTypes []FunctionResponseType
// The date that the event source mapping was last updated or that its state
// changed.
LastModified *time.Time
// The result of the last Lambda invocation of your function.
LastProcessingResult *string
// The maximum amount of time, in seconds, that Lambda spends gathering records
// before invoking the function. You can configure MaximumBatchingWindowInSeconds
// to any value from 0 seconds to 300 seconds in increments of seconds. For streams
// and Amazon SQS event sources, the default batching window is 0 seconds. For
// Amazon MSK, Self-managed Apache Kafka, Amazon MQ, and DocumentDB event sources,
// the default batching window is 500 ms. Note that because you can only change
// MaximumBatchingWindowInSeconds in increments of seconds, you cannot revert back
// to the 500 ms default batching window after you have changed it. To restore the
// default batching window, you must create a new event source mapping. Related
// setting: For streams and Amazon SQS event sources, when you set BatchSize to a
// value greater than 10, you must set MaximumBatchingWindowInSeconds to at least
// 1.
MaximumBatchingWindowInSeconds *int32
// (Kinesis and DynamoDB Streams only) Discard records older than the specified
// age. The default value is -1, which sets the maximum age to infinite. When the
// value is set to infinite, Lambda never discards old records. The minimum valid
// value for maximum record age is 60s. Although values less than 60 and greater
// than -1 fall within the parameter's absolute range, they are not allowed
MaximumRecordAgeInSeconds *int32
// (Kinesis and DynamoDB Streams only) Discard records after the specified number
// of retries. The default value is -1, which sets the maximum number of retries to
// infinite. When MaximumRetryAttempts is infinite, Lambda retries failed records
// until the record expires in the event source.
MaximumRetryAttempts *int32
// (Kinesis and DynamoDB Streams only) The number of batches to process
// concurrently from each shard. The default value is 1.
ParallelizationFactor *int32
// (Amazon MQ) The name of the Amazon MQ broker destination queue to consume.
Queues []string
// (Amazon SQS only) The scaling configuration for the event source. For more
// information, see Configuring maximum concurrency for Amazon SQS event sources (https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-max-concurrency)
// .
ScalingConfig *ScalingConfig
// The self-managed Apache Kafka cluster for your event source.
SelfManagedEventSource *SelfManagedEventSource
// Specific configuration settings for a self-managed Apache Kafka event source.
SelfManagedKafkaEventSourceConfig *SelfManagedKafkaEventSourceConfig
// An array of the authentication protocol, VPC components, or virtual host to
// secure and define your event source.
SourceAccessConfigurations []SourceAccessConfiguration
// The position in a stream from which to start reading. Required for Amazon
// Kinesis and Amazon DynamoDB Stream event sources. AT_TIMESTAMP is supported
// only for Amazon Kinesis streams, Amazon DocumentDB, Amazon MSK, and self-managed
// Apache Kafka.
StartingPosition EventSourcePosition
// With StartingPosition set to AT_TIMESTAMP , the time from which to start
// reading. StartingPositionTimestamp cannot be in the future.
StartingPositionTimestamp *time.Time
// The state of the event source mapping. It can be one of the following: Creating
// , Enabling , Enabled , Disabling , Disabled , Updating , or Deleting .
State *string
// Indicates whether a user or Lambda made the last change to the event source
// mapping.
StateTransitionReason *string
// The name of the Kafka topic.
Topics []string
// (Kinesis and DynamoDB Streams only) The duration in seconds of a processing
// window for DynamoDB and Kinesis Streams event sources. A value of 0 seconds
// indicates no tumbling window.
TumblingWindowInSeconds *int32
// The identifier of the event source mapping.
UUID *string
noSmithyDocumentSerde
}
// Details about the connection between a Lambda function and an Amazon EFS file
// system (https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)
// .
type FileSystemConfig struct {
// The Amazon Resource Name (ARN) of the Amazon EFS access point that provides
// access to the file system.
//
// This member is required.
Arn *string
// The path where the function can access the file system, starting with /mnt/ .
//
// This member is required.
LocalMountPath *string
noSmithyDocumentSerde
}
// A structure within a FilterCriteria object that defines an event filtering
// pattern.
type Filter struct {
// A filter pattern. For more information on the syntax of a filter pattern, see
// Filter rule syntax (https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventfiltering.html#filtering-syntax)
// .
Pattern *string
noSmithyDocumentSerde
}
// An object that contains the filters for an event source.
type FilterCriteria struct {
// A list of filters.
Filters []Filter
noSmithyDocumentSerde
}
// The code for the Lambda function. You can either specify an object in Amazon
// S3, upload a .zip file archive deployment package directly, or specify the URI
// of a container image.
type FunctionCode struct {
// URI of a container image (https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html)
// in the Amazon ECR registry.
ImageUri *string
// An Amazon S3 bucket in the same Amazon Web Services Region as your function.
// The bucket can be in a different Amazon Web Services account.
S3Bucket *string
// The Amazon S3 key of the deployment package.
S3Key *string
// For versioned objects, the version of the deployment package object to use.
S3ObjectVersion *string
// The base64-encoded contents of the deployment package. Amazon Web Services SDK
// and CLI clients handle the encoding for you.
ZipFile []byte
noSmithyDocumentSerde
}
// Details about a function's deployment package.
type FunctionCodeLocation struct {
// URI of a container image in the Amazon ECR registry.
ImageUri *string
// A presigned URL that you can use to download the deployment package.
Location *string
// The service that's hosting the file.
RepositoryType *string
// The resolved URI for the image.
ResolvedImageUri *string
noSmithyDocumentSerde
}
// Details about a function's configuration.
type FunctionConfiguration struct {
// The instruction set architecture that the function supports. Architecture is a
// string array with one of the valid values. The default architecture value is
// x86_64 .
Architectures []Architecture
// The SHA256 hash of the function's deployment package.
CodeSha256 *string
// The size of the function's deployment package, in bytes.
CodeSize int64
// The function's dead letter queue.
DeadLetterConfig *DeadLetterConfig
// The function's description.
Description *string
// The function's environment variables (https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html)
// . Omitted from CloudTrail logs.
Environment *EnvironmentResponse
// The size of the function’s /tmp directory in MB. The default value is 512, but
// it can be any whole number between 512 and 10,240 MB.
EphemeralStorage *EphemeralStorage
// Connection settings for an Amazon EFS file system (https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html)
// .
FileSystemConfigs []FileSystemConfig
// The function's Amazon Resource Name (ARN).
FunctionArn *string
// The name of the function.
FunctionName *string
// The function that Lambda calls to begin running your function.
Handler *string
// The function's image configuration values.
ImageConfigResponse *ImageConfigResponse
// The KMS key that's used to encrypt the function's environment variables (https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-encryption)
// . When Lambda SnapStart (https://docs.aws.amazon.com/lambda/latest/dg/snapstart-security.html)
// is activated, this key is also used to encrypt the function's snapshot. This key
// is returned only if you've configured a customer managed key.
KMSKeyArn *string
// The date and time that the function was last updated, in ISO-8601 format (https://www.w3.org/TR/NOTE-datetime)
// (YYYY-MM-DDThh:mm:ss.sTZD).
LastModified *string
// The status of the last update that was performed on the function. This is first
// set to Successful after function creation completes.
LastUpdateStatus LastUpdateStatus
// The reason for the last update that was performed on the function.
LastUpdateStatusReason *string
// The reason code for the last update that was performed on the function.
LastUpdateStatusReasonCode LastUpdateStatusReasonCode
// The function's layers (https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)
// .
Layers []Layer
// For Lambda@Edge functions, the ARN of the main function.
MasterArn *string
// The amount of memory available to the function at runtime.
MemorySize *int32
// The type of deployment package. Set to Image for container image and set Zip
// for .zip file archive.
PackageType PackageType
// The latest updated revision of the function or alias.
RevisionId *string
// The function's execution role.
Role *string
// The identifier of the function's runtime (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)
// . Runtime is required if the deployment package is a .zip file archive. The
// following list includes deprecated runtimes. For more information, see Runtime
// deprecation policy (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy)
// .
Runtime Runtime
// The ARN of the runtime and any errors that occured.
RuntimeVersionConfig *RuntimeVersionConfig
// The ARN of the signing job.
SigningJobArn *string
// The ARN of the signing profile version.
SigningProfileVersionArn *string
// Set ApplyOn to PublishedVersions to create a snapshot of the initialized
// execution environment when you publish a function version. For more information,
// see Improving startup performance with Lambda SnapStart (https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html)
// .
SnapStart *SnapStartResponse
// The current state of the function. When the state is Inactive , you can
// reactivate the function by invoking it.
State State
// The reason for the function's current state.
StateReason *string
// The reason code for the function's current state. When the code is Creating ,
// you can't invoke or modify the function.
StateReasonCode StateReasonCode
// The amount of time in seconds that Lambda allows a function to run before
// stopping it.
Timeout *int32
// The function's X-Ray tracing configuration.
TracingConfig *TracingConfigResponse
// The version of the Lambda function.
Version *string
// The function's networking configuration.
VpcConfig *VpcConfigResponse
noSmithyDocumentSerde
}
type FunctionEventInvokeConfig struct {
// A destination for events after they have been sent to a function for
// processing. Destinations
// - Function - The Amazon Resource Name (ARN) of a Lambda function.
// - Queue - The ARN of a standard SQS queue.
// - Topic - The ARN of a standard SNS topic.
// - Event Bus - The ARN of an Amazon EventBridge event bus.
DestinationConfig *DestinationConfig
// The Amazon Resource Name (ARN) of the function.
FunctionArn *string
// The date and time that the configuration was last updated.
LastModified *time.Time
// The maximum age of a request that Lambda sends to a function for processing.
MaximumEventAgeInSeconds *int32
// The maximum number of times to retry when the function returns an error.
MaximumRetryAttempts *int32
noSmithyDocumentSerde
}
// Details about a Lambda function URL.
type FunctionUrlConfig struct {
// The type of authentication that your function URL uses. Set to AWS_IAM if you
// want to restrict access to authenticated users only. Set to NONE if you want to
// bypass IAM authentication to create a public endpoint. For more information, see
// Security and auth model for Lambda function URLs (https://docs.aws.amazon.com/lambda/latest/dg/urls-auth.html)
// .
//
// This member is required.
AuthType FunctionUrlAuthType
// When the function URL was created, in ISO-8601 format (https://www.w3.org/TR/NOTE-datetime)
// (YYYY-MM-DDThh:mm:ss.sTZD).
//
// This member is required.
CreationTime *string
// The Amazon Resource Name (ARN) of your function.
//
// This member is required.
FunctionArn *string
// The HTTP URL endpoint for your function.
//
// This member is required.
FunctionUrl *string
// When the function URL configuration was last updated, in ISO-8601 format (https://www.w3.org/TR/NOTE-datetime)
// (YYYY-MM-DDThh:mm:ss.sTZD).
//
// This member is required.
LastModifiedTime *string
// The cross-origin resource sharing (CORS) (https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)
// settings for your function URL.
Cors *Cors
// Use one of the following options:
// - BUFFERED – This is the default option. Lambda invokes your function using
// the Invoke API operation. Invocation results are available when the payload is
// complete. The maximum payload size is 6 MB.
// - RESPONSE_STREAM – Your function streams payload results as they become
// available. Lambda invokes your function using the InvokeWithResponseStream API
// operation. The maximum response payload size is 20 MB, however, you can
// request a quota increase (https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html)
// .
InvokeMode InvokeMode
noSmithyDocumentSerde
}
// Configuration values that override the container image Dockerfile settings. For
// more information, see Container image settings (https://docs.aws.amazon.com/lambda/latest/dg/images-create.html#images-parms)
// .
type ImageConfig struct {
// Specifies parameters that you want to pass in with ENTRYPOINT.
Command []string
// Specifies the entry point to their application, which is typically the location
// of the runtime executable.
EntryPoint []string
// Specifies the working directory.
WorkingDirectory *string
noSmithyDocumentSerde
}
// Error response to GetFunctionConfiguration .
type ImageConfigError struct {
// Error code.
ErrorCode *string
// Error message.
Message *string
noSmithyDocumentSerde
}
// Response to a GetFunctionConfiguration request.
type ImageConfigResponse struct {
// Error response to GetFunctionConfiguration .
Error *ImageConfigError
// Configuration values that override the container image Dockerfile.
ImageConfig *ImageConfig
noSmithyDocumentSerde
}
// A chunk of the streamed response payload.
type InvokeResponseStreamUpdate struct {
// Data returned by your Lambda function.
Payload []byte
noSmithyDocumentSerde
}
// A response confirming that the event stream is complete.
type InvokeWithResponseStreamCompleteEvent struct {
// An error code.
ErrorCode *string
// The details of any returned error.
ErrorDetails *string
// The last 4 KB of the execution log, which is base64-encoded.
LogResult *string
noSmithyDocumentSerde
}
// An object that includes a chunk of the response payload. When the stream has
// ended, Lambda includes a InvokeComplete object.
//
// The following types satisfy this interface:
//
// InvokeWithResponseStreamResponseEventMemberInvokeComplete
// InvokeWithResponseStreamResponseEventMemberPayloadChunk
type InvokeWithResponseStreamResponseEvent interface {
isInvokeWithResponseStreamResponseEvent()
}
// An object that's returned when the stream has ended and all the payload chunks
// have been returned.
type InvokeWithResponseStreamResponseEventMemberInvokeComplete struct {
Value InvokeWithResponseStreamCompleteEvent
noSmithyDocumentSerde
}
func (*InvokeWithResponseStreamResponseEventMemberInvokeComplete) isInvokeWithResponseStreamResponseEvent() {
}
// A chunk of the streamed response payload.
type InvokeWithResponseStreamResponseEventMemberPayloadChunk struct {
Value InvokeResponseStreamUpdate
noSmithyDocumentSerde
}
func (*InvokeWithResponseStreamResponseEventMemberPayloadChunk) isInvokeWithResponseStreamResponseEvent() {
}
// An Lambda layer (https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)
// .
type Layer struct {
// The Amazon Resource Name (ARN) of the function layer.
Arn *string
// The size of the layer archive in bytes.
CodeSize int64
// The Amazon Resource Name (ARN) of a signing job.
SigningJobArn *string
// The Amazon Resource Name (ARN) for a signing profile version.
SigningProfileVersionArn *string
noSmithyDocumentSerde
}
// Details about an Lambda layer (https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)
// .
type LayersListItem struct {
// The newest version of the layer.
LatestMatchingVersion *LayerVersionsListItem
// The Amazon Resource Name (ARN) of the function layer.
LayerArn *string
// The name of the layer.
LayerName *string
noSmithyDocumentSerde
}
// A ZIP archive that contains the contents of an Lambda layer (https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)
// . You can specify either an Amazon S3 location, or upload a layer archive
// directly.
type LayerVersionContentInput struct {
// The Amazon S3 bucket of the layer archive.
S3Bucket *string
// The Amazon S3 key of the layer archive.
S3Key *string
// For versioned objects, the version of the layer archive object to use.
S3ObjectVersion *string
// The base64-encoded contents of the layer archive. Amazon Web Services SDK and
// Amazon Web Services CLI clients handle the encoding for you.
ZipFile []byte
noSmithyDocumentSerde
}
// Details about a version of an Lambda layer (https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)
// .
type LayerVersionContentOutput struct {
// The SHA-256 hash of the layer archive.
CodeSha256 *string
// The size of the layer archive in bytes.
CodeSize int64
// A link to the layer archive in Amazon S3 that is valid for 10 minutes.
Location *string
// The Amazon Resource Name (ARN) of a signing job.
SigningJobArn *string
// The Amazon Resource Name (ARN) for a signing profile version.
SigningProfileVersionArn *string
noSmithyDocumentSerde
}
// Details about a version of an Lambda layer (https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html)
// .
type LayerVersionsListItem struct {
// A list of compatible instruction set architectures (https://docs.aws.amazon.com/lambda/latest/dg/foundation-arch.html)
// .
CompatibleArchitectures []Architecture
// The layer's compatible runtimes. The following list includes deprecated
// runtimes. For more information, see Runtime deprecation policy (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtime-support-policy)
// .
CompatibleRuntimes []Runtime
// The date that the version was created, in ISO 8601 format. For example,
// 2018-11-27T15:10:45.123+0000 .
CreatedDate *string
// The description of the version.
Description *string
// The ARN of the layer version.
LayerVersionArn *string
// The layer's open-source license.
LicenseInfo *string
// The version number.
Version int64
noSmithyDocumentSerde
}
// A destination for events that failed processing.
type OnFailure struct {
// The Amazon Resource Name (ARN) of the destination resource.
Destination *string
noSmithyDocumentSerde
}
// A destination for events that were processed successfully.
type OnSuccess struct {
// The Amazon Resource Name (ARN) of the destination resource.
Destination *string
noSmithyDocumentSerde
}
// Details about the provisioned concurrency configuration for a function alias or
// version.
type ProvisionedConcurrencyConfigListItem struct {
// The amount of provisioned concurrency allocated. When a weighted alias is used
// during linear and canary deployments, this value fluctuates depending on the
// amount of concurrency that is provisioned for the function versions.
AllocatedProvisionedConcurrentExecutions *int32
// The amount of provisioned concurrency available.
AvailableProvisionedConcurrentExecutions *int32
// The Amazon Resource Name (ARN) of the alias or version.
FunctionArn *string
// The date and time that a user last updated the configuration, in ISO 8601 format (https://www.iso.org/iso-8601-date-and-time-format.html)
// .
LastModified *string
// The amount of provisioned concurrency requested.
RequestedProvisionedConcurrentExecutions *int32
// The status of the allocation process.
Status ProvisionedConcurrencyStatusEnum
// For failed allocations, the reason that provisioned concurrency could not be
// allocated.
StatusReason *string
noSmithyDocumentSerde
}
// The ARN of the runtime and any errors that occured.
type RuntimeVersionConfig struct {
// Error response when Lambda is unable to retrieve the runtime version for a
// function.
Error *RuntimeVersionError
// The ARN of the runtime version you want the function to use.
RuntimeVersionArn *string
noSmithyDocumentSerde
}
// Any error returned when the runtime version information for the function could
// not be retrieved.
type RuntimeVersionError struct {
// The error code.
ErrorCode *string
// The error message.
Message *string
noSmithyDocumentSerde
}
// (Amazon SQS only) The scaling configuration for the event source. To remove the
// configuration, pass an empty value.
type ScalingConfig struct {
// Limits the number of concurrent instances that the Amazon SQS event source can
// invoke.
MaximumConcurrency *int32
noSmithyDocumentSerde
}
// The self-managed Apache Kafka cluster for your event source.
type SelfManagedEventSource struct {
// The list of bootstrap servers for your Kafka brokers in the following format:
// "KAFKA_BOOTSTRAP_SERVERS": ["abc.xyz.com:xxxx","abc2.xyz.com:xxxx"] .
Endpoints map[string][]string
noSmithyDocumentSerde
}
// Specific configuration settings for a self-managed Apache Kafka event source.
type SelfManagedKafkaEventSourceConfig struct {
// The identifier for the Kafka consumer group to join. The consumer group ID must
// be unique among all your Kafka event sources. After creating a Kafka event
// source mapping with the consumer group ID specified, you cannot update this
// value. For more information, see Customizable consumer group ID (https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-consumer-group-id)
// .
ConsumerGroupId *string
noSmithyDocumentSerde
}
// The function's Lambda SnapStart (https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html)
// setting. Set ApplyOn to PublishedVersions to create a snapshot of the
// initialized execution environment when you publish a function version.
type SnapStart struct {
// Set to PublishedVersions to create a snapshot of the initialized execution
// environment when you publish a function version.
ApplyOn SnapStartApplyOn
noSmithyDocumentSerde
}
// The function's SnapStart (https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html)
// setting.
type SnapStartResponse struct {
// When set to PublishedVersions , Lambda creates a snapshot of the execution
// environment when you publish a function version.
ApplyOn SnapStartApplyOn
// When you provide a qualified Amazon Resource Name (ARN) (https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html#versioning-versions-using)
// , this response element indicates whether SnapStart is activated for the
// specified function version.
OptimizationStatus SnapStartOptimizationStatus
noSmithyDocumentSerde
}
// To secure and define access to your event source, you can specify the
// authentication protocol, VPC components, or virtual host.
type SourceAccessConfiguration struct {
// The type of authentication protocol, VPC components, or virtual host for your
// event source. For example: "Type":"SASL_SCRAM_512_AUTH" .
// - BASIC_AUTH – (Amazon MQ) The Secrets Manager secret that stores your broker
// credentials.
// - BASIC_AUTH – (Self-managed Apache Kafka) The Secrets Manager ARN of your
// secret key used for SASL/PLAIN authentication of your Apache Kafka brokers.
// - VPC_SUBNET – (Self-managed Apache Kafka) The subnets associated with your
// VPC. Lambda connects to these subnets to fetch data from your self-managed
// Apache Kafka cluster.
// - VPC_SECURITY_GROUP – (Self-managed Apache Kafka) The VPC security group used
// to manage access to your self-managed Apache Kafka brokers.
// - SASL_SCRAM_256_AUTH – (Self-managed Apache Kafka) The Secrets Manager ARN of
// your secret key used for SASL SCRAM-256 authentication of your self-managed
// Apache Kafka brokers.
// - SASL_SCRAM_512_AUTH – (Amazon MSK, Self-managed Apache Kafka) The Secrets
// Manager ARN of your secret key used for SASL SCRAM-512 authentication of your
// self-managed Apache Kafka brokers.
// - VIRTUAL_HOST –- (RabbitMQ) The name of the virtual host in your RabbitMQ
// broker. Lambda uses this RabbitMQ host as the event source. This property cannot
// be specified in an UpdateEventSourceMapping API call.
// - CLIENT_CERTIFICATE_TLS_AUTH – (Amazon MSK, self-managed Apache Kafka) The
// Secrets Manager ARN of your secret key containing the certificate chain (X.509
// PEM), private key (PKCS#8 PEM), and private key password (optional) used for
// mutual TLS authentication of your MSK/Apache Kafka brokers.
// - SERVER_ROOT_CA_CERTIFICATE – (Self-managed Apache Kafka) The Secrets Manager
// ARN of your secret key containing the root CA certificate (X.509 PEM) used for
// TLS encryption of your Apache Kafka brokers.
Type SourceAccessType
// The value for your chosen configuration in Type . For example: "URI":
// "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName" .
URI *string
noSmithyDocumentSerde
}
// The function's X-Ray (https://docs.aws.amazon.com/lambda/latest/dg/services-xray.html)
// tracing configuration. To sample and record incoming requests, set Mode to
// Active .
type TracingConfig struct {
// The tracing mode.
Mode TracingMode
noSmithyDocumentSerde
}
// The function's X-Ray tracing configuration.
type TracingConfigResponse struct {
// The tracing mode.
Mode TracingMode
noSmithyDocumentSerde
}
// The VPC security groups and subnets that are attached to a Lambda function. For
// more information, see Configuring a Lambda function to access resources in a VPC (https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html)
// .
type VpcConfig struct {
// A list of VPC security group IDs.
SecurityGroupIds []string
// A list of VPC subnet IDs.
SubnetIds []string
noSmithyDocumentSerde
}
// The VPC security groups and subnets that are attached to a Lambda function.
type VpcConfigResponse struct {
// A list of VPC security group IDs.
SecurityGroupIds []string
// A list of VPC subnet IDs.
SubnetIds []string
// The ID of the VPC.
VpcId *string
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
// UnknownUnionMember is returned when a union member is returned over the wire,
// but has an unknown tag.
type UnknownUnionMember struct {
Tag string
Value []byte
noSmithyDocumentSerde
}
func (*UnknownUnionMember) isInvokeWithResponseStreamResponseEvent() {}
| 1,173 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types_test
import (
"fmt"
"github.com/aws/aws-sdk-go-v2/service/lambda/types"
)
func ExampleInvokeWithResponseStreamResponseEvent_outputUsage() {
var union types.InvokeWithResponseStreamResponseEvent
// type switches can be used to check the union value
switch v := union.(type) {
case *types.InvokeWithResponseStreamResponseEventMemberInvokeComplete:
_ = v.Value // Value is types.InvokeWithResponseStreamCompleteEvent
case *types.InvokeWithResponseStreamResponseEventMemberPayloadChunk:
_ = v.Value // Value is types.InvokeResponseStreamUpdate
case *types.UnknownUnionMember:
fmt.Println("unknown tag:", v.Tag)
default:
fmt.Println("union is nil or unknown type")
}
}
var _ *types.InvokeWithResponseStreamCompleteEvent
var _ *types.InvokeResponseStreamUpdate
| 31 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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 = "Lex Model Building Service"
const ServiceAPIVersion = "2017-04-19"
// Client provides the API client to make operations call for Amazon Lex Model
// Building Service.
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, "lexmodelbuildingservice", 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 lexmodelbuildingservice
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 lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates a new version of the bot based on the $LATEST version. If the $LATEST
// version of this resource hasn't changed since you created the last version,
// Amazon Lex doesn't create a new version. It returns the last created version.
// You can update only the $LATEST version of the bot. You can't update the
// numbered versions that you create with the CreateBotVersion operation. When you
// create the first version of a bot, Amazon Lex sets the version to 1. Subsequent
// versions increment by 1. For more information, see versioning-intro . This
// operation requires permission for the lex:CreateBotVersion action.
func (c *Client) CreateBotVersion(ctx context.Context, params *CreateBotVersionInput, optFns ...func(*Options)) (*CreateBotVersionOutput, error) {
if params == nil {
params = &CreateBotVersionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateBotVersion", params, optFns, c.addOperationCreateBotVersionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateBotVersionOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateBotVersionInput struct {
// The name of the bot that you want to create a new version of. The name is case
// sensitive.
//
// This member is required.
Name *string
// Identifies a specific revision of the $LATEST version of the bot. If you
// specify a checksum and the $LATEST version of the bot has a different checksum,
// a PreconditionFailedException exception is returned and Amazon Lex doesn't
// publish a new version. If you don't specify a checksum, Amazon Lex publishes the
// $LATEST version.
Checksum *string
noSmithyDocumentSerde
}
type CreateBotVersionOutput struct {
// The message that Amazon Lex uses to cancel a conversation. For more
// information, see PutBot .
AbortStatement *types.Statement
// Checksum identifying the version of the bot that was created.
Checksum *string
// For each Amazon Lex bot created with the Amazon Lex Model Building Service, you
// must specify whether your use of Amazon Lex is related to a website, program, or
// other application that is directed or targeted, in whole or in part, to children
// under age 13 and subject to the Children's Online Privacy Protection Act (COPPA)
// by specifying true or false in the childDirected field. By specifying true in
// the childDirected field, you confirm that your use of Amazon Lex is related to
// a website, program, or other application that is directed or targeted, in whole
// or in part, to children under age 13 and subject to COPPA. By specifying false
// in the childDirected field, you confirm that your use of Amazon Lex is not
// related to a website, program, or other application that is directed or
// targeted, in whole or in part, to children under age 13 and subject to COPPA.
// You may not specify a default value for the childDirected field that does not
// accurately reflect whether your use of Amazon Lex is related to a website,
// program, or other application that is directed or targeted, in whole or in part,
// to children under age 13 and subject to COPPA. If your use of Amazon Lex relates
// to a website, program, or other application that is directed in whole or in
// part, to children under age 13, you must obtain any required verifiable parental
// consent under COPPA. For information regarding the use of Amazon Lex in
// connection with websites, programs, or other applications that are directed or
// targeted, in whole or in part, to children under age 13, see the Amazon Lex FAQ. (https://aws.amazon.com/lex/faqs#data-security)
ChildDirected *bool
// The message that Amazon Lex uses when it doesn't understand the user's request.
// For more information, see PutBot .
ClarificationPrompt *types.Prompt
// The date when the bot version was created.
CreatedDate *time.Time
// A description of the bot.
Description *string
// Indicates whether utterances entered by the user should be sent to Amazon
// Comprehend for sentiment analysis.
DetectSentiment *bool
// Indicates whether the bot uses accuracy improvements. true indicates that the
// bot is using the improvements, otherwise, false .
EnableModelImprovements *bool
// If status is FAILED , Amazon Lex provides the reason that it failed to build the
// bot.
FailureReason *string
// The maximum time in seconds that Amazon Lex retains the data gathered in a
// conversation. For more information, see PutBot .
IdleSessionTTLInSeconds *int32
// An array of Intent objects. For more information, see PutBot .
Intents []types.Intent
// The date when the $LATEST version of this bot was updated.
LastUpdatedDate *time.Time
// Specifies the target locale for the bot.
Locale types.Locale
// The name of the bot.
Name *string
// When you send a request to create or update a bot, Amazon Lex sets the status
// response element to BUILDING . After Amazon Lex builds the bot, it sets status
// to READY . If Amazon Lex can't build the bot, it sets status to FAILED . Amazon
// Lex returns the reason for the failure in the failureReason response element.
Status types.Status
// The version of the bot.
Version *string
// The Amazon Polly voice ID that Amazon Lex uses for voice interactions with the
// user.
VoiceId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateBotVersionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateBotVersion{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateBotVersion{}, 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 = addOpCreateBotVersionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateBotVersion(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_opCreateBotVersion(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "CreateBotVersion",
}
}
| 218 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates a new version of an intent based on the $LATEST version of the intent.
// If the $LATEST version of this intent hasn't changed since you last updated it,
// Amazon Lex doesn't create a new version. It returns the last version you
// created. You can update only the $LATEST version of the intent. You can't
// update the numbered versions that you create with the CreateIntentVersion
// operation. When you create a version of an intent, Amazon Lex sets the version
// to 1. Subsequent versions increment by 1. For more information, see
// versioning-intro . This operation requires permissions to perform the
// lex:CreateIntentVersion action.
func (c *Client) CreateIntentVersion(ctx context.Context, params *CreateIntentVersionInput, optFns ...func(*Options)) (*CreateIntentVersionOutput, error) {
if params == nil {
params = &CreateIntentVersionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateIntentVersion", params, optFns, c.addOperationCreateIntentVersionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateIntentVersionOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateIntentVersionInput struct {
// The name of the intent that you want to create a new version of. The name is
// case sensitive.
//
// This member is required.
Name *string
// Checksum of the $LATEST version of the intent that should be used to create the
// new version. If you specify a checksum and the $LATEST version of the intent
// has a different checksum, Amazon Lex returns a PreconditionFailedException
// exception and doesn't publish a new version. If you don't specify a checksum,
// Amazon Lex publishes the $LATEST version.
Checksum *string
noSmithyDocumentSerde
}
type CreateIntentVersionOutput struct {
// Checksum of the intent version created.
Checksum *string
// After the Lambda function specified in the fulfillmentActivity field fulfills
// the intent, Amazon Lex conveys this statement to the user.
ConclusionStatement *types.Statement
// If defined, the prompt that Amazon Lex uses to confirm the user's intent before
// fulfilling it.
ConfirmationPrompt *types.Prompt
// The date that the intent was created.
CreatedDate *time.Time
// A description of the intent.
Description *string
// If defined, Amazon Lex invokes this Lambda function for each user input.
DialogCodeHook *types.CodeHook
// If defined, Amazon Lex uses this prompt to solicit additional user activity
// after the intent is fulfilled.
FollowUpPrompt *types.FollowUpPrompt
// Describes how the intent is fulfilled.
FulfillmentActivity *types.FulfillmentActivity
// An array of InputContext objects that lists the contexts that must be active
// for Amazon Lex to choose the intent in a conversation with the user.
InputContexts []types.InputContext
// Configuration information, if any, for connecting an Amazon Kendra index with
// the AMAZON.KendraSearchIntent intent.
KendraConfiguration *types.KendraConfiguration
// The date that the intent was updated.
LastUpdatedDate *time.Time
// The name of the intent.
Name *string
// An array of OutputContext objects that lists the contexts that the intent
// activates when the intent is fulfilled.
OutputContexts []types.OutputContext
// A unique identifier for a built-in intent.
ParentIntentSignature *string
// If the user answers "no" to the question defined in confirmationPrompt , Amazon
// Lex responds with this statement to acknowledge that the intent was canceled.
RejectionStatement *types.Statement
// An array of sample utterances configured for the intent.
SampleUtterances []string
// An array of slot types that defines the information required to fulfill the
// intent.
Slots []types.Slot
// The version number assigned to the new version of the intent.
Version *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateIntentVersionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateIntentVersion{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateIntentVersion{}, 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 = addOpCreateIntentVersionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateIntentVersion(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_opCreateIntentVersion(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "CreateIntentVersion",
}
}
| 201 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates a new version of a slot type based on the $LATEST version of the
// specified slot type. If the $LATEST version of this resource has not changed
// since the last version that you created, Amazon Lex doesn't create a new
// version. It returns the last version that you created. You can update only the
// $LATEST version of a slot type. You can't update the numbered versions that you
// create with the CreateSlotTypeVersion operation. When you create a version of a
// slot type, Amazon Lex sets the version to 1. Subsequent versions increment by 1.
// For more information, see versioning-intro . This operation requires permissions
// for the lex:CreateSlotTypeVersion action.
func (c *Client) CreateSlotTypeVersion(ctx context.Context, params *CreateSlotTypeVersionInput, optFns ...func(*Options)) (*CreateSlotTypeVersionOutput, error) {
if params == nil {
params = &CreateSlotTypeVersionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateSlotTypeVersion", params, optFns, c.addOperationCreateSlotTypeVersionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateSlotTypeVersionOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateSlotTypeVersionInput struct {
// The name of the slot type that you want to create a new version for. The name
// is case sensitive.
//
// This member is required.
Name *string
// Checksum for the $LATEST version of the slot type that you want to publish. If
// you specify a checksum and the $LATEST version of the slot type has a different
// checksum, Amazon Lex returns a PreconditionFailedException exception and
// doesn't publish the new version. If you don't specify a checksum, Amazon Lex
// publishes the $LATEST version.
Checksum *string
noSmithyDocumentSerde
}
type CreateSlotTypeVersionOutput struct {
// Checksum of the $LATEST version of the slot type.
Checksum *string
// The date that the slot type was created.
CreatedDate *time.Time
// A description of the slot type.
Description *string
// A list of EnumerationValue objects that defines the values that the slot type
// can take.
EnumerationValues []types.EnumerationValue
// The date that the slot type was updated. When you create a resource, the
// creation date and last update date are the same.
LastUpdatedDate *time.Time
// The name of the slot type.
Name *string
// The built-in slot type used a the parent of the slot type.
ParentSlotTypeSignature *string
// Configuration information that extends the parent built-in slot type.
SlotTypeConfigurations []types.SlotTypeConfiguration
// The strategy that Amazon Lex uses to determine the value of the slot. For more
// information, see PutSlotType .
ValueSelectionStrategy types.SlotValueSelectionStrategy
// The version assigned to the new slot type version.
Version *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateSlotTypeVersionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateSlotTypeVersion{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateSlotTypeVersion{}, 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 = addOpCreateSlotTypeVersionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSlotTypeVersion(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_opCreateSlotTypeVersion(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "CreateSlotTypeVersion",
}
}
| 172 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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 all versions of the bot, including the $LATEST version. To delete a
// specific version of the bot, use the DeleteBotVersion operation. The DeleteBot
// operation doesn't immediately remove the bot schema. Instead, it is marked for
// deletion and removed later. Amazon Lex stores utterances indefinitely for
// improving the ability of your bot to respond to user inputs. These utterances
// are not removed when the bot is deleted. To remove the utterances, use the
// DeleteUtterances operation. If a bot has an alias, you can't delete it. Instead,
// the DeleteBot operation returns a ResourceInUseException exception that
// includes a reference to the alias that refers to the bot. To remove the
// reference to the bot, delete the alias. If you get the same exception again,
// delete the referring alias until the DeleteBot operation is successful. This
// operation requires permissions for the lex:DeleteBot action.
func (c *Client) DeleteBot(ctx context.Context, params *DeleteBotInput, optFns ...func(*Options)) (*DeleteBotOutput, error) {
if params == nil {
params = &DeleteBotInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteBot", params, optFns, c.addOperationDeleteBotMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteBotOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteBotInput struct {
// The name of the bot. The name is case sensitive.
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
type DeleteBotOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteBotMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteBot{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteBot{}, 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 = addOpDeleteBotValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteBot(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_opDeleteBot(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DeleteBot",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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 alias for the specified bot. You can't delete an alias that is used
// in the association between a bot and a messaging channel. If an alias is used in
// a channel association, the DeleteBot operation returns a ResourceInUseException
// exception that includes a reference to the channel association that refers to
// the bot. You can remove the reference to the alias by deleting the channel
// association. If you get the same exception again, delete the referring
// association until the DeleteBotAlias operation is successful.
func (c *Client) DeleteBotAlias(ctx context.Context, params *DeleteBotAliasInput, optFns ...func(*Options)) (*DeleteBotAliasOutput, error) {
if params == nil {
params = &DeleteBotAliasInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteBotAlias", params, optFns, c.addOperationDeleteBotAliasMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteBotAliasOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteBotAliasInput struct {
// The name of the bot that the alias points to.
//
// This member is required.
BotName *string
// The name of the alias to delete. The name is case sensitive.
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
type DeleteBotAliasOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteBotAliasMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteBotAlias{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteBotAlias{}, 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 = addOpDeleteBotAliasValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteBotAlias(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_opDeleteBotAlias(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DeleteBotAlias",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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 the association between an Amazon Lex bot and a messaging platform.
// This operation requires permission for the lex:DeleteBotChannelAssociation
// action.
func (c *Client) DeleteBotChannelAssociation(ctx context.Context, params *DeleteBotChannelAssociationInput, optFns ...func(*Options)) (*DeleteBotChannelAssociationOutput, error) {
if params == nil {
params = &DeleteBotChannelAssociationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteBotChannelAssociation", params, optFns, c.addOperationDeleteBotChannelAssociationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteBotChannelAssociationOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteBotChannelAssociationInput struct {
// An alias that points to the specific version of the Amazon Lex bot to which
// this association is being made.
//
// This member is required.
BotAlias *string
// The name of the Amazon Lex bot.
//
// This member is required.
BotName *string
// The name of the association. The name is case sensitive.
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
type DeleteBotChannelAssociationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteBotChannelAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteBotChannelAssociation{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteBotChannelAssociation{}, 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 = addOpDeleteBotChannelAssociationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteBotChannelAssociation(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_opDeleteBotChannelAssociation(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DeleteBotChannelAssociation",
}
}
| 133 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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 specific version of a bot. To delete all versions of a bot, use the
// DeleteBot operation. This operation requires permissions for the
// lex:DeleteBotVersion action.
func (c *Client) DeleteBotVersion(ctx context.Context, params *DeleteBotVersionInput, optFns ...func(*Options)) (*DeleteBotVersionOutput, error) {
if params == nil {
params = &DeleteBotVersionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteBotVersion", params, optFns, c.addOperationDeleteBotVersionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteBotVersionOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteBotVersionInput struct {
// The name of the bot.
//
// This member is required.
Name *string
// The version of the bot to delete. You cannot delete the $LATEST version of the
// bot. To delete the $LATEST version, use the DeleteBot operation.
//
// This member is required.
Version *string
noSmithyDocumentSerde
}
type DeleteBotVersionOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteBotVersionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteBotVersion{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteBotVersion{}, 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 = addOpDeleteBotVersionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteBotVersion(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_opDeleteBotVersion(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DeleteBotVersion",
}
}
| 128 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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 all versions of the intent, including the $LATEST version. To delete a
// specific version of the intent, use the DeleteIntentVersion operation. You can
// delete a version of an intent only if it is not referenced. To delete an intent
// that is referred to in one or more bots (see how-it-works ), you must remove
// those references first. If you get the ResourceInUseException exception, it
// provides an example reference that shows where the intent is referenced. To
// remove the reference to the intent, either update the bot or delete it. If you
// get the same exception when you attempt to delete the intent again, repeat until
// the intent has no references and the call to DeleteIntent is successful. This
// operation requires permission for the lex:DeleteIntent action.
func (c *Client) DeleteIntent(ctx context.Context, params *DeleteIntentInput, optFns ...func(*Options)) (*DeleteIntentOutput, error) {
if params == nil {
params = &DeleteIntentInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteIntent", params, optFns, c.addOperationDeleteIntentMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteIntentOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteIntentInput struct {
// The name of the intent. The name is case sensitive.
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
type DeleteIntentOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteIntentMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteIntent{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteIntent{}, 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 = addOpDeleteIntentValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteIntent(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_opDeleteIntent(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DeleteIntent",
}
}
| 129 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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 specific version of an intent. To delete all versions of a intent,
// use the DeleteIntent operation. This operation requires permissions for the
// lex:DeleteIntentVersion action.
func (c *Client) DeleteIntentVersion(ctx context.Context, params *DeleteIntentVersionInput, optFns ...func(*Options)) (*DeleteIntentVersionOutput, error) {
if params == nil {
params = &DeleteIntentVersionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteIntentVersion", params, optFns, c.addOperationDeleteIntentVersionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteIntentVersionOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteIntentVersionInput struct {
// The name of the intent.
//
// This member is required.
Name *string
// The version of the intent to delete. You cannot delete the $LATEST version of
// the intent. To delete the $LATEST version, use the DeleteIntent operation.
//
// This member is required.
Version *string
noSmithyDocumentSerde
}
type DeleteIntentVersionOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteIntentVersionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteIntentVersion{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteIntentVersion{}, 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 = addOpDeleteIntentVersionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteIntentVersion(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_opDeleteIntentVersion(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DeleteIntentVersion",
}
}
| 128 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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 all versions of the slot type, including the $LATEST version. To delete
// a specific version of the slot type, use the DeleteSlotTypeVersion operation.
// You can delete a version of a slot type only if it is not referenced. To delete
// a slot type that is referred to in one or more intents, you must remove those
// references first. If you get the ResourceInUseException exception, the
// exception provides an example reference that shows the intent where the slot
// type is referenced. To remove the reference to the slot type, either update the
// intent or delete it. If you get the same exception when you attempt to delete
// the slot type again, repeat until the slot type has no references and the
// DeleteSlotType call is successful. This operation requires permission for the
// lex:DeleteSlotType action.
func (c *Client) DeleteSlotType(ctx context.Context, params *DeleteSlotTypeInput, optFns ...func(*Options)) (*DeleteSlotTypeOutput, error) {
if params == nil {
params = &DeleteSlotTypeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteSlotType", params, optFns, c.addOperationDeleteSlotTypeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteSlotTypeOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteSlotTypeInput struct {
// The name of the slot type. The name is case sensitive.
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
type DeleteSlotTypeOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteSlotTypeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteSlotType{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteSlotType{}, 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 = addOpDeleteSlotTypeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSlotType(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_opDeleteSlotType(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DeleteSlotType",
}
}
| 130 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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 specific version of a slot type. To delete all versions of a slot
// type, use the DeleteSlotType operation. This operation requires permissions for
// the lex:DeleteSlotTypeVersion action.
func (c *Client) DeleteSlotTypeVersion(ctx context.Context, params *DeleteSlotTypeVersionInput, optFns ...func(*Options)) (*DeleteSlotTypeVersionOutput, error) {
if params == nil {
params = &DeleteSlotTypeVersionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteSlotTypeVersion", params, optFns, c.addOperationDeleteSlotTypeVersionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteSlotTypeVersionOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteSlotTypeVersionInput struct {
// The name of the slot type.
//
// This member is required.
Name *string
// The version of the slot type to delete. You cannot delete the $LATEST version
// of the slot type. To delete the $LATEST version, use the DeleteSlotType
// operation.
//
// This member is required.
Version *string
noSmithyDocumentSerde
}
type DeleteSlotTypeVersionOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteSlotTypeVersionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteSlotTypeVersion{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteSlotTypeVersion{}, 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 = addOpDeleteSlotTypeVersionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSlotTypeVersion(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_opDeleteSlotTypeVersion(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DeleteSlotTypeVersion",
}
}
| 129 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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 stored utterances. Amazon Lex stores the utterances that users send to
// your bot. Utterances are stored for 15 days for use with the GetUtterancesView
// operation, and then stored indefinitely for use in improving the ability of your
// bot to respond to user input. Use the DeleteUtterances operation to manually
// delete stored utterances for a specific user. When you use the DeleteUtterances
// operation, utterances stored for improving your bot's ability to respond to user
// input are deleted immediately. Utterances stored for use with the
// GetUtterancesView operation are deleted after 15 days. This operation requires
// permissions for the lex:DeleteUtterances action.
func (c *Client) DeleteUtterances(ctx context.Context, params *DeleteUtterancesInput, optFns ...func(*Options)) (*DeleteUtterancesOutput, error) {
if params == nil {
params = &DeleteUtterancesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteUtterances", params, optFns, c.addOperationDeleteUtterancesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteUtterancesOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteUtterancesInput struct {
// The name of the bot that stored the utterances.
//
// This member is required.
BotName *string
// The unique identifier for the user that made the utterances. This is the user
// ID that was sent in the PostContent (http://docs.aws.amazon.com/lex/latest/dg/API_runtime_PostContent.html)
// or PostText (http://docs.aws.amazon.com/lex/latest/dg/API_runtime_PostText.html)
// operation request that contained the utterance.
//
// This member is required.
UserId *string
noSmithyDocumentSerde
}
type DeleteUtterancesOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteUtterancesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteUtterances{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteUtterances{}, 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 = addOpDeleteUtterancesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteUtterances(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_opDeleteUtterances(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "DeleteUtterances",
}
}
| 136 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Returns metadata information for a specific bot. You must provide the bot name
// and the bot version or alias. This operation requires permissions for the
// lex:GetBot action.
func (c *Client) GetBot(ctx context.Context, params *GetBotInput, optFns ...func(*Options)) (*GetBotOutput, error) {
if params == nil {
params = &GetBotInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetBot", params, optFns, c.addOperationGetBotMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetBotOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetBotInput struct {
// The name of the bot. The name is case sensitive.
//
// This member is required.
Name *string
// The version or alias of the bot.
//
// This member is required.
VersionOrAlias *string
noSmithyDocumentSerde
}
type GetBotOutput struct {
// The message that Amazon Lex returns when the user elects to end the
// conversation without completing it. For more information, see PutBot .
AbortStatement *types.Statement
// Checksum of the bot used to identify a specific revision of the bot's $LATEST
// version.
Checksum *string
// For each Amazon Lex bot created with the Amazon Lex Model Building Service, you
// must specify whether your use of Amazon Lex is related to a website, program, or
// other application that is directed or targeted, in whole or in part, to children
// under age 13 and subject to the Children's Online Privacy Protection Act (COPPA)
// by specifying true or false in the childDirected field. By specifying true in
// the childDirected field, you confirm that your use of Amazon Lex is related to
// a website, program, or other application that is directed or targeted, in whole
// or in part, to children under age 13 and subject to COPPA. By specifying false
// in the childDirected field, you confirm that your use of Amazon Lex is not
// related to a website, program, or other application that is directed or
// targeted, in whole or in part, to children under age 13 and subject to COPPA.
// You may not specify a default value for the childDirected field that does not
// accurately reflect whether your use of Amazon Lex is related to a website,
// program, or other application that is directed or targeted, in whole or in part,
// to children under age 13 and subject to COPPA. If your use of Amazon Lex relates
// to a website, program, or other application that is directed in whole or in
// part, to children under age 13, you must obtain any required verifiable parental
// consent under COPPA. For information regarding the use of Amazon Lex in
// connection with websites, programs, or other applications that are directed or
// targeted, in whole or in part, to children under age 13, see the Amazon Lex FAQ. (https://aws.amazon.com/lex/faqs#data-security)
ChildDirected *bool
// The message Amazon Lex uses when it doesn't understand the user's request. For
// more information, see PutBot .
ClarificationPrompt *types.Prompt
// The date that the bot was created.
CreatedDate *time.Time
// A description of the bot.
Description *string
// Indicates whether user utterances should be sent to Amazon Comprehend for
// sentiment analysis.
DetectSentiment *bool
// Indicates whether the bot uses accuracy improvements. true indicates that the
// bot is using the improvements, otherwise, false .
EnableModelImprovements *bool
// If status is FAILED , Amazon Lex explains why it failed to build the bot.
FailureReason *string
// The maximum time in seconds that Amazon Lex retains the data gathered in a
// conversation. For more information, see PutBot .
IdleSessionTTLInSeconds *int32
// An array of intent objects. For more information, see PutBot .
Intents []types.Intent
// The date that the bot was updated. When you create a resource, the creation
// date and last updated date are the same.
LastUpdatedDate *time.Time
// The target locale for the bot.
Locale types.Locale
// The name of the bot.
Name *string
// The score that determines where Amazon Lex inserts the AMAZON.FallbackIntent ,
// AMAZON.KendraSearchIntent , or both when returning alternative intents in a
// PostContent (https://docs.aws.amazon.com/lex/latest/dg/API_runtime_PostContent.html)
// or PostText (https://docs.aws.amazon.com/lex/latest/dg/API_runtime_PostText.html)
// response. AMAZON.FallbackIntent is inserted if the confidence score for all
// intents is below this value. AMAZON.KendraSearchIntent is only inserted if it
// is configured for the bot.
NluIntentConfidenceThreshold *float64
// The status of the bot. When the status is BUILDING Amazon Lex is building the
// bot for testing and use. If the status of the bot is READY_BASIC_TESTING , you
// can test the bot using the exact utterances specified in the bot's intents. When
// the bot is ready for full testing or to run, the status is READY . If there was
// a problem with building the bot, the status is FAILED and the failureReason
// field explains why the bot did not build. If the bot was saved but not built,
// the status is NOT_BUILT .
Status types.Status
// The version of the bot. For a new bot, the version is always $LATEST .
Version *string
// The Amazon Polly voice ID that Amazon Lex uses for voice interaction with the
// user. For more information, see PutBot .
VoiceId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetBotMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetBot{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetBot{}, 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 = addOpGetBotValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetBot(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_opGetBot(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "GetBot",
}
}
| 223 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Returns information about an Amazon Lex bot alias. For more information about
// aliases, see versioning-aliases . This operation requires permissions for the
// lex:GetBotAlias action.
func (c *Client) GetBotAlias(ctx context.Context, params *GetBotAliasInput, optFns ...func(*Options)) (*GetBotAliasOutput, error) {
if params == nil {
params = &GetBotAliasInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetBotAlias", params, optFns, c.addOperationGetBotAliasMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetBotAliasOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetBotAliasInput struct {
// The name of the bot.
//
// This member is required.
BotName *string
// The name of the bot alias. The name is case sensitive.
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
type GetBotAliasOutput struct {
// The name of the bot that the alias points to.
BotName *string
// The version of the bot that the alias points to.
BotVersion *string
// Checksum of the bot alias.
Checksum *string
// The settings that determine how Amazon Lex uses conversation logs for the alias.
ConversationLogs *types.ConversationLogsResponse
// The date that the bot alias was created.
CreatedDate *time.Time
// A description of the bot alias.
Description *string
// The date that the bot alias was updated. When you create a resource, the
// creation date and the last updated date are the same.
LastUpdatedDate *time.Time
// The name of the bot alias.
Name *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetBotAliasMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetBotAlias{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetBotAlias{}, 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 = addOpGetBotAliasValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetBotAlias(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_opGetBotAlias(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "GetBotAlias",
}
}
| 155 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a list of aliases for a specified Amazon Lex bot. This operation
// requires permissions for the lex:GetBotAliases action.
func (c *Client) GetBotAliases(ctx context.Context, params *GetBotAliasesInput, optFns ...func(*Options)) (*GetBotAliasesOutput, error) {
if params == nil {
params = &GetBotAliasesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetBotAliases", params, optFns, c.addOperationGetBotAliasesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetBotAliasesOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetBotAliasesInput struct {
// The name of the bot.
//
// This member is required.
BotName *string
// The maximum number of aliases to return in the response. The default is 50. .
MaxResults *int32
// Substring to match in bot alias names. An alias will be returned if any part of
// its name matches the substring. For example, "xyz" matches both "xyzabc" and
// "abcxyz."
NameContains *string
// A pagination token for fetching the next page of aliases. If the response to
// this call is truncated, Amazon Lex returns a pagination token in the response.
// To fetch the next page of aliases, specify the pagination token in the next
// request.
NextToken *string
noSmithyDocumentSerde
}
type GetBotAliasesOutput struct {
// An array of BotAliasMetadata objects, each describing a bot alias.
BotAliases []types.BotAliasMetadata
// A pagination token for fetching next page of aliases. If the response to this
// call is truncated, Amazon Lex returns a pagination token in the response. To
// fetch the next page of aliases, specify the pagination token in the next
// request.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetBotAliasesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetBotAliases{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetBotAliases{}, 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 = addOpGetBotAliasesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetBotAliases(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
}
// GetBotAliasesAPIClient is a client that implements the GetBotAliases operation.
type GetBotAliasesAPIClient interface {
GetBotAliases(context.Context, *GetBotAliasesInput, ...func(*Options)) (*GetBotAliasesOutput, error)
}
var _ GetBotAliasesAPIClient = (*Client)(nil)
// GetBotAliasesPaginatorOptions is the paginator options for GetBotAliases
type GetBotAliasesPaginatorOptions struct {
// The maximum number of aliases to return in the response. The default is 50. .
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
}
// GetBotAliasesPaginator is a paginator for GetBotAliases
type GetBotAliasesPaginator struct {
options GetBotAliasesPaginatorOptions
client GetBotAliasesAPIClient
params *GetBotAliasesInput
nextToken *string
firstPage bool
}
// NewGetBotAliasesPaginator returns a new GetBotAliasesPaginator
func NewGetBotAliasesPaginator(client GetBotAliasesAPIClient, params *GetBotAliasesInput, optFns ...func(*GetBotAliasesPaginatorOptions)) *GetBotAliasesPaginator {
if params == nil {
params = &GetBotAliasesInput{}
}
options := GetBotAliasesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &GetBotAliasesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *GetBotAliasesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next GetBotAliases page.
func (p *GetBotAliasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetBotAliasesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.GetBotAliases(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opGetBotAliases(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "GetBotAliases",
}
}
| 236 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Returns information about the association between an Amazon Lex bot and a
// messaging platform. This operation requires permissions for the
// lex:GetBotChannelAssociation action.
func (c *Client) GetBotChannelAssociation(ctx context.Context, params *GetBotChannelAssociationInput, optFns ...func(*Options)) (*GetBotChannelAssociationOutput, error) {
if params == nil {
params = &GetBotChannelAssociationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetBotChannelAssociation", params, optFns, c.addOperationGetBotChannelAssociationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetBotChannelAssociationOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetBotChannelAssociationInput struct {
// An alias pointing to the specific version of the Amazon Lex bot to which this
// association is being made.
//
// This member is required.
BotAlias *string
// The name of the Amazon Lex bot.
//
// This member is required.
BotName *string
// The name of the association between the bot and the channel. The name is case
// sensitive.
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
type GetBotChannelAssociationOutput struct {
// An alias pointing to the specific version of the Amazon Lex bot to which this
// association is being made.
BotAlias *string
// Provides information that the messaging platform needs to communicate with the
// Amazon Lex bot.
BotConfiguration map[string]string
// The name of the Amazon Lex bot.
BotName *string
// The date that the association between the bot and the channel was created.
CreatedDate *time.Time
// A description of the association between the bot and the channel.
Description *string
// If status is FAILED , Amazon Lex provides the reason that it failed to create
// the association.
FailureReason *string
// The name of the association between the bot and the channel.
Name *string
// The status of the bot channel.
// - CREATED - The channel has been created and is ready for use.
// - IN_PROGRESS - Channel creation is in progress.
// - FAILED - There was an error creating the channel. For information about the
// reason for the failure, see the failureReason field.
Status types.ChannelStatus
// The type of the messaging platform.
Type types.ChannelType
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetBotChannelAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetBotChannelAssociation{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetBotChannelAssociation{}, 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 = addOpGetBotChannelAssociationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetBotChannelAssociation(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_opGetBotChannelAssociation(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "GetBotChannelAssociation",
}
}
| 171 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a list of all of the channels associated with the specified bot. The
// GetBotChannelAssociations operation requires permissions for the
// lex:GetBotChannelAssociations action.
func (c *Client) GetBotChannelAssociations(ctx context.Context, params *GetBotChannelAssociationsInput, optFns ...func(*Options)) (*GetBotChannelAssociationsOutput, error) {
if params == nil {
params = &GetBotChannelAssociationsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetBotChannelAssociations", params, optFns, c.addOperationGetBotChannelAssociationsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetBotChannelAssociationsOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetBotChannelAssociationsInput struct {
// An alias pointing to the specific version of the Amazon Lex bot to which this
// association is being made.
//
// This member is required.
BotAlias *string
// The name of the Amazon Lex bot in the association.
//
// This member is required.
BotName *string
// The maximum number of associations to return in the response. The default is 50.
MaxResults *int32
// Substring to match in channel association names. An association will be
// returned if any part of its name matches the substring. For example, "xyz"
// matches both "xyzabc" and "abcxyz." To return all bot channel associations, use
// a hyphen ("-") as the nameContains parameter.
NameContains *string
// A pagination token for fetching the next page of associations. If the response
// to this call is truncated, Amazon Lex returns a pagination token in the
// response. To fetch the next page of associations, specify the pagination token
// in the next request.
NextToken *string
noSmithyDocumentSerde
}
type GetBotChannelAssociationsOutput struct {
// An array of objects, one for each association, that provides information about
// the Amazon Lex bot and its association with the channel.
BotChannelAssociations []types.BotChannelAssociation
// A pagination token that fetches the next page of associations. If the response
// to this call is truncated, Amazon Lex returns a pagination token in the
// response. To fetch the next page of associations, specify the pagination token
// in the next request.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetBotChannelAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetBotChannelAssociations{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetBotChannelAssociations{}, 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 = addOpGetBotChannelAssociationsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetBotChannelAssociations(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
}
// GetBotChannelAssociationsAPIClient is a client that implements the
// GetBotChannelAssociations operation.
type GetBotChannelAssociationsAPIClient interface {
GetBotChannelAssociations(context.Context, *GetBotChannelAssociationsInput, ...func(*Options)) (*GetBotChannelAssociationsOutput, error)
}
var _ GetBotChannelAssociationsAPIClient = (*Client)(nil)
// GetBotChannelAssociationsPaginatorOptions is the paginator options for
// GetBotChannelAssociations
type GetBotChannelAssociationsPaginatorOptions struct {
// The maximum number of associations to return in the response. The default is 50.
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
}
// GetBotChannelAssociationsPaginator is a paginator for GetBotChannelAssociations
type GetBotChannelAssociationsPaginator struct {
options GetBotChannelAssociationsPaginatorOptions
client GetBotChannelAssociationsAPIClient
params *GetBotChannelAssociationsInput
nextToken *string
firstPage bool
}
// NewGetBotChannelAssociationsPaginator returns a new
// GetBotChannelAssociationsPaginator
func NewGetBotChannelAssociationsPaginator(client GetBotChannelAssociationsAPIClient, params *GetBotChannelAssociationsInput, optFns ...func(*GetBotChannelAssociationsPaginatorOptions)) *GetBotChannelAssociationsPaginator {
if params == nil {
params = &GetBotChannelAssociationsInput{}
}
options := GetBotChannelAssociationsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &GetBotChannelAssociationsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *GetBotChannelAssociationsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next GetBotChannelAssociations page.
func (p *GetBotChannelAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetBotChannelAssociationsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.GetBotChannelAssociations(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opGetBotChannelAssociations(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "GetBotChannelAssociations",
}
}
| 248 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns bot information as follows:
// - If you provide the nameContains field, the response includes information for
// the $LATEST version of all bots whose name contains the specified string.
// - If you don't specify the nameContains field, the operation returns
// information about the $LATEST version of all of your bots.
//
// This operation requires permission for the lex:GetBots action.
func (c *Client) GetBots(ctx context.Context, params *GetBotsInput, optFns ...func(*Options)) (*GetBotsOutput, error) {
if params == nil {
params = &GetBotsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetBots", params, optFns, c.addOperationGetBotsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetBotsOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetBotsInput struct {
// The maximum number of bots to return in the response that the request will
// return. The default is 10.
MaxResults *int32
// Substring to match in bot names. A bot will be returned if any part of its name
// matches the substring. For example, "xyz" matches both "xyzabc" and "abcxyz."
NameContains *string
// A pagination token that fetches the next page of bots. If the response to this
// call is truncated, Amazon Lex returns a pagination token in the response. To
// fetch the next page of bots, specify the pagination token in the next request.
NextToken *string
noSmithyDocumentSerde
}
type GetBotsOutput struct {
// An array of botMetadata objects, with one entry for each bot.
Bots []types.BotMetadata
// If the response is truncated, it includes a pagination token that you can
// specify in your next request to fetch the next page of bots.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetBotsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetBots{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetBots{}, 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_opGetBots(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
}
// GetBotsAPIClient is a client that implements the GetBots operation.
type GetBotsAPIClient interface {
GetBots(context.Context, *GetBotsInput, ...func(*Options)) (*GetBotsOutput, error)
}
var _ GetBotsAPIClient = (*Client)(nil)
// GetBotsPaginatorOptions is the paginator options for GetBots
type GetBotsPaginatorOptions struct {
// The maximum number of bots to return in the response that the request will
// return. The default is 10.
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
}
// GetBotsPaginator is a paginator for GetBots
type GetBotsPaginator struct {
options GetBotsPaginatorOptions
client GetBotsAPIClient
params *GetBotsInput
nextToken *string
firstPage bool
}
// NewGetBotsPaginator returns a new GetBotsPaginator
func NewGetBotsPaginator(client GetBotsAPIClient, params *GetBotsInput, optFns ...func(*GetBotsPaginatorOptions)) *GetBotsPaginator {
if params == nil {
params = &GetBotsInput{}
}
options := GetBotsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &GetBotsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *GetBotsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next GetBots page.
func (p *GetBotsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetBotsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.GetBots(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opGetBots(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "GetBots",
}
}
| 231 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets information about all of the versions of a bot. The GetBotVersions
// operation returns a BotMetadata object for each version of a bot. For example,
// if a bot has three numbered versions, the GetBotVersions operation returns four
// BotMetadata objects in the response, one for each numbered version and one for
// the $LATEST version. The GetBotVersions operation always returns at least one
// version, the $LATEST version. This operation requires permissions for the
// lex:GetBotVersions action.
func (c *Client) GetBotVersions(ctx context.Context, params *GetBotVersionsInput, optFns ...func(*Options)) (*GetBotVersionsOutput, error) {
if params == nil {
params = &GetBotVersionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetBotVersions", params, optFns, c.addOperationGetBotVersionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetBotVersionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetBotVersionsInput struct {
// The name of the bot for which versions should be returned.
//
// This member is required.
Name *string
// The maximum number of bot versions to return in the response. The default is 10.
MaxResults *int32
// A pagination token for fetching the next page of bot versions. If the response
// to this call is truncated, Amazon Lex returns a pagination token in the
// response. To fetch the next page of versions, specify the pagination token in
// the next request.
NextToken *string
noSmithyDocumentSerde
}
type GetBotVersionsOutput struct {
// An array of BotMetadata objects, one for each numbered version of the bot plus
// one for the $LATEST version.
Bots []types.BotMetadata
// A pagination token for fetching the next page of bot versions. If the response
// to this call is truncated, Amazon Lex returns a pagination token in the
// response. To fetch the next page of versions, specify the pagination token in
// the next request.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetBotVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetBotVersions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetBotVersions{}, 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 = addOpGetBotVersionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetBotVersions(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
}
// GetBotVersionsAPIClient is a client that implements the GetBotVersions
// operation.
type GetBotVersionsAPIClient interface {
GetBotVersions(context.Context, *GetBotVersionsInput, ...func(*Options)) (*GetBotVersionsOutput, error)
}
var _ GetBotVersionsAPIClient = (*Client)(nil)
// GetBotVersionsPaginatorOptions is the paginator options for GetBotVersions
type GetBotVersionsPaginatorOptions struct {
// The maximum number of bot versions to return in the response. The default is 10.
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
}
// GetBotVersionsPaginator is a paginator for GetBotVersions
type GetBotVersionsPaginator struct {
options GetBotVersionsPaginatorOptions
client GetBotVersionsAPIClient
params *GetBotVersionsInput
nextToken *string
firstPage bool
}
// NewGetBotVersionsPaginator returns a new GetBotVersionsPaginator
func NewGetBotVersionsPaginator(client GetBotVersionsAPIClient, params *GetBotVersionsInput, optFns ...func(*GetBotVersionsPaginatorOptions)) *GetBotVersionsPaginator {
if params == nil {
params = &GetBotVersionsInput{}
}
options := GetBotVersionsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &GetBotVersionsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *GetBotVersionsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next GetBotVersions page.
func (p *GetBotVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetBotVersionsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.GetBotVersions(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opGetBotVersions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "GetBotVersions",
}
}
| 238 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns information about a built-in intent. This operation requires permission
// for the lex:GetBuiltinIntent action.
func (c *Client) GetBuiltinIntent(ctx context.Context, params *GetBuiltinIntentInput, optFns ...func(*Options)) (*GetBuiltinIntentOutput, error) {
if params == nil {
params = &GetBuiltinIntentInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetBuiltinIntent", params, optFns, c.addOperationGetBuiltinIntentMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetBuiltinIntentOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetBuiltinIntentInput struct {
// The unique identifier for a built-in intent. To find the signature for an
// intent, see Standard Built-in Intents (https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/standard-intents)
// in the Alexa Skills Kit.
//
// This member is required.
Signature *string
noSmithyDocumentSerde
}
type GetBuiltinIntentOutput struct {
// The unique identifier for a built-in intent.
Signature *string
// An array of BuiltinIntentSlot objects, one entry for each slot type in the
// intent.
Slots []types.BuiltinIntentSlot
// A list of locales that the intent supports.
SupportedLocales []types.Locale
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetBuiltinIntentMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetBuiltinIntent{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetBuiltinIntent{}, 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 = addOpGetBuiltinIntentValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetBuiltinIntent(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_opGetBuiltinIntent(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "GetBuiltinIntent",
}
}
| 135 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets a list of built-in intents that meet the specified criteria. This
// operation requires permission for the lex:GetBuiltinIntents action.
func (c *Client) GetBuiltinIntents(ctx context.Context, params *GetBuiltinIntentsInput, optFns ...func(*Options)) (*GetBuiltinIntentsOutput, error) {
if params == nil {
params = &GetBuiltinIntentsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetBuiltinIntents", params, optFns, c.addOperationGetBuiltinIntentsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetBuiltinIntentsOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetBuiltinIntentsInput struct {
// A list of locales that the intent supports.
Locale types.Locale
// The maximum number of intents to return in the response. The default is 10.
MaxResults *int32
// A pagination token that fetches the next page of intents. If this API call is
// truncated, Amazon Lex returns a pagination token in the response. To fetch the
// next page of intents, use the pagination token in the next request.
NextToken *string
// Substring to match in built-in intent signatures. An intent will be returned if
// any part of its signature matches the substring. For example, "xyz" matches both
// "xyzabc" and "abcxyz." To find the signature for an intent, see Standard
// Built-in Intents (https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/standard-intents)
// in the Alexa Skills Kit.
SignatureContains *string
noSmithyDocumentSerde
}
type GetBuiltinIntentsOutput struct {
// An array of builtinIntentMetadata objects, one for each intent in the response.
Intents []types.BuiltinIntentMetadata
// A pagination token that fetches the next page of intents. If the response to
// this API call is truncated, Amazon Lex returns a pagination token in the
// response. To fetch the next page of intents, specify the pagination token in the
// next request.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetBuiltinIntentsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetBuiltinIntents{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetBuiltinIntents{}, 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_opGetBuiltinIntents(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
}
// GetBuiltinIntentsAPIClient is a client that implements the GetBuiltinIntents
// operation.
type GetBuiltinIntentsAPIClient interface {
GetBuiltinIntents(context.Context, *GetBuiltinIntentsInput, ...func(*Options)) (*GetBuiltinIntentsOutput, error)
}
var _ GetBuiltinIntentsAPIClient = (*Client)(nil)
// GetBuiltinIntentsPaginatorOptions is the paginator options for GetBuiltinIntents
type GetBuiltinIntentsPaginatorOptions struct {
// The maximum number of intents to return in the response. The default is 10.
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
}
// GetBuiltinIntentsPaginator is a paginator for GetBuiltinIntents
type GetBuiltinIntentsPaginator struct {
options GetBuiltinIntentsPaginatorOptions
client GetBuiltinIntentsAPIClient
params *GetBuiltinIntentsInput
nextToken *string
firstPage bool
}
// NewGetBuiltinIntentsPaginator returns a new GetBuiltinIntentsPaginator
func NewGetBuiltinIntentsPaginator(client GetBuiltinIntentsAPIClient, params *GetBuiltinIntentsInput, optFns ...func(*GetBuiltinIntentsPaginatorOptions)) *GetBuiltinIntentsPaginator {
if params == nil {
params = &GetBuiltinIntentsInput{}
}
options := GetBuiltinIntentsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &GetBuiltinIntentsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *GetBuiltinIntentsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next GetBuiltinIntents page.
func (p *GetBuiltinIntentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetBuiltinIntentsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.GetBuiltinIntents(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opGetBuiltinIntents(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "GetBuiltinIntents",
}
}
| 233 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets a list of built-in slot types that meet the specified criteria. For a list
// of built-in slot types, see Slot Type Reference (https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/slot-type-reference)
// in the Alexa Skills Kit. This operation requires permission for the
// lex:GetBuiltInSlotTypes action.
func (c *Client) GetBuiltinSlotTypes(ctx context.Context, params *GetBuiltinSlotTypesInput, optFns ...func(*Options)) (*GetBuiltinSlotTypesOutput, error) {
if params == nil {
params = &GetBuiltinSlotTypesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetBuiltinSlotTypes", params, optFns, c.addOperationGetBuiltinSlotTypesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetBuiltinSlotTypesOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetBuiltinSlotTypesInput struct {
// A list of locales that the slot type supports.
Locale types.Locale
// The maximum number of slot types to return in the response. The default is 10.
MaxResults *int32
// A pagination token that fetches the next page of slot types. If the response to
// this API call is truncated, Amazon Lex returns a pagination token in the
// response. To fetch the next page of slot types, specify the pagination token in
// the next request.
NextToken *string
// Substring to match in built-in slot type signatures. A slot type will be
// returned if any part of its signature matches the substring. For example, "xyz"
// matches both "xyzabc" and "abcxyz."
SignatureContains *string
noSmithyDocumentSerde
}
type GetBuiltinSlotTypesOutput struct {
// If the response is truncated, the response includes a pagination token that you
// can use in your next request to fetch the next page of slot types.
NextToken *string
// An array of BuiltInSlotTypeMetadata objects, one entry for each slot type
// returned.
SlotTypes []types.BuiltinSlotTypeMetadata
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetBuiltinSlotTypesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetBuiltinSlotTypes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetBuiltinSlotTypes{}, 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_opGetBuiltinSlotTypes(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
}
// GetBuiltinSlotTypesAPIClient is a client that implements the
// GetBuiltinSlotTypes operation.
type GetBuiltinSlotTypesAPIClient interface {
GetBuiltinSlotTypes(context.Context, *GetBuiltinSlotTypesInput, ...func(*Options)) (*GetBuiltinSlotTypesOutput, error)
}
var _ GetBuiltinSlotTypesAPIClient = (*Client)(nil)
// GetBuiltinSlotTypesPaginatorOptions is the paginator options for
// GetBuiltinSlotTypes
type GetBuiltinSlotTypesPaginatorOptions struct {
// The maximum number of slot types to return in the response. The default is 10.
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
}
// GetBuiltinSlotTypesPaginator is a paginator for GetBuiltinSlotTypes
type GetBuiltinSlotTypesPaginator struct {
options GetBuiltinSlotTypesPaginatorOptions
client GetBuiltinSlotTypesAPIClient
params *GetBuiltinSlotTypesInput
nextToken *string
firstPage bool
}
// NewGetBuiltinSlotTypesPaginator returns a new GetBuiltinSlotTypesPaginator
func NewGetBuiltinSlotTypesPaginator(client GetBuiltinSlotTypesAPIClient, params *GetBuiltinSlotTypesInput, optFns ...func(*GetBuiltinSlotTypesPaginatorOptions)) *GetBuiltinSlotTypesPaginator {
if params == nil {
params = &GetBuiltinSlotTypesInput{}
}
options := GetBuiltinSlotTypesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &GetBuiltinSlotTypesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *GetBuiltinSlotTypesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next GetBuiltinSlotTypes page.
func (p *GetBuiltinSlotTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetBuiltinSlotTypesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.GetBuiltinSlotTypes(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opGetBuiltinSlotTypes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "GetBuiltinSlotTypes",
}
}
| 234 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Exports the contents of a Amazon Lex resource in a specified format.
func (c *Client) GetExport(ctx context.Context, params *GetExportInput, optFns ...func(*Options)) (*GetExportOutput, error) {
if params == nil {
params = &GetExportInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetExport", params, optFns, c.addOperationGetExportMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetExportOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetExportInput struct {
// The format of the exported data.
//
// This member is required.
ExportType types.ExportType
// The name of the bot to export.
//
// This member is required.
Name *string
// The type of resource to export.
//
// This member is required.
ResourceType types.ResourceType
// The version of the bot to export.
//
// This member is required.
Version *string
noSmithyDocumentSerde
}
type GetExportOutput struct {
// The status of the export.
// - IN_PROGRESS - The export is in progress.
// - READY - The export is complete.
// - FAILED - The export could not be completed.
ExportStatus types.ExportStatus
// The format of the exported data.
ExportType types.ExportType
// If status is FAILED , Amazon Lex provides the reason that it failed to export
// the resource.
FailureReason *string
// The name of the bot being exported.
Name *string
// The type of the exported resource.
ResourceType types.ResourceType
// An S3 pre-signed URL that provides the location of the exported resource. The
// exported resource is a ZIP archive that contains the exported resource in JSON
// format. The structure of the archive may change. Your code should not rely on
// the archive structure.
Url *string
// The version of the bot being exported.
Version *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetExportMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetExport{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetExport{}, 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 = addOpGetExportValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetExport(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_opGetExport(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "GetExport",
}
}
| 165 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Gets information about an import job started with the StartImport operation.
func (c *Client) GetImport(ctx context.Context, params *GetImportInput, optFns ...func(*Options)) (*GetImportOutput, error) {
if params == nil {
params = &GetImportInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetImport", params, optFns, c.addOperationGetImportMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetImportOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetImportInput struct {
// The identifier of the import job information to return.
//
// This member is required.
ImportId *string
noSmithyDocumentSerde
}
type GetImportOutput struct {
// A timestamp for the date and time that the import job was created.
CreatedDate *time.Time
// A string that describes why an import job failed to complete.
FailureReason []string
// The identifier for the specific import job.
ImportId *string
// The status of the import job. If the status is FAILED , you can get the reason
// for the failure from the failureReason field.
ImportStatus types.ImportStatus
// The action taken when there was a conflict between an existing resource and a
// resource in the import file.
MergeStrategy types.MergeStrategy
// The name given to the import job.
Name *string
// The type of resource imported.
ResourceType types.ResourceType
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetImportMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetImport{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetImport{}, 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 = addOpGetImportValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetImport(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_opGetImport(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "GetImport",
}
}
| 146 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Returns information about an intent. In addition to the intent name, you must
// specify the intent version. This operation requires permissions to perform the
// lex:GetIntent action.
func (c *Client) GetIntent(ctx context.Context, params *GetIntentInput, optFns ...func(*Options)) (*GetIntentOutput, error) {
if params == nil {
params = &GetIntentInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetIntent", params, optFns, c.addOperationGetIntentMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetIntentOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetIntentInput struct {
// The name of the intent. The name is case sensitive.
//
// This member is required.
Name *string
// The version of the intent.
//
// This member is required.
Version *string
noSmithyDocumentSerde
}
type GetIntentOutput struct {
// Checksum of the intent.
Checksum *string
// After the Lambda function specified in the fulfillmentActivity element fulfills
// the intent, Amazon Lex conveys this statement to the user.
ConclusionStatement *types.Statement
// If defined in the bot, Amazon Lex uses prompt to confirm the intent before
// fulfilling the user's request. For more information, see PutIntent .
ConfirmationPrompt *types.Prompt
// The date that the intent was created.
CreatedDate *time.Time
// A description of the intent.
Description *string
// If defined in the bot, Amazon Amazon Lex invokes this Lambda function for each
// user input. For more information, see PutIntent .
DialogCodeHook *types.CodeHook
// If defined in the bot, Amazon Lex uses this prompt to solicit additional user
// activity after the intent is fulfilled. For more information, see PutIntent .
FollowUpPrompt *types.FollowUpPrompt
// Describes how the intent is fulfilled. For more information, see PutIntent .
FulfillmentActivity *types.FulfillmentActivity
// An array of InputContext objects that lists the contexts that must be active
// for Amazon Lex to choose the intent in a conversation with the user.
InputContexts []types.InputContext
// Configuration information, if any, to connect to an Amazon Kendra index with
// the AMAZON.KendraSearchIntent intent.
KendraConfiguration *types.KendraConfiguration
// The date that the intent was updated. When you create a resource, the creation
// date and the last updated date are the same.
LastUpdatedDate *time.Time
// The name of the intent.
Name *string
// An array of OutputContext objects that lists the contexts that the intent
// activates when the intent is fulfilled.
OutputContexts []types.OutputContext
// A unique identifier for a built-in intent.
ParentIntentSignature *string
// If the user answers "no" to the question defined in confirmationPrompt , Amazon
// Lex responds with this statement to acknowledge that the intent was canceled.
RejectionStatement *types.Statement
// An array of sample utterances configured for the intent.
SampleUtterances []string
// An array of intent slots configured for the intent.
Slots []types.Slot
// The version of the intent.
Version *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetIntentMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetIntent{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetIntent{}, 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 = addOpGetIntentValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetIntent(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_opGetIntent(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "GetIntent",
}
}
| 193 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns intent information as follows:
// - If you specify the nameContains field, returns the $LATEST version of all
// intents that contain the specified string.
// - If you don't specify the nameContains field, returns information about the
// $LATEST version of all intents.
//
// The operation requires permission for the lex:GetIntents action.
func (c *Client) GetIntents(ctx context.Context, params *GetIntentsInput, optFns ...func(*Options)) (*GetIntentsOutput, error) {
if params == nil {
params = &GetIntentsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetIntents", params, optFns, c.addOperationGetIntentsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetIntentsOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetIntentsInput struct {
// The maximum number of intents to return in the response. The default is 10.
MaxResults *int32
// Substring to match in intent names. An intent will be returned if any part of
// its name matches the substring. For example, "xyz" matches both "xyzabc" and
// "abcxyz."
NameContains *string
// A pagination token that fetches the next page of intents. If the response to
// this API call is truncated, Amazon Lex returns a pagination token in the
// response. To fetch the next page of intents, specify the pagination token in the
// next request.
NextToken *string
noSmithyDocumentSerde
}
type GetIntentsOutput struct {
// An array of Intent objects. For more information, see PutBot .
Intents []types.IntentMetadata
// If the response is truncated, the response includes a pagination token that you
// can specify in your next request to fetch the next page of intents.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetIntentsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetIntents{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetIntents{}, 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_opGetIntents(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
}
// GetIntentsAPIClient is a client that implements the GetIntents operation.
type GetIntentsAPIClient interface {
GetIntents(context.Context, *GetIntentsInput, ...func(*Options)) (*GetIntentsOutput, error)
}
var _ GetIntentsAPIClient = (*Client)(nil)
// GetIntentsPaginatorOptions is the paginator options for GetIntents
type GetIntentsPaginatorOptions struct {
// The maximum number of intents to return in the response. The default is 10.
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
}
// GetIntentsPaginator is a paginator for GetIntents
type GetIntentsPaginator struct {
options GetIntentsPaginatorOptions
client GetIntentsAPIClient
params *GetIntentsInput
nextToken *string
firstPage bool
}
// NewGetIntentsPaginator returns a new GetIntentsPaginator
func NewGetIntentsPaginator(client GetIntentsAPIClient, params *GetIntentsInput, optFns ...func(*GetIntentsPaginatorOptions)) *GetIntentsPaginator {
if params == nil {
params = &GetIntentsInput{}
}
options := GetIntentsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &GetIntentsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *GetIntentsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next GetIntents page.
func (p *GetIntentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetIntentsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.GetIntents(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opGetIntents(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "GetIntents",
}
}
| 231 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets information about all of the versions of an intent. The GetIntentVersions
// operation returns an IntentMetadata object for each version of an intent. For
// example, if an intent has three numbered versions, the GetIntentVersions
// operation returns four IntentMetadata objects in the response, one for each
// numbered version and one for the $LATEST version. The GetIntentVersions
// operation always returns at least one version, the $LATEST version. This
// operation requires permissions for the lex:GetIntentVersions action.
func (c *Client) GetIntentVersions(ctx context.Context, params *GetIntentVersionsInput, optFns ...func(*Options)) (*GetIntentVersionsOutput, error) {
if params == nil {
params = &GetIntentVersionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetIntentVersions", params, optFns, c.addOperationGetIntentVersionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetIntentVersionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetIntentVersionsInput struct {
// The name of the intent for which versions should be returned.
//
// This member is required.
Name *string
// The maximum number of intent versions to return in the response. The default is
// 10.
MaxResults *int32
// A pagination token for fetching the next page of intent versions. If the
// response to this call is truncated, Amazon Lex returns a pagination token in the
// response. To fetch the next page of versions, specify the pagination token in
// the next request.
NextToken *string
noSmithyDocumentSerde
}
type GetIntentVersionsOutput struct {
// An array of IntentMetadata objects, one for each numbered version of the intent
// plus one for the $LATEST version.
Intents []types.IntentMetadata
// A pagination token for fetching the next page of intent versions. If the
// response to this call is truncated, Amazon Lex returns a pagination token in the
// response. To fetch the next page of versions, specify the pagination token in
// the next request.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetIntentVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetIntentVersions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetIntentVersions{}, 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 = addOpGetIntentVersionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetIntentVersions(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
}
// GetIntentVersionsAPIClient is a client that implements the GetIntentVersions
// operation.
type GetIntentVersionsAPIClient interface {
GetIntentVersions(context.Context, *GetIntentVersionsInput, ...func(*Options)) (*GetIntentVersionsOutput, error)
}
var _ GetIntentVersionsAPIClient = (*Client)(nil)
// GetIntentVersionsPaginatorOptions is the paginator options for GetIntentVersions
type GetIntentVersionsPaginatorOptions struct {
// The maximum number of intent versions to return in the response. The default is
// 10.
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
}
// GetIntentVersionsPaginator is a paginator for GetIntentVersions
type GetIntentVersionsPaginator struct {
options GetIntentVersionsPaginatorOptions
client GetIntentVersionsAPIClient
params *GetIntentVersionsInput
nextToken *string
firstPage bool
}
// NewGetIntentVersionsPaginator returns a new GetIntentVersionsPaginator
func NewGetIntentVersionsPaginator(client GetIntentVersionsAPIClient, params *GetIntentVersionsInput, optFns ...func(*GetIntentVersionsPaginatorOptions)) *GetIntentVersionsPaginator {
if params == nil {
params = &GetIntentVersionsInput{}
}
options := GetIntentVersionsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &GetIntentVersionsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *GetIntentVersionsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next GetIntentVersions page.
func (p *GetIntentVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetIntentVersionsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.GetIntentVersions(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opGetIntentVersions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "GetIntentVersions",
}
}
| 240 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Provides details about an ongoing or complete migration from an Amazon Lex V1
// bot to an Amazon Lex V2 bot. Use this operation to view the migration alerts and
// warnings related to the migration.
func (c *Client) GetMigration(ctx context.Context, params *GetMigrationInput, optFns ...func(*Options)) (*GetMigrationOutput, error) {
if params == nil {
params = &GetMigrationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetMigration", params, optFns, c.addOperationGetMigrationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetMigrationOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetMigrationInput struct {
// The unique identifier of the migration to view. The migrationID is returned by
// the operation.
//
// This member is required.
MigrationId *string
noSmithyDocumentSerde
}
type GetMigrationOutput struct {
// A list of alerts and warnings that indicate issues with the migration for the
// Amazon Lex V1 bot to Amazon Lex V2. You receive a warning when an Amazon Lex V1
// feature has a different implementation if Amazon Lex V2. For more information,
// see Migrating a bot (https://docs.aws.amazon.com/lexv2/latest/dg/migrate.html)
// in the Amazon Lex V2 developer guide.
Alerts []types.MigrationAlert
// The unique identifier of the migration. This is the same as the identifier used
// when calling the GetMigration operation.
MigrationId *string
// Indicates the status of the migration. When the status is COMPLETE the
// migration is finished and the bot is available in Amazon Lex V2. There may be
// alerts and warnings that need to be resolved to complete the migration.
MigrationStatus types.MigrationStatus
// The strategy used to conduct the migration.
// - CREATE_NEW - Creates a new Amazon Lex V2 bot and migrates the Amazon Lex V1
// bot to the new bot.
// - UPDATE_EXISTING - Overwrites the existing Amazon Lex V2 bot metadata and the
// locale being migrated. It doesn't change any other locales in the Amazon Lex V2
// bot. If the locale doesn't exist, a new locale is created in the Amazon Lex V2
// bot.
MigrationStrategy types.MigrationStrategy
// The date and time that the migration started.
MigrationTimestamp *time.Time
// The locale of the Amazon Lex V1 bot migrated to Amazon Lex V2.
V1BotLocale types.Locale
// The name of the Amazon Lex V1 bot migrated to Amazon Lex V2.
V1BotName *string
// The version of the Amazon Lex V1 bot migrated to Amazon Lex V2.
V1BotVersion *string
// The unique identifier of the Amazon Lex V2 bot that the Amazon Lex V1 is being
// migrated to.
V2BotId *string
// The IAM role that Amazon Lex uses to run the Amazon Lex V2 bot.
V2BotRole *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetMigrationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetMigration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetMigration{}, 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 = addOpGetMigrationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMigration(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_opGetMigration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "GetMigration",
}
}
| 170 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets a list of migrations between Amazon Lex V1 and Amazon Lex V2.
func (c *Client) GetMigrations(ctx context.Context, params *GetMigrationsInput, optFns ...func(*Options)) (*GetMigrationsOutput, error) {
if params == nil {
params = &GetMigrationsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetMigrations", params, optFns, c.addOperationGetMigrationsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetMigrationsOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetMigrationsInput struct {
// The maximum number of migrations to return in the response. The default is 10.
MaxResults *int32
// Filters the list to contain only migrations in the specified state.
MigrationStatusEquals types.MigrationStatus
// A pagination token that fetches the next page of migrations. If the response to
// this operation is truncated, Amazon Lex returns a pagination token in the
// response. To fetch the next page of migrations, specify the pagination token in
// the request.
NextToken *string
// The field to sort the list of migrations by. You can sort by the Amazon Lex V1
// bot name or the date and time that the migration was started.
SortByAttribute types.MigrationSortAttribute
// The order so sort the list.
SortByOrder types.SortOrder
// Filters the list to contain only bots whose name contains the specified string.
// The string is matched anywhere in bot name.
V1BotNameContains *string
noSmithyDocumentSerde
}
type GetMigrationsOutput struct {
// An array of summaries for migrations from Amazon Lex V1 to Amazon Lex V2. To
// see details of the migration, use the migrationId from the summary in a call to
// the operation.
MigrationSummaries []types.MigrationSummary
// If the response is truncated, it includes a pagination token that you can
// specify in your next request to fetch the next page of migrations.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetMigrationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetMigrations{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetMigrations{}, 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_opGetMigrations(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
}
// GetMigrationsAPIClient is a client that implements the GetMigrations operation.
type GetMigrationsAPIClient interface {
GetMigrations(context.Context, *GetMigrationsInput, ...func(*Options)) (*GetMigrationsOutput, error)
}
var _ GetMigrationsAPIClient = (*Client)(nil)
// GetMigrationsPaginatorOptions is the paginator options for GetMigrations
type GetMigrationsPaginatorOptions struct {
// The maximum number of migrations to return in the response. The default is 10.
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
}
// GetMigrationsPaginator is a paginator for GetMigrations
type GetMigrationsPaginator struct {
options GetMigrationsPaginatorOptions
client GetMigrationsAPIClient
params *GetMigrationsInput
nextToken *string
firstPage bool
}
// NewGetMigrationsPaginator returns a new GetMigrationsPaginator
func NewGetMigrationsPaginator(client GetMigrationsAPIClient, params *GetMigrationsInput, optFns ...func(*GetMigrationsPaginatorOptions)) *GetMigrationsPaginator {
if params == nil {
params = &GetMigrationsInput{}
}
options := GetMigrationsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &GetMigrationsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *GetMigrationsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next GetMigrations page.
func (p *GetMigrationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetMigrationsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.GetMigrations(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opGetMigrations(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "GetMigrations",
}
}
| 236 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Returns information about a specific version of a slot type. In addition to
// specifying the slot type name, you must specify the slot type version. This
// operation requires permissions for the lex:GetSlotType action.
func (c *Client) GetSlotType(ctx context.Context, params *GetSlotTypeInput, optFns ...func(*Options)) (*GetSlotTypeOutput, error) {
if params == nil {
params = &GetSlotTypeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetSlotType", params, optFns, c.addOperationGetSlotTypeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetSlotTypeOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetSlotTypeInput struct {
// The name of the slot type. The name is case sensitive.
//
// This member is required.
Name *string
// The version of the slot type.
//
// This member is required.
Version *string
noSmithyDocumentSerde
}
type GetSlotTypeOutput struct {
// Checksum of the $LATEST version of the slot type.
Checksum *string
// The date that the slot type was created.
CreatedDate *time.Time
// A description of the slot type.
Description *string
// A list of EnumerationValue objects that defines the values that the slot type
// can take.
EnumerationValues []types.EnumerationValue
// The date that the slot type was updated. When you create a resource, the
// creation date and last update date are the same.
LastUpdatedDate *time.Time
// The name of the slot type.
Name *string
// The built-in slot type used as a parent for the slot type.
ParentSlotTypeSignature *string
// Configuration information that extends the parent built-in slot type.
SlotTypeConfigurations []types.SlotTypeConfiguration
// The strategy that Amazon Lex uses to determine the value of the slot. For more
// information, see PutSlotType .
ValueSelectionStrategy types.SlotValueSelectionStrategy
// The version of the slot type.
Version *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetSlotTypeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSlotType{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSlotType{}, 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 = addOpGetSlotTypeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSlotType(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_opGetSlotType(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "GetSlotType",
}
}
| 163 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns slot type information as follows:
// - If you specify the nameContains field, returns the $LATEST version of all
// slot types that contain the specified string.
// - If you don't specify the nameContains field, returns information about the
// $LATEST version of all slot types.
//
// The operation requires permission for the lex:GetSlotTypes action.
func (c *Client) GetSlotTypes(ctx context.Context, params *GetSlotTypesInput, optFns ...func(*Options)) (*GetSlotTypesOutput, error) {
if params == nil {
params = &GetSlotTypesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetSlotTypes", params, optFns, c.addOperationGetSlotTypesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetSlotTypesOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetSlotTypesInput struct {
// The maximum number of slot types to return in the response. The default is 10.
MaxResults *int32
// Substring to match in slot type names. A slot type will be returned if any part
// of its name matches the substring. For example, "xyz" matches both "xyzabc" and
// "abcxyz."
NameContains *string
// A pagination token that fetches the next page of slot types. If the response to
// this API call is truncated, Amazon Lex returns a pagination token in the
// response. To fetch next page of slot types, specify the pagination token in the
// next request.
NextToken *string
noSmithyDocumentSerde
}
type GetSlotTypesOutput struct {
// If the response is truncated, it includes a pagination token that you can
// specify in your next request to fetch the next page of slot types.
NextToken *string
// An array of objects, one for each slot type, that provides information such as
// the name of the slot type, the version, and a description.
SlotTypes []types.SlotTypeMetadata
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetSlotTypesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSlotTypes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSlotTypes{}, 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_opGetSlotTypes(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
}
// GetSlotTypesAPIClient is a client that implements the GetSlotTypes operation.
type GetSlotTypesAPIClient interface {
GetSlotTypes(context.Context, *GetSlotTypesInput, ...func(*Options)) (*GetSlotTypesOutput, error)
}
var _ GetSlotTypesAPIClient = (*Client)(nil)
// GetSlotTypesPaginatorOptions is the paginator options for GetSlotTypes
type GetSlotTypesPaginatorOptions struct {
// The maximum number of slot types to return in the response. The default is 10.
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
}
// GetSlotTypesPaginator is a paginator for GetSlotTypes
type GetSlotTypesPaginator struct {
options GetSlotTypesPaginatorOptions
client GetSlotTypesAPIClient
params *GetSlotTypesInput
nextToken *string
firstPage bool
}
// NewGetSlotTypesPaginator returns a new GetSlotTypesPaginator
func NewGetSlotTypesPaginator(client GetSlotTypesAPIClient, params *GetSlotTypesInput, optFns ...func(*GetSlotTypesPaginatorOptions)) *GetSlotTypesPaginator {
if params == nil {
params = &GetSlotTypesInput{}
}
options := GetSlotTypesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &GetSlotTypesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *GetSlotTypesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next GetSlotTypes page.
func (p *GetSlotTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetSlotTypesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.GetSlotTypes(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opGetSlotTypes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "GetSlotTypes",
}
}
| 232 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets information about all versions of a slot type. The GetSlotTypeVersions
// operation returns a SlotTypeMetadata object for each version of a slot type.
// For example, if a slot type has three numbered versions, the GetSlotTypeVersions
// operation returns four SlotTypeMetadata objects in the response, one for each
// numbered version and one for the $LATEST version. The GetSlotTypeVersions
// operation always returns at least one version, the $LATEST version. This
// operation requires permissions for the lex:GetSlotTypeVersions action.
func (c *Client) GetSlotTypeVersions(ctx context.Context, params *GetSlotTypeVersionsInput, optFns ...func(*Options)) (*GetSlotTypeVersionsOutput, error) {
if params == nil {
params = &GetSlotTypeVersionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetSlotTypeVersions", params, optFns, c.addOperationGetSlotTypeVersionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetSlotTypeVersionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetSlotTypeVersionsInput struct {
// The name of the slot type for which versions should be returned.
//
// This member is required.
Name *string
// The maximum number of slot type versions to return in the response. The default
// is 10.
MaxResults *int32
// A pagination token for fetching the next page of slot type versions. If the
// response to this call is truncated, Amazon Lex returns a pagination token in the
// response. To fetch the next page of versions, specify the pagination token in
// the next request.
NextToken *string
noSmithyDocumentSerde
}
type GetSlotTypeVersionsOutput struct {
// A pagination token for fetching the next page of slot type versions. If the
// response to this call is truncated, Amazon Lex returns a pagination token in the
// response. To fetch the next page of versions, specify the pagination token in
// the next request.
NextToken *string
// An array of SlotTypeMetadata objects, one for each numbered version of the slot
// type plus one for the $LATEST version.
SlotTypes []types.SlotTypeMetadata
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetSlotTypeVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSlotTypeVersions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSlotTypeVersions{}, 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 = addOpGetSlotTypeVersionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSlotTypeVersions(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
}
// GetSlotTypeVersionsAPIClient is a client that implements the
// GetSlotTypeVersions operation.
type GetSlotTypeVersionsAPIClient interface {
GetSlotTypeVersions(context.Context, *GetSlotTypeVersionsInput, ...func(*Options)) (*GetSlotTypeVersionsOutput, error)
}
var _ GetSlotTypeVersionsAPIClient = (*Client)(nil)
// GetSlotTypeVersionsPaginatorOptions is the paginator options for
// GetSlotTypeVersions
type GetSlotTypeVersionsPaginatorOptions struct {
// The maximum number of slot type versions to return in the response. The default
// is 10.
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
}
// GetSlotTypeVersionsPaginator is a paginator for GetSlotTypeVersions
type GetSlotTypeVersionsPaginator struct {
options GetSlotTypeVersionsPaginatorOptions
client GetSlotTypeVersionsAPIClient
params *GetSlotTypeVersionsInput
nextToken *string
firstPage bool
}
// NewGetSlotTypeVersionsPaginator returns a new GetSlotTypeVersionsPaginator
func NewGetSlotTypeVersionsPaginator(client GetSlotTypeVersionsAPIClient, params *GetSlotTypeVersionsInput, optFns ...func(*GetSlotTypeVersionsPaginatorOptions)) *GetSlotTypeVersionsPaginator {
if params == nil {
params = &GetSlotTypeVersionsInput{}
}
options := GetSlotTypeVersionsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &GetSlotTypeVersionsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *GetSlotTypeVersionsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next GetSlotTypeVersions page.
func (p *GetSlotTypeVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetSlotTypeVersionsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.GetSlotTypeVersions(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opGetSlotTypeVersions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "GetSlotTypeVersions",
}
}
| 241 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Use the GetUtterancesView operation to get information about the utterances
// that your users have made to your bot. You can use this list to tune the
// utterances that your bot responds to. For example, say that you have created a
// bot to order flowers. After your users have used your bot for a while, use the
// GetUtterancesView operation to see the requests that they have made and whether
// they have been successful. You might find that the utterance "I want flowers" is
// not being recognized. You could add this utterance to the OrderFlowers intent
// so that your bot recognizes that utterance. After you publish a new version of a
// bot, you can get information about the old version and the new so that you can
// compare the performance across the two versions. Utterance statistics are
// generated once a day. Data is available for the last 15 days. You can request
// information for up to 5 versions of your bot in each request. Amazon Lex returns
// the most frequent utterances received by the bot in the last 15 days. The
// response contains information about a maximum of 100 utterances for each
// version. If you set childDirected field to true when you created your bot, if
// you are using slot obfuscation with one or more slots, or if you opted out of
// participating in improving Amazon Lex, utterances are not available. This
// operation requires permissions for the lex:GetUtterancesView action.
func (c *Client) GetUtterancesView(ctx context.Context, params *GetUtterancesViewInput, optFns ...func(*Options)) (*GetUtterancesViewOutput, error) {
if params == nil {
params = &GetUtterancesViewInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetUtterancesView", params, optFns, c.addOperationGetUtterancesViewMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetUtterancesViewOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetUtterancesViewInput struct {
// The name of the bot for which utterance information should be returned.
//
// This member is required.
BotName *string
// An array of bot versions for which utterance information should be returned.
// The limit is 5 versions per request.
//
// This member is required.
BotVersions []string
// To return utterances that were recognized and handled, use Detected . To return
// utterances that were not recognized, use Missed .
//
// This member is required.
StatusType types.StatusType
noSmithyDocumentSerde
}
type GetUtterancesViewOutput struct {
// The name of the bot for which utterance information was returned.
BotName *string
// An array of UtteranceList objects, each containing a list of UtteranceData
// objects describing the utterances that were processed by your bot. The response
// contains a maximum of 100 UtteranceData objects for each version. Amazon Lex
// returns the most frequent utterances received by the bot in the last 15 days.
Utterances []types.UtteranceList
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetUtterancesViewMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetUtterancesView{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetUtterancesView{}, 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 = addOpGetUtterancesViewValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetUtterancesView(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_opGetUtterancesView(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "GetUtterancesView",
}
}
| 160 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets a list of tags associated with the specified resource. Only bots, bot
// aliases, and bot channels can have tags associated with them.
func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) {
if params == nil {
params = &ListTagsForResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListTagsForResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListTagsForResourceInput struct {
// The Amazon Resource Name (ARN) of the resource to get a list of tags for.
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type ListTagsForResourceOutput struct {
// The tags associated with a resource.
Tags []types.Tag
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&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: "lex",
OperationName: "ListTagsForResource",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates an Amazon Lex conversational bot or replaces an existing bot. When you
// create or update a bot you are only required to specify a name, a locale, and
// whether the bot is directed toward children under age 13. You can use this to
// add intents later, or to remove intents from an existing bot. When you create a
// bot with the minimum information, the bot is created or updated but Amazon Lex
// returns the response FAILED . You can build the bot after you add one or more
// intents. For more information about Amazon Lex bots, see how-it-works . If you
// specify the name of an existing bot, the fields in the request replace the
// existing values in the $LATEST version of the bot. Amazon Lex removes any
// fields that you don't provide values for in the request, except for the
// idleTTLInSeconds and privacySettings fields, which are set to their default
// values. If you don't specify values for required fields, Amazon Lex throws an
// exception. This operation requires permissions for the lex:PutBot action. For
// more information, see security-iam .
func (c *Client) PutBot(ctx context.Context, params *PutBotInput, optFns ...func(*Options)) (*PutBotOutput, error) {
if params == nil {
params = &PutBotInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutBot", params, optFns, c.addOperationPutBotMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutBotOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutBotInput struct {
// For each Amazon Lex bot created with the Amazon Lex Model Building Service, you
// must specify whether your use of Amazon Lex is related to a website, program, or
// other application that is directed or targeted, in whole or in part, to children
// under age 13 and subject to the Children's Online Privacy Protection Act (COPPA)
// by specifying true or false in the childDirected field. By specifying true in
// the childDirected field, you confirm that your use of Amazon Lex is related to
// a website, program, or other application that is directed or targeted, in whole
// or in part, to children under age 13 and subject to COPPA. By specifying false
// in the childDirected field, you confirm that your use of Amazon Lex is not
// related to a website, program, or other application that is directed or
// targeted, in whole or in part, to children under age 13 and subject to COPPA.
// You may not specify a default value for the childDirected field that does not
// accurately reflect whether your use of Amazon Lex is related to a website,
// program, or other application that is directed or targeted, in whole or in part,
// to children under age 13 and subject to COPPA. If your use of Amazon Lex relates
// to a website, program, or other application that is directed in whole or in
// part, to children under age 13, you must obtain any required verifiable parental
// consent under COPPA. For information regarding the use of Amazon Lex in
// connection with websites, programs, or other applications that are directed or
// targeted, in whole or in part, to children under age 13, see the Amazon Lex FAQ. (https://aws.amazon.com/lex/faqs#data-security)
//
// This member is required.
ChildDirected *bool
// Specifies the target locale for the bot. Any intent used in the bot must be
// compatible with the locale of the bot. The default is en-US .
//
// This member is required.
Locale types.Locale
// The name of the bot. The name is not case sensitive.
//
// This member is required.
Name *string
// When Amazon Lex can't understand the user's input in context, it tries to
// elicit the information a few times. After that, Amazon Lex sends the message
// defined in abortStatement to the user, and then cancels the conversation. To
// set the number of retries, use the valueElicitationPrompt field for the slot
// type. For example, in a pizza ordering bot, Amazon Lex might ask a user "What
// type of crust would you like?" If the user's response is not one of the expected
// responses (for example, "thin crust, "deep dish," etc.), Amazon Lex tries to
// elicit a correct response a few more times. For example, in a pizza ordering
// application, OrderPizza might be one of the intents. This intent might require
// the CrustType slot. You specify the valueElicitationPrompt field when you
// create the CrustType slot. If you have defined a fallback intent the cancel
// statement will not be sent to the user, the fallback intent is used instead. For
// more information, see AMAZON.FallbackIntent (https://docs.aws.amazon.com/lex/latest/dg/built-in-intent-fallback.html)
// .
AbortStatement *types.Statement
// Identifies a specific revision of the $LATEST version. When you create a new
// bot, leave the checksum field blank. If you specify a checksum you get a
// BadRequestException exception. When you want to update a bot, set the checksum
// field to the checksum of the most recent revision of the $LATEST version. If
// you don't specify the checksum field, or if the checksum does not match the
// $LATEST version, you get a PreconditionFailedException exception.
Checksum *string
// When Amazon Lex doesn't understand the user's intent, it uses this message to
// get clarification. To specify how many times Amazon Lex should repeat the
// clarification prompt, use the maxAttempts field. If Amazon Lex still doesn't
// understand, it sends the message in the abortStatement field. When you create a
// clarification prompt, make sure that it suggests the correct response from the
// user. for example, for a bot that orders pizza and drinks, you might create this
// clarification prompt: "What would you like to do? You can say 'Order a pizza' or
// 'Order a drink.'" If you have defined a fallback intent, it will be invoked if
// the clarification prompt is repeated the number of times defined in the
// maxAttempts field. For more information, see AMAZON.FallbackIntent (https://docs.aws.amazon.com/lex/latest/dg/built-in-intent-fallback.html)
// . If you don't define a clarification prompt, at runtime Amazon Lex will return
// a 400 Bad Request exception in three cases:
// - Follow-up prompt - When the user responds to a follow-up prompt but does
// not provide an intent. For example, in response to a follow-up prompt that says
// "Would you like anything else today?" the user says "Yes." Amazon Lex will
// return a 400 Bad Request exception because it does not have a clarification
// prompt to send to the user to get an intent.
// - Lambda function - When using a Lambda function, you return an ElicitIntent
// dialog type. Since Amazon Lex does not have a clarification prompt to get an
// intent from the user, it returns a 400 Bad Request exception.
// - PutSession operation - When using the PutSession operation, you send an
// ElicitIntent dialog type. Since Amazon Lex does not have a clarification
// prompt to get an intent from the user, it returns a 400 Bad Request exception.
ClarificationPrompt *types.Prompt
// When set to true a new numbered version of the bot is created. This is the same
// as calling the CreateBotVersion operation. If you don't specify createVersion ,
// the default is false .
CreateVersion *bool
// A description of the bot.
Description *string
// When set to true user utterances are sent to Amazon Comprehend for sentiment
// analysis. If you don't specify detectSentiment , the default is false .
DetectSentiment *bool
// Set to true to enable access to natural language understanding improvements.
// When you set the enableModelImprovements parameter to true you can use the
// nluIntentConfidenceThreshold parameter to configure confidence scores. For more
// information, see Confidence Scores (https://docs.aws.amazon.com/lex/latest/dg/confidence-scores.html)
// . You can only set the enableModelImprovements parameter in certain Regions. If
// you set the parameter to true , your bot has access to accuracy improvements.
// The Regions where you can set the enableModelImprovements parameter to true
// are:
// - US East (N. Virginia) (us-east-1)
// - US West (Oregon) (us-west-2)
// - Asia Pacific (Sydney) (ap-southeast-2)
// - EU (Ireland) (eu-west-1)
// In other Regions, the enableModelImprovements parameter is set to true by
// default. In these Regions setting the parameter to false throws a
// ValidationException exception.
EnableModelImprovements *bool
// The maximum time in seconds that Amazon Lex retains the data gathered in a
// conversation. A user interaction session remains active for the amount of time
// specified. If no conversation occurs during this time, the session expires and
// Amazon Lex deletes any data provided before the timeout. For example, suppose
// that a user chooses the OrderPizza intent, but gets sidetracked halfway through
// placing an order. If the user doesn't complete the order within the specified
// time, Amazon Lex discards the slot information that it gathered, and the user
// must start over. If you don't include the idleSessionTTLInSeconds element in a
// PutBot operation request, Amazon Lex uses the default value. This is also true
// if the request replaces an existing bot. The default is 300 seconds (5 minutes).
IdleSessionTTLInSeconds *int32
// An array of Intent objects. Each intent represents a command that a user can
// express. For example, a pizza ordering bot might support an OrderPizza intent.
// For more information, see how-it-works .
Intents []types.Intent
// Determines the threshold where Amazon Lex will insert the AMAZON.FallbackIntent
// , AMAZON.KendraSearchIntent , or both when returning alternative intents in a
// PostContent (https://docs.aws.amazon.com/lex/latest/dg/API_runtime_PostContent.html)
// or PostText (https://docs.aws.amazon.com/lex/latest/dg/API_runtime_PostText.html)
// response. AMAZON.FallbackIntent and AMAZON.KendraSearchIntent are only inserted
// if they are configured for the bot. You must set the enableModelImprovements
// parameter to true to use confidence scores in the following regions.
// - US East (N. Virginia) (us-east-1)
// - US West (Oregon) (us-west-2)
// - Asia Pacific (Sydney) (ap-southeast-2)
// - EU (Ireland) (eu-west-1)
// In other Regions, the enableModelImprovements parameter is set to true by
// default. For example, suppose a bot is configured with the confidence threshold
// of 0.80 and the AMAZON.FallbackIntent . Amazon Lex returns three alternative
// intents with the following confidence scores: IntentA (0.70), IntentB (0.60),
// IntentC (0.50). The response from the PostText operation would be:
// - AMAZON.FallbackIntent
// - IntentA
// - IntentB
// - IntentC
NluIntentConfidenceThreshold *float64
// If you set the processBehavior element to BUILD , Amazon Lex builds the bot so
// that it can be run. If you set the element to SAVE Amazon Lex saves the bot,
// but doesn't build it. If you don't specify this value, the default value is
// BUILD .
ProcessBehavior types.ProcessBehavior
// A list of tags to add to the bot. You can only add tags when you create a bot,
// you can't use the PutBot operation to update the tags on a bot. To update tags,
// use the TagResource operation.
Tags []types.Tag
// The Amazon Polly voice ID that you want Amazon Lex to use for voice
// interactions with the user. The locale configured for the voice must match the
// locale of the bot. For more information, see Voices in Amazon Polly (https://docs.aws.amazon.com/polly/latest/dg/voicelist.html)
// in the Amazon Polly Developer Guide.
VoiceId *string
noSmithyDocumentSerde
}
type PutBotOutput struct {
// The message that Amazon Lex uses to cancel a conversation. For more
// information, see PutBot .
AbortStatement *types.Statement
// Checksum of the bot that you created.
Checksum *string
// For each Amazon Lex bot created with the Amazon Lex Model Building Service, you
// must specify whether your use of Amazon Lex is related to a website, program, or
// other application that is directed or targeted, in whole or in part, to children
// under age 13 and subject to the Children's Online Privacy Protection Act (COPPA)
// by specifying true or false in the childDirected field. By specifying true in
// the childDirected field, you confirm that your use of Amazon Lex is related to
// a website, program, or other application that is directed or targeted, in whole
// or in part, to children under age 13 and subject to COPPA. By specifying false
// in the childDirected field, you confirm that your use of Amazon Lex is not
// related to a website, program, or other application that is directed or
// targeted, in whole or in part, to children under age 13 and subject to COPPA.
// You may not specify a default value for the childDirected field that does not
// accurately reflect whether your use of Amazon Lex is related to a website,
// program, or other application that is directed or targeted, in whole or in part,
// to children under age 13 and subject to COPPA. If your use of Amazon Lex relates
// to a website, program, or other application that is directed in whole or in
// part, to children under age 13, you must obtain any required verifiable parental
// consent under COPPA. For information regarding the use of Amazon Lex in
// connection with websites, programs, or other applications that are directed or
// targeted, in whole or in part, to children under age 13, see the Amazon Lex FAQ. (https://aws.amazon.com/lex/faqs#data-security)
ChildDirected *bool
// The prompts that Amazon Lex uses when it doesn't understand the user's intent.
// For more information, see PutBot .
ClarificationPrompt *types.Prompt
// True if a new version of the bot was created. If the createVersion field was
// not specified in the request, the createVersion field is set to false in the
// response.
CreateVersion *bool
// The date that the bot was created.
CreatedDate *time.Time
// A description of the bot.
Description *string
// true if the bot is configured to send user utterances to Amazon Comprehend for
// sentiment analysis. If the detectSentiment field was not specified in the
// request, the detectSentiment field is false in the response.
DetectSentiment *bool
// Indicates whether the bot uses accuracy improvements. true indicates that the
// bot is using the improvements, otherwise, false .
EnableModelImprovements *bool
// If status is FAILED , Amazon Lex provides the reason that it failed to build the
// bot.
FailureReason *string
// The maximum length of time that Amazon Lex retains the data gathered in a
// conversation. For more information, see PutBot .
IdleSessionTTLInSeconds *int32
// An array of Intent objects. For more information, see PutBot .
Intents []types.Intent
// The date that the bot was updated. When you create a resource, the creation
// date and last updated date are the same.
LastUpdatedDate *time.Time
// The target locale for the bot.
Locale types.Locale
// The name of the bot.
Name *string
// The score that determines where Amazon Lex inserts the AMAZON.FallbackIntent ,
// AMAZON.KendraSearchIntent , or both when returning alternative intents in a
// PostContent (https://docs.aws.amazon.com/lex/latest/dg/API_runtime_PostContent.html)
// or PostText (https://docs.aws.amazon.com/lex/latest/dg/API_runtime_PostText.html)
// response. AMAZON.FallbackIntent is inserted if the confidence score for all
// intents is below this value. AMAZON.KendraSearchIntent is only inserted if it
// is configured for the bot.
NluIntentConfidenceThreshold *float64
// When you send a request to create a bot with processBehavior set to BUILD ,
// Amazon Lex sets the status response element to BUILDING . In the
// READY_BASIC_TESTING state you can test the bot with user inputs that exactly
// match the utterances configured for the bot's intents and values in the slot
// types. If Amazon Lex can't build the bot, Amazon Lex sets status to FAILED .
// Amazon Lex returns the reason for the failure in the failureReason response
// element. When you set processBehavior to SAVE , Amazon Lex sets the status code
// to NOT BUILT . When the bot is in the READY state you can test and publish the
// bot.
Status types.Status
// A list of tags associated with the bot.
Tags []types.Tag
// The version of the bot. For a new bot, the version is always $LATEST .
Version *string
// The Amazon Polly voice ID that Amazon Lex uses for voice interaction with the
// user. For more information, see PutBot .
VoiceId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutBotMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutBot{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutBot{}, 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 = addOpPutBotValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutBot(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_opPutBot(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "PutBot",
}
}
| 404 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates an alias for the specified version of the bot or replaces an alias for
// the specified bot. To change the version of the bot that the alias points to,
// replace the alias. For more information about aliases, see versioning-aliases .
// This operation requires permissions for the lex:PutBotAlias action.
func (c *Client) PutBotAlias(ctx context.Context, params *PutBotAliasInput, optFns ...func(*Options)) (*PutBotAliasOutput, error) {
if params == nil {
params = &PutBotAliasInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutBotAlias", params, optFns, c.addOperationPutBotAliasMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutBotAliasOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutBotAliasInput struct {
// The name of the bot.
//
// This member is required.
BotName *string
// The version of the bot.
//
// This member is required.
BotVersion *string
// The name of the alias. The name is not case sensitive.
//
// This member is required.
Name *string
// Identifies a specific revision of the $LATEST version. When you create a new
// bot alias, leave the checksum field blank. If you specify a checksum you get a
// BadRequestException exception. When you want to update a bot alias, set the
// checksum field to the checksum of the most recent revision of the $LATEST
// version. If you don't specify the checksum field, or if the checksum does not
// match the $LATEST version, you get a PreconditionFailedException exception.
Checksum *string
// Settings for conversation logs for the alias.
ConversationLogs *types.ConversationLogsRequest
// A description of the alias.
Description *string
// A list of tags to add to the bot alias. You can only add tags when you create
// an alias, you can't use the PutBotAlias operation to update the tags on a bot
// alias. To update tags, use the TagResource operation.
Tags []types.Tag
noSmithyDocumentSerde
}
type PutBotAliasOutput struct {
// The name of the bot that the alias points to.
BotName *string
// The version of the bot that the alias points to.
BotVersion *string
// The checksum for the current version of the alias.
Checksum *string
// The settings that determine how Amazon Lex uses conversation logs for the alias.
ConversationLogs *types.ConversationLogsResponse
// The date that the bot alias was created.
CreatedDate *time.Time
// A description of the alias.
Description *string
// The date that the bot alias was updated. When you create a resource, the
// creation date and the last updated date are the same.
LastUpdatedDate *time.Time
// The name of the alias.
Name *string
// A list of tags associated with a bot.
Tags []types.Tag
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutBotAliasMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutBotAlias{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutBotAlias{}, 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 = addOpPutBotAliasValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutBotAlias(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_opPutBotAlias(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "PutBotAlias",
}
}
| 183 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates an intent or replaces an existing intent. To define the interaction
// between the user and your bot, you use one or more intents. For a pizza ordering
// bot, for example, you would create an OrderPizza intent. To create an intent or
// replace an existing intent, you must provide the following:
//
// - Intent name. For example, OrderPizza .
//
// - Sample utterances. For example, "Can I order a pizza, please." and "I want
// to order a pizza."
//
// - Information to be gathered. You specify slot types for the information that
// your bot will request from the user. You can specify standard slot types, such
// as a date or a time, or custom slot types such as the size and crust of a pizza.
//
// - How the intent will be fulfilled. You can provide a Lambda function or
// configure the intent to return the intent information to the client application.
// If you use a Lambda function, when all of the intent information is available,
// Amazon Lex invokes your Lambda function. If you configure your intent to return
// the intent information to the client application.
//
// You can specify other optional information in the request, such as:
// - A confirmation prompt to ask the user to confirm an intent. For example,
// "Shall I order your pizza?"
// - A conclusion statement to send to the user after the intent has been
// fulfilled. For example, "I placed your pizza order."
// - A follow-up prompt that asks the user for additional activity. For example,
// asking "Do you want to order a drink with your pizza?"
//
// If you specify an existing intent name to update the intent, Amazon Lex
// replaces the values in the $LATEST version of the intent with the values in the
// request. Amazon Lex removes fields that you don't provide in the request. If you
// don't specify the required fields, Amazon Lex throws an exception. When you
// update the $LATEST version of an intent, the status field of any bot that uses
// the $LATEST version of the intent is set to NOT_BUILT . For more information,
// see how-it-works . This operation requires permissions for the lex:PutIntent
// action.
func (c *Client) PutIntent(ctx context.Context, params *PutIntentInput, optFns ...func(*Options)) (*PutIntentOutput, error) {
if params == nil {
params = &PutIntentInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutIntent", params, optFns, c.addOperationPutIntentMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutIntentOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutIntentInput struct {
// The name of the intent. The name is not case sensitive. The name can't match a
// built-in intent name, or a built-in intent name with "AMAZON." removed. For
// example, because there is a built-in intent called AMAZON.HelpIntent , you can't
// create a custom intent called HelpIntent . For a list of built-in intents, see
// Standard Built-in Intents (https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/standard-intents)
// in the Alexa Skills Kit.
//
// This member is required.
Name *string
// Identifies a specific revision of the $LATEST version. When you create a new
// intent, leave the checksum field blank. If you specify a checksum you get a
// BadRequestException exception. When you want to update a intent, set the
// checksum field to the checksum of the most recent revision of the $LATEST
// version. If you don't specify the checksum field, or if the checksum does not
// match the $LATEST version, you get a PreconditionFailedException exception.
Checksum *string
// The statement that you want Amazon Lex to convey to the user after the intent
// is successfully fulfilled by the Lambda function. This element is relevant only
// if you provide a Lambda function in the fulfillmentActivity . If you return the
// intent to the client application, you can't specify this element. The
// followUpPrompt and conclusionStatement are mutually exclusive. You can specify
// only one.
ConclusionStatement *types.Statement
// Prompts the user to confirm the intent. This question should have a yes or no
// answer. Amazon Lex uses this prompt to ensure that the user acknowledges that
// the intent is ready for fulfillment. For example, with the OrderPizza intent,
// you might want to confirm that the order is correct before placing it. For other
// intents, such as intents that simply respond to user questions, you might not
// need to ask the user for confirmation before providing the information. You you
// must provide both the rejectionStatement and the confirmationPrompt , or neither.
ConfirmationPrompt *types.Prompt
// When set to true a new numbered version of the intent is created. This is the
// same as calling the CreateIntentVersion operation. If you do not specify
// createVersion , the default is false .
CreateVersion *bool
// A description of the intent.
Description *string
// Specifies a Lambda function to invoke for each user input. You can invoke this
// Lambda function to personalize user interaction. For example, suppose your bot
// determines that the user is John. Your Lambda function might retrieve John's
// information from a backend database and prepopulate some of the values. For
// example, if you find that John is gluten intolerant, you might set the
// corresponding intent slot, GlutenIntolerant , to true. You might find John's
// phone number and set the corresponding session attribute.
DialogCodeHook *types.CodeHook
// Amazon Lex uses this prompt to solicit additional activity after fulfilling an
// intent. For example, after the OrderPizza intent is fulfilled, you might prompt
// the user to order a drink. The action that Amazon Lex takes depends on the
// user's response, as follows:
// - If the user says "Yes" it responds with the clarification prompt that is
// configured for the bot.
// - if the user says "Yes" and continues with an utterance that triggers an
// intent it starts a conversation for the intent.
// - If the user says "No" it responds with the rejection statement configured
// for the the follow-up prompt.
// - If it doesn't recognize the utterance it repeats the follow-up prompt
// again.
// The followUpPrompt field and the conclusionStatement field are mutually
// exclusive. You can specify only one.
FollowUpPrompt *types.FollowUpPrompt
// Required. Describes how the intent is fulfilled. For example, after a user
// provides all of the information for a pizza order, fulfillmentActivity defines
// how the bot places an order with a local pizza store. You might configure Amazon
// Lex to return all of the intent information to the client application, or direct
// it to invoke a Lambda function that can process the intent (for example, place
// an order with a pizzeria).
FulfillmentActivity *types.FulfillmentActivity
// An array of InputContext objects that lists the contexts that must be active
// for Amazon Lex to choose the intent in a conversation with the user.
InputContexts []types.InputContext
// Configuration information required to use the AMAZON.KendraSearchIntent intent
// to connect to an Amazon Kendra index. For more information, see
// AMAZON.KendraSearchIntent (http://docs.aws.amazon.com/lex/latest/dg/built-in-intent-kendra-search.html)
// .
KendraConfiguration *types.KendraConfiguration
// An array of OutputContext objects that lists the contexts that the intent
// activates when the intent is fulfilled.
OutputContexts []types.OutputContext
// A unique identifier for the built-in intent to base this intent on. To find the
// signature for an intent, see Standard Built-in Intents (https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/standard-intents)
// in the Alexa Skills Kit.
ParentIntentSignature *string
// When the user answers "no" to the question defined in confirmationPrompt ,
// Amazon Lex responds with this statement to acknowledge that the intent was
// canceled. You must provide both the rejectionStatement and the
// confirmationPrompt , or neither.
RejectionStatement *types.Statement
// An array of utterances (strings) that a user might say to signal the intent.
// For example, "I want {PizzaSize} pizza", "Order {Quantity} {PizzaSize} pizzas".
// In each utterance, a slot name is enclosed in curly braces.
SampleUtterances []string
// An array of intent slots. At runtime, Amazon Lex elicits required slot values
// from the user using prompts defined in the slots. For more information, see
// how-it-works .
Slots []types.Slot
noSmithyDocumentSerde
}
type PutIntentOutput struct {
// Checksum of the $LATEST version of the intent created or updated.
Checksum *string
// After the Lambda function specified in the fulfillmentActivity intent fulfills
// the intent, Amazon Lex conveys this statement to the user.
ConclusionStatement *types.Statement
// If defined in the intent, Amazon Lex prompts the user to confirm the intent
// before fulfilling it.
ConfirmationPrompt *types.Prompt
// True if a new version of the intent was created. If the createVersion field was
// not specified in the request, the createVersion field is set to false in the
// response.
CreateVersion *bool
// The date that the intent was created.
CreatedDate *time.Time
// A description of the intent.
Description *string
// If defined in the intent, Amazon Lex invokes this Lambda function for each user
// input.
DialogCodeHook *types.CodeHook
// If defined in the intent, Amazon Lex uses this prompt to solicit additional
// user activity after the intent is fulfilled.
FollowUpPrompt *types.FollowUpPrompt
// If defined in the intent, Amazon Lex invokes this Lambda function to fulfill
// the intent after the user provides all of the information required by the
// intent.
FulfillmentActivity *types.FulfillmentActivity
// An array of InputContext objects that lists the contexts that must be active
// for Amazon Lex to choose the intent in a conversation with the user.
InputContexts []types.InputContext
// Configuration information, if any, required to connect to an Amazon Kendra
// index and use the AMAZON.KendraSearchIntent intent.
KendraConfiguration *types.KendraConfiguration
// The date that the intent was updated. When you create a resource, the creation
// date and last update dates are the same.
LastUpdatedDate *time.Time
// The name of the intent.
Name *string
// An array of OutputContext objects that lists the contexts that the intent
// activates when the intent is fulfilled.
OutputContexts []types.OutputContext
// A unique identifier for the built-in intent that this intent is based on.
ParentIntentSignature *string
// If the user answers "no" to the question defined in confirmationPrompt Amazon
// Lex responds with this statement to acknowledge that the intent was canceled.
RejectionStatement *types.Statement
// An array of sample utterances that are configured for the intent.
SampleUtterances []string
// An array of intent slots that are configured for the intent.
Slots []types.Slot
// The version of the intent. For a new intent, the version is always $LATEST .
Version *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutIntentMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutIntent{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutIntent{}, 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 = addOpPutIntentValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutIntent(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_opPutIntent(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "PutIntent",
}
}
| 334 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates a custom slot type or replaces an existing custom slot type. To create
// a custom slot type, specify a name for the slot type and a set of enumeration
// values, which are the values that a slot of this type can assume. For more
// information, see how-it-works . If you specify the name of an existing slot
// type, the fields in the request replace the existing values in the $LATEST
// version of the slot type. Amazon Lex removes the fields that you don't provide
// in the request. If you don't specify required fields, Amazon Lex throws an
// exception. When you update the $LATEST version of a slot type, if a bot uses
// the $LATEST version of an intent that contains the slot type, the bot's status
// field is set to NOT_BUILT . This operation requires permissions for the
// lex:PutSlotType action.
func (c *Client) PutSlotType(ctx context.Context, params *PutSlotTypeInput, optFns ...func(*Options)) (*PutSlotTypeOutput, error) {
if params == nil {
params = &PutSlotTypeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutSlotType", params, optFns, c.addOperationPutSlotTypeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutSlotTypeOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutSlotTypeInput struct {
// The name of the slot type. The name is not case sensitive. The name can't match
// a built-in slot type name, or a built-in slot type name with "AMAZON." removed.
// For example, because there is a built-in slot type called AMAZON.DATE , you
// can't create a custom slot type called DATE . For a list of built-in slot types,
// see Slot Type Reference (https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/slot-type-reference)
// in the Alexa Skills Kit.
//
// This member is required.
Name *string
// Identifies a specific revision of the $LATEST version. When you create a new
// slot type, leave the checksum field blank. If you specify a checksum you get a
// BadRequestException exception. When you want to update a slot type, set the
// checksum field to the checksum of the most recent revision of the $LATEST
// version. If you don't specify the checksum field, or if the checksum does not
// match the $LATEST version, you get a PreconditionFailedException exception.
Checksum *string
// When set to true a new numbered version of the slot type is created. This is
// the same as calling the CreateSlotTypeVersion operation. If you do not specify
// createVersion , the default is false .
CreateVersion *bool
// A description of the slot type.
Description *string
// A list of EnumerationValue objects that defines the values that the slot type
// can take. Each value can have a list of synonyms , which are additional values
// that help train the machine learning model about the values that it resolves for
// a slot. A regular expression slot type doesn't require enumeration values. All
// other slot types require a list of enumeration values. When Amazon Lex resolves
// a slot value, it generates a resolution list that contains up to five possible
// values for the slot. If you are using a Lambda function, this resolution list is
// passed to the function. If you are not using a Lambda function you can choose to
// return the value that the user entered or the first value in the resolution list
// as the slot value. The valueSelectionStrategy field indicates the option to use.
EnumerationValues []types.EnumerationValue
// The built-in slot type used as the parent of the slot type. When you define a
// parent slot type, the new slot type has all of the same configuration as the
// parent. Only AMAZON.AlphaNumeric is supported.
ParentSlotTypeSignature *string
// Configuration information that extends the parent built-in slot type. The
// configuration is added to the settings for the parent slot type.
SlotTypeConfigurations []types.SlotTypeConfiguration
// Determines the slot resolution strategy that Amazon Lex uses to return slot
// type values. The field can be set to one of the following values:
// - ORIGINAL_VALUE - Returns the value entered by the user, if the user value is
// similar to the slot value.
// - TOP_RESOLUTION - If there is a resolution list for the slot, return the
// first value in the resolution list as the slot type value. If there is no
// resolution list, null is returned.
// If you don't specify the valueSelectionStrategy , the default is ORIGINAL_VALUE .
ValueSelectionStrategy types.SlotValueSelectionStrategy
noSmithyDocumentSerde
}
type PutSlotTypeOutput struct {
// Checksum of the $LATEST version of the slot type.
Checksum *string
// True if a new version of the slot type was created. If the createVersion field
// was not specified in the request, the createVersion field is set to false in
// the response.
CreateVersion *bool
// The date that the slot type was created.
CreatedDate *time.Time
// A description of the slot type.
Description *string
// A list of EnumerationValue objects that defines the values that the slot type
// can take.
EnumerationValues []types.EnumerationValue
// The date that the slot type was updated. When you create a slot type, the
// creation date and last update date are the same.
LastUpdatedDate *time.Time
// The name of the slot type.
Name *string
// The built-in slot type used as the parent of the slot type.
ParentSlotTypeSignature *string
// Configuration information that extends the parent built-in slot type.
SlotTypeConfigurations []types.SlotTypeConfiguration
// The slot resolution strategy that Amazon Lex uses to determine the value of the
// slot. For more information, see PutSlotType .
ValueSelectionStrategy types.SlotValueSelectionStrategy
// The version of the slot type. For a new slot type, the version is always
// $LATEST .
Version *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutSlotTypeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutSlotType{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutSlotType{}, 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 = addOpPutSlotTypeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutSlotType(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_opPutSlotType(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "PutSlotType",
}
}
| 224 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Starts a job to import a resource to Amazon Lex.
func (c *Client) StartImport(ctx context.Context, params *StartImportInput, optFns ...func(*Options)) (*StartImportOutput, error) {
if params == nil {
params = &StartImportInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartImport", params, optFns, c.addOperationStartImportMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartImportOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartImportInput struct {
// Specifies the action that the StartImport operation should take when there is
// an existing resource with the same name.
// - FAIL_ON_CONFLICT - The import operation is stopped on the first conflict
// between a resource in the import file and an existing resource. The name of the
// resource causing the conflict is in the failureReason field of the response to
// the GetImport operation. OVERWRITE_LATEST - The import operation proceeds even
// if there is a conflict with an existing resource. The $LASTEST version of the
// existing resource is overwritten with the data from the import file.
//
// This member is required.
MergeStrategy types.MergeStrategy
// A zip archive in binary format. The archive should contain one file, a JSON
// file containing the resource to import. The resource should match the type
// specified in the resourceType field.
//
// This member is required.
Payload []byte
// Specifies the type of resource to export. Each resource also exports any
// resources that it depends on.
// - A bot exports dependent intents.
// - An intent exports dependent slot types.
//
// This member is required.
ResourceType types.ResourceType
// A list of tags to add to the imported bot. You can only add tags when you
// import a bot, you can't add tags to an intent or slot type.
Tags []types.Tag
noSmithyDocumentSerde
}
type StartImportOutput struct {
// A timestamp for the date and time that the import job was requested.
CreatedDate *time.Time
// The identifier for the specific import job.
ImportId *string
// The status of the import job. If the status is FAILED , you can get the reason
// for the failure using the GetImport operation.
ImportStatus types.ImportStatus
// The action to take when there is a merge conflict.
MergeStrategy types.MergeStrategy
// The name given to the import job.
Name *string
// The type of resource to import.
ResourceType types.ResourceType
// A list of tags added to the imported bot.
Tags []types.Tag
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStartImportMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpStartImport{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartImport{}, 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 = addOpStartImportValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartImport(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_opStartImport(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "StartImport",
}
}
| 171 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Starts migrating a bot from Amazon Lex V1 to Amazon Lex V2. Migrate your bot
// when you want to take advantage of the new features of Amazon Lex V2. For more
// information, see Migrating a bot (https://docs.aws.amazon.com/lex/latest/dg/migrate.html)
// in the Amazon Lex developer guide.
func (c *Client) StartMigration(ctx context.Context, params *StartMigrationInput, optFns ...func(*Options)) (*StartMigrationOutput, error) {
if params == nil {
params = &StartMigrationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "StartMigration", params, optFns, c.addOperationStartMigrationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*StartMigrationOutput)
out.ResultMetadata = metadata
return out, nil
}
type StartMigrationInput struct {
// The strategy used to conduct the migration.
// - CREATE_NEW - Creates a new Amazon Lex V2 bot and migrates the Amazon Lex V1
// bot to the new bot.
// - UPDATE_EXISTING - Overwrites the existing Amazon Lex V2 bot metadata and the
// locale being migrated. It doesn't change any other locales in the Amazon Lex V2
// bot. If the locale doesn't exist, a new locale is created in the Amazon Lex V2
// bot.
//
// This member is required.
MigrationStrategy types.MigrationStrategy
// The name of the Amazon Lex V1 bot that you are migrating to Amazon Lex V2.
//
// This member is required.
V1BotName *string
// The version of the bot to migrate to Amazon Lex V2. You can migrate the $LATEST
// version as well as any numbered version.
//
// This member is required.
V1BotVersion *string
// The name of the Amazon Lex V2 bot that you are migrating the Amazon Lex V1 bot
// to.
// - If the Amazon Lex V2 bot doesn't exist, you must use the CREATE_NEW
// migration strategy.
// - If the Amazon Lex V2 bot exists, you must use the UPDATE_EXISTING migration
// strategy to change the contents of the Amazon Lex V2 bot.
//
// This member is required.
V2BotName *string
// The IAM role that Amazon Lex uses to run the Amazon Lex V2 bot.
//
// This member is required.
V2BotRole *string
noSmithyDocumentSerde
}
type StartMigrationOutput struct {
// The unique identifier that Amazon Lex assigned to the migration.
MigrationId *string
// The strategy used to conduct the migration.
MigrationStrategy types.MigrationStrategy
// The date and time that the migration started.
MigrationTimestamp *time.Time
// The locale used for the Amazon Lex V1 bot.
V1BotLocale types.Locale
// The name of the Amazon Lex V1 bot that you are migrating to Amazon Lex V2.
V1BotName *string
// The version of the bot to migrate to Amazon Lex V2.
V1BotVersion *string
// The unique identifier for the Amazon Lex V2 bot.
V2BotId *string
// The IAM role that Amazon Lex uses to run the Amazon Lex V2 bot.
V2BotRole *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationStartMigrationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpStartMigration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartMigration{}, 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 = addOpStartMigrationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartMigration(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_opStartMigration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "StartMigration",
}
}
| 182 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds the specified tags to the specified resource. If a tag key already exists,
// the existing value is replaced with the new value.
func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) {
if params == nil {
params = &TagResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*TagResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type TagResourceInput struct {
// The Amazon Resource Name (ARN) of the bot, bot alias, or bot channel to tag.
//
// This member is required.
ResourceArn *string
// A list of tag keys to add to the resource. If a tag key already exists, the
// existing value is replaced with the new value.
//
// This member is required.
Tags []types.Tag
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: "lex",
OperationName: "TagResource",
}
}
| 128 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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 tags from a bot, bot alias or bot channel.
func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) {
if params == nil {
params = &UntagResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UntagResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type UntagResourceInput struct {
// The Amazon Resource Name (ARN) of the resource to remove the tags from.
//
// This member is required.
ResourceArn *string
// A list of tag keys to remove from the resource. If a tag key does not exist on
// the resource, it is ignored.
//
// 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: "lex",
OperationName: "UntagResource",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
import (
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice/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_deserializeOpCreateBotVersion struct {
}
func (*awsRestjson1_deserializeOpCreateBotVersion) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateBotVersion) 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_deserializeOpErrorCreateBotVersion(response, &metadata)
}
output := &CreateBotVersionOutput{}
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_deserializeOpDocumentCreateBotVersionOutput(&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_deserializeOpErrorCreateBotVersion(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("PreconditionFailedException", errorCode):
return awsRestjson1_deserializeErrorPreconditionFailedException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateBotVersionOutput(v **CreateBotVersionOutput, 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 *CreateBotVersionOutput
if *v == nil {
sv = &CreateBotVersionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "abortStatement":
if err := awsRestjson1_deserializeDocumentStatement(&sv.AbortStatement, value); err != nil {
return err
}
case "checksum":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Checksum = ptr.String(jtv)
}
case "childDirected":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.ChildDirected = ptr.Bool(jtv)
}
case "clarificationPrompt":
if err := awsRestjson1_deserializeDocumentPrompt(&sv.ClarificationPrompt, value); err != nil {
return err
}
case "createdDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Description to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "detectSentiment":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.DetectSentiment = ptr.Bool(jtv)
}
case "enableModelImprovements":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.EnableModelImprovements = ptr.Bool(jtv)
}
case "failureReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.FailureReason = ptr.String(jtv)
}
case "idleSessionTTLInSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected SessionTTL to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.IdleSessionTTLInSeconds = ptr.Int32(int32(i64))
}
case "intents":
if err := awsRestjson1_deserializeDocumentIntentList(&sv.Intents, value); err != nil {
return err
}
case "lastUpdatedDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUpdatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "locale":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Locale to be of type string, got %T instead", value)
}
sv.Locale = types.Locale(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BotName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Status to be of type string, got %T instead", value)
}
sv.Status = types.Status(jtv)
}
case "version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Version to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
case "voiceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.VoiceId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateIntentVersion struct {
}
func (*awsRestjson1_deserializeOpCreateIntentVersion) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateIntentVersion) 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_deserializeOpErrorCreateIntentVersion(response, &metadata)
}
output := &CreateIntentVersionOutput{}
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_deserializeOpDocumentCreateIntentVersionOutput(&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_deserializeOpErrorCreateIntentVersion(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("PreconditionFailedException", errorCode):
return awsRestjson1_deserializeErrorPreconditionFailedException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateIntentVersionOutput(v **CreateIntentVersionOutput, 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 *CreateIntentVersionOutput
if *v == nil {
sv = &CreateIntentVersionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "checksum":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Checksum = ptr.String(jtv)
}
case "conclusionStatement":
if err := awsRestjson1_deserializeDocumentStatement(&sv.ConclusionStatement, value); err != nil {
return err
}
case "confirmationPrompt":
if err := awsRestjson1_deserializeDocumentPrompt(&sv.ConfirmationPrompt, value); err != nil {
return err
}
case "createdDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Description to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "dialogCodeHook":
if err := awsRestjson1_deserializeDocumentCodeHook(&sv.DialogCodeHook, value); err != nil {
return err
}
case "followUpPrompt":
if err := awsRestjson1_deserializeDocumentFollowUpPrompt(&sv.FollowUpPrompt, value); err != nil {
return err
}
case "fulfillmentActivity":
if err := awsRestjson1_deserializeDocumentFulfillmentActivity(&sv.FulfillmentActivity, value); err != nil {
return err
}
case "inputContexts":
if err := awsRestjson1_deserializeDocumentInputContextList(&sv.InputContexts, value); err != nil {
return err
}
case "kendraConfiguration":
if err := awsRestjson1_deserializeDocumentKendraConfiguration(&sv.KendraConfiguration, value); err != nil {
return err
}
case "lastUpdatedDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUpdatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IntentName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "outputContexts":
if err := awsRestjson1_deserializeDocumentOutputContextList(&sv.OutputContexts, value); err != nil {
return err
}
case "parentIntentSignature":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BuiltinIntentSignature to be of type string, got %T instead", value)
}
sv.ParentIntentSignature = ptr.String(jtv)
}
case "rejectionStatement":
if err := awsRestjson1_deserializeDocumentStatement(&sv.RejectionStatement, value); err != nil {
return err
}
case "sampleUtterances":
if err := awsRestjson1_deserializeDocumentIntentUtteranceList(&sv.SampleUtterances, value); err != nil {
return err
}
case "slots":
if err := awsRestjson1_deserializeDocumentSlotList(&sv.Slots, value); err != nil {
return err
}
case "version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Version to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateSlotTypeVersion struct {
}
func (*awsRestjson1_deserializeOpCreateSlotTypeVersion) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateSlotTypeVersion) 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_deserializeOpErrorCreateSlotTypeVersion(response, &metadata)
}
output := &CreateSlotTypeVersionOutput{}
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_deserializeOpDocumentCreateSlotTypeVersionOutput(&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_deserializeOpErrorCreateSlotTypeVersion(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("PreconditionFailedException", errorCode):
return awsRestjson1_deserializeErrorPreconditionFailedException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateSlotTypeVersionOutput(v **CreateSlotTypeVersionOutput, 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 *CreateSlotTypeVersionOutput
if *v == nil {
sv = &CreateSlotTypeVersionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "checksum":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Checksum = ptr.String(jtv)
}
case "createdDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Description to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "enumerationValues":
if err := awsRestjson1_deserializeDocumentEnumerationValues(&sv.EnumerationValues, value); err != nil {
return err
}
case "lastUpdatedDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUpdatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SlotTypeName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "parentSlotTypeSignature":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CustomOrBuiltinSlotTypeName to be of type string, got %T instead", value)
}
sv.ParentSlotTypeSignature = ptr.String(jtv)
}
case "slotTypeConfigurations":
if err := awsRestjson1_deserializeDocumentSlotTypeConfigurations(&sv.SlotTypeConfigurations, value); err != nil {
return err
}
case "valueSelectionStrategy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SlotValueSelectionStrategy to be of type string, got %T instead", value)
}
sv.ValueSelectionStrategy = types.SlotValueSelectionStrategy(jtv)
}
case "version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Version to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDeleteBot struct {
}
func (*awsRestjson1_deserializeOpDeleteBot) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteBot) 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_deserializeOpErrorDeleteBot(response, &metadata)
}
output := &DeleteBotOutput{}
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_deserializeOpErrorDeleteBot(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeleteBotAlias struct {
}
func (*awsRestjson1_deserializeOpDeleteBotAlias) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteBotAlias) 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_deserializeOpErrorDeleteBotAlias(response, &metadata)
}
output := &DeleteBotAliasOutput{}
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_deserializeOpErrorDeleteBotAlias(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeleteBotChannelAssociation struct {
}
func (*awsRestjson1_deserializeOpDeleteBotChannelAssociation) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteBotChannelAssociation) 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_deserializeOpErrorDeleteBotChannelAssociation(response, &metadata)
}
output := &DeleteBotChannelAssociationOutput{}
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_deserializeOpErrorDeleteBotChannelAssociation(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeleteBotVersion struct {
}
func (*awsRestjson1_deserializeOpDeleteBotVersion) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteBotVersion) 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_deserializeOpErrorDeleteBotVersion(response, &metadata)
}
output := &DeleteBotVersionOutput{}
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_deserializeOpErrorDeleteBotVersion(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeleteIntent struct {
}
func (*awsRestjson1_deserializeOpDeleteIntent) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteIntent) 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_deserializeOpErrorDeleteIntent(response, &metadata)
}
output := &DeleteIntentOutput{}
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_deserializeOpErrorDeleteIntent(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeleteIntentVersion struct {
}
func (*awsRestjson1_deserializeOpDeleteIntentVersion) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteIntentVersion) 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_deserializeOpErrorDeleteIntentVersion(response, &metadata)
}
output := &DeleteIntentVersionOutput{}
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_deserializeOpErrorDeleteIntentVersion(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeleteSlotType struct {
}
func (*awsRestjson1_deserializeOpDeleteSlotType) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteSlotType) 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_deserializeOpErrorDeleteSlotType(response, &metadata)
}
output := &DeleteSlotTypeOutput{}
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_deserializeOpErrorDeleteSlotType(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeleteSlotTypeVersion struct {
}
func (*awsRestjson1_deserializeOpDeleteSlotTypeVersion) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteSlotTypeVersion) 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_deserializeOpErrorDeleteSlotTypeVersion(response, &metadata)
}
output := &DeleteSlotTypeVersionOutput{}
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_deserializeOpErrorDeleteSlotTypeVersion(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("ResourceInUseException", errorCode):
return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeleteUtterances struct {
}
func (*awsRestjson1_deserializeOpDeleteUtterances) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteUtterances) 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_deserializeOpErrorDeleteUtterances(response, &metadata)
}
output := &DeleteUtterancesOutput{}
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_deserializeOpErrorDeleteUtterances(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpGetBot struct {
}
func (*awsRestjson1_deserializeOpGetBot) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetBot) 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_deserializeOpErrorGetBot(response, &metadata)
}
output := &GetBotOutput{}
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_deserializeOpDocumentGetBotOutput(&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_deserializeOpErrorGetBot(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetBotOutput(v **GetBotOutput, 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 *GetBotOutput
if *v == nil {
sv = &GetBotOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "abortStatement":
if err := awsRestjson1_deserializeDocumentStatement(&sv.AbortStatement, value); err != nil {
return err
}
case "checksum":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Checksum = ptr.String(jtv)
}
case "childDirected":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.ChildDirected = ptr.Bool(jtv)
}
case "clarificationPrompt":
if err := awsRestjson1_deserializeDocumentPrompt(&sv.ClarificationPrompt, value); err != nil {
return err
}
case "createdDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Description to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "detectSentiment":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.DetectSentiment = ptr.Bool(jtv)
}
case "enableModelImprovements":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.EnableModelImprovements = ptr.Bool(jtv)
}
case "failureReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.FailureReason = ptr.String(jtv)
}
case "idleSessionTTLInSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected SessionTTL to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.IdleSessionTTLInSeconds = ptr.Int32(int32(i64))
}
case "intents":
if err := awsRestjson1_deserializeDocumentIntentList(&sv.Intents, value); err != nil {
return err
}
case "lastUpdatedDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUpdatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "locale":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Locale to be of type string, got %T instead", value)
}
sv.Locale = types.Locale(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BotName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "nluIntentConfidenceThreshold":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.NluIntentConfidenceThreshold = ptr.Float64(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.NluIntentConfidenceThreshold = ptr.Float64(f64)
default:
return fmt.Errorf("expected ConfidenceThreshold to be a JSON Number, got %T instead", value)
}
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Status to be of type string, got %T instead", value)
}
sv.Status = types.Status(jtv)
}
case "version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Version to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
case "voiceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.VoiceId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetBotAlias struct {
}
func (*awsRestjson1_deserializeOpGetBotAlias) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetBotAlias) 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_deserializeOpErrorGetBotAlias(response, &metadata)
}
output := &GetBotAliasOutput{}
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_deserializeOpDocumentGetBotAliasOutput(&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_deserializeOpErrorGetBotAlias(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetBotAliasOutput(v **GetBotAliasOutput, 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 *GetBotAliasOutput
if *v == nil {
sv = &GetBotAliasOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "botName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BotName to be of type string, got %T instead", value)
}
sv.BotName = ptr.String(jtv)
}
case "botVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Version to be of type string, got %T instead", value)
}
sv.BotVersion = ptr.String(jtv)
}
case "checksum":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Checksum = ptr.String(jtv)
}
case "conversationLogs":
if err := awsRestjson1_deserializeDocumentConversationLogsResponse(&sv.ConversationLogs, value); err != nil {
return err
}
case "createdDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Description to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "lastUpdatedDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUpdatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AliasName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetBotAliases struct {
}
func (*awsRestjson1_deserializeOpGetBotAliases) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetBotAliases) 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_deserializeOpErrorGetBotAliases(response, &metadata)
}
output := &GetBotAliasesOutput{}
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_deserializeOpDocumentGetBotAliasesOutput(&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_deserializeOpErrorGetBotAliases(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetBotAliasesOutput(v **GetBotAliasesOutput, 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 *GetBotAliasesOutput
if *v == nil {
sv = &GetBotAliasesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "BotAliases":
if err := awsRestjson1_deserializeDocumentBotAliasMetadataList(&sv.BotAliases, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetBotChannelAssociation struct {
}
func (*awsRestjson1_deserializeOpGetBotChannelAssociation) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetBotChannelAssociation) 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_deserializeOpErrorGetBotChannelAssociation(response, &metadata)
}
output := &GetBotChannelAssociationOutput{}
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_deserializeOpDocumentGetBotChannelAssociationOutput(&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_deserializeOpErrorGetBotChannelAssociation(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetBotChannelAssociationOutput(v **GetBotChannelAssociationOutput, 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 *GetBotChannelAssociationOutput
if *v == nil {
sv = &GetBotChannelAssociationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "botAlias":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AliasName to be of type string, got %T instead", value)
}
sv.BotAlias = ptr.String(jtv)
}
case "botConfiguration":
if err := awsRestjson1_deserializeDocumentChannelConfigurationMap(&sv.BotConfiguration, value); err != nil {
return err
}
case "botName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BotName to be of type string, got %T instead", value)
}
sv.BotName = ptr.String(jtv)
}
case "createdDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Description to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "failureReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.FailureReason = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BotChannelName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChannelStatus to be of type string, got %T instead", value)
}
sv.Status = types.ChannelStatus(jtv)
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChannelType to be of type string, got %T instead", value)
}
sv.Type = types.ChannelType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetBotChannelAssociations struct {
}
func (*awsRestjson1_deserializeOpGetBotChannelAssociations) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetBotChannelAssociations) 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_deserializeOpErrorGetBotChannelAssociations(response, &metadata)
}
output := &GetBotChannelAssociationsOutput{}
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_deserializeOpDocumentGetBotChannelAssociationsOutput(&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_deserializeOpErrorGetBotChannelAssociations(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetBotChannelAssociationsOutput(v **GetBotChannelAssociationsOutput, 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 *GetBotChannelAssociationsOutput
if *v == nil {
sv = &GetBotChannelAssociationsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "botChannelAssociations":
if err := awsRestjson1_deserializeDocumentBotChannelAssociationList(&sv.BotChannelAssociations, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetBots struct {
}
func (*awsRestjson1_deserializeOpGetBots) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetBots) 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_deserializeOpErrorGetBots(response, &metadata)
}
output := &GetBotsOutput{}
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_deserializeOpDocumentGetBotsOutput(&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_deserializeOpErrorGetBots(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetBotsOutput(v **GetBotsOutput, 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 *GetBotsOutput
if *v == nil {
sv = &GetBotsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "bots":
if err := awsRestjson1_deserializeDocumentBotMetadataList(&sv.Bots, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetBotVersions struct {
}
func (*awsRestjson1_deserializeOpGetBotVersions) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetBotVersions) 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_deserializeOpErrorGetBotVersions(response, &metadata)
}
output := &GetBotVersionsOutput{}
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_deserializeOpDocumentGetBotVersionsOutput(&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_deserializeOpErrorGetBotVersions(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetBotVersionsOutput(v **GetBotVersionsOutput, 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 *GetBotVersionsOutput
if *v == nil {
sv = &GetBotVersionsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "bots":
if err := awsRestjson1_deserializeDocumentBotMetadataList(&sv.Bots, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetBuiltinIntent struct {
}
func (*awsRestjson1_deserializeOpGetBuiltinIntent) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetBuiltinIntent) 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_deserializeOpErrorGetBuiltinIntent(response, &metadata)
}
output := &GetBuiltinIntentOutput{}
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_deserializeOpDocumentGetBuiltinIntentOutput(&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_deserializeOpErrorGetBuiltinIntent(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetBuiltinIntentOutput(v **GetBuiltinIntentOutput, 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 *GetBuiltinIntentOutput
if *v == nil {
sv = &GetBuiltinIntentOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "signature":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BuiltinIntentSignature to be of type string, got %T instead", value)
}
sv.Signature = ptr.String(jtv)
}
case "slots":
if err := awsRestjson1_deserializeDocumentBuiltinIntentSlotList(&sv.Slots, value); err != nil {
return err
}
case "supportedLocales":
if err := awsRestjson1_deserializeDocumentLocaleList(&sv.SupportedLocales, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetBuiltinIntents struct {
}
func (*awsRestjson1_deserializeOpGetBuiltinIntents) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetBuiltinIntents) 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_deserializeOpErrorGetBuiltinIntents(response, &metadata)
}
output := &GetBuiltinIntentsOutput{}
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_deserializeOpDocumentGetBuiltinIntentsOutput(&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_deserializeOpErrorGetBuiltinIntents(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetBuiltinIntentsOutput(v **GetBuiltinIntentsOutput, 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 *GetBuiltinIntentsOutput
if *v == nil {
sv = &GetBuiltinIntentsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "intents":
if err := awsRestjson1_deserializeDocumentBuiltinIntentMetadataList(&sv.Intents, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetBuiltinSlotTypes struct {
}
func (*awsRestjson1_deserializeOpGetBuiltinSlotTypes) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetBuiltinSlotTypes) 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_deserializeOpErrorGetBuiltinSlotTypes(response, &metadata)
}
output := &GetBuiltinSlotTypesOutput{}
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_deserializeOpDocumentGetBuiltinSlotTypesOutput(&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_deserializeOpErrorGetBuiltinSlotTypes(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetBuiltinSlotTypesOutput(v **GetBuiltinSlotTypesOutput, 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 *GetBuiltinSlotTypesOutput
if *v == nil {
sv = &GetBuiltinSlotTypesOutput{}
} 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 NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "slotTypes":
if err := awsRestjson1_deserializeDocumentBuiltinSlotTypeMetadataList(&sv.SlotTypes, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetExport struct {
}
func (*awsRestjson1_deserializeOpGetExport) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetExport) 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_deserializeOpErrorGetExport(response, &metadata)
}
output := &GetExportOutput{}
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_deserializeOpDocumentGetExportOutput(&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_deserializeOpErrorGetExport(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetExportOutput(v **GetExportOutput, 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 *GetExportOutput
if *v == nil {
sv = &GetExportOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "exportStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExportStatus to be of type string, got %T instead", value)
}
sv.ExportStatus = types.ExportStatus(jtv)
}
case "exportType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExportType to be of type string, got %T instead", value)
}
sv.ExportType = types.ExportType(jtv)
}
case "failureReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.FailureReason = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Name to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "resourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value)
}
sv.ResourceType = types.ResourceType(jtv)
}
case "url":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Url = ptr.String(jtv)
}
case "version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NumericalVersion to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetImport struct {
}
func (*awsRestjson1_deserializeOpGetImport) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetImport) 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_deserializeOpErrorGetImport(response, &metadata)
}
output := &GetImportOutput{}
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_deserializeOpDocumentGetImportOutput(&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_deserializeOpErrorGetImport(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetImportOutput(v **GetImportOutput, 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 *GetImportOutput
if *v == nil {
sv = &GetImportOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "createdDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "failureReason":
if err := awsRestjson1_deserializeDocumentStringList(&sv.FailureReason, value); err != nil {
return err
}
case "importId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ImportId = ptr.String(jtv)
}
case "importStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImportStatus to be of type string, got %T instead", value)
}
sv.ImportStatus = types.ImportStatus(jtv)
}
case "mergeStrategy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MergeStrategy to be of type string, got %T instead", value)
}
sv.MergeStrategy = types.MergeStrategy(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Name to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "resourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value)
}
sv.ResourceType = types.ResourceType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetIntent struct {
}
func (*awsRestjson1_deserializeOpGetIntent) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetIntent) 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_deserializeOpErrorGetIntent(response, &metadata)
}
output := &GetIntentOutput{}
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_deserializeOpDocumentGetIntentOutput(&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_deserializeOpErrorGetIntent(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetIntentOutput(v **GetIntentOutput, 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 *GetIntentOutput
if *v == nil {
sv = &GetIntentOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "checksum":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Checksum = ptr.String(jtv)
}
case "conclusionStatement":
if err := awsRestjson1_deserializeDocumentStatement(&sv.ConclusionStatement, value); err != nil {
return err
}
case "confirmationPrompt":
if err := awsRestjson1_deserializeDocumentPrompt(&sv.ConfirmationPrompt, value); err != nil {
return err
}
case "createdDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Description to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "dialogCodeHook":
if err := awsRestjson1_deserializeDocumentCodeHook(&sv.DialogCodeHook, value); err != nil {
return err
}
case "followUpPrompt":
if err := awsRestjson1_deserializeDocumentFollowUpPrompt(&sv.FollowUpPrompt, value); err != nil {
return err
}
case "fulfillmentActivity":
if err := awsRestjson1_deserializeDocumentFulfillmentActivity(&sv.FulfillmentActivity, value); err != nil {
return err
}
case "inputContexts":
if err := awsRestjson1_deserializeDocumentInputContextList(&sv.InputContexts, value); err != nil {
return err
}
case "kendraConfiguration":
if err := awsRestjson1_deserializeDocumentKendraConfiguration(&sv.KendraConfiguration, value); err != nil {
return err
}
case "lastUpdatedDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUpdatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IntentName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "outputContexts":
if err := awsRestjson1_deserializeDocumentOutputContextList(&sv.OutputContexts, value); err != nil {
return err
}
case "parentIntentSignature":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BuiltinIntentSignature to be of type string, got %T instead", value)
}
sv.ParentIntentSignature = ptr.String(jtv)
}
case "rejectionStatement":
if err := awsRestjson1_deserializeDocumentStatement(&sv.RejectionStatement, value); err != nil {
return err
}
case "sampleUtterances":
if err := awsRestjson1_deserializeDocumentIntentUtteranceList(&sv.SampleUtterances, value); err != nil {
return err
}
case "slots":
if err := awsRestjson1_deserializeDocumentSlotList(&sv.Slots, value); err != nil {
return err
}
case "version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Version to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetIntents struct {
}
func (*awsRestjson1_deserializeOpGetIntents) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetIntents) 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_deserializeOpErrorGetIntents(response, &metadata)
}
output := &GetIntentsOutput{}
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_deserializeOpDocumentGetIntentsOutput(&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_deserializeOpErrorGetIntents(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetIntentsOutput(v **GetIntentsOutput, 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 *GetIntentsOutput
if *v == nil {
sv = &GetIntentsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "intents":
if err := awsRestjson1_deserializeDocumentIntentMetadataList(&sv.Intents, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetIntentVersions struct {
}
func (*awsRestjson1_deserializeOpGetIntentVersions) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetIntentVersions) 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_deserializeOpErrorGetIntentVersions(response, &metadata)
}
output := &GetIntentVersionsOutput{}
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_deserializeOpDocumentGetIntentVersionsOutput(&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_deserializeOpErrorGetIntentVersions(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetIntentVersionsOutput(v **GetIntentVersionsOutput, 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 *GetIntentVersionsOutput
if *v == nil {
sv = &GetIntentVersionsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "intents":
if err := awsRestjson1_deserializeDocumentIntentMetadataList(&sv.Intents, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetMigration struct {
}
func (*awsRestjson1_deserializeOpGetMigration) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetMigration) 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_deserializeOpErrorGetMigration(response, &metadata)
}
output := &GetMigrationOutput{}
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_deserializeOpDocumentGetMigrationOutput(&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_deserializeOpErrorGetMigration(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetMigrationOutput(v **GetMigrationOutput, 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 *GetMigrationOutput
if *v == nil {
sv = &GetMigrationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "alerts":
if err := awsRestjson1_deserializeDocumentMigrationAlerts(&sv.Alerts, value); err != nil {
return err
}
case "migrationId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MigrationId to be of type string, got %T instead", value)
}
sv.MigrationId = ptr.String(jtv)
}
case "migrationStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MigrationStatus to be of type string, got %T instead", value)
}
sv.MigrationStatus = types.MigrationStatus(jtv)
}
case "migrationStrategy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MigrationStrategy to be of type string, got %T instead", value)
}
sv.MigrationStrategy = types.MigrationStrategy(jtv)
}
case "migrationTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.MigrationTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "v1BotLocale":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Locale to be of type string, got %T instead", value)
}
sv.V1BotLocale = types.Locale(jtv)
}
case "v1BotName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BotName to be of type string, got %T instead", value)
}
sv.V1BotName = ptr.String(jtv)
}
case "v1BotVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Version to be of type string, got %T instead", value)
}
sv.V1BotVersion = ptr.String(jtv)
}
case "v2BotId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected V2BotId to be of type string, got %T instead", value)
}
sv.V2BotId = ptr.String(jtv)
}
case "v2BotRole":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IamRoleArn to be of type string, got %T instead", value)
}
sv.V2BotRole = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetMigrations struct {
}
func (*awsRestjson1_deserializeOpGetMigrations) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetMigrations) 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_deserializeOpErrorGetMigrations(response, &metadata)
}
output := &GetMigrationsOutput{}
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_deserializeOpDocumentGetMigrationsOutput(&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_deserializeOpErrorGetMigrations(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetMigrationsOutput(v **GetMigrationsOutput, 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 *GetMigrationsOutput
if *v == nil {
sv = &GetMigrationsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "migrationSummaries":
if err := awsRestjson1_deserializeDocumentMigrationSummaryList(&sv.MigrationSummaries, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetSlotType struct {
}
func (*awsRestjson1_deserializeOpGetSlotType) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetSlotType) 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_deserializeOpErrorGetSlotType(response, &metadata)
}
output := &GetSlotTypeOutput{}
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_deserializeOpDocumentGetSlotTypeOutput(&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_deserializeOpErrorGetSlotType(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetSlotTypeOutput(v **GetSlotTypeOutput, 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 *GetSlotTypeOutput
if *v == nil {
sv = &GetSlotTypeOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "checksum":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Checksum = ptr.String(jtv)
}
case "createdDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Description to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "enumerationValues":
if err := awsRestjson1_deserializeDocumentEnumerationValues(&sv.EnumerationValues, value); err != nil {
return err
}
case "lastUpdatedDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUpdatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SlotTypeName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "parentSlotTypeSignature":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CustomOrBuiltinSlotTypeName to be of type string, got %T instead", value)
}
sv.ParentSlotTypeSignature = ptr.String(jtv)
}
case "slotTypeConfigurations":
if err := awsRestjson1_deserializeDocumentSlotTypeConfigurations(&sv.SlotTypeConfigurations, value); err != nil {
return err
}
case "valueSelectionStrategy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SlotValueSelectionStrategy to be of type string, got %T instead", value)
}
sv.ValueSelectionStrategy = types.SlotValueSelectionStrategy(jtv)
}
case "version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Version to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetSlotTypes struct {
}
func (*awsRestjson1_deserializeOpGetSlotTypes) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetSlotTypes) 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_deserializeOpErrorGetSlotTypes(response, &metadata)
}
output := &GetSlotTypesOutput{}
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_deserializeOpDocumentGetSlotTypesOutput(&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_deserializeOpErrorGetSlotTypes(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetSlotTypesOutput(v **GetSlotTypesOutput, 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 *GetSlotTypesOutput
if *v == nil {
sv = &GetSlotTypesOutput{}
} 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 NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "slotTypes":
if err := awsRestjson1_deserializeDocumentSlotTypeMetadataList(&sv.SlotTypes, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetSlotTypeVersions struct {
}
func (*awsRestjson1_deserializeOpGetSlotTypeVersions) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetSlotTypeVersions) 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_deserializeOpErrorGetSlotTypeVersions(response, &metadata)
}
output := &GetSlotTypeVersionsOutput{}
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_deserializeOpDocumentGetSlotTypeVersionsOutput(&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_deserializeOpErrorGetSlotTypeVersions(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetSlotTypeVersionsOutput(v **GetSlotTypeVersionsOutput, 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 *GetSlotTypeVersionsOutput
if *v == nil {
sv = &GetSlotTypeVersionsOutput{}
} 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 NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "slotTypes":
if err := awsRestjson1_deserializeDocumentSlotTypeMetadataList(&sv.SlotTypes, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetUtterancesView struct {
}
func (*awsRestjson1_deserializeOpGetUtterancesView) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetUtterancesView) 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_deserializeOpErrorGetUtterancesView(response, &metadata)
}
output := &GetUtterancesViewOutput{}
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_deserializeOpDocumentGetUtterancesViewOutput(&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_deserializeOpErrorGetUtterancesView(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetUtterancesViewOutput(v **GetUtterancesViewOutput, 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 *GetUtterancesViewOutput
if *v == nil {
sv = &GetUtterancesViewOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "botName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BotName to be of type string, got %T instead", value)
}
sv.BotName = ptr.String(jtv)
}
case "utterances":
if err := awsRestjson1_deserializeDocumentListsOfUtterances(&sv.Utterances, 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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(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_deserializeDocumentTagList(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpPutBot struct {
}
func (*awsRestjson1_deserializeOpPutBot) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutBot) 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_deserializeOpErrorPutBot(response, &metadata)
}
output := &PutBotOutput{}
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_deserializeOpDocumentPutBotOutput(&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_deserializeOpErrorPutBot(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("PreconditionFailedException", errorCode):
return awsRestjson1_deserializeErrorPreconditionFailedException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentPutBotOutput(v **PutBotOutput, 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 *PutBotOutput
if *v == nil {
sv = &PutBotOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "abortStatement":
if err := awsRestjson1_deserializeDocumentStatement(&sv.AbortStatement, value); err != nil {
return err
}
case "checksum":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Checksum = ptr.String(jtv)
}
case "childDirected":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.ChildDirected = ptr.Bool(jtv)
}
case "clarificationPrompt":
if err := awsRestjson1_deserializeDocumentPrompt(&sv.ClarificationPrompt, value); err != nil {
return err
}
case "createdDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "createVersion":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.CreateVersion = ptr.Bool(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Description to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "detectSentiment":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.DetectSentiment = ptr.Bool(jtv)
}
case "enableModelImprovements":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.EnableModelImprovements = ptr.Bool(jtv)
}
case "failureReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.FailureReason = ptr.String(jtv)
}
case "idleSessionTTLInSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected SessionTTL to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.IdleSessionTTLInSeconds = ptr.Int32(int32(i64))
}
case "intents":
if err := awsRestjson1_deserializeDocumentIntentList(&sv.Intents, value); err != nil {
return err
}
case "lastUpdatedDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUpdatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "locale":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Locale to be of type string, got %T instead", value)
}
sv.Locale = types.Locale(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BotName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "nluIntentConfidenceThreshold":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.NluIntentConfidenceThreshold = ptr.Float64(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.NluIntentConfidenceThreshold = ptr.Float64(f64)
default:
return fmt.Errorf("expected ConfidenceThreshold to be a JSON Number, got %T instead", value)
}
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Status to be of type string, got %T instead", value)
}
sv.Status = types.Status(jtv)
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil {
return err
}
case "version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Version to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
case "voiceId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.VoiceId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpPutBotAlias struct {
}
func (*awsRestjson1_deserializeOpPutBotAlias) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutBotAlias) 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_deserializeOpErrorPutBotAlias(response, &metadata)
}
output := &PutBotAliasOutput{}
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_deserializeOpDocumentPutBotAliasOutput(&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_deserializeOpErrorPutBotAlias(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("PreconditionFailedException", errorCode):
return awsRestjson1_deserializeErrorPreconditionFailedException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentPutBotAliasOutput(v **PutBotAliasOutput, 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 *PutBotAliasOutput
if *v == nil {
sv = &PutBotAliasOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "botName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BotName to be of type string, got %T instead", value)
}
sv.BotName = ptr.String(jtv)
}
case "botVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Version to be of type string, got %T instead", value)
}
sv.BotVersion = ptr.String(jtv)
}
case "checksum":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Checksum = ptr.String(jtv)
}
case "conversationLogs":
if err := awsRestjson1_deserializeDocumentConversationLogsResponse(&sv.ConversationLogs, value); err != nil {
return err
}
case "createdDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Description to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "lastUpdatedDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUpdatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AliasName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpPutIntent struct {
}
func (*awsRestjson1_deserializeOpPutIntent) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutIntent) 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_deserializeOpErrorPutIntent(response, &metadata)
}
output := &PutIntentOutput{}
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_deserializeOpDocumentPutIntentOutput(&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_deserializeOpErrorPutIntent(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("PreconditionFailedException", errorCode):
return awsRestjson1_deserializeErrorPreconditionFailedException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentPutIntentOutput(v **PutIntentOutput, 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 *PutIntentOutput
if *v == nil {
sv = &PutIntentOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "checksum":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Checksum = ptr.String(jtv)
}
case "conclusionStatement":
if err := awsRestjson1_deserializeDocumentStatement(&sv.ConclusionStatement, value); err != nil {
return err
}
case "confirmationPrompt":
if err := awsRestjson1_deserializeDocumentPrompt(&sv.ConfirmationPrompt, value); err != nil {
return err
}
case "createdDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "createVersion":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.CreateVersion = ptr.Bool(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Description to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "dialogCodeHook":
if err := awsRestjson1_deserializeDocumentCodeHook(&sv.DialogCodeHook, value); err != nil {
return err
}
case "followUpPrompt":
if err := awsRestjson1_deserializeDocumentFollowUpPrompt(&sv.FollowUpPrompt, value); err != nil {
return err
}
case "fulfillmentActivity":
if err := awsRestjson1_deserializeDocumentFulfillmentActivity(&sv.FulfillmentActivity, value); err != nil {
return err
}
case "inputContexts":
if err := awsRestjson1_deserializeDocumentInputContextList(&sv.InputContexts, value); err != nil {
return err
}
case "kendraConfiguration":
if err := awsRestjson1_deserializeDocumentKendraConfiguration(&sv.KendraConfiguration, value); err != nil {
return err
}
case "lastUpdatedDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUpdatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IntentName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "outputContexts":
if err := awsRestjson1_deserializeDocumentOutputContextList(&sv.OutputContexts, value); err != nil {
return err
}
case "parentIntentSignature":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BuiltinIntentSignature to be of type string, got %T instead", value)
}
sv.ParentIntentSignature = ptr.String(jtv)
}
case "rejectionStatement":
if err := awsRestjson1_deserializeDocumentStatement(&sv.RejectionStatement, value); err != nil {
return err
}
case "sampleUtterances":
if err := awsRestjson1_deserializeDocumentIntentUtteranceList(&sv.SampleUtterances, value); err != nil {
return err
}
case "slots":
if err := awsRestjson1_deserializeDocumentSlotList(&sv.Slots, value); err != nil {
return err
}
case "version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Version to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpPutSlotType struct {
}
func (*awsRestjson1_deserializeOpPutSlotType) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutSlotType) 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_deserializeOpErrorPutSlotType(response, &metadata)
}
output := &PutSlotTypeOutput{}
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_deserializeOpDocumentPutSlotTypeOutput(&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_deserializeOpErrorPutSlotType(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("PreconditionFailedException", errorCode):
return awsRestjson1_deserializeErrorPreconditionFailedException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentPutSlotTypeOutput(v **PutSlotTypeOutput, 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 *PutSlotTypeOutput
if *v == nil {
sv = &PutSlotTypeOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "checksum":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Checksum = ptr.String(jtv)
}
case "createdDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "createVersion":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value)
}
sv.CreateVersion = ptr.Bool(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Description to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "enumerationValues":
if err := awsRestjson1_deserializeDocumentEnumerationValues(&sv.EnumerationValues, value); err != nil {
return err
}
case "lastUpdatedDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUpdatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SlotTypeName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "parentSlotTypeSignature":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CustomOrBuiltinSlotTypeName to be of type string, got %T instead", value)
}
sv.ParentSlotTypeSignature = ptr.String(jtv)
}
case "slotTypeConfigurations":
if err := awsRestjson1_deserializeDocumentSlotTypeConfigurations(&sv.SlotTypeConfigurations, value); err != nil {
return err
}
case "valueSelectionStrategy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SlotValueSelectionStrategy to be of type string, got %T instead", value)
}
sv.ValueSelectionStrategy = types.SlotValueSelectionStrategy(jtv)
}
case "version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Version to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpStartImport struct {
}
func (*awsRestjson1_deserializeOpStartImport) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpStartImport) 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_deserializeOpErrorStartImport(response, &metadata)
}
output := &StartImportOutput{}
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_deserializeOpDocumentStartImportOutput(&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_deserializeOpErrorStartImport(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("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentStartImportOutput(v **StartImportOutput, 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 *StartImportOutput
if *v == nil {
sv = &StartImportOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "createdDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "importId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ImportId = ptr.String(jtv)
}
case "importStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImportStatus to be of type string, got %T instead", value)
}
sv.ImportStatus = types.ImportStatus(jtv)
}
case "mergeStrategy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MergeStrategy to be of type string, got %T instead", value)
}
sv.MergeStrategy = types.MergeStrategy(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Name to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "resourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value)
}
sv.ResourceType = types.ResourceType(jtv)
}
case "tags":
if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpStartMigration struct {
}
func (*awsRestjson1_deserializeOpStartMigration) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpStartMigration) 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_deserializeOpErrorStartMigration(response, &metadata)
}
output := &StartMigrationOutput{}
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_deserializeOpDocumentStartMigrationOutput(&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_deserializeOpErrorStartMigration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentStartMigrationOutput(v **StartMigrationOutput, 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 *StartMigrationOutput
if *v == nil {
sv = &StartMigrationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "migrationId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MigrationId to be of type string, got %T instead", value)
}
sv.MigrationId = ptr.String(jtv)
}
case "migrationStrategy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MigrationStrategy to be of type string, got %T instead", value)
}
sv.MigrationStrategy = types.MigrationStrategy(jtv)
}
case "migrationTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.MigrationTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "v1BotLocale":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Locale to be of type string, got %T instead", value)
}
sv.V1BotLocale = types.Locale(jtv)
}
case "v1BotName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BotName to be of type string, got %T instead", value)
}
sv.V1BotName = ptr.String(jtv)
}
case "v1BotVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Version to be of type string, got %T instead", value)
}
sv.V1BotVersion = ptr.String(jtv)
}
case "v2BotId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected V2BotId to be of type string, got %T instead", value)
}
sv.V2BotId = ptr.String(jtv)
}
case "v2BotRole":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IamRoleArn to be of type string, got %T instead", value)
}
sv.V2BotRole = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpTagResource struct {
}
func (*awsRestjson1_deserializeOpTagResource) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata)
}
output := &TagResourceOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(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
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("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalFailureException", errorCode):
return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpHttpBindingsLimitExceededException(v *types.LimitExceededException, response *smithyhttp.Response) error {
if v == nil {
return fmt.Errorf("unsupported deserialization for nil %T", v)
}
if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
v.RetryAfterSeconds = ptr.String(headerValues[0])
}
return nil
}
func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.AccessDeniedException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_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_deserializeErrorInternalFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.InternalFailureException{}
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_deserializeDocumentInternalFailureException(&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_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.LimitExceededException{}
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_deserializeDocumentLimitExceededException(&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)
if err := awsRestjson1_deserializeOpHttpBindingsLimitExceededException(output, response); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)}
}
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_deserializeErrorPreconditionFailedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.PreconditionFailedException{}
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_deserializeDocumentPreconditionFailedException(&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_deserializeErrorResourceInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ResourceInUseException{}
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_deserializeDocumentResourceInUseException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AccessDeniedException
if *v == nil {
sv = &types.AccessDeniedException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_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_deserializeDocumentBotAliasMetadata(v **types.BotAliasMetadata, 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.BotAliasMetadata
if *v == nil {
sv = &types.BotAliasMetadata{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "botName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BotName to be of type string, got %T instead", value)
}
sv.BotName = ptr.String(jtv)
}
case "botVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Version to be of type string, got %T instead", value)
}
sv.BotVersion = ptr.String(jtv)
}
case "checksum":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Checksum = ptr.String(jtv)
}
case "conversationLogs":
if err := awsRestjson1_deserializeDocumentConversationLogsResponse(&sv.ConversationLogs, value); err != nil {
return err
}
case "createdDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Description to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "lastUpdatedDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUpdatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AliasName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentBotAliasMetadataList(v *[]types.BotAliasMetadata, 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.BotAliasMetadata
if *v == nil {
cv = []types.BotAliasMetadata{}
} else {
cv = *v
}
for _, value := range shape {
var col types.BotAliasMetadata
destAddr := &col
if err := awsRestjson1_deserializeDocumentBotAliasMetadata(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentBotChannelAssociation(v **types.BotChannelAssociation, 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.BotChannelAssociation
if *v == nil {
sv = &types.BotChannelAssociation{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "botAlias":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AliasName to be of type string, got %T instead", value)
}
sv.BotAlias = ptr.String(jtv)
}
case "botConfiguration":
if err := awsRestjson1_deserializeDocumentChannelConfigurationMap(&sv.BotConfiguration, value); err != nil {
return err
}
case "botName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BotName to be of type string, got %T instead", value)
}
sv.BotName = ptr.String(jtv)
}
case "createdDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Description to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "failureReason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.FailureReason = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BotChannelName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChannelStatus to be of type string, got %T instead", value)
}
sv.Status = types.ChannelStatus(jtv)
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ChannelType to be of type string, got %T instead", value)
}
sv.Type = types.ChannelType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentBotChannelAssociationList(v *[]types.BotChannelAssociation, 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.BotChannelAssociation
if *v == nil {
cv = []types.BotChannelAssociation{}
} else {
cv = *v
}
for _, value := range shape {
var col types.BotChannelAssociation
destAddr := &col
if err := awsRestjson1_deserializeDocumentBotChannelAssociation(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentBotMetadata(v **types.BotMetadata, 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.BotMetadata
if *v == nil {
sv = &types.BotMetadata{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "createdDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Description to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "lastUpdatedDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUpdatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BotName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Status to be of type string, got %T instead", value)
}
sv.Status = types.Status(jtv)
}
case "version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Version to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentBotMetadataList(v *[]types.BotMetadata, 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.BotMetadata
if *v == nil {
cv = []types.BotMetadata{}
} else {
cv = *v
}
for _, value := range shape {
var col types.BotMetadata
destAddr := &col
if err := awsRestjson1_deserializeDocumentBotMetadata(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentBuiltinIntentMetadata(v **types.BuiltinIntentMetadata, 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.BuiltinIntentMetadata
if *v == nil {
sv = &types.BuiltinIntentMetadata{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "signature":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BuiltinIntentSignature to be of type string, got %T instead", value)
}
sv.Signature = ptr.String(jtv)
}
case "supportedLocales":
if err := awsRestjson1_deserializeDocumentLocaleList(&sv.SupportedLocales, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentBuiltinIntentMetadataList(v *[]types.BuiltinIntentMetadata, 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.BuiltinIntentMetadata
if *v == nil {
cv = []types.BuiltinIntentMetadata{}
} else {
cv = *v
}
for _, value := range shape {
var col types.BuiltinIntentMetadata
destAddr := &col
if err := awsRestjson1_deserializeDocumentBuiltinIntentMetadata(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentBuiltinIntentSlot(v **types.BuiltinIntentSlot, 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.BuiltinIntentSlot
if *v == nil {
sv = &types.BuiltinIntentSlot{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
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_deserializeDocumentBuiltinIntentSlotList(v *[]types.BuiltinIntentSlot, 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.BuiltinIntentSlot
if *v == nil {
cv = []types.BuiltinIntentSlot{}
} else {
cv = *v
}
for _, value := range shape {
var col types.BuiltinIntentSlot
destAddr := &col
if err := awsRestjson1_deserializeDocumentBuiltinIntentSlot(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentBuiltinSlotTypeMetadata(v **types.BuiltinSlotTypeMetadata, 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.BuiltinSlotTypeMetadata
if *v == nil {
sv = &types.BuiltinSlotTypeMetadata{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "signature":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BuiltinSlotTypeSignature to be of type string, got %T instead", value)
}
sv.Signature = ptr.String(jtv)
}
case "supportedLocales":
if err := awsRestjson1_deserializeDocumentLocaleList(&sv.SupportedLocales, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentBuiltinSlotTypeMetadataList(v *[]types.BuiltinSlotTypeMetadata, 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.BuiltinSlotTypeMetadata
if *v == nil {
cv = []types.BuiltinSlotTypeMetadata{}
} else {
cv = *v
}
for _, value := range shape {
var col types.BuiltinSlotTypeMetadata
destAddr := &col
if err := awsRestjson1_deserializeDocumentBuiltinSlotTypeMetadata(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentChannelConfigurationMap(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_deserializeDocumentCodeHook(v **types.CodeHook, 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.CodeHook
if *v == nil {
sv = &types.CodeHook{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "messageVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MessageVersion to be of type string, got %T instead", value)
}
sv.MessageVersion = ptr.String(jtv)
}
case "uri":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LambdaARN to be of type string, got %T instead", value)
}
sv.Uri = 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_deserializeDocumentConversationLogsResponse(v **types.ConversationLogsResponse, 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.ConversationLogsResponse
if *v == nil {
sv = &types.ConversationLogsResponse{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "iamRoleArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IamRoleArn to be of type string, got %T instead", value)
}
sv.IamRoleArn = ptr.String(jtv)
}
case "logSettings":
if err := awsRestjson1_deserializeDocumentLogSettingsResponseList(&sv.LogSettings, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentEnumerationValue(v **types.EnumerationValue, 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.EnumerationValue
if *v == nil {
sv = &types.EnumerationValue{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "synonyms":
if err := awsRestjson1_deserializeDocumentSynonymList(&sv.Synonyms, value); err != nil {
return err
}
case "value":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Value to be of type string, got %T instead", value)
}
sv.Value = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentEnumerationValues(v *[]types.EnumerationValue, 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.EnumerationValue
if *v == nil {
cv = []types.EnumerationValue{}
} else {
cv = *v
}
for _, value := range shape {
var col types.EnumerationValue
destAddr := &col
if err := awsRestjson1_deserializeDocumentEnumerationValue(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentFollowUpPrompt(v **types.FollowUpPrompt, 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.FollowUpPrompt
if *v == nil {
sv = &types.FollowUpPrompt{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "prompt":
if err := awsRestjson1_deserializeDocumentPrompt(&sv.Prompt, value); err != nil {
return err
}
case "rejectionStatement":
if err := awsRestjson1_deserializeDocumentStatement(&sv.RejectionStatement, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentFulfillmentActivity(v **types.FulfillmentActivity, 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.FulfillmentActivity
if *v == nil {
sv = &types.FulfillmentActivity{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "codeHook":
if err := awsRestjson1_deserializeDocumentCodeHook(&sv.CodeHook, value); err != nil {
return err
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FulfillmentActivityType to be of type string, got %T instead", value)
}
sv.Type = types.FulfillmentActivityType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentInputContext(v **types.InputContext, 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.InputContext
if *v == nil {
sv = &types.InputContext{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected InputContextName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentInputContextList(v *[]types.InputContext, 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.InputContext
if *v == nil {
cv = []types.InputContext{}
} else {
cv = *v
}
for _, value := range shape {
var col types.InputContext
destAddr := &col
if err := awsRestjson1_deserializeDocumentInputContext(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentIntent(v **types.Intent, 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.Intent
if *v == nil {
sv = &types.Intent{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "intentName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IntentName to be of type string, got %T instead", value)
}
sv.IntentName = ptr.String(jtv)
}
case "intentVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Version to be of type string, got %T instead", value)
}
sv.IntentVersion = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentIntentList(v *[]types.Intent, 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.Intent
if *v == nil {
cv = []types.Intent{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Intent
destAddr := &col
if err := awsRestjson1_deserializeDocumentIntent(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentIntentMetadata(v **types.IntentMetadata, 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.IntentMetadata
if *v == nil {
sv = &types.IntentMetadata{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "createdDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Description to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "lastUpdatedDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUpdatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IntentName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Version to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentIntentMetadataList(v *[]types.IntentMetadata, 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.IntentMetadata
if *v == nil {
cv = []types.IntentMetadata{}
} else {
cv = *v
}
for _, value := range shape {
var col types.IntentMetadata
destAddr := &col
if err := awsRestjson1_deserializeDocumentIntentMetadata(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentIntentUtteranceList(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 Utterance to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentInternalFailureException(v **types.InternalFailureException, 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.InternalFailureException
if *v == nil {
sv = &types.InternalFailureException{}
} 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_deserializeDocumentKendraConfiguration(v **types.KendraConfiguration, 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.KendraConfiguration
if *v == nil {
sv = &types.KendraConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "kendraIndex":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected KendraIndexArn to be of type string, got %T instead", value)
}
sv.KendraIndex = ptr.String(jtv)
}
case "queryFilterString":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected QueryFilterString to be of type string, got %T instead", value)
}
sv.QueryFilterString = ptr.String(jtv)
}
case "role":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected roleArn to be of type string, got %T instead", value)
}
sv.Role = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentLimitExceededException(v **types.LimitExceededException, 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.LimitExceededException
if *v == nil {
sv = &types.LimitExceededException{}
} 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)
}
case "retryAfterSeconds":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.RetryAfterSeconds = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentListOfUtterance(v *[]types.UtteranceData, 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.UtteranceData
if *v == nil {
cv = []types.UtteranceData{}
} else {
cv = *v
}
for _, value := range shape {
var col types.UtteranceData
destAddr := &col
if err := awsRestjson1_deserializeDocumentUtteranceData(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentListsOfUtterances(v *[]types.UtteranceList, 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.UtteranceList
if *v == nil {
cv = []types.UtteranceList{}
} else {
cv = *v
}
for _, value := range shape {
var col types.UtteranceList
destAddr := &col
if err := awsRestjson1_deserializeDocumentUtteranceList(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentLocaleList(v *[]types.Locale, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Locale
if *v == nil {
cv = []types.Locale{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Locale
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Locale to be of type string, got %T instead", value)
}
col = types.Locale(jtv)
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentLogSettingsResponse(v **types.LogSettingsResponse, 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.LogSettingsResponse
if *v == nil {
sv = &types.LogSettingsResponse{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "destination":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Destination to be of type string, got %T instead", value)
}
sv.Destination = types.Destination(jtv)
}
case "kmsKeyArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value)
}
sv.KmsKeyArn = ptr.String(jtv)
}
case "logType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected LogType to be of type string, got %T instead", value)
}
sv.LogType = types.LogType(jtv)
}
case "resourceArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceArn to be of type string, got %T instead", value)
}
sv.ResourceArn = ptr.String(jtv)
}
case "resourcePrefix":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourcePrefix to be of type string, got %T instead", value)
}
sv.ResourcePrefix = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentLogSettingsResponseList(v *[]types.LogSettingsResponse, 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.LogSettingsResponse
if *v == nil {
cv = []types.LogSettingsResponse{}
} else {
cv = *v
}
for _, value := range shape {
var col types.LogSettingsResponse
destAddr := &col
if err := awsRestjson1_deserializeDocumentLogSettingsResponse(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentMessage(v **types.Message, 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.Message
if *v == nil {
sv = &types.Message{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "content":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ContentString to be of type string, got %T instead", value)
}
sv.Content = ptr.String(jtv)
}
case "contentType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ContentType to be of type string, got %T instead", value)
}
sv.ContentType = types.ContentType(jtv)
}
case "groupNumber":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected GroupNumber to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.GroupNumber = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentMessageList(v *[]types.Message, 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.Message
if *v == nil {
cv = []types.Message{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Message
destAddr := &col
if err := awsRestjson1_deserializeDocumentMessage(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentMigrationAlert(v **types.MigrationAlert, 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.MigrationAlert
if *v == nil {
sv = &types.MigrationAlert{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "details":
if err := awsRestjson1_deserializeDocumentMigrationAlertDetails(&sv.Details, value); err != nil {
return err
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MigrationAlertMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "referenceURLs":
if err := awsRestjson1_deserializeDocumentMigrationAlertReferenceURLs(&sv.ReferenceURLs, value); err != nil {
return err
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MigrationAlertType to be of type string, got %T instead", value)
}
sv.Type = types.MigrationAlertType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentMigrationAlertDetails(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 MigrationAlertDetail to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentMigrationAlertReferenceURLs(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 MigrationAlertReferenceURL to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentMigrationAlerts(v *[]types.MigrationAlert, 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.MigrationAlert
if *v == nil {
cv = []types.MigrationAlert{}
} else {
cv = *v
}
for _, value := range shape {
var col types.MigrationAlert
destAddr := &col
if err := awsRestjson1_deserializeDocumentMigrationAlert(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentMigrationSummary(v **types.MigrationSummary, 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.MigrationSummary
if *v == nil {
sv = &types.MigrationSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "migrationId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MigrationId to be of type string, got %T instead", value)
}
sv.MigrationId = ptr.String(jtv)
}
case "migrationStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MigrationStatus to be of type string, got %T instead", value)
}
sv.MigrationStatus = types.MigrationStatus(jtv)
}
case "migrationStrategy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MigrationStrategy to be of type string, got %T instead", value)
}
sv.MigrationStrategy = types.MigrationStrategy(jtv)
}
case "migrationTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.MigrationTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "v1BotLocale":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Locale to be of type string, got %T instead", value)
}
sv.V1BotLocale = types.Locale(jtv)
}
case "v1BotName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BotName to be of type string, got %T instead", value)
}
sv.V1BotName = ptr.String(jtv)
}
case "v1BotVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Version to be of type string, got %T instead", value)
}
sv.V1BotVersion = ptr.String(jtv)
}
case "v2BotId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected V2BotId to be of type string, got %T instead", value)
}
sv.V2BotId = ptr.String(jtv)
}
case "v2BotRole":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IamRoleArn to be of type string, got %T instead", value)
}
sv.V2BotRole = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentMigrationSummaryList(v *[]types.MigrationSummary, 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.MigrationSummary
if *v == nil {
cv = []types.MigrationSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.MigrationSummary
destAddr := &col
if err := awsRestjson1_deserializeDocumentMigrationSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
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_deserializeDocumentOutputContext(v **types.OutputContext, 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.OutputContext
if *v == nil {
sv = &types.OutputContext{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OutputContextName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "timeToLiveInSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected ContextTimeToLiveInSeconds to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TimeToLiveInSeconds = ptr.Int32(int32(i64))
}
case "turnsToLive":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected ContextTurnsToLive to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.TurnsToLive = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentOutputContextList(v *[]types.OutputContext, 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.OutputContext
if *v == nil {
cv = []types.OutputContext{}
} else {
cv = *v
}
for _, value := range shape {
var col types.OutputContext
destAddr := &col
if err := awsRestjson1_deserializeDocumentOutputContext(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentPreconditionFailedException(v **types.PreconditionFailedException, 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.PreconditionFailedException
if *v == nil {
sv = &types.PreconditionFailedException{}
} 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_deserializeDocumentPrompt(v **types.Prompt, 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.Prompt
if *v == nil {
sv = &types.Prompt{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "maxAttempts":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected PromptMaxAttempts to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MaxAttempts = ptr.Int32(int32(i64))
}
case "messages":
if err := awsRestjson1_deserializeDocumentMessageList(&sv.Messages, value); err != nil {
return err
}
case "responseCard":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResponseCard to be of type string, got %T instead", value)
}
sv.ResponseCard = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentResourceInUseException(v **types.ResourceInUseException, 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.ResourceInUseException
if *v == nil {
sv = &types.ResourceInUseException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "exampleReference":
if err := awsRestjson1_deserializeDocumentResourceReference(&sv.ExampleReference, value); err != nil {
return err
}
case "referenceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ReferenceType to be of type string, got %T instead", value)
}
sv.ReferenceType = types.ReferenceType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentResourceReference(v **types.ResourceReference, 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.ResourceReference
if *v == nil {
sv = &types.ResourceReference{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Name to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Version to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSlot(v **types.Slot, 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.Slot
if *v == nil {
sv = &types.Slot{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "defaultValueSpec":
if err := awsRestjson1_deserializeDocumentSlotDefaultValueSpec(&sv.DefaultValueSpec, value); err != nil {
return err
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Description to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SlotName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "obfuscationSetting":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ObfuscationSetting to be of type string, got %T instead", value)
}
sv.ObfuscationSetting = types.ObfuscationSetting(jtv)
}
case "priority":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Priority to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Priority = ptr.Int32(int32(i64))
}
case "responseCard":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResponseCard to be of type string, got %T instead", value)
}
sv.ResponseCard = ptr.String(jtv)
}
case "sampleUtterances":
if err := awsRestjson1_deserializeDocumentSlotUtteranceList(&sv.SampleUtterances, value); err != nil {
return err
}
case "slotConstraint":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SlotConstraint to be of type string, got %T instead", value)
}
sv.SlotConstraint = types.SlotConstraint(jtv)
}
case "slotType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CustomOrBuiltinSlotTypeName to be of type string, got %T instead", value)
}
sv.SlotType = ptr.String(jtv)
}
case "slotTypeVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Version to be of type string, got %T instead", value)
}
sv.SlotTypeVersion = ptr.String(jtv)
}
case "valueElicitationPrompt":
if err := awsRestjson1_deserializeDocumentPrompt(&sv.ValueElicitationPrompt, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSlotDefaultValue(v **types.SlotDefaultValue, 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.SlotDefaultValue
if *v == nil {
sv = &types.SlotDefaultValue{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "defaultValue":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SlotDefaultValueString to be of type string, got %T instead", value)
}
sv.DefaultValue = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSlotDefaultValueList(v *[]types.SlotDefaultValue, 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.SlotDefaultValue
if *v == nil {
cv = []types.SlotDefaultValue{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SlotDefaultValue
destAddr := &col
if err := awsRestjson1_deserializeDocumentSlotDefaultValue(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentSlotDefaultValueSpec(v **types.SlotDefaultValueSpec, 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.SlotDefaultValueSpec
if *v == nil {
sv = &types.SlotDefaultValueSpec{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "defaultValueList":
if err := awsRestjson1_deserializeDocumentSlotDefaultValueList(&sv.DefaultValueList, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSlotList(v *[]types.Slot, 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.Slot
if *v == nil {
cv = []types.Slot{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Slot
destAddr := &col
if err := awsRestjson1_deserializeDocumentSlot(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentSlotTypeConfiguration(v **types.SlotTypeConfiguration, 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.SlotTypeConfiguration
if *v == nil {
sv = &types.SlotTypeConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "regexConfiguration":
if err := awsRestjson1_deserializeDocumentSlotTypeRegexConfiguration(&sv.RegexConfiguration, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSlotTypeConfigurations(v *[]types.SlotTypeConfiguration, 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.SlotTypeConfiguration
if *v == nil {
cv = []types.SlotTypeConfiguration{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SlotTypeConfiguration
destAddr := &col
if err := awsRestjson1_deserializeDocumentSlotTypeConfiguration(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentSlotTypeMetadata(v **types.SlotTypeMetadata, 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.SlotTypeMetadata
if *v == nil {
sv = &types.SlotTypeMetadata{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "createdDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Description to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "lastUpdatedDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUpdatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SlotTypeName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "version":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Version to be of type string, got %T instead", value)
}
sv.Version = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSlotTypeMetadataList(v *[]types.SlotTypeMetadata, 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.SlotTypeMetadata
if *v == nil {
cv = []types.SlotTypeMetadata{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SlotTypeMetadata
destAddr := &col
if err := awsRestjson1_deserializeDocumentSlotTypeMetadata(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentSlotTypeRegexConfiguration(v **types.SlotTypeRegexConfiguration, 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.SlotTypeRegexConfiguration
if *v == nil {
sv = &types.SlotTypeRegexConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "pattern":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RegexPattern to be of type string, got %T instead", value)
}
sv.Pattern = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSlotUtteranceList(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 Utterance to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentStatement(v **types.Statement, 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.Statement
if *v == nil {
sv = &types.Statement{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "messages":
if err := awsRestjson1_deserializeDocumentMessageList(&sv.Messages, value); err != nil {
return err
}
case "responseCard":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResponseCard to be of type string, got %T instead", value)
}
sv.ResponseCard = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentStringList(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentSynonymList(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 Value to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentTag(v **types.Tag, 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.Tag
if *v == nil {
sv = &types.Tag{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "key":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TagKey to be of type string, got %T instead", value)
}
sv.Key = ptr.String(jtv)
}
case "value":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TagValue to be of type string, got %T instead", value)
}
sv.Value = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentTagList(v *[]types.Tag, 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.Tag
if *v == nil {
cv = []types.Tag{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Tag
destAddr := &col
if err := awsRestjson1_deserializeDocumentTag(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentUtteranceData(v **types.UtteranceData, 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.UtteranceData
if *v == nil {
sv = &types.UtteranceData{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "count":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Count to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Count = ptr.Int32(int32(i64))
}
case "distinctUsers":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Count to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.DistinctUsers = ptr.Int32(int32(i64))
}
case "firstUtteredDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.FirstUtteredDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "lastUtteredDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUtteredDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "utteranceString":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UtteranceString to be of type string, got %T instead", value)
}
sv.UtteranceString = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentUtteranceList(v **types.UtteranceList, 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.UtteranceList
if *v == nil {
sv = &types.UtteranceList{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "botVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Version to be of type string, got %T instead", value)
}
sv.BotVersion = ptr.String(jtv)
}
case "utterances":
if err := awsRestjson1_deserializeDocumentListOfUtterance(&sv.Utterances, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
| 11,589 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package lexmodelbuildingservice provides the API client, operations, and
// parameter types for Amazon Lex Model Building Service.
//
// Amazon Lex Build-Time Actions Amazon Lex is an AWS service for building
// conversational voice and text interfaces. Use these actions to create, update,
// and delete conversational bots for new and existing client applications.
package lexmodelbuildingservice
| 10 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
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/lexmodelbuildingservice/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 = "lex"
}
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 lexmodelbuildingservice
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.17.12"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice/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"
"math"
)
type awsRestjson1_serializeOpCreateBotVersion struct {
}
func (*awsRestjson1_serializeOpCreateBotVersion) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateBotVersion) 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.(*CreateBotVersionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{name}/versions")
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_serializeOpHttpBindingsCreateBotVersionInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateBotVersionInput(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_serializeOpHttpBindingsCreateBotVersionInput(v *CreateBotVersionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("name").String(*v.Name); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateBotVersionInput(v *CreateBotVersionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Checksum != nil {
ok := object.Key("checksum")
ok.String(*v.Checksum)
}
return nil
}
type awsRestjson1_serializeOpCreateIntentVersion struct {
}
func (*awsRestjson1_serializeOpCreateIntentVersion) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateIntentVersion) 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.(*CreateIntentVersionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/intents/{name}/versions")
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_serializeOpHttpBindingsCreateIntentVersionInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateIntentVersionInput(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_serializeOpHttpBindingsCreateIntentVersionInput(v *CreateIntentVersionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("name").String(*v.Name); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateIntentVersionInput(v *CreateIntentVersionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Checksum != nil {
ok := object.Key("checksum")
ok.String(*v.Checksum)
}
return nil
}
type awsRestjson1_serializeOpCreateSlotTypeVersion struct {
}
func (*awsRestjson1_serializeOpCreateSlotTypeVersion) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateSlotTypeVersion) 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.(*CreateSlotTypeVersionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/slottypes/{name}/versions")
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_serializeOpHttpBindingsCreateSlotTypeVersionInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateSlotTypeVersionInput(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_serializeOpHttpBindingsCreateSlotTypeVersionInput(v *CreateSlotTypeVersionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("name").String(*v.Name); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateSlotTypeVersionInput(v *CreateSlotTypeVersionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Checksum != nil {
ok := object.Key("checksum")
ok.String(*v.Checksum)
}
return nil
}
type awsRestjson1_serializeOpDeleteBot struct {
}
func (*awsRestjson1_serializeOpDeleteBot) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteBot) 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.(*DeleteBotInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{name}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteBotInput(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_serializeOpHttpBindingsDeleteBotInput(v *DeleteBotInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("name").String(*v.Name); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteBotAlias struct {
}
func (*awsRestjson1_serializeOpDeleteBotAlias) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteBotAlias) 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.(*DeleteBotAliasInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botName}/aliases/{name}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteBotAliasInput(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_serializeOpHttpBindingsDeleteBotAliasInput(v *DeleteBotAliasInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotName == nil || len(*v.BotName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botName must not be empty")}
}
if v.BotName != nil {
if err := encoder.SetURI("botName").String(*v.BotName); err != nil {
return err
}
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("name").String(*v.Name); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteBotChannelAssociation struct {
}
func (*awsRestjson1_serializeOpDeleteBotChannelAssociation) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteBotChannelAssociation) 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.(*DeleteBotChannelAssociationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botName}/aliases/{botAlias}/channels/{name}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteBotChannelAssociationInput(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_serializeOpHttpBindingsDeleteBotChannelAssociationInput(v *DeleteBotChannelAssociationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotAlias == nil || len(*v.BotAlias) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botAlias must not be empty")}
}
if v.BotAlias != nil {
if err := encoder.SetURI("botAlias").String(*v.BotAlias); err != nil {
return err
}
}
if v.BotName == nil || len(*v.BotName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botName must not be empty")}
}
if v.BotName != nil {
if err := encoder.SetURI("botName").String(*v.BotName); err != nil {
return err
}
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("name").String(*v.Name); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteBotVersion struct {
}
func (*awsRestjson1_serializeOpDeleteBotVersion) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteBotVersion) 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.(*DeleteBotVersionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{name}/versions/{version}")
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_serializeOpHttpBindingsDeleteBotVersionInput(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_serializeOpHttpBindingsDeleteBotVersionInput(v *DeleteBotVersionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("name").String(*v.Name); err != nil {
return err
}
}
if v.Version == nil || len(*v.Version) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member version must not be empty")}
}
if v.Version != nil {
if err := encoder.SetURI("version").String(*v.Version); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteIntent struct {
}
func (*awsRestjson1_serializeOpDeleteIntent) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteIntent) 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.(*DeleteIntentInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/intents/{name}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteIntentInput(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_serializeOpHttpBindingsDeleteIntentInput(v *DeleteIntentInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("name").String(*v.Name); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteIntentVersion struct {
}
func (*awsRestjson1_serializeOpDeleteIntentVersion) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteIntentVersion) 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.(*DeleteIntentVersionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/intents/{name}/versions/{version}")
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_serializeOpHttpBindingsDeleteIntentVersionInput(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_serializeOpHttpBindingsDeleteIntentVersionInput(v *DeleteIntentVersionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("name").String(*v.Name); err != nil {
return err
}
}
if v.Version == nil || len(*v.Version) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member version must not be empty")}
}
if v.Version != nil {
if err := encoder.SetURI("version").String(*v.Version); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteSlotType struct {
}
func (*awsRestjson1_serializeOpDeleteSlotType) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteSlotType) 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.(*DeleteSlotTypeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/slottypes/{name}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteSlotTypeInput(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_serializeOpHttpBindingsDeleteSlotTypeInput(v *DeleteSlotTypeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("name").String(*v.Name); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteSlotTypeVersion struct {
}
func (*awsRestjson1_serializeOpDeleteSlotTypeVersion) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteSlotTypeVersion) 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.(*DeleteSlotTypeVersionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/slottypes/{name}/version/{version}")
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_serializeOpHttpBindingsDeleteSlotTypeVersionInput(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_serializeOpHttpBindingsDeleteSlotTypeVersionInput(v *DeleteSlotTypeVersionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("name").String(*v.Name); err != nil {
return err
}
}
if v.Version == nil || len(*v.Version) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member version must not be empty")}
}
if v.Version != nil {
if err := encoder.SetURI("version").String(*v.Version); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteUtterances struct {
}
func (*awsRestjson1_serializeOpDeleteUtterances) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteUtterances) 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.(*DeleteUtterancesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botName}/utterances/{userId}")
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_serializeOpHttpBindingsDeleteUtterancesInput(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_serializeOpHttpBindingsDeleteUtterancesInput(v *DeleteUtterancesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotName == nil || len(*v.BotName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botName must not be empty")}
}
if v.BotName != nil {
if err := encoder.SetURI("botName").String(*v.BotName); err != nil {
return err
}
}
if v.UserId == nil || len(*v.UserId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member userId must not be empty")}
}
if v.UserId != nil {
if err := encoder.SetURI("userId").String(*v.UserId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetBot struct {
}
func (*awsRestjson1_serializeOpGetBot) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetBot) 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.(*GetBotInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{name}/versions/{versionOrAlias}")
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_serializeOpHttpBindingsGetBotInput(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_serializeOpHttpBindingsGetBotInput(v *GetBotInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("name").String(*v.Name); err != nil {
return err
}
}
if v.VersionOrAlias == nil || len(*v.VersionOrAlias) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member versionOrAlias must not be empty")}
}
if v.VersionOrAlias != nil {
if err := encoder.SetURI("versionOrAlias").String(*v.VersionOrAlias); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetBotAlias struct {
}
func (*awsRestjson1_serializeOpGetBotAlias) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetBotAlias) 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.(*GetBotAliasInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botName}/aliases/{name}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetBotAliasInput(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_serializeOpHttpBindingsGetBotAliasInput(v *GetBotAliasInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotName == nil || len(*v.BotName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botName must not be empty")}
}
if v.BotName != nil {
if err := encoder.SetURI("botName").String(*v.BotName); err != nil {
return err
}
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("name").String(*v.Name); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetBotAliases struct {
}
func (*awsRestjson1_serializeOpGetBotAliases) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetBotAliases) 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.(*GetBotAliasesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botName}/aliases")
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_serializeOpHttpBindingsGetBotAliasesInput(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_serializeOpHttpBindingsGetBotAliasesInput(v *GetBotAliasesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotName == nil || len(*v.BotName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botName must not be empty")}
}
if v.BotName != nil {
if err := encoder.SetURI("botName").String(*v.BotName); err != nil {
return err
}
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NameContains != nil {
encoder.SetQuery("nameContains").String(*v.NameContains)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpGetBotChannelAssociation struct {
}
func (*awsRestjson1_serializeOpGetBotChannelAssociation) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetBotChannelAssociation) 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.(*GetBotChannelAssociationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botName}/aliases/{botAlias}/channels/{name}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetBotChannelAssociationInput(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_serializeOpHttpBindingsGetBotChannelAssociationInput(v *GetBotChannelAssociationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotAlias == nil || len(*v.BotAlias) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botAlias must not be empty")}
}
if v.BotAlias != nil {
if err := encoder.SetURI("botAlias").String(*v.BotAlias); err != nil {
return err
}
}
if v.BotName == nil || len(*v.BotName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botName must not be empty")}
}
if v.BotName != nil {
if err := encoder.SetURI("botName").String(*v.BotName); err != nil {
return err
}
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("name").String(*v.Name); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetBotChannelAssociations struct {
}
func (*awsRestjson1_serializeOpGetBotChannelAssociations) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetBotChannelAssociations) 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.(*GetBotChannelAssociationsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botName}/aliases/{botAlias}/channels")
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_serializeOpHttpBindingsGetBotChannelAssociationsInput(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_serializeOpHttpBindingsGetBotChannelAssociationsInput(v *GetBotChannelAssociationsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotAlias == nil || len(*v.BotAlias) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botAlias must not be empty")}
}
if v.BotAlias != nil {
if err := encoder.SetURI("botAlias").String(*v.BotAlias); err != nil {
return err
}
}
if v.BotName == nil || len(*v.BotName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botName must not be empty")}
}
if v.BotName != nil {
if err := encoder.SetURI("botName").String(*v.BotName); err != nil {
return err
}
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NameContains != nil {
encoder.SetQuery("nameContains").String(*v.NameContains)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpGetBots struct {
}
func (*awsRestjson1_serializeOpGetBots) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetBots) 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.(*GetBotsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots")
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_serializeOpHttpBindingsGetBotsInput(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_serializeOpHttpBindingsGetBotsInput(v *GetBotsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NameContains != nil {
encoder.SetQuery("nameContains").String(*v.NameContains)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpGetBotVersions struct {
}
func (*awsRestjson1_serializeOpGetBotVersions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetBotVersions) 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.(*GetBotVersionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{name}/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_serializeOpHttpBindingsGetBotVersionsInput(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_serializeOpHttpBindingsGetBotVersionsInput(v *GetBotVersionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("name").String(*v.Name); err != nil {
return err
}
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpGetBuiltinIntent struct {
}
func (*awsRestjson1_serializeOpGetBuiltinIntent) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetBuiltinIntent) 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.(*GetBuiltinIntentInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/builtins/intents/{signature}")
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_serializeOpHttpBindingsGetBuiltinIntentInput(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_serializeOpHttpBindingsGetBuiltinIntentInput(v *GetBuiltinIntentInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Signature == nil || len(*v.Signature) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member signature must not be empty")}
}
if v.Signature != nil {
if err := encoder.SetURI("signature").String(*v.Signature); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetBuiltinIntents struct {
}
func (*awsRestjson1_serializeOpGetBuiltinIntents) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetBuiltinIntents) 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.(*GetBuiltinIntentsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/builtins/intents")
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_serializeOpHttpBindingsGetBuiltinIntentsInput(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_serializeOpHttpBindingsGetBuiltinIntentsInput(v *GetBuiltinIntentsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if len(v.Locale) > 0 {
encoder.SetQuery("locale").String(string(v.Locale))
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.SignatureContains != nil {
encoder.SetQuery("signatureContains").String(*v.SignatureContains)
}
return nil
}
type awsRestjson1_serializeOpGetBuiltinSlotTypes struct {
}
func (*awsRestjson1_serializeOpGetBuiltinSlotTypes) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetBuiltinSlotTypes) 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.(*GetBuiltinSlotTypesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/builtins/slottypes")
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_serializeOpHttpBindingsGetBuiltinSlotTypesInput(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_serializeOpHttpBindingsGetBuiltinSlotTypesInput(v *GetBuiltinSlotTypesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if len(v.Locale) > 0 {
encoder.SetQuery("locale").String(string(v.Locale))
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.SignatureContains != nil {
encoder.SetQuery("signatureContains").String(*v.SignatureContains)
}
return nil
}
type awsRestjson1_serializeOpGetExport struct {
}
func (*awsRestjson1_serializeOpGetExport) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetExport) 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.(*GetExportInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/exports")
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_serializeOpHttpBindingsGetExportInput(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_serializeOpHttpBindingsGetExportInput(v *GetExportInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if len(v.ExportType) > 0 {
encoder.SetQuery("exportType").String(string(v.ExportType))
}
if v.Name != nil {
encoder.SetQuery("name").String(*v.Name)
}
if len(v.ResourceType) > 0 {
encoder.SetQuery("resourceType").String(string(v.ResourceType))
}
if v.Version != nil {
encoder.SetQuery("version").String(*v.Version)
}
return nil
}
type awsRestjson1_serializeOpGetImport struct {
}
func (*awsRestjson1_serializeOpGetImport) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetImport) 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.(*GetImportInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/imports/{importId}")
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_serializeOpHttpBindingsGetImportInput(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_serializeOpHttpBindingsGetImportInput(v *GetImportInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ImportId == nil || len(*v.ImportId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member importId must not be empty")}
}
if v.ImportId != nil {
if err := encoder.SetURI("importId").String(*v.ImportId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetIntent struct {
}
func (*awsRestjson1_serializeOpGetIntent) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetIntent) 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.(*GetIntentInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/intents/{name}/versions/{version}")
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_serializeOpHttpBindingsGetIntentInput(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_serializeOpHttpBindingsGetIntentInput(v *GetIntentInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("name").String(*v.Name); err != nil {
return err
}
}
if v.Version == nil || len(*v.Version) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member version must not be empty")}
}
if v.Version != nil {
if err := encoder.SetURI("version").String(*v.Version); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetIntents struct {
}
func (*awsRestjson1_serializeOpGetIntents) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetIntents) 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.(*GetIntentsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/intents")
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_serializeOpHttpBindingsGetIntentsInput(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_serializeOpHttpBindingsGetIntentsInput(v *GetIntentsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NameContains != nil {
encoder.SetQuery("nameContains").String(*v.NameContains)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpGetIntentVersions struct {
}
func (*awsRestjson1_serializeOpGetIntentVersions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetIntentVersions) 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.(*GetIntentVersionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/intents/{name}/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_serializeOpHttpBindingsGetIntentVersionsInput(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_serializeOpHttpBindingsGetIntentVersionsInput(v *GetIntentVersionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("name").String(*v.Name); err != nil {
return err
}
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpGetMigration struct {
}
func (*awsRestjson1_serializeOpGetMigration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetMigration) 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.(*GetMigrationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/migrations/{migrationId}")
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_serializeOpHttpBindingsGetMigrationInput(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_serializeOpHttpBindingsGetMigrationInput(v *GetMigrationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MigrationId == nil || len(*v.MigrationId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member migrationId must not be empty")}
}
if v.MigrationId != nil {
if err := encoder.SetURI("migrationId").String(*v.MigrationId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetMigrations struct {
}
func (*awsRestjson1_serializeOpGetMigrations) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetMigrations) 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.(*GetMigrationsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/migrations")
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_serializeOpHttpBindingsGetMigrationsInput(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_serializeOpHttpBindingsGetMigrationsInput(v *GetMigrationsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if len(v.MigrationStatusEquals) > 0 {
encoder.SetQuery("migrationStatusEquals").String(string(v.MigrationStatusEquals))
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if len(v.SortByAttribute) > 0 {
encoder.SetQuery("sortByAttribute").String(string(v.SortByAttribute))
}
if len(v.SortByOrder) > 0 {
encoder.SetQuery("sortByOrder").String(string(v.SortByOrder))
}
if v.V1BotNameContains != nil {
encoder.SetQuery("v1BotNameContains").String(*v.V1BotNameContains)
}
return nil
}
type awsRestjson1_serializeOpGetSlotType struct {
}
func (*awsRestjson1_serializeOpGetSlotType) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetSlotType) 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.(*GetSlotTypeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/slottypes/{name}/versions/{version}")
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_serializeOpHttpBindingsGetSlotTypeInput(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_serializeOpHttpBindingsGetSlotTypeInput(v *GetSlotTypeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("name").String(*v.Name); err != nil {
return err
}
}
if v.Version == nil || len(*v.Version) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member version must not be empty")}
}
if v.Version != nil {
if err := encoder.SetURI("version").String(*v.Version); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetSlotTypes struct {
}
func (*awsRestjson1_serializeOpGetSlotTypes) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetSlotTypes) 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.(*GetSlotTypesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/slottypes")
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_serializeOpHttpBindingsGetSlotTypesInput(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_serializeOpHttpBindingsGetSlotTypesInput(v *GetSlotTypesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NameContains != nil {
encoder.SetQuery("nameContains").String(*v.NameContains)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpGetSlotTypeVersions struct {
}
func (*awsRestjson1_serializeOpGetSlotTypeVersions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetSlotTypeVersions) 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.(*GetSlotTypeVersionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/slottypes/{name}/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_serializeOpHttpBindingsGetSlotTypeVersionsInput(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_serializeOpHttpBindingsGetSlotTypeVersionsInput(v *GetSlotTypeVersionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("name").String(*v.Name); err != nil {
return err
}
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpGetUtterancesView struct {
}
func (*awsRestjson1_serializeOpGetUtterancesView) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetUtterancesView) 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.(*GetUtterancesViewInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botName}/utterances?view=aggregation")
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_serializeOpHttpBindingsGetUtterancesViewInput(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_serializeOpHttpBindingsGetUtterancesViewInput(v *GetUtterancesViewInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotName == nil || len(*v.BotName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botName must not be empty")}
}
if v.BotName != nil {
if err := encoder.SetURI("botName").String(*v.BotName); err != nil {
return err
}
}
if v.BotVersions != nil {
for i := range v.BotVersions {
encoder.AddQuery("bot_versions").String(v.BotVersions[i])
}
}
if len(v.StatusType) > 0 {
encoder.SetQuery("status_type").String(string(v.StatusType))
}
return nil
}
type awsRestjson1_serializeOpListTagsForResource struct {
}
func (*awsRestjson1_serializeOpListTagsForResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListTagsForResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ResourceArn == nil || len(*v.ResourceArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")}
}
if v.ResourceArn != nil {
if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpPutBot struct {
}
func (*awsRestjson1_serializeOpPutBot) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutBot) 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.(*PutBotInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{name}/versions/$LATEST")
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_serializeOpHttpBindingsPutBotInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutBotInput(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_serializeOpHttpBindingsPutBotInput(v *PutBotInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("name").String(*v.Name); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentPutBotInput(v *PutBotInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AbortStatement != nil {
ok := object.Key("abortStatement")
if err := awsRestjson1_serializeDocumentStatement(v.AbortStatement, ok); err != nil {
return err
}
}
if v.Checksum != nil {
ok := object.Key("checksum")
ok.String(*v.Checksum)
}
if v.ChildDirected != nil {
ok := object.Key("childDirected")
ok.Boolean(*v.ChildDirected)
}
if v.ClarificationPrompt != nil {
ok := object.Key("clarificationPrompt")
if err := awsRestjson1_serializeDocumentPrompt(v.ClarificationPrompt, ok); err != nil {
return err
}
}
if v.CreateVersion != nil {
ok := object.Key("createVersion")
ok.Boolean(*v.CreateVersion)
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.DetectSentiment != nil {
ok := object.Key("detectSentiment")
ok.Boolean(*v.DetectSentiment)
}
if v.EnableModelImprovements != nil {
ok := object.Key("enableModelImprovements")
ok.Boolean(*v.EnableModelImprovements)
}
if v.IdleSessionTTLInSeconds != nil {
ok := object.Key("idleSessionTTLInSeconds")
ok.Integer(*v.IdleSessionTTLInSeconds)
}
if v.Intents != nil {
ok := object.Key("intents")
if err := awsRestjson1_serializeDocumentIntentList(v.Intents, ok); err != nil {
return err
}
}
if len(v.Locale) > 0 {
ok := object.Key("locale")
ok.String(string(v.Locale))
}
if v.NluIntentConfidenceThreshold != nil {
ok := object.Key("nluIntentConfidenceThreshold")
switch {
case math.IsNaN(*v.NluIntentConfidenceThreshold):
ok.String("NaN")
case math.IsInf(*v.NluIntentConfidenceThreshold, 1):
ok.String("Infinity")
case math.IsInf(*v.NluIntentConfidenceThreshold, -1):
ok.String("-Infinity")
default:
ok.Double(*v.NluIntentConfidenceThreshold)
}
}
if len(v.ProcessBehavior) > 0 {
ok := object.Key("processBehavior")
ok.String(string(v.ProcessBehavior))
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
if v.VoiceId != nil {
ok := object.Key("voiceId")
ok.String(*v.VoiceId)
}
return nil
}
type awsRestjson1_serializeOpPutBotAlias struct {
}
func (*awsRestjson1_serializeOpPutBotAlias) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutBotAlias) 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.(*PutBotAliasInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/bots/{botName}/aliases/{name}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsPutBotAliasInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutBotAliasInput(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_serializeOpHttpBindingsPutBotAliasInput(v *PutBotAliasInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BotName == nil || len(*v.BotName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member botName must not be empty")}
}
if v.BotName != nil {
if err := encoder.SetURI("botName").String(*v.BotName); err != nil {
return err
}
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("name").String(*v.Name); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentPutBotAliasInput(v *PutBotAliasInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BotVersion != nil {
ok := object.Key("botVersion")
ok.String(*v.BotVersion)
}
if v.Checksum != nil {
ok := object.Key("checksum")
ok.String(*v.Checksum)
}
if v.ConversationLogs != nil {
ok := object.Key("conversationLogs")
if err := awsRestjson1_serializeDocumentConversationLogsRequest(v.ConversationLogs, ok); err != nil {
return err
}
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpPutIntent struct {
}
func (*awsRestjson1_serializeOpPutIntent) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutIntent) 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.(*PutIntentInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/intents/{name}/versions/$LATEST")
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_serializeOpHttpBindingsPutIntentInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutIntentInput(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_serializeOpHttpBindingsPutIntentInput(v *PutIntentInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("name").String(*v.Name); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentPutIntentInput(v *PutIntentInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Checksum != nil {
ok := object.Key("checksum")
ok.String(*v.Checksum)
}
if v.ConclusionStatement != nil {
ok := object.Key("conclusionStatement")
if err := awsRestjson1_serializeDocumentStatement(v.ConclusionStatement, ok); err != nil {
return err
}
}
if v.ConfirmationPrompt != nil {
ok := object.Key("confirmationPrompt")
if err := awsRestjson1_serializeDocumentPrompt(v.ConfirmationPrompt, ok); err != nil {
return err
}
}
if v.CreateVersion != nil {
ok := object.Key("createVersion")
ok.Boolean(*v.CreateVersion)
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.DialogCodeHook != nil {
ok := object.Key("dialogCodeHook")
if err := awsRestjson1_serializeDocumentCodeHook(v.DialogCodeHook, ok); err != nil {
return err
}
}
if v.FollowUpPrompt != nil {
ok := object.Key("followUpPrompt")
if err := awsRestjson1_serializeDocumentFollowUpPrompt(v.FollowUpPrompt, ok); err != nil {
return err
}
}
if v.FulfillmentActivity != nil {
ok := object.Key("fulfillmentActivity")
if err := awsRestjson1_serializeDocumentFulfillmentActivity(v.FulfillmentActivity, ok); err != nil {
return err
}
}
if v.InputContexts != nil {
ok := object.Key("inputContexts")
if err := awsRestjson1_serializeDocumentInputContextList(v.InputContexts, ok); err != nil {
return err
}
}
if v.KendraConfiguration != nil {
ok := object.Key("kendraConfiguration")
if err := awsRestjson1_serializeDocumentKendraConfiguration(v.KendraConfiguration, ok); err != nil {
return err
}
}
if v.OutputContexts != nil {
ok := object.Key("outputContexts")
if err := awsRestjson1_serializeDocumentOutputContextList(v.OutputContexts, ok); err != nil {
return err
}
}
if v.ParentIntentSignature != nil {
ok := object.Key("parentIntentSignature")
ok.String(*v.ParentIntentSignature)
}
if v.RejectionStatement != nil {
ok := object.Key("rejectionStatement")
if err := awsRestjson1_serializeDocumentStatement(v.RejectionStatement, ok); err != nil {
return err
}
}
if v.SampleUtterances != nil {
ok := object.Key("sampleUtterances")
if err := awsRestjson1_serializeDocumentIntentUtteranceList(v.SampleUtterances, ok); err != nil {
return err
}
}
if v.Slots != nil {
ok := object.Key("slots")
if err := awsRestjson1_serializeDocumentSlotList(v.Slots, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpPutSlotType struct {
}
func (*awsRestjson1_serializeOpPutSlotType) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutSlotType) 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.(*PutSlotTypeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/slottypes/{name}/versions/$LATEST")
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_serializeOpHttpBindingsPutSlotTypeInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutSlotTypeInput(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_serializeOpHttpBindingsPutSlotTypeInput(v *PutSlotTypeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Name == nil || len(*v.Name) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member name must not be empty")}
}
if v.Name != nil {
if err := encoder.SetURI("name").String(*v.Name); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentPutSlotTypeInput(v *PutSlotTypeInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Checksum != nil {
ok := object.Key("checksum")
ok.String(*v.Checksum)
}
if v.CreateVersion != nil {
ok := object.Key("createVersion")
ok.Boolean(*v.CreateVersion)
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.EnumerationValues != nil {
ok := object.Key("enumerationValues")
if err := awsRestjson1_serializeDocumentEnumerationValues(v.EnumerationValues, ok); err != nil {
return err
}
}
if v.ParentSlotTypeSignature != nil {
ok := object.Key("parentSlotTypeSignature")
ok.String(*v.ParentSlotTypeSignature)
}
if v.SlotTypeConfigurations != nil {
ok := object.Key("slotTypeConfigurations")
if err := awsRestjson1_serializeDocumentSlotTypeConfigurations(v.SlotTypeConfigurations, ok); err != nil {
return err
}
}
if len(v.ValueSelectionStrategy) > 0 {
ok := object.Key("valueSelectionStrategy")
ok.String(string(v.ValueSelectionStrategy))
}
return nil
}
type awsRestjson1_serializeOpStartImport struct {
}
func (*awsRestjson1_serializeOpStartImport) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpStartImport) 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.(*StartImportInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/imports")
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_serializeOpDocumentStartImportInput(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_serializeOpHttpBindingsStartImportInput(v *StartImportInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentStartImportInput(v *StartImportInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.MergeStrategy) > 0 {
ok := object.Key("mergeStrategy")
ok.String(string(v.MergeStrategy))
}
if v.Payload != nil {
ok := object.Key("payload")
ok.Base64EncodeBytes(v.Payload)
}
if len(v.ResourceType) > 0 {
ok := object.Key("resourceType")
ok.String(string(v.ResourceType))
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpStartMigration struct {
}
func (*awsRestjson1_serializeOpStartMigration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpStartMigration) 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.(*StartMigrationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/migrations")
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_serializeOpDocumentStartMigrationInput(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_serializeOpHttpBindingsStartMigrationInput(v *StartMigrationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentStartMigrationInput(v *StartMigrationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.MigrationStrategy) > 0 {
ok := object.Key("migrationStrategy")
ok.String(string(v.MigrationStrategy))
}
if v.V1BotName != nil {
ok := object.Key("v1BotName")
ok.String(*v.V1BotName)
}
if v.V1BotVersion != nil {
ok := object.Key("v1BotVersion")
ok.String(*v.V1BotVersion)
}
if v.V2BotName != nil {
ok := object.Key("v2BotName")
ok.String(*v.V2BotName)
}
if v.V2BotRole != nil {
ok := object.Key("v2BotRole")
ok.String(*v.V2BotRole)
}
return nil
}
type awsRestjson1_serializeOpTagResource struct {
}
func (*awsRestjson1_serializeOpTagResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*TagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ResourceArn == nil || len(*v.ResourceArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")}
}
if v.ResourceArn != nil {
if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpUntagResource struct {
}
func (*awsRestjson1_serializeOpUntagResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UntagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ResourceArn == nil || len(*v.ResourceArn) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")}
}
if v.ResourceArn != nil {
if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil {
return err
}
}
if v.TagKeys != nil {
for i := range v.TagKeys {
encoder.AddQuery("tagKeys").String(v.TagKeys[i])
}
}
return nil
}
func awsRestjson1_serializeDocumentCodeHook(v *types.CodeHook, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MessageVersion != nil {
ok := object.Key("messageVersion")
ok.String(*v.MessageVersion)
}
if v.Uri != nil {
ok := object.Key("uri")
ok.String(*v.Uri)
}
return nil
}
func awsRestjson1_serializeDocumentConversationLogsRequest(v *types.ConversationLogsRequest, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.IamRoleArn != nil {
ok := object.Key("iamRoleArn")
ok.String(*v.IamRoleArn)
}
if v.LogSettings != nil {
ok := object.Key("logSettings")
if err := awsRestjson1_serializeDocumentLogSettingsRequestList(v.LogSettings, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentEnumerationValue(v *types.EnumerationValue, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Synonyms != nil {
ok := object.Key("synonyms")
if err := awsRestjson1_serializeDocumentSynonymList(v.Synonyms, ok); err != nil {
return err
}
}
if v.Value != nil {
ok := object.Key("value")
ok.String(*v.Value)
}
return nil
}
func awsRestjson1_serializeDocumentEnumerationValues(v []types.EnumerationValue, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentEnumerationValue(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentFollowUpPrompt(v *types.FollowUpPrompt, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Prompt != nil {
ok := object.Key("prompt")
if err := awsRestjson1_serializeDocumentPrompt(v.Prompt, ok); err != nil {
return err
}
}
if v.RejectionStatement != nil {
ok := object.Key("rejectionStatement")
if err := awsRestjson1_serializeDocumentStatement(v.RejectionStatement, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentFulfillmentActivity(v *types.FulfillmentActivity, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CodeHook != nil {
ok := object.Key("codeHook")
if err := awsRestjson1_serializeDocumentCodeHook(v.CodeHook, ok); err != nil {
return err
}
}
if len(v.Type) > 0 {
ok := object.Key("type")
ok.String(string(v.Type))
}
return nil
}
func awsRestjson1_serializeDocumentInputContext(v *types.InputContext, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
return nil
}
func awsRestjson1_serializeDocumentInputContextList(v []types.InputContext, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentInputContext(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentIntent(v *types.Intent, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.IntentName != nil {
ok := object.Key("intentName")
ok.String(*v.IntentName)
}
if v.IntentVersion != nil {
ok := object.Key("intentVersion")
ok.String(*v.IntentVersion)
}
return nil
}
func awsRestjson1_serializeDocumentIntentList(v []types.Intent, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentIntent(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentIntentUtteranceList(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_serializeDocumentKendraConfiguration(v *types.KendraConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.KendraIndex != nil {
ok := object.Key("kendraIndex")
ok.String(*v.KendraIndex)
}
if v.QueryFilterString != nil {
ok := object.Key("queryFilterString")
ok.String(*v.QueryFilterString)
}
if v.Role != nil {
ok := object.Key("role")
ok.String(*v.Role)
}
return nil
}
func awsRestjson1_serializeDocumentLogSettingsRequest(v *types.LogSettingsRequest, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.Destination) > 0 {
ok := object.Key("destination")
ok.String(string(v.Destination))
}
if v.KmsKeyArn != nil {
ok := object.Key("kmsKeyArn")
ok.String(*v.KmsKeyArn)
}
if len(v.LogType) > 0 {
ok := object.Key("logType")
ok.String(string(v.LogType))
}
if v.ResourceArn != nil {
ok := object.Key("resourceArn")
ok.String(*v.ResourceArn)
}
return nil
}
func awsRestjson1_serializeDocumentLogSettingsRequestList(v []types.LogSettingsRequest, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentLogSettingsRequest(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentMessage(v *types.Message, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Content != nil {
ok := object.Key("content")
ok.String(*v.Content)
}
if len(v.ContentType) > 0 {
ok := object.Key("contentType")
ok.String(string(v.ContentType))
}
if v.GroupNumber != nil {
ok := object.Key("groupNumber")
ok.Integer(*v.GroupNumber)
}
return nil
}
func awsRestjson1_serializeDocumentMessageList(v []types.Message, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentMessage(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentOutputContext(v *types.OutputContext, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.TimeToLiveInSeconds != nil {
ok := object.Key("timeToLiveInSeconds")
ok.Integer(*v.TimeToLiveInSeconds)
}
if v.TurnsToLive != nil {
ok := object.Key("turnsToLive")
ok.Integer(*v.TurnsToLive)
}
return nil
}
func awsRestjson1_serializeDocumentOutputContextList(v []types.OutputContext, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentOutputContext(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentPrompt(v *types.Prompt, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxAttempts != nil {
ok := object.Key("maxAttempts")
ok.Integer(*v.MaxAttempts)
}
if v.Messages != nil {
ok := object.Key("messages")
if err := awsRestjson1_serializeDocumentMessageList(v.Messages, ok); err != nil {
return err
}
}
if v.ResponseCard != nil {
ok := object.Key("responseCard")
ok.String(*v.ResponseCard)
}
return nil
}
func awsRestjson1_serializeDocumentSlot(v *types.Slot, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DefaultValueSpec != nil {
ok := object.Key("defaultValueSpec")
if err := awsRestjson1_serializeDocumentSlotDefaultValueSpec(v.DefaultValueSpec, ok); err != nil {
return err
}
}
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 len(v.ObfuscationSetting) > 0 {
ok := object.Key("obfuscationSetting")
ok.String(string(v.ObfuscationSetting))
}
if v.Priority != nil {
ok := object.Key("priority")
ok.Integer(*v.Priority)
}
if v.ResponseCard != nil {
ok := object.Key("responseCard")
ok.String(*v.ResponseCard)
}
if v.SampleUtterances != nil {
ok := object.Key("sampleUtterances")
if err := awsRestjson1_serializeDocumentSlotUtteranceList(v.SampleUtterances, ok); err != nil {
return err
}
}
if len(v.SlotConstraint) > 0 {
ok := object.Key("slotConstraint")
ok.String(string(v.SlotConstraint))
}
if v.SlotType != nil {
ok := object.Key("slotType")
ok.String(*v.SlotType)
}
if v.SlotTypeVersion != nil {
ok := object.Key("slotTypeVersion")
ok.String(*v.SlotTypeVersion)
}
if v.ValueElicitationPrompt != nil {
ok := object.Key("valueElicitationPrompt")
if err := awsRestjson1_serializeDocumentPrompt(v.ValueElicitationPrompt, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSlotDefaultValue(v *types.SlotDefaultValue, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DefaultValue != nil {
ok := object.Key("defaultValue")
ok.String(*v.DefaultValue)
}
return nil
}
func awsRestjson1_serializeDocumentSlotDefaultValueList(v []types.SlotDefaultValue, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentSlotDefaultValue(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSlotDefaultValueSpec(v *types.SlotDefaultValueSpec, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DefaultValueList != nil {
ok := object.Key("defaultValueList")
if err := awsRestjson1_serializeDocumentSlotDefaultValueList(v.DefaultValueList, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSlotList(v []types.Slot, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentSlot(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSlotTypeConfiguration(v *types.SlotTypeConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RegexConfiguration != nil {
ok := object.Key("regexConfiguration")
if err := awsRestjson1_serializeDocumentSlotTypeRegexConfiguration(v.RegexConfiguration, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSlotTypeConfigurations(v []types.SlotTypeConfiguration, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentSlotTypeConfiguration(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentSlotTypeRegexConfiguration(v *types.SlotTypeRegexConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Pattern != nil {
ok := object.Key("pattern")
ok.String(*v.Pattern)
}
return nil
}
func awsRestjson1_serializeDocumentSlotUtteranceList(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_serializeDocumentStatement(v *types.Statement, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Messages != nil {
ok := object.Key("messages")
if err := awsRestjson1_serializeDocumentMessageList(v.Messages, ok); err != nil {
return err
}
}
if v.ResponseCard != nil {
ok := object.Key("responseCard")
ok.String(*v.ResponseCard)
}
return nil
}
func awsRestjson1_serializeDocumentSynonymList(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_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Key != nil {
ok := object.Key("key")
ok.String(*v.Key)
}
if v.Value != nil {
ok := object.Key("value")
ok.String(*v.Value)
}
return nil
}
func awsRestjson1_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentTag(&v[i], av); err != nil {
return err
}
}
return nil
}
| 3,741 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelbuildingservice
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpCreateBotVersion struct {
}
func (*validateOpCreateBotVersion) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateBotVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateBotVersionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateBotVersionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateIntentVersion struct {
}
func (*validateOpCreateIntentVersion) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateIntentVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateIntentVersionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateIntentVersionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateSlotTypeVersion struct {
}
func (*validateOpCreateSlotTypeVersion) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateSlotTypeVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateSlotTypeVersionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateSlotTypeVersionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteBotAlias struct {
}
func (*validateOpDeleteBotAlias) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteBotAlias) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteBotAliasInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteBotAliasInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteBotChannelAssociation struct {
}
func (*validateOpDeleteBotChannelAssociation) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteBotChannelAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteBotChannelAssociationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteBotChannelAssociationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteBot struct {
}
func (*validateOpDeleteBot) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteBot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteBotInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteBotInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteBotVersion struct {
}
func (*validateOpDeleteBotVersion) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteBotVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteBotVersionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteBotVersionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteIntent struct {
}
func (*validateOpDeleteIntent) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteIntent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteIntentInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteIntentInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteIntentVersion struct {
}
func (*validateOpDeleteIntentVersion) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteIntentVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteIntentVersionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteIntentVersionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteSlotType struct {
}
func (*validateOpDeleteSlotType) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteSlotType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteSlotTypeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteSlotTypeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteSlotTypeVersion struct {
}
func (*validateOpDeleteSlotTypeVersion) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteSlotTypeVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteSlotTypeVersionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteSlotTypeVersionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteUtterances struct {
}
func (*validateOpDeleteUtterances) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteUtterances) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteUtterancesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteUtterancesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetBotAliases struct {
}
func (*validateOpGetBotAliases) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetBotAliases) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetBotAliasesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetBotAliasesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetBotAlias struct {
}
func (*validateOpGetBotAlias) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetBotAlias) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetBotAliasInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetBotAliasInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetBotChannelAssociation struct {
}
func (*validateOpGetBotChannelAssociation) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetBotChannelAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetBotChannelAssociationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetBotChannelAssociationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetBotChannelAssociations struct {
}
func (*validateOpGetBotChannelAssociations) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetBotChannelAssociations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetBotChannelAssociationsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetBotChannelAssociationsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetBot struct {
}
func (*validateOpGetBot) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetBot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetBotInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetBotInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetBotVersions struct {
}
func (*validateOpGetBotVersions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetBotVersions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetBotVersionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetBotVersionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetBuiltinIntent struct {
}
func (*validateOpGetBuiltinIntent) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetBuiltinIntent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetBuiltinIntentInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetBuiltinIntentInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetExport struct {
}
func (*validateOpGetExport) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetExport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetExportInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetExportInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetImport struct {
}
func (*validateOpGetImport) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetImport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetImportInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetImportInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetIntent struct {
}
func (*validateOpGetIntent) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetIntent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetIntentInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetIntentInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetIntentVersions struct {
}
func (*validateOpGetIntentVersions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetIntentVersions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetIntentVersionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetIntentVersionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetMigration struct {
}
func (*validateOpGetMigration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetMigration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetMigrationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetMigrationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetSlotType struct {
}
func (*validateOpGetSlotType) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetSlotType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetSlotTypeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetSlotTypeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetSlotTypeVersions struct {
}
func (*validateOpGetSlotTypeVersions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetSlotTypeVersions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetSlotTypeVersionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetSlotTypeVersionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetUtterancesView struct {
}
func (*validateOpGetUtterancesView) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetUtterancesView) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetUtterancesViewInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetUtterancesViewInput(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 validateOpPutBotAlias struct {
}
func (*validateOpPutBotAlias) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutBotAlias) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutBotAliasInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutBotAliasInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutBot struct {
}
func (*validateOpPutBot) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutBot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutBotInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutBotInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutIntent struct {
}
func (*validateOpPutIntent) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutIntent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutIntentInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutIntentInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutSlotType struct {
}
func (*validateOpPutSlotType) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutSlotType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutSlotTypeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutSlotTypeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartImport struct {
}
func (*validateOpStartImport) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartImport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartImportInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartImportInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpStartMigration struct {
}
func (*validateOpStartMigration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpStartMigration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*StartMigrationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpStartMigrationInput(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)
}
func addOpCreateBotVersionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateBotVersion{}, middleware.After)
}
func addOpCreateIntentVersionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateIntentVersion{}, middleware.After)
}
func addOpCreateSlotTypeVersionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateSlotTypeVersion{}, middleware.After)
}
func addOpDeleteBotAliasValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteBotAlias{}, middleware.After)
}
func addOpDeleteBotChannelAssociationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteBotChannelAssociation{}, middleware.After)
}
func addOpDeleteBotValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteBot{}, middleware.After)
}
func addOpDeleteBotVersionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteBotVersion{}, middleware.After)
}
func addOpDeleteIntentValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteIntent{}, middleware.After)
}
func addOpDeleteIntentVersionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteIntentVersion{}, middleware.After)
}
func addOpDeleteSlotTypeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteSlotType{}, middleware.After)
}
func addOpDeleteSlotTypeVersionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteSlotTypeVersion{}, middleware.After)
}
func addOpDeleteUtterancesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteUtterances{}, middleware.After)
}
func addOpGetBotAliasesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetBotAliases{}, middleware.After)
}
func addOpGetBotAliasValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetBotAlias{}, middleware.After)
}
func addOpGetBotChannelAssociationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetBotChannelAssociation{}, middleware.After)
}
func addOpGetBotChannelAssociationsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetBotChannelAssociations{}, middleware.After)
}
func addOpGetBotValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetBot{}, middleware.After)
}
func addOpGetBotVersionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetBotVersions{}, middleware.After)
}
func addOpGetBuiltinIntentValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetBuiltinIntent{}, middleware.After)
}
func addOpGetExportValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetExport{}, middleware.After)
}
func addOpGetImportValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetImport{}, middleware.After)
}
func addOpGetIntentValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetIntent{}, middleware.After)
}
func addOpGetIntentVersionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetIntentVersions{}, middleware.After)
}
func addOpGetMigrationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetMigration{}, middleware.After)
}
func addOpGetSlotTypeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetSlotType{}, middleware.After)
}
func addOpGetSlotTypeVersionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetSlotTypeVersions{}, middleware.After)
}
func addOpGetUtterancesViewValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetUtterancesView{}, middleware.After)
}
func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After)
}
func addOpPutBotAliasValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutBotAlias{}, middleware.After)
}
func addOpPutBotValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutBot{}, middleware.After)
}
func addOpPutIntentValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutIntent{}, middleware.After)
}
func addOpPutSlotTypeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutSlotType{}, middleware.After)
}
func addOpStartImportValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartImport{}, middleware.After)
}
func addOpStartMigrationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpStartMigration{}, 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 validateCodeHook(v *types.CodeHook) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CodeHook"}
if v.Uri == nil {
invalidParams.Add(smithy.NewErrParamRequired("Uri"))
}
if v.MessageVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("MessageVersion"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateConversationLogsRequest(v *types.ConversationLogsRequest) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ConversationLogsRequest"}
if v.LogSettings == nil {
invalidParams.Add(smithy.NewErrParamRequired("LogSettings"))
} else if v.LogSettings != nil {
if err := validateLogSettingsRequestList(v.LogSettings); err != nil {
invalidParams.AddNested("LogSettings", err.(smithy.InvalidParamsError))
}
}
if v.IamRoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("IamRoleArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateEnumerationValue(v *types.EnumerationValue) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "EnumerationValue"}
if v.Value == nil {
invalidParams.Add(smithy.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateEnumerationValues(v []types.EnumerationValue) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "EnumerationValues"}
for i := range v {
if err := validateEnumerationValue(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateFollowUpPrompt(v *types.FollowUpPrompt) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "FollowUpPrompt"}
if v.Prompt == nil {
invalidParams.Add(smithy.NewErrParamRequired("Prompt"))
} else if v.Prompt != nil {
if err := validatePrompt(v.Prompt); err != nil {
invalidParams.AddNested("Prompt", err.(smithy.InvalidParamsError))
}
}
if v.RejectionStatement == nil {
invalidParams.Add(smithy.NewErrParamRequired("RejectionStatement"))
} else if v.RejectionStatement != nil {
if err := validateStatement(v.RejectionStatement); err != nil {
invalidParams.AddNested("RejectionStatement", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateFulfillmentActivity(v *types.FulfillmentActivity) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "FulfillmentActivity"}
if len(v.Type) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if v.CodeHook != nil {
if err := validateCodeHook(v.CodeHook); err != nil {
invalidParams.AddNested("CodeHook", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInputContext(v *types.InputContext) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InputContext"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateInputContextList(v []types.InputContext) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "InputContextList"}
for i := range v {
if err := validateInputContext(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateIntent(v *types.Intent) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Intent"}
if v.IntentName == nil {
invalidParams.Add(smithy.NewErrParamRequired("IntentName"))
}
if v.IntentVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("IntentVersion"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateIntentList(v []types.Intent) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "IntentList"}
for i := range v {
if err := validateIntent(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateKendraConfiguration(v *types.KendraConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "KendraConfiguration"}
if v.KendraIndex == nil {
invalidParams.Add(smithy.NewErrParamRequired("KendraIndex"))
}
if v.Role == nil {
invalidParams.Add(smithy.NewErrParamRequired("Role"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateLogSettingsRequest(v *types.LogSettingsRequest) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "LogSettingsRequest"}
if len(v.LogType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("LogType"))
}
if len(v.Destination) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Destination"))
}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateLogSettingsRequestList(v []types.LogSettingsRequest) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "LogSettingsRequestList"}
for i := range v {
if err := validateLogSettingsRequest(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateMessage(v *types.Message) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Message"}
if len(v.ContentType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ContentType"))
}
if v.Content == nil {
invalidParams.Add(smithy.NewErrParamRequired("Content"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateMessageList(v []types.Message) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "MessageList"}
for i := range v {
if err := validateMessage(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOutputContext(v *types.OutputContext) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "OutputContext"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.TimeToLiveInSeconds == nil {
invalidParams.Add(smithy.NewErrParamRequired("TimeToLiveInSeconds"))
}
if v.TurnsToLive == nil {
invalidParams.Add(smithy.NewErrParamRequired("TurnsToLive"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOutputContextList(v []types.OutputContext) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "OutputContextList"}
for i := range v {
if err := validateOutputContext(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validatePrompt(v *types.Prompt) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Prompt"}
if v.Messages == nil {
invalidParams.Add(smithy.NewErrParamRequired("Messages"))
} else if v.Messages != nil {
if err := validateMessageList(v.Messages); err != nil {
invalidParams.AddNested("Messages", err.(smithy.InvalidParamsError))
}
}
if v.MaxAttempts == nil {
invalidParams.Add(smithy.NewErrParamRequired("MaxAttempts"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlot(v *types.Slot) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Slot"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if len(v.SlotConstraint) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("SlotConstraint"))
}
if v.ValueElicitationPrompt != nil {
if err := validatePrompt(v.ValueElicitationPrompt); err != nil {
invalidParams.AddNested("ValueElicitationPrompt", err.(smithy.InvalidParamsError))
}
}
if v.DefaultValueSpec != nil {
if err := validateSlotDefaultValueSpec(v.DefaultValueSpec); err != nil {
invalidParams.AddNested("DefaultValueSpec", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlotDefaultValue(v *types.SlotDefaultValue) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SlotDefaultValue"}
if v.DefaultValue == nil {
invalidParams.Add(smithy.NewErrParamRequired("DefaultValue"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlotDefaultValueList(v []types.SlotDefaultValue) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SlotDefaultValueList"}
for i := range v {
if err := validateSlotDefaultValue(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlotDefaultValueSpec(v *types.SlotDefaultValueSpec) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SlotDefaultValueSpec"}
if v.DefaultValueList == nil {
invalidParams.Add(smithy.NewErrParamRequired("DefaultValueList"))
} else if v.DefaultValueList != nil {
if err := validateSlotDefaultValueList(v.DefaultValueList); err != nil {
invalidParams.AddNested("DefaultValueList", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlotList(v []types.Slot) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SlotList"}
for i := range v {
if err := validateSlot(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlotTypeConfiguration(v *types.SlotTypeConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SlotTypeConfiguration"}
if v.RegexConfiguration != nil {
if err := validateSlotTypeRegexConfiguration(v.RegexConfiguration); err != nil {
invalidParams.AddNested("RegexConfiguration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlotTypeConfigurations(v []types.SlotTypeConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SlotTypeConfigurations"}
for i := range v {
if err := validateSlotTypeConfiguration(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSlotTypeRegexConfiguration(v *types.SlotTypeRegexConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SlotTypeRegexConfiguration"}
if v.Pattern == nil {
invalidParams.Add(smithy.NewErrParamRequired("Pattern"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateStatement(v *types.Statement) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Statement"}
if v.Messages == nil {
invalidParams.Add(smithy.NewErrParamRequired("Messages"))
} else if v.Messages != nil {
if err := validateMessageList(v.Messages); err != nil {
invalidParams.AddNested("Messages", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTag(v *types.Tag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Tag"}
if v.Key == nil {
invalidParams.Add(smithy.NewErrParamRequired("Key"))
}
if v.Value == nil {
invalidParams.Add(smithy.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTagList(v []types.Tag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TagList"}
for i := range v {
if err := validateTag(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateBotVersionInput(v *CreateBotVersionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateBotVersionInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateIntentVersionInput(v *CreateIntentVersionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateIntentVersionInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateSlotTypeVersionInput(v *CreateSlotTypeVersionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateSlotTypeVersionInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteBotAliasInput(v *DeleteBotAliasInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteBotAliasInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.BotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteBotChannelAssociationInput(v *DeleteBotChannelAssociationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteBotChannelAssociationInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.BotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotName"))
}
if v.BotAlias == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotAlias"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteBotInput(v *DeleteBotInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteBotInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteBotVersionInput(v *DeleteBotVersionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteBotVersionInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Version == nil {
invalidParams.Add(smithy.NewErrParamRequired("Version"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteIntentInput(v *DeleteIntentInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteIntentInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteIntentVersionInput(v *DeleteIntentVersionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteIntentVersionInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Version == nil {
invalidParams.Add(smithy.NewErrParamRequired("Version"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteSlotTypeInput(v *DeleteSlotTypeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteSlotTypeInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteSlotTypeVersionInput(v *DeleteSlotTypeVersionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteSlotTypeVersionInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Version == nil {
invalidParams.Add(smithy.NewErrParamRequired("Version"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteUtterancesInput(v *DeleteUtterancesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteUtterancesInput"}
if v.BotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotName"))
}
if v.UserId == nil {
invalidParams.Add(smithy.NewErrParamRequired("UserId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetBotAliasesInput(v *GetBotAliasesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetBotAliasesInput"}
if v.BotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetBotAliasInput(v *GetBotAliasInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetBotAliasInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.BotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetBotChannelAssociationInput(v *GetBotChannelAssociationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetBotChannelAssociationInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.BotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotName"))
}
if v.BotAlias == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotAlias"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetBotChannelAssociationsInput(v *GetBotChannelAssociationsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetBotChannelAssociationsInput"}
if v.BotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotName"))
}
if v.BotAlias == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotAlias"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetBotInput(v *GetBotInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetBotInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.VersionOrAlias == nil {
invalidParams.Add(smithy.NewErrParamRequired("VersionOrAlias"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetBotVersionsInput(v *GetBotVersionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetBotVersionsInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetBuiltinIntentInput(v *GetBuiltinIntentInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetBuiltinIntentInput"}
if v.Signature == nil {
invalidParams.Add(smithy.NewErrParamRequired("Signature"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetExportInput(v *GetExportInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetExportInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Version == nil {
invalidParams.Add(smithy.NewErrParamRequired("Version"))
}
if len(v.ResourceType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ResourceType"))
}
if len(v.ExportType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ExportType"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetImportInput(v *GetImportInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetImportInput"}
if v.ImportId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ImportId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetIntentInput(v *GetIntentInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetIntentInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Version == nil {
invalidParams.Add(smithy.NewErrParamRequired("Version"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetIntentVersionsInput(v *GetIntentVersionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetIntentVersionsInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetMigrationInput(v *GetMigrationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetMigrationInput"}
if v.MigrationId == nil {
invalidParams.Add(smithy.NewErrParamRequired("MigrationId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetSlotTypeInput(v *GetSlotTypeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetSlotTypeInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Version == nil {
invalidParams.Add(smithy.NewErrParamRequired("Version"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetSlotTypeVersionsInput(v *GetSlotTypeVersionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetSlotTypeVersionsInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetUtterancesViewInput(v *GetUtterancesViewInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetUtterancesViewInput"}
if v.BotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotName"))
}
if v.BotVersions == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersions"))
}
if len(v.StatusType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("StatusType"))
}
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 validateOpPutBotAliasInput(v *PutBotAliasInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutBotAliasInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotVersion"))
}
if v.BotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("BotName"))
}
if v.ConversationLogs != nil {
if err := validateConversationLogsRequest(v.ConversationLogs); err != nil {
invalidParams.AddNested("ConversationLogs", err.(smithy.InvalidParamsError))
}
}
if v.Tags != nil {
if err := validateTagList(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutBotInput(v *PutBotInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutBotInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Intents != nil {
if err := validateIntentList(v.Intents); err != nil {
invalidParams.AddNested("Intents", err.(smithy.InvalidParamsError))
}
}
if v.ClarificationPrompt != nil {
if err := validatePrompt(v.ClarificationPrompt); err != nil {
invalidParams.AddNested("ClarificationPrompt", err.(smithy.InvalidParamsError))
}
}
if v.AbortStatement != nil {
if err := validateStatement(v.AbortStatement); err != nil {
invalidParams.AddNested("AbortStatement", err.(smithy.InvalidParamsError))
}
}
if len(v.Locale) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Locale"))
}
if v.ChildDirected == nil {
invalidParams.Add(smithy.NewErrParamRequired("ChildDirected"))
}
if v.Tags != nil {
if err := validateTagList(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutIntentInput(v *PutIntentInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutIntentInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Slots != nil {
if err := validateSlotList(v.Slots); err != nil {
invalidParams.AddNested("Slots", err.(smithy.InvalidParamsError))
}
}
if v.ConfirmationPrompt != nil {
if err := validatePrompt(v.ConfirmationPrompt); err != nil {
invalidParams.AddNested("ConfirmationPrompt", err.(smithy.InvalidParamsError))
}
}
if v.RejectionStatement != nil {
if err := validateStatement(v.RejectionStatement); err != nil {
invalidParams.AddNested("RejectionStatement", err.(smithy.InvalidParamsError))
}
}
if v.FollowUpPrompt != nil {
if err := validateFollowUpPrompt(v.FollowUpPrompt); err != nil {
invalidParams.AddNested("FollowUpPrompt", err.(smithy.InvalidParamsError))
}
}
if v.ConclusionStatement != nil {
if err := validateStatement(v.ConclusionStatement); err != nil {
invalidParams.AddNested("ConclusionStatement", err.(smithy.InvalidParamsError))
}
}
if v.DialogCodeHook != nil {
if err := validateCodeHook(v.DialogCodeHook); err != nil {
invalidParams.AddNested("DialogCodeHook", err.(smithy.InvalidParamsError))
}
}
if v.FulfillmentActivity != nil {
if err := validateFulfillmentActivity(v.FulfillmentActivity); err != nil {
invalidParams.AddNested("FulfillmentActivity", err.(smithy.InvalidParamsError))
}
}
if v.KendraConfiguration != nil {
if err := validateKendraConfiguration(v.KendraConfiguration); err != nil {
invalidParams.AddNested("KendraConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.InputContexts != nil {
if err := validateInputContextList(v.InputContexts); err != nil {
invalidParams.AddNested("InputContexts", err.(smithy.InvalidParamsError))
}
}
if v.OutputContexts != nil {
if err := validateOutputContextList(v.OutputContexts); err != nil {
invalidParams.AddNested("OutputContexts", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutSlotTypeInput(v *PutSlotTypeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutSlotTypeInput"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.EnumerationValues != nil {
if err := validateEnumerationValues(v.EnumerationValues); err != nil {
invalidParams.AddNested("EnumerationValues", err.(smithy.InvalidParamsError))
}
}
if v.SlotTypeConfigurations != nil {
if err := validateSlotTypeConfigurations(v.SlotTypeConfigurations); err != nil {
invalidParams.AddNested("SlotTypeConfigurations", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartImportInput(v *StartImportInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartImportInput"}
if v.Payload == nil {
invalidParams.Add(smithy.NewErrParamRequired("Payload"))
}
if len(v.ResourceType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ResourceType"))
}
if len(v.MergeStrategy) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("MergeStrategy"))
}
if v.Tags != nil {
if err := validateTagList(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpStartMigrationInput(v *StartMigrationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "StartMigrationInput"}
if v.V1BotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("V1BotName"))
}
if v.V1BotVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("V1BotVersion"))
}
if v.V2BotName == nil {
invalidParams.Add(smithy.NewErrParamRequired("V2BotName"))
}
if v.V2BotRole == nil {
invalidParams.Add(smithy.NewErrParamRequired("V2BotRole"))
}
if len(v.MigrationStrategy) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("MigrationStrategy"))
}
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"))
} else if v.Tags != nil {
if err := validateTagList(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
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
}
}
| 2,143 |
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 Lex Model Building Service 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: "models.lex.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
CredentialScope: endpoints.CredentialScope{
Service: "lex",
},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "models-fips.lex.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
CredentialScope: endpoints.CredentialScope{
Service: "lex",
},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "models.lex-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
CredentialScope: endpoints.CredentialScope{
Service: "lex",
},
},
{
Variant: 0,
}: {
Hostname: "models.lex.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
CredentialScope: endpoints.CredentialScope{
Service: "lex",
},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "ap-northeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "models-fips.lex.us-east-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-east-1-fips",
}: endpoints.Endpoint{
Hostname: "models-fips.lex.us-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "models-fips.lex.us-west-2.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-2-fips",
}: endpoints.Endpoint{
Hostname: "models-fips.lex.us-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
Deprecated: aws.TrueTernary,
},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "models.lex.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "models.lex-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "models.lex-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "models.lex.{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: "models.lex-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "models.lex.{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: "models.lex-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "models.lex.{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: "models.lex-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "models.lex.{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: "models.lex-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "models.lex.{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: "models.lex.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
CredentialScope: endpoints.CredentialScope{
Service: "lex",
},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "models-fips.lex.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
CredentialScope: endpoints.CredentialScope{
Service: "lex",
},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "models.lex-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
CredentialScope: endpoints.CredentialScope{
Service: "lex",
},
},
{
Variant: 0,
}: {
Hostname: "models.lex.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
CredentialScope: endpoints.CredentialScope{
Service: "lex",
},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "us-gov-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-gov-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "models-fips.lex.us-gov-west-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-gov-west-1-fips",
}: endpoints.Endpoint{
Hostname: "models-fips.lex.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
Deprecated: aws.TrueTernary,
},
},
},
}
| 397 |
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 ChannelStatus string
// Enum values for ChannelStatus
const (
ChannelStatusInProgress ChannelStatus = "IN_PROGRESS"
ChannelStatusCreated ChannelStatus = "CREATED"
ChannelStatusFailed ChannelStatus = "FAILED"
)
// Values returns all known values for ChannelStatus. 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 (ChannelStatus) Values() []ChannelStatus {
return []ChannelStatus{
"IN_PROGRESS",
"CREATED",
"FAILED",
}
}
type ChannelType string
// Enum values for ChannelType
const (
ChannelTypeFacebook ChannelType = "Facebook"
ChannelTypeSlack ChannelType = "Slack"
ChannelTypeTwilioSms ChannelType = "Twilio-Sms"
ChannelTypeKik ChannelType = "Kik"
)
// Values returns all known values for ChannelType. 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 (ChannelType) Values() []ChannelType {
return []ChannelType{
"Facebook",
"Slack",
"Twilio-Sms",
"Kik",
}
}
type ContentType string
// Enum values for ContentType
const (
ContentTypePlainText ContentType = "PlainText"
ContentTypeSsml ContentType = "SSML"
ContentTypeCustomPayload ContentType = "CustomPayload"
)
// Values returns all known values for ContentType. 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 (ContentType) Values() []ContentType {
return []ContentType{
"PlainText",
"SSML",
"CustomPayload",
}
}
type Destination string
// Enum values for Destination
const (
DestinationCloudwatchLogs Destination = "CLOUDWATCH_LOGS"
DestinationS3 Destination = "S3"
)
// Values returns all known values for Destination. 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 (Destination) Values() []Destination {
return []Destination{
"CLOUDWATCH_LOGS",
"S3",
}
}
type ExportStatus string
// Enum values for ExportStatus
const (
ExportStatusInProgress ExportStatus = "IN_PROGRESS"
ExportStatusReady ExportStatus = "READY"
ExportStatusFailed ExportStatus = "FAILED"
)
// Values returns all known values for ExportStatus. 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 (ExportStatus) Values() []ExportStatus {
return []ExportStatus{
"IN_PROGRESS",
"READY",
"FAILED",
}
}
type ExportType string
// Enum values for ExportType
const (
ExportTypeAlexaSkillsKit ExportType = "ALEXA_SKILLS_KIT"
ExportTypeLex ExportType = "LEX"
)
// Values returns all known values for ExportType. 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 (ExportType) Values() []ExportType {
return []ExportType{
"ALEXA_SKILLS_KIT",
"LEX",
}
}
type FulfillmentActivityType string
// Enum values for FulfillmentActivityType
const (
FulfillmentActivityTypeReturnIntent FulfillmentActivityType = "ReturnIntent"
FulfillmentActivityTypeCodeHook FulfillmentActivityType = "CodeHook"
)
// Values returns all known values for FulfillmentActivityType. 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 (FulfillmentActivityType) Values() []FulfillmentActivityType {
return []FulfillmentActivityType{
"ReturnIntent",
"CodeHook",
}
}
type ImportStatus string
// Enum values for ImportStatus
const (
ImportStatusInProgress ImportStatus = "IN_PROGRESS"
ImportStatusComplete ImportStatus = "COMPLETE"
ImportStatusFailed ImportStatus = "FAILED"
)
// Values returns all known values for ImportStatus. 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 (ImportStatus) Values() []ImportStatus {
return []ImportStatus{
"IN_PROGRESS",
"COMPLETE",
"FAILED",
}
}
type Locale string
// Enum values for Locale
const (
LocaleDeDe Locale = "de-DE"
LocaleEnAu Locale = "en-AU"
LocaleEnGb Locale = "en-GB"
LocaleEnIn Locale = "en-IN"
LocaleEnUs Locale = "en-US"
LocaleEs419 Locale = "es-419"
LocaleEsEs Locale = "es-ES"
LocaleEsUs Locale = "es-US"
LocaleFrFr Locale = "fr-FR"
LocaleFrCa Locale = "fr-CA"
LocaleItIt Locale = "it-IT"
LocaleJaJp Locale = "ja-JP"
LocaleKoKr Locale = "ko-KR"
)
// Values returns all known values for Locale. 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 (Locale) Values() []Locale {
return []Locale{
"de-DE",
"en-AU",
"en-GB",
"en-IN",
"en-US",
"es-419",
"es-ES",
"es-US",
"fr-FR",
"fr-CA",
"it-IT",
"ja-JP",
"ko-KR",
}
}
type LogType string
// Enum values for LogType
const (
LogTypeAudio LogType = "AUDIO"
LogTypeText LogType = "TEXT"
)
// Values returns all known values for LogType. 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 (LogType) Values() []LogType {
return []LogType{
"AUDIO",
"TEXT",
}
}
type MergeStrategy string
// Enum values for MergeStrategy
const (
MergeStrategyOverwriteLatest MergeStrategy = "OVERWRITE_LATEST"
MergeStrategyFailOnConflict MergeStrategy = "FAIL_ON_CONFLICT"
)
// Values returns all known values for MergeStrategy. 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 (MergeStrategy) Values() []MergeStrategy {
return []MergeStrategy{
"OVERWRITE_LATEST",
"FAIL_ON_CONFLICT",
}
}
type MigrationAlertType string
// Enum values for MigrationAlertType
const (
MigrationAlertTypeError MigrationAlertType = "ERROR"
MigrationAlertTypeWarn MigrationAlertType = "WARN"
)
// Values returns all known values for MigrationAlertType. 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 (MigrationAlertType) Values() []MigrationAlertType {
return []MigrationAlertType{
"ERROR",
"WARN",
}
}
type MigrationSortAttribute string
// Enum values for MigrationSortAttribute
const (
MigrationSortAttributeV1BotName MigrationSortAttribute = "V1_BOT_NAME"
MigrationSortAttributeMigrationDateTime MigrationSortAttribute = "MIGRATION_DATE_TIME"
)
// Values returns all known values for MigrationSortAttribute. 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 (MigrationSortAttribute) Values() []MigrationSortAttribute {
return []MigrationSortAttribute{
"V1_BOT_NAME",
"MIGRATION_DATE_TIME",
}
}
type MigrationStatus string
// Enum values for MigrationStatus
const (
MigrationStatusInProgress MigrationStatus = "IN_PROGRESS"
MigrationStatusCompleted MigrationStatus = "COMPLETED"
MigrationStatusFailed MigrationStatus = "FAILED"
)
// Values returns all known values for MigrationStatus. 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 (MigrationStatus) Values() []MigrationStatus {
return []MigrationStatus{
"IN_PROGRESS",
"COMPLETED",
"FAILED",
}
}
type MigrationStrategy string
// Enum values for MigrationStrategy
const (
MigrationStrategyCreateNew MigrationStrategy = "CREATE_NEW"
MigrationStrategyUpdateExisting MigrationStrategy = "UPDATE_EXISTING"
)
// Values returns all known values for MigrationStrategy. 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 (MigrationStrategy) Values() []MigrationStrategy {
return []MigrationStrategy{
"CREATE_NEW",
"UPDATE_EXISTING",
}
}
type ObfuscationSetting string
// Enum values for ObfuscationSetting
const (
ObfuscationSettingNone ObfuscationSetting = "NONE"
ObfuscationSettingDefaultObfuscation ObfuscationSetting = "DEFAULT_OBFUSCATION"
)
// Values returns all known values for ObfuscationSetting. 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 (ObfuscationSetting) Values() []ObfuscationSetting {
return []ObfuscationSetting{
"NONE",
"DEFAULT_OBFUSCATION",
}
}
type ProcessBehavior string
// Enum values for ProcessBehavior
const (
ProcessBehaviorSave ProcessBehavior = "SAVE"
ProcessBehaviorBuild ProcessBehavior = "BUILD"
)
// Values returns all known values for ProcessBehavior. 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 (ProcessBehavior) Values() []ProcessBehavior {
return []ProcessBehavior{
"SAVE",
"BUILD",
}
}
type ReferenceType string
// Enum values for ReferenceType
const (
ReferenceTypeIntent ReferenceType = "Intent"
ReferenceTypeBot ReferenceType = "Bot"
ReferenceTypeBotalias ReferenceType = "BotAlias"
ReferenceTypeBotchannel ReferenceType = "BotChannel"
)
// Values returns all known values for ReferenceType. 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 (ReferenceType) Values() []ReferenceType {
return []ReferenceType{
"Intent",
"Bot",
"BotAlias",
"BotChannel",
}
}
type ResourceType string
// Enum values for ResourceType
const (
ResourceTypeBot ResourceType = "BOT"
ResourceTypeIntent ResourceType = "INTENT"
ResourceTypeSlotType ResourceType = "SLOT_TYPE"
)
// Values returns all known values for ResourceType. 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 (ResourceType) Values() []ResourceType {
return []ResourceType{
"BOT",
"INTENT",
"SLOT_TYPE",
}
}
type SlotConstraint string
// Enum values for SlotConstraint
const (
SlotConstraintRequired SlotConstraint = "Required"
SlotConstraintOptional SlotConstraint = "Optional"
)
// Values returns all known values for SlotConstraint. 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 (SlotConstraint) Values() []SlotConstraint {
return []SlotConstraint{
"Required",
"Optional",
}
}
type SlotValueSelectionStrategy string
// Enum values for SlotValueSelectionStrategy
const (
SlotValueSelectionStrategyOriginalValue SlotValueSelectionStrategy = "ORIGINAL_VALUE"
SlotValueSelectionStrategyTopResolution SlotValueSelectionStrategy = "TOP_RESOLUTION"
)
// Values returns all known values for SlotValueSelectionStrategy. 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 (SlotValueSelectionStrategy) Values() []SlotValueSelectionStrategy {
return []SlotValueSelectionStrategy{
"ORIGINAL_VALUE",
"TOP_RESOLUTION",
}
}
type SortOrder string
// Enum values for SortOrder
const (
SortOrderAscending SortOrder = "ASCENDING"
SortOrderDescending SortOrder = "DESCENDING"
)
// Values returns all known values for SortOrder. 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 (SortOrder) Values() []SortOrder {
return []SortOrder{
"ASCENDING",
"DESCENDING",
}
}
type Status string
// Enum values for Status
const (
StatusBuilding Status = "BUILDING"
StatusReady Status = "READY"
StatusReadyBasicTesting Status = "READY_BASIC_TESTING"
StatusFailed Status = "FAILED"
StatusNotBuilt Status = "NOT_BUILT"
)
// Values returns all known values for Status. 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 (Status) Values() []Status {
return []Status{
"BUILDING",
"READY",
"READY_BASIC_TESTING",
"FAILED",
"NOT_BUILT",
}
}
type StatusType string
// Enum values for StatusType
const (
StatusTypeDetected StatusType = "Detected"
StatusTypeMissed StatusType = "Missed"
)
// Values returns all known values for StatusType. 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 (StatusType) Values() []StatusType {
return []StatusType{
"Detected",
"Missed",
}
}
| 484 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
"fmt"
smithy "github.com/aws/smithy-go"
)
// Your IAM user or role does not have permission to call the Amazon Lex V2 APIs
// required to migrate your bot.
type AccessDeniedException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *AccessDeniedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *AccessDeniedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *AccessDeniedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "AccessDeniedException"
}
return *e.ErrorCodeOverride
}
func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The request is not well formed. For example, a value is invalid or a required
// field is missing. Check the field values, and try again.
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 }
// There was a conflict processing the request. Try your request again.
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 }
// An internal Amazon Lex error occurred. Try your request again.
type InternalFailureException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InternalFailureException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InternalFailureException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InternalFailureException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InternalFailureException"
}
return *e.ErrorCodeOverride
}
func (e *InternalFailureException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// The request exceeded a limit. Try your request again.
type LimitExceededException struct {
Message *string
ErrorCodeOverride *string
RetryAfterSeconds *string
noSmithyDocumentSerde
}
func (e *LimitExceededException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *LimitExceededException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *LimitExceededException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "LimitExceededException"
}
return *e.ErrorCodeOverride
}
func (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The resource specified in the request was not found. Check the resource and try
// again.
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 }
// The checksum of the resource that you are trying to change does not match the
// checksum in the request. Check the resource's checksum and try again.
type PreconditionFailedException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *PreconditionFailedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *PreconditionFailedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *PreconditionFailedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "PreconditionFailedException"
}
return *e.ErrorCodeOverride
}
func (e *PreconditionFailedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The resource that you are attempting to delete is referred to by another
// resource. Use this information to remove references to the resource that you are
// trying to delete. The body of the exception contains a JSON object that
// describes the resource. { "resourceType": BOT | BOTALIAS | BOTCHANNEL | INTENT,
//
// "resourceReference": {
//
// "name": string, "version": string } }
type ResourceInUseException struct {
Message *string
ErrorCodeOverride *string
ReferenceType ReferenceType
ExampleReference *ResourceReference
noSmithyDocumentSerde
}
func (e *ResourceInUseException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ResourceInUseException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ResourceInUseException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ResourceInUseException"
}
return *e.ErrorCodeOverride
}
func (e *ResourceInUseException) 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"
)
// Provides information about a bot alias.
type BotAliasMetadata struct {
// The name of the bot to which the alias points.
BotName *string
// The version of the Amazon Lex bot to which the alias points.
BotVersion *string
// Checksum of the bot alias.
Checksum *string
// Settings that determine how Amazon Lex uses conversation logs for the alias.
ConversationLogs *ConversationLogsResponse
// The date that the bot alias was created.
CreatedDate *time.Time
// A description of the bot alias.
Description *string
// The date that the bot alias was updated. When you create a resource, the
// creation date and last updated date are the same.
LastUpdatedDate *time.Time
// The name of the bot alias.
Name *string
noSmithyDocumentSerde
}
// Represents an association between an Amazon Lex bot and an external messaging
// platform.
type BotChannelAssociation struct {
// An alias pointing to the specific version of the Amazon Lex bot to which this
// association is being made.
BotAlias *string
// Provides information necessary to communicate with the messaging platform.
BotConfiguration map[string]string
// The name of the Amazon Lex bot to which this association is being made.
// Currently, Amazon Lex supports associations with Facebook and Slack, and Twilio.
BotName *string
// The date that the association between the Amazon Lex bot and the channel was
// created.
CreatedDate *time.Time
// A text description of the association you are creating.
Description *string
// If status is FAILED , Amazon Lex provides the reason that it failed to create
// the association.
FailureReason *string
// The name of the association between the bot and the channel.
Name *string
// The status of the bot channel.
// - CREATED - The channel has been created and is ready for use.
// - IN_PROGRESS - Channel creation is in progress.
// - FAILED - There was an error creating the channel. For information about the
// reason for the failure, see the failureReason field.
Status ChannelStatus
// Specifies the type of association by indicating the type of channel being
// established between the Amazon Lex bot and the external messaging platform.
Type ChannelType
noSmithyDocumentSerde
}
// Provides information about a bot. .
type BotMetadata struct {
// The date that the bot was created.
CreatedDate *time.Time
// A description of the bot.
Description *string
// The date that the bot was updated. When you create a bot, the creation date and
// last updated date are the same.
LastUpdatedDate *time.Time
// The name of the bot.
Name *string
// The status of the bot.
Status Status
// The version of the bot. For a new bot, the version is always $LATEST .
Version *string
noSmithyDocumentSerde
}
// Provides metadata for a built-in intent.
type BuiltinIntentMetadata struct {
// A unique identifier for the built-in intent. To find the signature for an
// intent, see Standard Built-in Intents (https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/standard-intents)
// in the Alexa Skills Kit.
Signature *string
// A list of identifiers for the locales that the intent supports.
SupportedLocales []Locale
noSmithyDocumentSerde
}
// Provides information about a slot used in a built-in intent.
type BuiltinIntentSlot struct {
// A list of the slots defined for the intent.
Name *string
noSmithyDocumentSerde
}
// Provides information about a built in slot type.
type BuiltinSlotTypeMetadata struct {
// A unique identifier for the built-in slot type. To find the signature for a
// slot type, see Slot Type Reference (https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/slot-type-reference)
// in the Alexa Skills Kit.
Signature *string
// A list of target locales for the slot.
SupportedLocales []Locale
noSmithyDocumentSerde
}
// Specifies a Lambda function that verifies requests to a bot or fulfills the
// user's request to a bot..
type CodeHook struct {
// The version of the request-response that you want Amazon Lex to use to invoke
// your Lambda function. For more information, see using-lambda .
//
// This member is required.
MessageVersion *string
// The Amazon Resource Name (ARN) of the Lambda function.
//
// This member is required.
Uri *string
noSmithyDocumentSerde
}
// Provides the settings needed for conversation logs.
type ConversationLogsRequest struct {
// The Amazon Resource Name (ARN) of an IAM role with permission to write to your
// CloudWatch Logs for text logs and your S3 bucket for audio logs. If audio
// encryption is enabled, this role also provides access permission for the AWS KMS
// key used for encrypting audio logs. For more information, see Creating an IAM
// Role and Policy for Conversation Logs (https://docs.aws.amazon.com/lex/latest/dg/conversation-logs-role-and-policy.html)
// .
//
// This member is required.
IamRoleArn *string
// The settings for your conversation logs. You can log the conversation text,
// conversation audio, or both.
//
// This member is required.
LogSettings []LogSettingsRequest
noSmithyDocumentSerde
}
// Contains information about conversation log settings.
type ConversationLogsResponse struct {
// The Amazon Resource Name (ARN) of the IAM role used to write your logs to
// CloudWatch Logs or an S3 bucket.
IamRoleArn *string
// The settings for your conversation logs. You can log text, audio, or both.
LogSettings []LogSettingsResponse
noSmithyDocumentSerde
}
// Each slot type can have a set of values. Each enumeration value represents a
// value the slot type can take. For example, a pizza ordering bot could have a
// slot type that specifies the type of crust that the pizza should have. The slot
// type could include the values
// - thick
// - thin
// - stuffed
type EnumerationValue struct {
// The value of the slot type.
//
// This member is required.
Value *string
// Additional values related to the slot type value.
Synonyms []string
noSmithyDocumentSerde
}
// A prompt for additional activity after an intent is fulfilled. For example,
// after the OrderPizza intent is fulfilled, you might prompt the user to find out
// whether the user wants to order drinks.
type FollowUpPrompt struct {
// Prompts for information from the user.
//
// This member is required.
Prompt *Prompt
// If the user answers "no" to the question defined in the prompt field, Amazon
// Lex responds with this statement to acknowledge that the intent was canceled.
//
// This member is required.
RejectionStatement *Statement
noSmithyDocumentSerde
}
// Describes how the intent is fulfilled after the user provides all of the
// information required for the intent. You can provide a Lambda function to
// process the intent, or you can return the intent information to the client
// application. We recommend that you use a Lambda function so that the relevant
// logic lives in the Cloud and limit the client-side code primarily to
// presentation. If you need to update the logic, you only update the Lambda
// function; you don't need to upgrade your client application. Consider the
// following examples:
// - In a pizza ordering application, after the user provides all of the
// information for placing an order, you use a Lambda function to place an order
// with a pizzeria.
// - In a gaming application, when a user says "pick up a rock," this
// information must go back to the client application so that it can perform the
// operation and update the graphics. In this case, you want Amazon Lex to return
// the intent data to the client.
type FulfillmentActivity struct {
// How the intent should be fulfilled, either by running a Lambda function or by
// returning the slot data to the client application.
//
// This member is required.
Type FulfillmentActivityType
// A description of the Lambda function that is run to fulfill the intent.
CodeHook *CodeHook
noSmithyDocumentSerde
}
// The name of a context that must be active for an intent to be selected by
// Amazon Lex.
type InputContext struct {
// The name of the context.
//
// This member is required.
Name *string
noSmithyDocumentSerde
}
// Identifies the specific version of an intent.
type Intent struct {
// The name of the intent.
//
// This member is required.
IntentName *string
// The version of the intent.
//
// This member is required.
IntentVersion *string
noSmithyDocumentSerde
}
// Provides information about an intent.
type IntentMetadata struct {
// The date that the intent was created.
CreatedDate *time.Time
// A description of the intent.
Description *string
// The date that the intent was updated. When you create an intent, the creation
// date and last updated date are the same.
LastUpdatedDate *time.Time
// The name of the intent.
Name *string
// The version of the intent.
Version *string
noSmithyDocumentSerde
}
// Provides configuration information for the AMAZON.KendraSearchIntent intent.
// When you use this intent, Amazon Lex searches the specified Amazon Kendra index
// and returns documents from the index that match the user's utterance. For more
// information, see AMAZON.KendraSearchIntent (http://docs.aws.amazon.com/lex/latest/dg/built-in-intent-kendra-search.html)
// .
type KendraConfiguration struct {
// The Amazon Resource Name (ARN) of the Amazon Kendra index that you want the
// AMAZON.KendraSearchIntent intent to search. The index must be in the same
// account and Region as the Amazon Lex bot. If the Amazon Kendra index does not
// exist, you get an exception when you call the PutIntent operation.
//
// This member is required.
KendraIndex *string
// The Amazon Resource Name (ARN) of an IAM role that has permission to search the
// Amazon Kendra index. The role must be in the same account and Region as the
// Amazon Lex bot. If the role does not exist, you get an exception when you call
// the PutIntent operation.
//
// This member is required.
Role *string
// A query filter that Amazon Lex sends to Amazon Kendra to filter the response
// from the query. The filter is in the format defined by Amazon Kendra. For more
// information, see Filtering queries (http://docs.aws.amazon.com/kendra/latest/dg/filtering.html)
// . You can override this filter string with a new filter string at runtime.
QueryFilterString *string
noSmithyDocumentSerde
}
// Settings used to configure delivery mode and destination for conversation logs.
type LogSettingsRequest struct {
// Where the logs will be delivered. Text logs are delivered to a CloudWatch Logs
// log group. Audio logs are delivered to an S3 bucket.
//
// This member is required.
Destination Destination
// The type of logging to enable. Text logs are delivered to a CloudWatch Logs log
// group. Audio logs are delivered to an S3 bucket.
//
// This member is required.
LogType LogType
// The Amazon Resource Name (ARN) of the CloudWatch Logs log group or S3 bucket
// where the logs should be delivered.
//
// This member is required.
ResourceArn *string
// The Amazon Resource Name (ARN) of the AWS KMS customer managed key for
// encrypting audio logs delivered to an S3 bucket. The key does not apply to
// CloudWatch Logs and is optional for S3 buckets.
KmsKeyArn *string
noSmithyDocumentSerde
}
// The settings for conversation logs.
type LogSettingsResponse struct {
// The destination where logs are delivered.
Destination Destination
// The Amazon Resource Name (ARN) of the key used to encrypt audio logs in an S3
// bucket.
KmsKeyArn *string
// The type of logging that is enabled.
LogType LogType
// The Amazon Resource Name (ARN) of the CloudWatch Logs log group or S3 bucket
// where the logs are delivered.
ResourceArn *string
// The resource prefix is the first part of the S3 object key within the S3 bucket
// that you specified to contain audio logs. For CloudWatch Logs it is the prefix
// of the log stream name within the log group that you specified.
ResourcePrefix *string
noSmithyDocumentSerde
}
// The message object that provides the message text and its type.
type Message struct {
// The text of the message.
//
// This member is required.
Content *string
// The content type of the message string.
//
// This member is required.
ContentType ContentType
// Identifies the message group that the message belongs to. When a group is
// assigned to a message, Amazon Lex returns one message from each group in the
// response.
GroupNumber *int32
noSmithyDocumentSerde
}
// Provides information about alerts and warnings that Amazon Lex sends during a
// migration. The alerts include information about how to resolve the issue.
type MigrationAlert struct {
// Additional details about the alert.
Details []string
// A message that describes why the alert was issued.
Message *string
// A link to the Amazon Lex documentation that describes how to resolve the alert.
ReferenceURLs []string
// The type of alert. There are two kinds of alerts:
// - ERROR - There was an issue with the migration that can't be resolved. The
// migration stops.
// - WARN - There was an issue with the migration that requires manual changes to
// the new Amazon Lex V2 bot. The migration continues.
Type MigrationAlertType
noSmithyDocumentSerde
}
// Provides information about migrating a bot from Amazon Lex V1 to Amazon Lex V2.
type MigrationSummary struct {
// The unique identifier that Amazon Lex assigned to the migration.
MigrationId *string
// The status of the operation. When the status is COMPLETE the bot is available
// in Amazon Lex V2. There may be alerts and warnings that need to be resolved to
// complete the migration.
MigrationStatus MigrationStatus
// The strategy used to conduct the migration.
MigrationStrategy MigrationStrategy
// The date and time that the migration started.
MigrationTimestamp *time.Time
// The locale of the Amazon Lex V1 bot that is the source of the migration.
V1BotLocale Locale
// The name of the Amazon Lex V1 bot that is the source of the migration.
V1BotName *string
// The version of the Amazon Lex V1 bot that is the source of the migration.
V1BotVersion *string
// The unique identifier of the Amazon Lex V2 that is the destination of the
// migration.
V2BotId *string
// The IAM role that Amazon Lex uses to run the Amazon Lex V2 bot.
V2BotRole *string
noSmithyDocumentSerde
}
// The specification of an output context that is set when an intent is fulfilled.
type OutputContext struct {
// The name of the context.
//
// This member is required.
Name *string
// The number of seconds that the context should be active after it is first sent
// in a PostContent or PostText response. You can set the value between 5 and
// 86,400 seconds (24 hours).
//
// This member is required.
TimeToLiveInSeconds *int32
// The number of conversation turns that the context should be active. A
// conversation turn is one PostContent or PostText request and the corresponding
// response from Amazon Lex.
//
// This member is required.
TurnsToLive *int32
noSmithyDocumentSerde
}
// Obtains information from the user. To define a prompt, provide one or more
// messages and specify the number of attempts to get information from the user. If
// you provide more than one message, Amazon Lex chooses one of the messages to use
// to prompt the user. For more information, see how-it-works .
type Prompt struct {
// The number of times to prompt the user for information.
//
// This member is required.
MaxAttempts *int32
// An array of objects, each of which provides a message string and its type. You
// can specify the message string in plain text or in Speech Synthesis Markup
// Language (SSML).
//
// This member is required.
Messages []Message
// A response card. Amazon Lex uses this prompt at runtime, in the PostText API
// response. It substitutes session attributes and slot values for placeholders in
// the response card. For more information, see ex-resp-card .
ResponseCard *string
noSmithyDocumentSerde
}
// Describes the resource that refers to the resource that you are attempting to
// delete. This object is returned as part of the ResourceInUseException exception.
type ResourceReference struct {
// The name of the resource that is using the resource that you are trying to
// delete.
Name *string
// The version of the resource that is using the resource that you are trying to
// delete.
Version *string
noSmithyDocumentSerde
}
// Identifies the version of a specific slot.
type Slot struct {
// The name of the slot.
//
// This member is required.
Name *string
// Specifies whether the slot is required or optional.
//
// This member is required.
SlotConstraint SlotConstraint
// A list of default values for the slot. Default values are used when Amazon Lex
// hasn't determined a value for a slot. You can specify default values from
// context variables, session attributes, and defined values.
DefaultValueSpec *SlotDefaultValueSpec
// A description of the slot.
Description *string
// Determines whether a slot is obfuscated in conversation logs and stored
// utterances. When you obfuscate a slot, the value is replaced by the slot name in
// curly braces ({}). For example, if the slot name is "full_name", obfuscated
// values are replaced with "{full_name}". For more information, see Slot
// Obfuscation (https://docs.aws.amazon.com/lex/latest/dg/how-obfuscate.html) .
ObfuscationSetting ObfuscationSetting
// Directs Amazon Lex the order in which to elicit this slot value from the user.
// For example, if the intent has two slots with priorities 1 and 2, AWS Amazon Lex
// first elicits a value for the slot with priority 1. If multiple slots share the
// same priority, the order in which Amazon Lex elicits values is arbitrary.
Priority *int32
// A set of possible responses for the slot type used by text-based clients. A
// user chooses an option from the response card, instead of using text to reply.
ResponseCard *string
// If you know a specific pattern with which users might respond to an Amazon Lex
// request for a slot value, you can provide those utterances to improve accuracy.
// This is optional. In most cases, Amazon Lex is capable of understanding user
// utterances.
SampleUtterances []string
// The type of the slot, either a custom slot type that you defined or one of the
// built-in slot types.
SlotType *string
// The version of the slot type.
SlotTypeVersion *string
// The prompt that Amazon Lex uses to elicit the slot value from the user.
ValueElicitationPrompt *Prompt
noSmithyDocumentSerde
}
// A default value for a slot.
type SlotDefaultValue struct {
// The default value for the slot. You can specify one of the following:
// - #context-name.slot-name - The slot value "slot-name" in the context
// "context-name."
// - {attribute} - The slot value of the session attribute "attribute."
// - 'value' - The discrete value "value."
//
// This member is required.
DefaultValue *string
noSmithyDocumentSerde
}
// Contains the default values for a slot. Default values are used when Amazon Lex
// hasn't determined a value for a slot.
type SlotDefaultValueSpec struct {
// The default values for a slot. You can specify more than one default. For
// example, you can specify a default value to use from a matching context
// variable, a session attribute, or a fixed value. The default value chosen is
// selected based on the order that you specify them in the list. For example, if
// you specify a context variable and a fixed value in that order, Amazon Lex uses
// the context variable if it is available, else it uses the fixed value.
//
// This member is required.
DefaultValueList []SlotDefaultValue
noSmithyDocumentSerde
}
// Provides configuration information for a slot type.
type SlotTypeConfiguration struct {
// A regular expression used to validate the value of a slot.
RegexConfiguration *SlotTypeRegexConfiguration
noSmithyDocumentSerde
}
// Provides information about a slot type..
type SlotTypeMetadata struct {
// The date that the slot type was created.
CreatedDate *time.Time
// A description of the slot type.
Description *string
// The date that the slot type was updated. When you create a resource, the
// creation date and last updated date are the same.
LastUpdatedDate *time.Time
// The name of the slot type.
Name *string
// The version of the slot type.
Version *string
noSmithyDocumentSerde
}
// Provides a regular expression used to validate the value of a slot.
type SlotTypeRegexConfiguration struct {
// A regular expression used to validate the value of a slot. Use a standard
// regular expression. Amazon Lex supports the following characters in the regular
// expression:
// - A-Z, a-z
// - 0-9
// - Unicode characters ("\ u")
// Represent Unicode characters with four digits, for example "\u0041" or
// "\u005A". The following regular expression operators are not supported:
// - Infinite repeaters: *, +, or {x,} with no upper bound.
// - Wild card (.)
//
// This member is required.
Pattern *string
noSmithyDocumentSerde
}
// A collection of messages that convey information to the user. At runtime,
// Amazon Lex selects the message to convey.
type Statement struct {
// A collection of message objects.
//
// This member is required.
Messages []Message
// At runtime, if the client is using the PostText (http://docs.aws.amazon.com/lex/latest/dg/API_runtime_PostText.html)
// API, Amazon Lex includes the response card in the response. It substitutes all
// of the session attributes and slot values for placeholders in the response card.
ResponseCard *string
noSmithyDocumentSerde
}
// A list of key/value pairs that identify a bot, bot alias, or bot channel. Tag
// keys and values can consist of Unicode letters, digits, white space, and any of
// the following symbols: _ . : / = + - @.
type Tag struct {
// The key for the tag. Keys are not case-sensitive and must be unique.
//
// This member is required.
Key *string
// The value associated with a key. The value may be an empty string but it can't
// be null.
//
// This member is required.
Value *string
noSmithyDocumentSerde
}
// Provides information about a single utterance that was made to your bot.
type UtteranceData struct {
// The number of times that the utterance was processed.
Count *int32
// The total number of individuals that used the utterance.
DistinctUsers *int32
// The date that the utterance was first recorded.
FirstUtteredDate *time.Time
// The date that the utterance was last recorded.
LastUtteredDate *time.Time
// The text that was entered by the user or the text representation of an audio
// clip.
UtteranceString *string
noSmithyDocumentSerde
}
// Provides a list of utterances that have been made to a specific version of your
// bot. The list contains a maximum of 100 utterances.
type UtteranceList struct {
// The version of the bot that processed the list.
BotVersion *string
// One or more UtteranceData objects that contain information about the utterances
// that have been made to a bot. The maximum number of object is 100.
Utterances []UtteranceData
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
| 762 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package lexmodelsv2
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 = "Lex Models V2"
const ServiceAPIVersion = "2020-08-07"
// Client provides the API client to make operations call for Amazon Lex Model
// Building V2.
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, "lexmodelsv2", 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 lexmodelsv2
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 lexmodelsv2
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/lexmodelsv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Create a batch of custom vocabulary items for a given bot locale's custom
// vocabulary.
func (c *Client) BatchCreateCustomVocabularyItem(ctx context.Context, params *BatchCreateCustomVocabularyItemInput, optFns ...func(*Options)) (*BatchCreateCustomVocabularyItemOutput, error) {
if params == nil {
params = &BatchCreateCustomVocabularyItemInput{}
}
result, metadata, err := c.invokeOperation(ctx, "BatchCreateCustomVocabularyItem", params, optFns, c.addOperationBatchCreateCustomVocabularyItemMiddlewares)
if err != nil {
return nil, err
}
out := result.(*BatchCreateCustomVocabularyItemOutput)
out.ResultMetadata = metadata
return out, nil
}
type BatchCreateCustomVocabularyItemInput struct {
// The identifier of the bot associated with this custom vocabulary.
//
// This member is required.
BotId *string
// The identifier of the version of the bot associated with this custom vocabulary.
//
// This member is required.
BotVersion *string
// A list of new custom vocabulary items. Each entry must contain a phrase and can
// optionally contain a displayAs and/or a weight.
//
// This member is required.
CustomVocabularyItemList []types.NewCustomVocabularyItem
// The identifier of the language and locale where this custom vocabulary is used.
// The string must match one of the supported locales. For more information, see
// Supported Languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
// .
//
// This member is required.
LocaleId *string
noSmithyDocumentSerde
}
type BatchCreateCustomVocabularyItemOutput struct {
// The identifier of the bot associated with this custom vocabulary.
BotId *string
// The identifier of the version of the bot associated with this custom vocabulary.
BotVersion *string
// A list of custom vocabulary items that failed to create during the operation.
// The reason for the error is contained within each error object.
Errors []types.FailedCustomVocabularyItem
// The identifier of the language and locale where this custom vocabulary is used.
// The string must match one of the supported locales. For more information, see
// Supported Languages (https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html)
// .
LocaleId *string
// A list of custom vocabulary items that were successfully created during the
// operation.
Resources []types.CustomVocabularyItem
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationBatchCreateCustomVocabularyItemMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchCreateCustomVocabularyItem{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchCreateCustomVocabularyItem{}, 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 = addOpBatchCreateCustomVocabularyItemValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchCreateCustomVocabularyItem(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_opBatchCreateCustomVocabularyItem(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "lex",
OperationName: "BatchCreateCustomVocabularyItem",
}
}
| 162 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.