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 sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Get information about an existing configuration set, including the dedicated IP
// pool that it's associated with, whether or not it's enabled for sending email,
// and more. Configuration sets are groups of rules that you can apply to the
// emails you send. You apply a configuration set to an email by including a
// reference to the configuration set in the headers of the email. When you apply a
// configuration set to an email, all of the rules in that configuration set are
// applied to the email.
func (c *Client) GetConfigurationSet(ctx context.Context, params *GetConfigurationSetInput, optFns ...func(*Options)) (*GetConfigurationSetOutput, error) {
if params == nil {
params = &GetConfigurationSetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetConfigurationSet", params, optFns, c.addOperationGetConfigurationSetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetConfigurationSetOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to obtain information about a configuration set.
type GetConfigurationSetInput struct {
// The name of the configuration set.
//
// This member is required.
ConfigurationSetName *string
noSmithyDocumentSerde
}
// Information about a configuration set.
type GetConfigurationSetOutput struct {
// The name of the configuration set.
ConfigurationSetName *string
// An object that defines the dedicated IP pool that is used to send emails that
// you send using the configuration set.
DeliveryOptions *types.DeliveryOptions
// An object that defines whether or not Amazon SES collects reputation metrics
// for the emails that you send that use the configuration set.
ReputationOptions *types.ReputationOptions
// An object that defines whether or not Amazon SES can send email that you send
// using the configuration set.
SendingOptions *types.SendingOptions
// An object that contains information about the suppression list preferences for
// your account.
SuppressionOptions *types.SuppressionOptions
// An array of objects that define the tags (keys and values) that are associated
// with the configuration set.
Tags []types.Tag
// An object that defines the open and click tracking options for emails that you
// send using the configuration set.
TrackingOptions *types.TrackingOptions
// An object that contains information about the VDM preferences for your
// configuration set.
VdmOptions *types.VdmOptions
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetConfigurationSetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetConfigurationSet{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetConfigurationSet{}, 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 = addOpGetConfigurationSetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetConfigurationSet(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_opGetConfigurationSet(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "GetConfigurationSet",
}
}
| 161 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieve a list of event destinations that are associated with a configuration
// set. Events include message sends, deliveries, opens, clicks, bounces, and
// complaints. Event destinations are places that you can send information about
// these events to. For example, you can send event data to Amazon SNS to receive
// notifications when you receive bounces or complaints, or you can use Amazon
// Kinesis Data Firehose to stream data to Amazon S3 for long-term storage.
func (c *Client) GetConfigurationSetEventDestinations(ctx context.Context, params *GetConfigurationSetEventDestinationsInput, optFns ...func(*Options)) (*GetConfigurationSetEventDestinationsOutput, error) {
if params == nil {
params = &GetConfigurationSetEventDestinationsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetConfigurationSetEventDestinations", params, optFns, c.addOperationGetConfigurationSetEventDestinationsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetConfigurationSetEventDestinationsOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to obtain information about the event destinations for a
// configuration set.
type GetConfigurationSetEventDestinationsInput struct {
// The name of the configuration set that contains the event destination.
//
// This member is required.
ConfigurationSetName *string
noSmithyDocumentSerde
}
// Information about an event destination for a configuration set.
type GetConfigurationSetEventDestinationsOutput struct {
// An array that includes all of the events destinations that have been configured
// for the configuration set.
EventDestinations []types.EventDestination
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetConfigurationSetEventDestinationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetConfigurationSetEventDestinations{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetConfigurationSetEventDestinations{}, 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 = addOpGetConfigurationSetEventDestinationsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetConfigurationSetEventDestinations(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_opGetConfigurationSetEventDestinations(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "GetConfigurationSetEventDestinations",
}
}
| 134 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Returns a contact from a contact list.
func (c *Client) GetContact(ctx context.Context, params *GetContactInput, optFns ...func(*Options)) (*GetContactOutput, error) {
if params == nil {
params = &GetContactInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetContact", params, optFns, c.addOperationGetContactMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetContactOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetContactInput struct {
// The name of the contact list to which the contact belongs.
//
// This member is required.
ContactListName *string
// The contact's email address.
//
// This member is required.
EmailAddress *string
noSmithyDocumentSerde
}
type GetContactOutput struct {
// The attribute data attached to a contact.
AttributesData *string
// The name of the contact list to which the contact belongs.
ContactListName *string
// A timestamp noting when the contact was created.
CreatedTimestamp *time.Time
// The contact's email address.
EmailAddress *string
// A timestamp noting the last time the contact's information was updated.
LastUpdatedTimestamp *time.Time
// The default topic preferences applied to the contact.
TopicDefaultPreferences []types.TopicPreference
// The contact's preference for being opted-in to or opted-out of a topic.>
TopicPreferences []types.TopicPreference
// A boolean value status noting if the contact is unsubscribed from all contact
// list topics.
UnsubscribeAll bool
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetContactMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetContact{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetContact{}, 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 = addOpGetContactValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetContact(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_opGetContact(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "GetContact",
}
}
| 153 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Returns contact list metadata. It does not return any information about the
// contacts present in the list.
func (c *Client) GetContactList(ctx context.Context, params *GetContactListInput, optFns ...func(*Options)) (*GetContactListOutput, error) {
if params == nil {
params = &GetContactListInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetContactList", params, optFns, c.addOperationGetContactListMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetContactListOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetContactListInput struct {
// The name of the contact list.
//
// This member is required.
ContactListName *string
noSmithyDocumentSerde
}
type GetContactListOutput struct {
// The name of the contact list.
ContactListName *string
// A timestamp noting when the contact list was created.
CreatedTimestamp *time.Time
// A description of what the contact list is about.
Description *string
// A timestamp noting the last time the contact list was updated.
LastUpdatedTimestamp *time.Time
// The tags associated with a contact list.
Tags []types.Tag
// An interest group, theme, or label within a list. A contact list can have
// multiple topics.
Topics []types.Topic
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetContactListMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetContactList{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetContactList{}, 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 = addOpGetContactListValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetContactList(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_opGetContactList(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "GetContactList",
}
}
| 143 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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 the custom email verification template for the template name you
// specify. For more information about custom verification email templates, see
// Using custom verification email templates (https://docs.aws.amazon.com/ses/latest/dg/creating-identities.html#send-email-verify-address-custom)
// in the Amazon SES Developer Guide. You can execute this operation no more than
// once per second.
func (c *Client) GetCustomVerificationEmailTemplate(ctx context.Context, params *GetCustomVerificationEmailTemplateInput, optFns ...func(*Options)) (*GetCustomVerificationEmailTemplateOutput, error) {
if params == nil {
params = &GetCustomVerificationEmailTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetCustomVerificationEmailTemplate", params, optFns, c.addOperationGetCustomVerificationEmailTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetCustomVerificationEmailTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents a request to retrieve an existing custom verification email template.
type GetCustomVerificationEmailTemplateInput struct {
// The name of the custom verification email template that you want to retrieve.
//
// This member is required.
TemplateName *string
noSmithyDocumentSerde
}
// The following elements are returned by the service.
type GetCustomVerificationEmailTemplateOutput struct {
// The URL that the recipient of the verification email is sent to if his or her
// address is not successfully verified.
FailureRedirectionURL *string
// The email address that the custom verification email is sent from.
FromEmailAddress *string
// The URL that the recipient of the verification email is sent to if his or her
// address is successfully verified.
SuccessRedirectionURL *string
// The content of the custom verification email.
TemplateContent *string
// The name of the custom verification email template.
TemplateName *string
// The subject line of the custom verification email.
TemplateSubject *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetCustomVerificationEmailTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetCustomVerificationEmailTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetCustomVerificationEmailTemplate{}, 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 = addOpGetCustomVerificationEmailTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCustomVerificationEmailTemplate(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_opGetCustomVerificationEmailTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "GetCustomVerificationEmailTemplate",
}
}
| 147 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Get information about a dedicated IP address, including the name of the
// dedicated IP pool that it's associated with, as well information about the
// automatic warm-up process for the address.
func (c *Client) GetDedicatedIp(ctx context.Context, params *GetDedicatedIpInput, optFns ...func(*Options)) (*GetDedicatedIpOutput, error) {
if params == nil {
params = &GetDedicatedIpInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetDedicatedIp", params, optFns, c.addOperationGetDedicatedIpMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetDedicatedIpOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to obtain more information about a dedicated IP address.
type GetDedicatedIpInput struct {
// The IP address that you want to obtain more information about. The value you
// specify has to be a dedicated IP address that's assocaited with your Amazon Web
// Services account.
//
// This member is required.
Ip *string
noSmithyDocumentSerde
}
// Information about a dedicated IP address.
type GetDedicatedIpOutput struct {
// An object that contains information about a dedicated IP address.
DedicatedIp *types.DedicatedIp
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetDedicatedIpMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDedicatedIp{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDedicatedIp{}, 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 = addOpGetDedicatedIpValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDedicatedIp(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_opGetDedicatedIp(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "GetDedicatedIp",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieve information about the dedicated pool.
func (c *Client) GetDedicatedIpPool(ctx context.Context, params *GetDedicatedIpPoolInput, optFns ...func(*Options)) (*GetDedicatedIpPoolOutput, error) {
if params == nil {
params = &GetDedicatedIpPoolInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetDedicatedIpPool", params, optFns, c.addOperationGetDedicatedIpPoolMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetDedicatedIpPoolOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to obtain more information about a dedicated IP pool.
type GetDedicatedIpPoolInput struct {
// The name of the dedicated IP pool to retrieve.
//
// This member is required.
PoolName *string
noSmithyDocumentSerde
}
// The following element is returned by the service.
type GetDedicatedIpPoolOutput struct {
// An object that contains information about a dedicated IP pool.
DedicatedIpPool *types.DedicatedIpPool
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetDedicatedIpPoolMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDedicatedIpPool{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDedicatedIpPool{}, 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 = addOpGetDedicatedIpPoolValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDedicatedIpPool(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_opGetDedicatedIpPool(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "GetDedicatedIpPool",
}
}
| 127 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// List the dedicated IP addresses that are associated with your Amazon Web
// Services account.
func (c *Client) GetDedicatedIps(ctx context.Context, params *GetDedicatedIpsInput, optFns ...func(*Options)) (*GetDedicatedIpsOutput, error) {
if params == nil {
params = &GetDedicatedIpsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetDedicatedIps", params, optFns, c.addOperationGetDedicatedIpsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetDedicatedIpsOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to obtain more information about dedicated IP pools.
type GetDedicatedIpsInput struct {
// A token returned from a previous call to GetDedicatedIps to indicate the
// position of the dedicated IP pool in the list of IP pools.
NextToken *string
// The number of results to show in a single call to GetDedicatedIpsRequest . If
// the number of results is larger than the number you specified in this parameter,
// then the response includes a NextToken element, which you can use to obtain
// additional results.
PageSize *int32
// The name of the IP pool that the dedicated IP address is associated with.
PoolName *string
noSmithyDocumentSerde
}
// Information about the dedicated IP addresses that are associated with your
// Amazon Web Services account.
type GetDedicatedIpsOutput struct {
// A list of dedicated IP addresses that are associated with your Amazon Web
// Services account.
DedicatedIps []types.DedicatedIp
// A token that indicates that there are additional dedicated IP addresses to
// list. To view additional addresses, issue another request to GetDedicatedIps ,
// passing this token in the NextToken parameter.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetDedicatedIpsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDedicatedIps{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDedicatedIps{}, 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_opGetDedicatedIps(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
}
// GetDedicatedIpsAPIClient is a client that implements the GetDedicatedIps
// operation.
type GetDedicatedIpsAPIClient interface {
GetDedicatedIps(context.Context, *GetDedicatedIpsInput, ...func(*Options)) (*GetDedicatedIpsOutput, error)
}
var _ GetDedicatedIpsAPIClient = (*Client)(nil)
// GetDedicatedIpsPaginatorOptions is the paginator options for GetDedicatedIps
type GetDedicatedIpsPaginatorOptions struct {
// The number of results to show in a single call to GetDedicatedIpsRequest . If
// the number of results is larger than the number you specified in this parameter,
// then the response includes a NextToken element, which you can use to obtain
// additional results.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// GetDedicatedIpsPaginator is a paginator for GetDedicatedIps
type GetDedicatedIpsPaginator struct {
options GetDedicatedIpsPaginatorOptions
client GetDedicatedIpsAPIClient
params *GetDedicatedIpsInput
nextToken *string
firstPage bool
}
// NewGetDedicatedIpsPaginator returns a new GetDedicatedIpsPaginator
func NewGetDedicatedIpsPaginator(client GetDedicatedIpsAPIClient, params *GetDedicatedIpsInput, optFns ...func(*GetDedicatedIpsPaginatorOptions)) *GetDedicatedIpsPaginator {
if params == nil {
params = &GetDedicatedIpsInput{}
}
options := GetDedicatedIpsPaginatorOptions{}
if params.PageSize != nil {
options.Limit = *params.PageSize
}
for _, fn := range optFns {
fn(&options)
}
return &GetDedicatedIpsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *GetDedicatedIpsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next GetDedicatedIps page.
func (p *GetDedicatedIpsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetDedicatedIpsOutput, 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.PageSize = limit
result, err := p.client.GetDedicatedIps(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_opGetDedicatedIps(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "GetDedicatedIps",
}
}
| 234 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Retrieve information about the status of the Deliverability dashboard for your
// account. When the Deliverability dashboard is enabled, you gain access to
// reputation, deliverability, and other metrics for the domains that you use to
// send email. You also gain the ability to perform predictive inbox placement
// tests. When you use the Deliverability dashboard, you pay a monthly subscription
// charge, in addition to any other fees that you accrue by using Amazon SES and
// other Amazon Web Services services. For more information about the features and
// cost of a Deliverability dashboard subscription, see Amazon SES Pricing (http://aws.amazon.com/ses/pricing/)
// .
func (c *Client) GetDeliverabilityDashboardOptions(ctx context.Context, params *GetDeliverabilityDashboardOptionsInput, optFns ...func(*Options)) (*GetDeliverabilityDashboardOptionsOutput, error) {
if params == nil {
params = &GetDeliverabilityDashboardOptionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetDeliverabilityDashboardOptions", params, optFns, c.addOperationGetDeliverabilityDashboardOptionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetDeliverabilityDashboardOptionsOutput)
out.ResultMetadata = metadata
return out, nil
}
// Retrieve information about the status of the Deliverability dashboard for your
// Amazon Web Services account. When the Deliverability dashboard is enabled, you
// gain access to reputation, deliverability, and other metrics for your domains.
// You also gain the ability to perform predictive inbox placement tests. When you
// use the Deliverability dashboard, you pay a monthly subscription charge, in
// addition to any other fees that you accrue by using Amazon SES and other Amazon
// Web Services services. For more information about the features and cost of a
// Deliverability dashboard subscription, see Amazon Pinpoint Pricing (http://aws.amazon.com/pinpoint/pricing/)
// .
type GetDeliverabilityDashboardOptionsInput struct {
noSmithyDocumentSerde
}
// An object that shows the status of the Deliverability dashboard.
type GetDeliverabilityDashboardOptionsOutput struct {
// Specifies whether the Deliverability dashboard is enabled. If this value is true
// , the dashboard is enabled.
//
// This member is required.
DashboardEnabled bool
// The current status of your Deliverability dashboard subscription. If this value
// is PENDING_EXPIRATION , your subscription is scheduled to expire at the end of
// the current calendar month.
AccountStatus types.DeliverabilityDashboardAccountStatus
// An array of objects, one for each verified domain that you use to send email
// and currently has an active Deliverability dashboard subscription that isn’t
// scheduled to expire at the end of the current calendar month.
ActiveSubscribedDomains []types.DomainDeliverabilityTrackingOption
// An array of objects, one for each verified domain that you use to send email
// and currently has an active Deliverability dashboard subscription that's
// scheduled to expire at the end of the current calendar month.
PendingExpirationSubscribedDomains []types.DomainDeliverabilityTrackingOption
// The date when your current subscription to the Deliverability dashboard is
// scheduled to expire, if your subscription is scheduled to expire at the end of
// the current calendar month. This value is null if you have an active
// subscription that isn’t due to expire at the end of the month.
SubscriptionExpiryDate *time.Time
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetDeliverabilityDashboardOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDeliverabilityDashboardOptions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDeliverabilityDashboardOptions{}, 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_opGetDeliverabilityDashboardOptions(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_opGetDeliverabilityDashboardOptions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "GetDeliverabilityDashboardOptions",
}
}
| 159 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieve the results of a predictive inbox placement test.
func (c *Client) GetDeliverabilityTestReport(ctx context.Context, params *GetDeliverabilityTestReportInput, optFns ...func(*Options)) (*GetDeliverabilityTestReportOutput, error) {
if params == nil {
params = &GetDeliverabilityTestReportInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetDeliverabilityTestReport", params, optFns, c.addOperationGetDeliverabilityTestReportMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetDeliverabilityTestReportOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to retrieve the results of a predictive inbox placement test.
type GetDeliverabilityTestReportInput struct {
// A unique string that identifies the predictive inbox placement test.
//
// This member is required.
ReportId *string
noSmithyDocumentSerde
}
// The results of the predictive inbox placement test.
type GetDeliverabilityTestReportOutput struct {
// An object that contains the results of the predictive inbox placement test.
//
// This member is required.
DeliverabilityTestReport *types.DeliverabilityTestReport
// An object that describes how the test email was handled by several email
// providers, including Gmail, Hotmail, Yahoo, AOL, and others.
//
// This member is required.
IspPlacements []types.IspPlacement
// An object that specifies how many test messages that were sent during the
// predictive inbox placement test were delivered to recipients' inboxes, how many
// were sent to recipients' spam folders, and how many weren't delivered.
//
// This member is required.
OverallPlacement *types.PlacementStatistics
// An object that contains the message that you sent when you performed this
// predictive inbox placement test.
Message *string
// An array of objects that define the tags (keys and values) that are associated
// with the predictive inbox placement test.
Tags []types.Tag
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetDeliverabilityTestReportMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDeliverabilityTestReport{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDeliverabilityTestReport{}, 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 = addOpGetDeliverabilityTestReportValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDeliverabilityTestReport(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_opGetDeliverabilityTestReport(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "GetDeliverabilityTestReport",
}
}
| 150 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieve all the deliverability data for a specific campaign. This data is
// available for a campaign only if the campaign sent email by using a domain that
// the Deliverability dashboard is enabled for.
func (c *Client) GetDomainDeliverabilityCampaign(ctx context.Context, params *GetDomainDeliverabilityCampaignInput, optFns ...func(*Options)) (*GetDomainDeliverabilityCampaignOutput, error) {
if params == nil {
params = &GetDomainDeliverabilityCampaignInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetDomainDeliverabilityCampaign", params, optFns, c.addOperationGetDomainDeliverabilityCampaignMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetDomainDeliverabilityCampaignOutput)
out.ResultMetadata = metadata
return out, nil
}
// Retrieve all the deliverability data for a specific campaign. This data is
// available for a campaign only if the campaign sent email by using a domain that
// the Deliverability dashboard is enabled for ( PutDeliverabilityDashboardOption
// operation).
type GetDomainDeliverabilityCampaignInput struct {
// The unique identifier for the campaign. The Deliverability dashboard
// automatically generates and assigns this identifier to a campaign.
//
// This member is required.
CampaignId *string
noSmithyDocumentSerde
}
// An object that contains all the deliverability data for a specific campaign.
// This data is available for a campaign only if the campaign sent email by using a
// domain that the Deliverability dashboard is enabled for.
type GetDomainDeliverabilityCampaignOutput struct {
// An object that contains the deliverability data for the campaign.
//
// This member is required.
DomainDeliverabilityCampaign *types.DomainDeliverabilityCampaign
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetDomainDeliverabilityCampaignMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDomainDeliverabilityCampaign{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDomainDeliverabilityCampaign{}, 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 = addOpGetDomainDeliverabilityCampaignValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDomainDeliverabilityCampaign(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_opGetDomainDeliverabilityCampaign(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "GetDomainDeliverabilityCampaign",
}
}
| 137 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Retrieve inbox placement and engagement rates for the domains that you use to
// send email.
func (c *Client) GetDomainStatisticsReport(ctx context.Context, params *GetDomainStatisticsReportInput, optFns ...func(*Options)) (*GetDomainStatisticsReportOutput, error) {
if params == nil {
params = &GetDomainStatisticsReportInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetDomainStatisticsReport", params, optFns, c.addOperationGetDomainStatisticsReportMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetDomainStatisticsReportOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to obtain deliverability metrics for a domain.
type GetDomainStatisticsReportInput struct {
// The domain that you want to obtain deliverability metrics for.
//
// This member is required.
Domain *string
// The last day (in Unix time) that you want to obtain domain deliverability
// metrics for. The EndDate that you specify has to be less than or equal to 30
// days after the StartDate .
//
// This member is required.
EndDate *time.Time
// The first day (in Unix time) that you want to obtain domain deliverability
// metrics for.
//
// This member is required.
StartDate *time.Time
noSmithyDocumentSerde
}
// An object that includes statistics that are related to the domain that you
// specified.
type GetDomainStatisticsReportOutput struct {
// An object that contains deliverability metrics for the domain that you
// specified. This object contains data for each day, starting on the StartDate
// and ending on the EndDate .
//
// This member is required.
DailyVolumes []types.DailyVolume
// An object that contains deliverability metrics for the domain that you
// specified. The data in this object is a summary of all of the data that was
// collected from the StartDate to the EndDate .
//
// This member is required.
OverallVolume *types.OverallVolume
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetDomainStatisticsReportMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDomainStatisticsReport{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDomainStatisticsReport{}, 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 = addOpGetDomainStatisticsReportValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDomainStatisticsReport(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_opGetDomainStatisticsReport(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "GetDomainStatisticsReport",
}
}
| 154 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Provides information about a specific identity, including the identity's
// verification status, sending authorization policies, its DKIM authentication
// status, and its custom Mail-From settings.
func (c *Client) GetEmailIdentity(ctx context.Context, params *GetEmailIdentityInput, optFns ...func(*Options)) (*GetEmailIdentityOutput, error) {
if params == nil {
params = &GetEmailIdentityInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetEmailIdentity", params, optFns, c.addOperationGetEmailIdentityMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetEmailIdentityOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to return details about an email identity.
type GetEmailIdentityInput struct {
// The email identity.
//
// This member is required.
EmailIdentity *string
noSmithyDocumentSerde
}
// Details about an email identity.
type GetEmailIdentityOutput struct {
// The configuration set used by default when sending from this identity.
ConfigurationSetName *string
// An object that contains information about the DKIM attributes for the identity.
DkimAttributes *types.DkimAttributes
// The feedback forwarding configuration for the identity. If the value is true ,
// you receive email notifications when bounce or complaint events occur. These
// notifications are sent to the address that you specified in the Return-Path
// header of the original email. You're required to have a method of tracking
// bounces and complaints. If you haven't set up another mechanism for receiving
// bounce or complaint notifications (for example, by setting up an event
// destination), you receive an email notification when these events occur (even if
// this setting is disabled).
FeedbackForwardingStatus bool
// The email identity type. Note: the MANAGED_DOMAIN identity type is not
// supported.
IdentityType types.IdentityType
// An object that contains information about the Mail-From attributes for the
// email identity.
MailFromAttributes *types.MailFromAttributes
// A map of policy names to policies.
Policies map[string]string
// An array of objects that define the tags (keys and values) that are associated
// with the email identity.
Tags []types.Tag
// The verification status of the identity. The status can be one of the
// following:
// - PENDING – The verification process was initiated, but Amazon SES hasn't yet
// been able to verify the identity.
// - SUCCESS – The verification process completed successfully.
// - FAILED – The verification process failed.
// - TEMPORARY_FAILURE – A temporary issue is preventing Amazon SES from
// determining the verification status of the identity.
// - NOT_STARTED – The verification process hasn't been initiated for the
// identity.
VerificationStatus types.VerificationStatus
// Specifies whether or not the identity is verified. You can only send email from
// verified email addresses or domains. For more information about verifying
// identities, see the Amazon Pinpoint User Guide (https://docs.aws.amazon.com/pinpoint/latest/userguide/channels-email-manage-verify.html)
// .
VerifiedForSendingStatus bool
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetEmailIdentityMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetEmailIdentity{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetEmailIdentity{}, 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 = addOpGetEmailIdentityValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetEmailIdentity(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_opGetEmailIdentity(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "GetEmailIdentity",
}
}
| 175 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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 the requested sending authorization policies for the given identity (an
// email address or a domain). The policies are returned as a map of policy names
// to policy contents. You can retrieve a maximum of 20 policies at a time. This
// API is for the identity owner only. If you have not verified the identity, this
// API will return an error. Sending authorization is a feature that enables an
// identity owner to authorize other senders to use its identities. For information
// about using sending authorization, see the Amazon SES Developer Guide (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html)
// . You can execute this operation no more than once per second.
func (c *Client) GetEmailIdentityPolicies(ctx context.Context, params *GetEmailIdentityPoliciesInput, optFns ...func(*Options)) (*GetEmailIdentityPoliciesOutput, error) {
if params == nil {
params = &GetEmailIdentityPoliciesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetEmailIdentityPolicies", params, optFns, c.addOperationGetEmailIdentityPoliciesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetEmailIdentityPoliciesOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to return the policies of an email identity.
type GetEmailIdentityPoliciesInput struct {
// The email identity.
//
// This member is required.
EmailIdentity *string
noSmithyDocumentSerde
}
// Identity policies associated with email identity.
type GetEmailIdentityPoliciesOutput struct {
// A map of policy names to policies.
Policies map[string]string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetEmailIdentityPoliciesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetEmailIdentityPolicies{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetEmailIdentityPolicies{}, 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 = addOpGetEmailIdentityPoliciesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetEmailIdentityPolicies(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_opGetEmailIdentityPolicies(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "GetEmailIdentityPolicies",
}
}
| 133 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Displays the template object (which includes the subject line, HTML part and
// text part) for the template you specify. You can execute this operation no more
// than once per second.
func (c *Client) GetEmailTemplate(ctx context.Context, params *GetEmailTemplateInput, optFns ...func(*Options)) (*GetEmailTemplateOutput, error) {
if params == nil {
params = &GetEmailTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetEmailTemplate", params, optFns, c.addOperationGetEmailTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetEmailTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents a request to display the template object (which includes the subject
// line, HTML part and text part) for the template you specify.
type GetEmailTemplateInput struct {
// The name of the template.
//
// This member is required.
TemplateName *string
noSmithyDocumentSerde
}
// The following element is returned by the service.
type GetEmailTemplateOutput struct {
// The content of the email template, composed of a subject line, an HTML part,
// and a text-only part.
//
// This member is required.
TemplateContent *types.EmailTemplateContent
// The name of the template.
//
// This member is required.
TemplateName *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetEmailTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetEmailTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetEmailTemplate{}, 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 = addOpGetEmailTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetEmailTemplate(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_opGetEmailTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "GetEmailTemplate",
}
}
| 138 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Provides information about an import job.
func (c *Client) GetImportJob(ctx context.Context, params *GetImportJobInput, optFns ...func(*Options)) (*GetImportJobOutput, error) {
if params == nil {
params = &GetImportJobInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetImportJob", params, optFns, c.addOperationGetImportJobMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetImportJobOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents a request for information about an import job using the import job
// ID.
type GetImportJobInput struct {
// The ID of the import job.
//
// This member is required.
JobId *string
noSmithyDocumentSerde
}
// An HTTP 200 response if the request succeeds, or an error message if the
// request fails.
type GetImportJobOutput struct {
// The time stamp of when the import job was completed.
CompletedTimestamp *time.Time
// The time stamp of when the import job was created.
CreatedTimestamp *time.Time
// The number of records that failed processing because of invalid input or other
// reasons.
FailedRecordsCount *int32
// The failure details about an import job.
FailureInfo *types.FailureInfo
// The data source of the import job.
ImportDataSource *types.ImportDataSource
// The destination of the import job.
ImportDestination *types.ImportDestination
// A string that represents the import job ID.
JobId *string
// The status of the import job.
JobStatus types.JobStatus
// The current number of records processed.
ProcessedRecordsCount *int32
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetImportJobMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetImportJob{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetImportJob{}, 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 = addOpGetImportJobValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetImportJob(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_opGetImportJob(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "GetImportJob",
}
}
| 155 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves information about a specific email address that's on the suppression
// list for your account.
func (c *Client) GetSuppressedDestination(ctx context.Context, params *GetSuppressedDestinationInput, optFns ...func(*Options)) (*GetSuppressedDestinationOutput, error) {
if params == nil {
params = &GetSuppressedDestinationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetSuppressedDestination", params, optFns, c.addOperationGetSuppressedDestinationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetSuppressedDestinationOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to retrieve information about an email address that's on the
// suppression list for your account.
type GetSuppressedDestinationInput struct {
// The email address that's on the account suppression list.
//
// This member is required.
EmailAddress *string
noSmithyDocumentSerde
}
// Information about the suppressed email address.
type GetSuppressedDestinationOutput struct {
// An object containing information about the suppressed email address.
//
// This member is required.
SuppressedDestination *types.SuppressedDestination
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetSuppressedDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSuppressedDestination{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSuppressedDestination{}, 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 = addOpGetSuppressedDestinationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSuppressedDestination(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_opGetSuppressedDestination(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "GetSuppressedDestination",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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 all of the configuration sets associated with your account in the current
// region. Configuration sets are groups of rules that you can apply to the emails
// you send. You apply a configuration set to an email by including a reference to
// the configuration set in the headers of the email. When you apply a
// configuration set to an email, all of the rules in that configuration set are
// applied to the email.
func (c *Client) ListConfigurationSets(ctx context.Context, params *ListConfigurationSetsInput, optFns ...func(*Options)) (*ListConfigurationSetsOutput, error) {
if params == nil {
params = &ListConfigurationSetsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListConfigurationSets", params, optFns, c.addOperationListConfigurationSetsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListConfigurationSetsOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to obtain a list of configuration sets for your Amazon SES account in
// the current Amazon Web Services Region.
type ListConfigurationSetsInput struct {
// A token returned from a previous call to ListConfigurationSets to indicate the
// position in the list of configuration sets.
NextToken *string
// The number of results to show in a single call to ListConfigurationSets . If the
// number of results is larger than the number you specified in this parameter,
// then the response includes a NextToken element, which you can use to obtain
// additional results.
PageSize *int32
noSmithyDocumentSerde
}
// A list of configuration sets in your Amazon SES account in the current Amazon
// Web Services Region.
type ListConfigurationSetsOutput struct {
// An array that contains all of the configuration sets in your Amazon SES account
// in the current Amazon Web Services Region.
ConfigurationSets []string
// A token that indicates that there are additional configuration sets to list. To
// view additional configuration sets, issue another request to
// ListConfigurationSets , and pass this token in the NextToken parameter.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListConfigurationSetsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListConfigurationSets{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListConfigurationSets{}, 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_opListConfigurationSets(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
}
// ListConfigurationSetsAPIClient is a client that implements the
// ListConfigurationSets operation.
type ListConfigurationSetsAPIClient interface {
ListConfigurationSets(context.Context, *ListConfigurationSetsInput, ...func(*Options)) (*ListConfigurationSetsOutput, error)
}
var _ ListConfigurationSetsAPIClient = (*Client)(nil)
// ListConfigurationSetsPaginatorOptions is the paginator options for
// ListConfigurationSets
type ListConfigurationSetsPaginatorOptions struct {
// The number of results to show in a single call to ListConfigurationSets . If the
// number of results is larger than the number you specified in this parameter,
// then the response includes a NextToken element, which you can use to obtain
// additional results.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListConfigurationSetsPaginator is a paginator for ListConfigurationSets
type ListConfigurationSetsPaginator struct {
options ListConfigurationSetsPaginatorOptions
client ListConfigurationSetsAPIClient
params *ListConfigurationSetsInput
nextToken *string
firstPage bool
}
// NewListConfigurationSetsPaginator returns a new ListConfigurationSetsPaginator
func NewListConfigurationSetsPaginator(client ListConfigurationSetsAPIClient, params *ListConfigurationSetsInput, optFns ...func(*ListConfigurationSetsPaginatorOptions)) *ListConfigurationSetsPaginator {
if params == nil {
params = &ListConfigurationSetsInput{}
}
options := ListConfigurationSetsPaginatorOptions{}
if params.PageSize != nil {
options.Limit = *params.PageSize
}
for _, fn := range optFns {
fn(&options)
}
return &ListConfigurationSetsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListConfigurationSetsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListConfigurationSets page.
func (p *ListConfigurationSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConfigurationSetsOutput, 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.PageSize = limit
result, err := p.client.ListConfigurationSets(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_opListConfigurationSets(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "ListConfigurationSets",
}
}
| 236 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists all of the contact lists available.
func (c *Client) ListContactLists(ctx context.Context, params *ListContactListsInput, optFns ...func(*Options)) (*ListContactListsOutput, error) {
if params == nil {
params = &ListContactListsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListContactLists", params, optFns, c.addOperationListContactListsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListContactListsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListContactListsInput struct {
// A string token indicating that there might be additional contact lists
// available to be listed. Use the token provided in the Response to use in the
// subsequent call to ListContactLists with the same parameters to retrieve the
// next page of contact lists.
NextToken *string
// Maximum number of contact lists to return at once. Use this parameter to
// paginate results. If additional contact lists exist beyond the specified limit,
// the NextToken element is sent in the response. Use the NextToken value in
// subsequent requests to retrieve additional lists.
PageSize *int32
noSmithyDocumentSerde
}
type ListContactListsOutput struct {
// The available contact lists.
ContactLists []types.ContactList
// A string token indicating that there might be additional contact lists
// available to be listed. Copy this token to a subsequent call to ListContactLists
// with the same parameters to retrieve the next page of contact lists.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListContactListsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListContactLists{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListContactLists{}, 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_opListContactLists(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
}
// ListContactListsAPIClient is a client that implements the ListContactLists
// operation.
type ListContactListsAPIClient interface {
ListContactLists(context.Context, *ListContactListsInput, ...func(*Options)) (*ListContactListsOutput, error)
}
var _ ListContactListsAPIClient = (*Client)(nil)
// ListContactListsPaginatorOptions is the paginator options for ListContactLists
type ListContactListsPaginatorOptions struct {
// Maximum number of contact lists to return at once. Use this parameter to
// paginate results. If additional contact lists exist beyond the specified limit,
// the NextToken element is sent in the response. Use the NextToken value in
// subsequent requests to retrieve additional lists.
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
}
// ListContactListsPaginator is a paginator for ListContactLists
type ListContactListsPaginator struct {
options ListContactListsPaginatorOptions
client ListContactListsAPIClient
params *ListContactListsInput
nextToken *string
firstPage bool
}
// NewListContactListsPaginator returns a new ListContactListsPaginator
func NewListContactListsPaginator(client ListContactListsAPIClient, params *ListContactListsInput, optFns ...func(*ListContactListsPaginatorOptions)) *ListContactListsPaginator {
if params == nil {
params = &ListContactListsInput{}
}
options := ListContactListsPaginatorOptions{}
if params.PageSize != nil {
options.Limit = *params.PageSize
}
for _, fn := range optFns {
fn(&options)
}
return &ListContactListsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListContactListsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListContactLists page.
func (p *ListContactListsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListContactListsOutput, 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.PageSize = limit
result, err := p.client.ListContactLists(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_opListContactLists(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "ListContactLists",
}
}
| 228 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the contacts present in a specific contact list.
func (c *Client) ListContacts(ctx context.Context, params *ListContactsInput, optFns ...func(*Options)) (*ListContactsOutput, error) {
if params == nil {
params = &ListContactsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListContacts", params, optFns, c.addOperationListContactsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListContactsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListContactsInput struct {
// The name of the contact list.
//
// This member is required.
ContactListName *string
// A filter that can be applied to a list of contacts.
Filter *types.ListContactsFilter
// A string token indicating that there might be additional contacts available to
// be listed. Use the token provided in the Response to use in the subsequent call
// to ListContacts with the same parameters to retrieve the next page of contacts.
NextToken *string
// The number of contacts that may be returned at once, which is dependent on if
// there are more or less contacts than the value of the PageSize. Use this
// parameter to paginate results. If additional contacts exist beyond the specified
// limit, the NextToken element is sent in the response. Use the NextToken value
// in subsequent requests to retrieve additional contacts.
PageSize *int32
noSmithyDocumentSerde
}
type ListContactsOutput struct {
// The contacts present in a specific contact list.
Contacts []types.Contact
// A string token indicating that there might be additional contacts available to
// be listed. Copy this token to a subsequent call to ListContacts with the same
// parameters to retrieve the next page of contacts.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListContactsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListContacts{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListContacts{}, 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 = addOpListContactsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListContacts(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
}
// ListContactsAPIClient is a client that implements the ListContacts operation.
type ListContactsAPIClient interface {
ListContacts(context.Context, *ListContactsInput, ...func(*Options)) (*ListContactsOutput, error)
}
var _ ListContactsAPIClient = (*Client)(nil)
// ListContactsPaginatorOptions is the paginator options for ListContacts
type ListContactsPaginatorOptions struct {
// The number of contacts that may be returned at once, which is dependent on if
// there are more or less contacts than the value of the PageSize. Use this
// parameter to paginate results. If additional contacts exist beyond the specified
// limit, the NextToken element is sent in the response. Use the NextToken value
// in subsequent requests to retrieve additional contacts.
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
}
// ListContactsPaginator is a paginator for ListContacts
type ListContactsPaginator struct {
options ListContactsPaginatorOptions
client ListContactsAPIClient
params *ListContactsInput
nextToken *string
firstPage bool
}
// NewListContactsPaginator returns a new ListContactsPaginator
func NewListContactsPaginator(client ListContactsAPIClient, params *ListContactsInput, optFns ...func(*ListContactsPaginatorOptions)) *ListContactsPaginator {
if params == nil {
params = &ListContactsInput{}
}
options := ListContactsPaginatorOptions{}
if params.PageSize != nil {
options.Limit = *params.PageSize
}
for _, fn := range optFns {
fn(&options)
}
return &ListContactsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListContactsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListContacts page.
func (p *ListContactsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListContactsOutput, 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.PageSize = limit
result, err := p.client.ListContacts(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_opListContacts(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "ListContacts",
}
}
| 239 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the existing custom verification email templates for your account in the
// current Amazon Web Services Region. For more information about custom
// verification email templates, see Using custom verification email templates (https://docs.aws.amazon.com/ses/latest/dg/creating-identities.html#send-email-verify-address-custom)
// in the Amazon SES Developer Guide. You can execute this operation no more than
// once per second.
func (c *Client) ListCustomVerificationEmailTemplates(ctx context.Context, params *ListCustomVerificationEmailTemplatesInput, optFns ...func(*Options)) (*ListCustomVerificationEmailTemplatesOutput, error) {
if params == nil {
params = &ListCustomVerificationEmailTemplatesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListCustomVerificationEmailTemplates", params, optFns, c.addOperationListCustomVerificationEmailTemplatesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListCustomVerificationEmailTemplatesOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents a request to list the existing custom verification email templates
// for your account.
type ListCustomVerificationEmailTemplatesInput struct {
// A token returned from a previous call to ListCustomVerificationEmailTemplates
// to indicate the position in the list of custom verification email templates.
NextToken *string
// The number of results to show in a single call to
// ListCustomVerificationEmailTemplates . If the number of results is larger than
// the number you specified in this parameter, then the response includes a
// NextToken element, which you can use to obtain additional results. The value you
// specify has to be at least 1, and can be no more than 50.
PageSize *int32
noSmithyDocumentSerde
}
// The following elements are returned by the service.
type ListCustomVerificationEmailTemplatesOutput struct {
// A list of the custom verification email templates that exist in your account.
CustomVerificationEmailTemplates []types.CustomVerificationEmailTemplateMetadata
// A token indicating that there are additional custom verification email
// templates available to be listed. Pass this token to a subsequent call to
// ListCustomVerificationEmailTemplates to retrieve the next 50 custom verification
// email templates.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListCustomVerificationEmailTemplatesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListCustomVerificationEmailTemplates{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListCustomVerificationEmailTemplates{}, 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_opListCustomVerificationEmailTemplates(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
}
// ListCustomVerificationEmailTemplatesAPIClient is a client that implements the
// ListCustomVerificationEmailTemplates operation.
type ListCustomVerificationEmailTemplatesAPIClient interface {
ListCustomVerificationEmailTemplates(context.Context, *ListCustomVerificationEmailTemplatesInput, ...func(*Options)) (*ListCustomVerificationEmailTemplatesOutput, error)
}
var _ ListCustomVerificationEmailTemplatesAPIClient = (*Client)(nil)
// ListCustomVerificationEmailTemplatesPaginatorOptions is the paginator options
// for ListCustomVerificationEmailTemplates
type ListCustomVerificationEmailTemplatesPaginatorOptions struct {
// The number of results to show in a single call to
// ListCustomVerificationEmailTemplates . If the number of results is larger than
// the number you specified in this parameter, then the response includes a
// NextToken element, which you can use to obtain additional results. The value you
// specify has to be at least 1, and can be no more than 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
}
// ListCustomVerificationEmailTemplatesPaginator is a paginator for
// ListCustomVerificationEmailTemplates
type ListCustomVerificationEmailTemplatesPaginator struct {
options ListCustomVerificationEmailTemplatesPaginatorOptions
client ListCustomVerificationEmailTemplatesAPIClient
params *ListCustomVerificationEmailTemplatesInput
nextToken *string
firstPage bool
}
// NewListCustomVerificationEmailTemplatesPaginator returns a new
// ListCustomVerificationEmailTemplatesPaginator
func NewListCustomVerificationEmailTemplatesPaginator(client ListCustomVerificationEmailTemplatesAPIClient, params *ListCustomVerificationEmailTemplatesInput, optFns ...func(*ListCustomVerificationEmailTemplatesPaginatorOptions)) *ListCustomVerificationEmailTemplatesPaginator {
if params == nil {
params = &ListCustomVerificationEmailTemplatesInput{}
}
options := ListCustomVerificationEmailTemplatesPaginatorOptions{}
if params.PageSize != nil {
options.Limit = *params.PageSize
}
for _, fn := range optFns {
fn(&options)
}
return &ListCustomVerificationEmailTemplatesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListCustomVerificationEmailTemplatesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListCustomVerificationEmailTemplates page.
func (p *ListCustomVerificationEmailTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCustomVerificationEmailTemplatesOutput, 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.PageSize = limit
result, err := p.client.ListCustomVerificationEmailTemplates(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_opListCustomVerificationEmailTemplates(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "ListCustomVerificationEmailTemplates",
}
}
| 239 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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 all of the dedicated IP pools that exist in your Amazon Web Services
// account in the current Region.
func (c *Client) ListDedicatedIpPools(ctx context.Context, params *ListDedicatedIpPoolsInput, optFns ...func(*Options)) (*ListDedicatedIpPoolsOutput, error) {
if params == nil {
params = &ListDedicatedIpPoolsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListDedicatedIpPools", params, optFns, c.addOperationListDedicatedIpPoolsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListDedicatedIpPoolsOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to obtain a list of dedicated IP pools.
type ListDedicatedIpPoolsInput struct {
// A token returned from a previous call to ListDedicatedIpPools to indicate the
// position in the list of dedicated IP pools.
NextToken *string
// The number of results to show in a single call to ListDedicatedIpPools . If the
// number of results is larger than the number you specified in this parameter,
// then the response includes a NextToken element, which you can use to obtain
// additional results.
PageSize *int32
noSmithyDocumentSerde
}
// A list of dedicated IP pools.
type ListDedicatedIpPoolsOutput struct {
// A list of all of the dedicated IP pools that are associated with your Amazon
// Web Services account in the current Region.
DedicatedIpPools []string
// A token that indicates that there are additional IP pools to list. To view
// additional IP pools, issue another request to ListDedicatedIpPools , passing
// this token in the NextToken parameter.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListDedicatedIpPoolsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListDedicatedIpPools{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListDedicatedIpPools{}, 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_opListDedicatedIpPools(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
}
// ListDedicatedIpPoolsAPIClient is a client that implements the
// ListDedicatedIpPools operation.
type ListDedicatedIpPoolsAPIClient interface {
ListDedicatedIpPools(context.Context, *ListDedicatedIpPoolsInput, ...func(*Options)) (*ListDedicatedIpPoolsOutput, error)
}
var _ ListDedicatedIpPoolsAPIClient = (*Client)(nil)
// ListDedicatedIpPoolsPaginatorOptions is the paginator options for
// ListDedicatedIpPools
type ListDedicatedIpPoolsPaginatorOptions struct {
// The number of results to show in a single call to ListDedicatedIpPools . If the
// number of results is larger than the number you specified in this parameter,
// then the response includes a NextToken element, which you can use to obtain
// additional results.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListDedicatedIpPoolsPaginator is a paginator for ListDedicatedIpPools
type ListDedicatedIpPoolsPaginator struct {
options ListDedicatedIpPoolsPaginatorOptions
client ListDedicatedIpPoolsAPIClient
params *ListDedicatedIpPoolsInput
nextToken *string
firstPage bool
}
// NewListDedicatedIpPoolsPaginator returns a new ListDedicatedIpPoolsPaginator
func NewListDedicatedIpPoolsPaginator(client ListDedicatedIpPoolsAPIClient, params *ListDedicatedIpPoolsInput, optFns ...func(*ListDedicatedIpPoolsPaginatorOptions)) *ListDedicatedIpPoolsPaginator {
if params == nil {
params = &ListDedicatedIpPoolsInput{}
}
options := ListDedicatedIpPoolsPaginatorOptions{}
if params.PageSize != nil {
options.Limit = *params.PageSize
}
for _, fn := range optFns {
fn(&options)
}
return &ListDedicatedIpPoolsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListDedicatedIpPoolsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListDedicatedIpPools page.
func (p *ListDedicatedIpPoolsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDedicatedIpPoolsOutput, 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.PageSize = limit
result, err := p.client.ListDedicatedIpPools(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_opListDedicatedIpPools(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "ListDedicatedIpPools",
}
}
| 230 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Show a list of the predictive inbox placement tests that you've performed,
// regardless of their statuses. For predictive inbox placement tests that are
// complete, you can use the GetDeliverabilityTestReport operation to view the
// results.
func (c *Client) ListDeliverabilityTestReports(ctx context.Context, params *ListDeliverabilityTestReportsInput, optFns ...func(*Options)) (*ListDeliverabilityTestReportsOutput, error) {
if params == nil {
params = &ListDeliverabilityTestReportsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListDeliverabilityTestReports", params, optFns, c.addOperationListDeliverabilityTestReportsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListDeliverabilityTestReportsOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to list all of the predictive inbox placement tests that you've
// performed.
type ListDeliverabilityTestReportsInput struct {
// A token returned from a previous call to ListDeliverabilityTestReports to
// indicate the position in the list of predictive inbox placement tests.
NextToken *string
// The number of results to show in a single call to ListDeliverabilityTestReports
// . If the number of results is larger than the number you specified in this
// parameter, then the response includes a NextToken element, which you can use to
// obtain additional results. The value you specify has to be at least 0, and can
// be no more than 1000.
PageSize *int32
noSmithyDocumentSerde
}
// A list of the predictive inbox placement test reports that are available for
// your account, regardless of whether or not those tests are complete.
type ListDeliverabilityTestReportsOutput struct {
// An object that contains a lists of predictive inbox placement tests that you've
// performed.
//
// This member is required.
DeliverabilityTestReports []types.DeliverabilityTestReport
// A token that indicates that there are additional predictive inbox placement
// tests to list. To view additional predictive inbox placement tests, issue
// another request to ListDeliverabilityTestReports , and pass this token in the
// NextToken parameter.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListDeliverabilityTestReportsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListDeliverabilityTestReports{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListDeliverabilityTestReports{}, 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_opListDeliverabilityTestReports(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
}
// ListDeliverabilityTestReportsAPIClient is a client that implements the
// ListDeliverabilityTestReports operation.
type ListDeliverabilityTestReportsAPIClient interface {
ListDeliverabilityTestReports(context.Context, *ListDeliverabilityTestReportsInput, ...func(*Options)) (*ListDeliverabilityTestReportsOutput, error)
}
var _ ListDeliverabilityTestReportsAPIClient = (*Client)(nil)
// ListDeliverabilityTestReportsPaginatorOptions is the paginator options for
// ListDeliverabilityTestReports
type ListDeliverabilityTestReportsPaginatorOptions struct {
// The number of results to show in a single call to ListDeliverabilityTestReports
// . If the number of results is larger than the number you specified in this
// parameter, then the response includes a NextToken element, which you can use to
// obtain additional results. The value you specify has to be at least 0, and can
// be no more than 1000.
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
}
// ListDeliverabilityTestReportsPaginator is a paginator for
// ListDeliverabilityTestReports
type ListDeliverabilityTestReportsPaginator struct {
options ListDeliverabilityTestReportsPaginatorOptions
client ListDeliverabilityTestReportsAPIClient
params *ListDeliverabilityTestReportsInput
nextToken *string
firstPage bool
}
// NewListDeliverabilityTestReportsPaginator returns a new
// ListDeliverabilityTestReportsPaginator
func NewListDeliverabilityTestReportsPaginator(client ListDeliverabilityTestReportsAPIClient, params *ListDeliverabilityTestReportsInput, optFns ...func(*ListDeliverabilityTestReportsPaginatorOptions)) *ListDeliverabilityTestReportsPaginator {
if params == nil {
params = &ListDeliverabilityTestReportsInput{}
}
options := ListDeliverabilityTestReportsPaginatorOptions{}
if params.PageSize != nil {
options.Limit = *params.PageSize
}
for _, fn := range optFns {
fn(&options)
}
return &ListDeliverabilityTestReportsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListDeliverabilityTestReportsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListDeliverabilityTestReports page.
func (p *ListDeliverabilityTestReportsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDeliverabilityTestReportsOutput, 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.PageSize = limit
result, err := p.client.ListDeliverabilityTestReports(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_opListDeliverabilityTestReports(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "ListDeliverabilityTestReports",
}
}
| 242 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Retrieve deliverability data for all the campaigns that used a specific domain
// to send email during a specified time range. This data is available for a domain
// only if you enabled the Deliverability dashboard for the domain.
func (c *Client) ListDomainDeliverabilityCampaigns(ctx context.Context, params *ListDomainDeliverabilityCampaignsInput, optFns ...func(*Options)) (*ListDomainDeliverabilityCampaignsOutput, error) {
if params == nil {
params = &ListDomainDeliverabilityCampaignsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListDomainDeliverabilityCampaigns", params, optFns, c.addOperationListDomainDeliverabilityCampaignsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListDomainDeliverabilityCampaignsOutput)
out.ResultMetadata = metadata
return out, nil
}
// Retrieve deliverability data for all the campaigns that used a specific domain
// to send email during a specified time range. This data is available for a domain
// only if you enabled the Deliverability dashboard.
type ListDomainDeliverabilityCampaignsInput struct {
// The last day that you want to obtain deliverability data for. This value has to
// be less than or equal to 30 days after the value of the StartDate parameter.
//
// This member is required.
EndDate *time.Time
// The first day that you want to obtain deliverability data for.
//
// This member is required.
StartDate *time.Time
// The domain to obtain deliverability data for.
//
// This member is required.
SubscribedDomain *string
// A token that’s returned from a previous call to the
// ListDomainDeliverabilityCampaigns operation. This token indicates the position
// of a campaign in the list of campaigns.
NextToken *string
// The maximum number of results to include in response to a single call to the
// ListDomainDeliverabilityCampaigns operation. If the number of results is larger
// than the number that you specify in this parameter, the response includes a
// NextToken element, which you can use to obtain additional results.
PageSize *int32
noSmithyDocumentSerde
}
// An array of objects that provide deliverability data for all the campaigns that
// used a specific domain to send email during a specified time range. This data is
// available for a domain only if you enabled the Deliverability dashboard for the
// domain.
type ListDomainDeliverabilityCampaignsOutput struct {
// An array of responses, one for each campaign that used the domain to send email
// during the specified time range.
//
// This member is required.
DomainDeliverabilityCampaigns []types.DomainDeliverabilityCampaign
// A token that’s returned from a previous call to the
// ListDomainDeliverabilityCampaigns operation. This token indicates the position
// of the campaign in the list of campaigns.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListDomainDeliverabilityCampaignsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListDomainDeliverabilityCampaigns{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListDomainDeliverabilityCampaigns{}, 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 = addOpListDomainDeliverabilityCampaignsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDomainDeliverabilityCampaigns(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
}
// ListDomainDeliverabilityCampaignsAPIClient is a client that implements the
// ListDomainDeliverabilityCampaigns operation.
type ListDomainDeliverabilityCampaignsAPIClient interface {
ListDomainDeliverabilityCampaigns(context.Context, *ListDomainDeliverabilityCampaignsInput, ...func(*Options)) (*ListDomainDeliverabilityCampaignsOutput, error)
}
var _ ListDomainDeliverabilityCampaignsAPIClient = (*Client)(nil)
// ListDomainDeliverabilityCampaignsPaginatorOptions is the paginator options for
// ListDomainDeliverabilityCampaigns
type ListDomainDeliverabilityCampaignsPaginatorOptions struct {
// The maximum number of results to include in response to a single call to the
// ListDomainDeliverabilityCampaigns operation. If the number of results is larger
// than the number that you specify in this parameter, the response includes a
// NextToken element, which you can use to obtain additional results.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListDomainDeliverabilityCampaignsPaginator is a paginator for
// ListDomainDeliverabilityCampaigns
type ListDomainDeliverabilityCampaignsPaginator struct {
options ListDomainDeliverabilityCampaignsPaginatorOptions
client ListDomainDeliverabilityCampaignsAPIClient
params *ListDomainDeliverabilityCampaignsInput
nextToken *string
firstPage bool
}
// NewListDomainDeliverabilityCampaignsPaginator returns a new
// ListDomainDeliverabilityCampaignsPaginator
func NewListDomainDeliverabilityCampaignsPaginator(client ListDomainDeliverabilityCampaignsAPIClient, params *ListDomainDeliverabilityCampaignsInput, optFns ...func(*ListDomainDeliverabilityCampaignsPaginatorOptions)) *ListDomainDeliverabilityCampaignsPaginator {
if params == nil {
params = &ListDomainDeliverabilityCampaignsInput{}
}
options := ListDomainDeliverabilityCampaignsPaginatorOptions{}
if params.PageSize != nil {
options.Limit = *params.PageSize
}
for _, fn := range optFns {
fn(&options)
}
return &ListDomainDeliverabilityCampaignsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListDomainDeliverabilityCampaignsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListDomainDeliverabilityCampaigns page.
func (p *ListDomainDeliverabilityCampaignsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDomainDeliverabilityCampaignsOutput, 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.PageSize = limit
result, err := p.client.ListDomainDeliverabilityCampaigns(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_opListDomainDeliverabilityCampaigns(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "ListDomainDeliverabilityCampaigns",
}
}
| 262 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns a list of all of the email identities that are associated with your
// Amazon Web Services account. An identity can be either an email address or a
// domain. This operation returns identities that are verified as well as those
// that aren't. This operation returns identities that are associated with Amazon
// SES and Amazon Pinpoint.
func (c *Client) ListEmailIdentities(ctx context.Context, params *ListEmailIdentitiesInput, optFns ...func(*Options)) (*ListEmailIdentitiesOutput, error) {
if params == nil {
params = &ListEmailIdentitiesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListEmailIdentities", params, optFns, c.addOperationListEmailIdentitiesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListEmailIdentitiesOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to list all of the email identities associated with your Amazon Web
// Services account. This list includes identities that you've already verified,
// identities that are unverified, and identities that were verified in the past,
// but are no longer verified.
type ListEmailIdentitiesInput struct {
// A token returned from a previous call to ListEmailIdentities to indicate the
// position in the list of identities.
NextToken *string
// The number of results to show in a single call to ListEmailIdentities . If the
// number of results is larger than the number you specified in this parameter,
// then the response includes a NextToken element, which you can use to obtain
// additional results. The value you specify has to be at least 0, and can be no
// more than 1000.
PageSize *int32
noSmithyDocumentSerde
}
// A list of all of the identities that you've attempted to verify, regardless of
// whether or not those identities were successfully verified.
type ListEmailIdentitiesOutput struct {
// An array that includes all of the email identities associated with your Amazon
// Web Services account.
EmailIdentities []types.IdentityInfo
// A token that indicates that there are additional configuration sets to list. To
// view additional configuration sets, issue another request to ListEmailIdentities
// , and pass this token in the NextToken parameter.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListEmailIdentitiesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListEmailIdentities{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListEmailIdentities{}, 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_opListEmailIdentities(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
}
// ListEmailIdentitiesAPIClient is a client that implements the
// ListEmailIdentities operation.
type ListEmailIdentitiesAPIClient interface {
ListEmailIdentities(context.Context, *ListEmailIdentitiesInput, ...func(*Options)) (*ListEmailIdentitiesOutput, error)
}
var _ ListEmailIdentitiesAPIClient = (*Client)(nil)
// ListEmailIdentitiesPaginatorOptions is the paginator options for
// ListEmailIdentities
type ListEmailIdentitiesPaginatorOptions struct {
// The number of results to show in a single call to ListEmailIdentities . If the
// number of results is larger than the number you specified in this parameter,
// then the response includes a NextToken element, which you can use to obtain
// additional results. The value you specify has to be at least 0, and can be no
// more than 1000.
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
}
// ListEmailIdentitiesPaginator is a paginator for ListEmailIdentities
type ListEmailIdentitiesPaginator struct {
options ListEmailIdentitiesPaginatorOptions
client ListEmailIdentitiesAPIClient
params *ListEmailIdentitiesInput
nextToken *string
firstPage bool
}
// NewListEmailIdentitiesPaginator returns a new ListEmailIdentitiesPaginator
func NewListEmailIdentitiesPaginator(client ListEmailIdentitiesAPIClient, params *ListEmailIdentitiesInput, optFns ...func(*ListEmailIdentitiesPaginatorOptions)) *ListEmailIdentitiesPaginator {
if params == nil {
params = &ListEmailIdentitiesInput{}
}
options := ListEmailIdentitiesPaginatorOptions{}
if params.PageSize != nil {
options.Limit = *params.PageSize
}
for _, fn := range optFns {
fn(&options)
}
return &ListEmailIdentitiesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListEmailIdentitiesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListEmailIdentities page.
func (p *ListEmailIdentitiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEmailIdentitiesOutput, 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.PageSize = limit
result, err := p.client.ListEmailIdentities(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_opListEmailIdentities(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "ListEmailIdentities",
}
}
| 240 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the email templates present in your Amazon SES account in the current
// Amazon Web Services Region. You can execute this operation no more than once per
// second.
func (c *Client) ListEmailTemplates(ctx context.Context, params *ListEmailTemplatesInput, optFns ...func(*Options)) (*ListEmailTemplatesOutput, error) {
if params == nil {
params = &ListEmailTemplatesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListEmailTemplates", params, optFns, c.addOperationListEmailTemplatesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListEmailTemplatesOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents a request to list the email templates present in your Amazon SES
// account in the current Amazon Web Services Region. For more information, see the
// Amazon SES Developer Guide (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-personalized-email-api.html)
// .
type ListEmailTemplatesInput struct {
// A token returned from a previous call to ListEmailTemplates to indicate the
// position in the list of email templates.
NextToken *string
// The number of results to show in a single call to ListEmailTemplates . If the
// number of results is larger than the number you specified in this parameter,
// then the response includes a NextToken element, which you can use to obtain
// additional results. The value you specify has to be at least 1, and can be no
// more than 10.
PageSize *int32
noSmithyDocumentSerde
}
// The following elements are returned by the service.
type ListEmailTemplatesOutput struct {
// A token indicating that there are additional email templates available to be
// listed. Pass this token to a subsequent ListEmailTemplates call to retrieve the
// next 10 email templates.
NextToken *string
// An array the contains the name and creation time stamp for each template in
// your Amazon SES account.
TemplatesMetadata []types.EmailTemplateMetadata
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListEmailTemplatesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListEmailTemplates{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListEmailTemplates{}, 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_opListEmailTemplates(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
}
// ListEmailTemplatesAPIClient is a client that implements the ListEmailTemplates
// operation.
type ListEmailTemplatesAPIClient interface {
ListEmailTemplates(context.Context, *ListEmailTemplatesInput, ...func(*Options)) (*ListEmailTemplatesOutput, error)
}
var _ ListEmailTemplatesAPIClient = (*Client)(nil)
// ListEmailTemplatesPaginatorOptions is the paginator options for
// ListEmailTemplates
type ListEmailTemplatesPaginatorOptions struct {
// The number of results to show in a single call to ListEmailTemplates . If the
// number of results is larger than the number you specified in this parameter,
// then the response includes a NextToken element, which you can use to obtain
// additional results. The value you specify has to be at least 1, and can be no
// more than 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
}
// ListEmailTemplatesPaginator is a paginator for ListEmailTemplates
type ListEmailTemplatesPaginator struct {
options ListEmailTemplatesPaginatorOptions
client ListEmailTemplatesAPIClient
params *ListEmailTemplatesInput
nextToken *string
firstPage bool
}
// NewListEmailTemplatesPaginator returns a new ListEmailTemplatesPaginator
func NewListEmailTemplatesPaginator(client ListEmailTemplatesAPIClient, params *ListEmailTemplatesInput, optFns ...func(*ListEmailTemplatesPaginatorOptions)) *ListEmailTemplatesPaginator {
if params == nil {
params = &ListEmailTemplatesInput{}
}
options := ListEmailTemplatesPaginatorOptions{}
if params.PageSize != nil {
options.Limit = *params.PageSize
}
for _, fn := range optFns {
fn(&options)
}
return &ListEmailTemplatesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListEmailTemplatesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListEmailTemplates page.
func (p *ListEmailTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEmailTemplatesOutput, 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.PageSize = limit
result, err := p.client.ListEmailTemplates(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_opListEmailTemplates(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "ListEmailTemplates",
}
}
| 237 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists all of the import jobs.
func (c *Client) ListImportJobs(ctx context.Context, params *ListImportJobsInput, optFns ...func(*Options)) (*ListImportJobsOutput, error) {
if params == nil {
params = &ListImportJobsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListImportJobs", params, optFns, c.addOperationListImportJobsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListImportJobsOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents a request to list all of the import jobs for a data destination
// within the specified maximum number of import jobs.
type ListImportJobsInput struct {
// The destination of the import job, which can be used to list import jobs that
// have a certain ImportDestinationType .
ImportDestinationType types.ImportDestinationType
// A string token indicating that there might be additional import jobs available
// to be listed. Copy this token to a subsequent call to ListImportJobs with the
// same parameters to retrieve the next page of import jobs.
NextToken *string
// Maximum number of import jobs to return at once. Use this parameter to paginate
// results. If additional import jobs exist beyond the specified limit, the
// NextToken element is sent in the response. Use the NextToken value in
// subsequent requests to retrieve additional addresses.
PageSize *int32
noSmithyDocumentSerde
}
// An HTTP 200 response if the request succeeds, or an error message if the
// request fails.
type ListImportJobsOutput struct {
// A list of the import job summaries.
ImportJobs []types.ImportJobSummary
// A string token indicating that there might be additional import jobs available
// to be listed. Copy this token to a subsequent call to ListImportJobs with the
// same parameters to retrieve the next page of import jobs.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListImportJobsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListImportJobs{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListImportJobs{}, 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_opListImportJobs(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
}
// ListImportJobsAPIClient is a client that implements the ListImportJobs
// operation.
type ListImportJobsAPIClient interface {
ListImportJobs(context.Context, *ListImportJobsInput, ...func(*Options)) (*ListImportJobsOutput, error)
}
var _ ListImportJobsAPIClient = (*Client)(nil)
// ListImportJobsPaginatorOptions is the paginator options for ListImportJobs
type ListImportJobsPaginatorOptions struct {
// Maximum number of import jobs to return at once. Use this parameter to paginate
// results. If additional import jobs exist beyond the specified limit, the
// NextToken element is sent in the response. Use the NextToken value in
// subsequent requests to retrieve additional addresses.
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
}
// ListImportJobsPaginator is a paginator for ListImportJobs
type ListImportJobsPaginator struct {
options ListImportJobsPaginatorOptions
client ListImportJobsAPIClient
params *ListImportJobsInput
nextToken *string
firstPage bool
}
// NewListImportJobsPaginator returns a new ListImportJobsPaginator
func NewListImportJobsPaginator(client ListImportJobsAPIClient, params *ListImportJobsInput, optFns ...func(*ListImportJobsPaginatorOptions)) *ListImportJobsPaginator {
if params == nil {
params = &ListImportJobsInput{}
}
options := ListImportJobsPaginatorOptions{}
if params.PageSize != nil {
options.Limit = *params.PageSize
}
for _, fn := range optFns {
fn(&options)
}
return &ListImportJobsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListImportJobsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListImportJobs page.
func (p *ListImportJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImportJobsOutput, 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.PageSize = limit
result, err := p.client.ListImportJobs(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_opListImportJobs(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "ListImportJobs",
}
}
| 235 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the recommendations present in your Amazon SES account in the current
// Amazon Web Services Region. You can execute this operation no more than once per
// second.
func (c *Client) ListRecommendations(ctx context.Context, params *ListRecommendationsInput, optFns ...func(*Options)) (*ListRecommendationsOutput, error) {
if params == nil {
params = &ListRecommendationsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListRecommendations", params, optFns, c.addOperationListRecommendationsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListRecommendationsOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents a request to list the existing recommendations for your account.
type ListRecommendationsInput struct {
// Filters applied when retrieving recommendations. Can eiter be an individual
// filter, or combinations of STATUS and IMPACT or STATUS and TYPE
Filter map[string]string
// A token returned from a previous call to ListRecommendations to indicate the
// position in the list of recommendations.
NextToken *string
// The number of results to show in a single call to ListRecommendations . If the
// number of results is larger than the number you specified in this parameter,
// then the response includes a NextToken element, which you can use to obtain
// additional results. The value you specify has to be at least 1, and can be no
// more than 100.
PageSize *int32
noSmithyDocumentSerde
}
// Contains the response to your request to retrieve the list of recommendations
// for your account.
type ListRecommendationsOutput struct {
// A string token indicating that there might be additional recommendations
// available to be listed. Use the token provided in the
// ListRecommendationsResponse to use in the subsequent call to ListRecommendations
// with the same parameters to retrieve the next page of recommendations.
NextToken *string
// The recommendations applicable to your account.
Recommendations []types.Recommendation
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListRecommendationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListRecommendations{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListRecommendations{}, 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_opListRecommendations(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
}
// ListRecommendationsAPIClient is a client that implements the
// ListRecommendations operation.
type ListRecommendationsAPIClient interface {
ListRecommendations(context.Context, *ListRecommendationsInput, ...func(*Options)) (*ListRecommendationsOutput, error)
}
var _ ListRecommendationsAPIClient = (*Client)(nil)
// ListRecommendationsPaginatorOptions is the paginator options for
// ListRecommendations
type ListRecommendationsPaginatorOptions struct {
// The number of results to show in a single call to ListRecommendations . If the
// number of results is larger than the number you specified in this parameter,
// then the response includes a NextToken element, which you can use to obtain
// additional results. The value you specify has to be at least 1, and can be no
// more than 100.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListRecommendationsPaginator is a paginator for ListRecommendations
type ListRecommendationsPaginator struct {
options ListRecommendationsPaginatorOptions
client ListRecommendationsAPIClient
params *ListRecommendationsInput
nextToken *string
firstPage bool
}
// NewListRecommendationsPaginator returns a new ListRecommendationsPaginator
func NewListRecommendationsPaginator(client ListRecommendationsAPIClient, params *ListRecommendationsInput, optFns ...func(*ListRecommendationsPaginatorOptions)) *ListRecommendationsPaginator {
if params == nil {
params = &ListRecommendationsInput{}
}
options := ListRecommendationsPaginatorOptions{}
if params.PageSize != nil {
options.Limit = *params.PageSize
}
for _, fn := range optFns {
fn(&options)
}
return &ListRecommendationsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListRecommendationsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListRecommendations page.
func (p *ListRecommendationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRecommendationsOutput, 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.PageSize = limit
result, err := p.client.ListRecommendations(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_opListRecommendations(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "ListRecommendations",
}
}
| 239 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Retrieves a list of email addresses that are on the suppression list for your
// account.
func (c *Client) ListSuppressedDestinations(ctx context.Context, params *ListSuppressedDestinationsInput, optFns ...func(*Options)) (*ListSuppressedDestinationsOutput, error) {
if params == nil {
params = &ListSuppressedDestinationsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListSuppressedDestinations", params, optFns, c.addOperationListSuppressedDestinationsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListSuppressedDestinationsOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to obtain a list of email destinations that are on the suppression
// list for your account.
type ListSuppressedDestinationsInput struct {
// Used to filter the list of suppressed email destinations so that it only
// includes addresses that were added to the list before a specific date.
EndDate *time.Time
// A token returned from a previous call to ListSuppressedDestinations to indicate
// the position in the list of suppressed email addresses.
NextToken *string
// The number of results to show in a single call to ListSuppressedDestinations .
// If the number of results is larger than the number you specified in this
// parameter, then the response includes a NextToken element, which you can use to
// obtain additional results.
PageSize *int32
// The factors that caused the email address to be added to .
Reasons []types.SuppressionListReason
// Used to filter the list of suppressed email destinations so that it only
// includes addresses that were added to the list after a specific date.
StartDate *time.Time
noSmithyDocumentSerde
}
// A list of suppressed email addresses.
type ListSuppressedDestinationsOutput struct {
// A token that indicates that there are additional email addresses on the
// suppression list for your account. To view additional suppressed addresses,
// issue another request to ListSuppressedDestinations , and pass this token in the
// NextToken parameter.
NextToken *string
// A list of summaries, each containing a summary for a suppressed email
// destination.
SuppressedDestinationSummaries []types.SuppressedDestinationSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListSuppressedDestinationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListSuppressedDestinations{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSuppressedDestinations{}, 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_opListSuppressedDestinations(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
}
// ListSuppressedDestinationsAPIClient is a client that implements the
// ListSuppressedDestinations operation.
type ListSuppressedDestinationsAPIClient interface {
ListSuppressedDestinations(context.Context, *ListSuppressedDestinationsInput, ...func(*Options)) (*ListSuppressedDestinationsOutput, error)
}
var _ ListSuppressedDestinationsAPIClient = (*Client)(nil)
// ListSuppressedDestinationsPaginatorOptions is the paginator options for
// ListSuppressedDestinations
type ListSuppressedDestinationsPaginatorOptions struct {
// The number of results to show in a single call to ListSuppressedDestinations .
// If the number of results is larger than the number you specified in this
// parameter, then the response includes a NextToken element, which you can use to
// obtain additional results.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListSuppressedDestinationsPaginator is a paginator for
// ListSuppressedDestinations
type ListSuppressedDestinationsPaginator struct {
options ListSuppressedDestinationsPaginatorOptions
client ListSuppressedDestinationsAPIClient
params *ListSuppressedDestinationsInput
nextToken *string
firstPage bool
}
// NewListSuppressedDestinationsPaginator returns a new
// ListSuppressedDestinationsPaginator
func NewListSuppressedDestinationsPaginator(client ListSuppressedDestinationsAPIClient, params *ListSuppressedDestinationsInput, optFns ...func(*ListSuppressedDestinationsPaginatorOptions)) *ListSuppressedDestinationsPaginator {
if params == nil {
params = &ListSuppressedDestinationsInput{}
}
options := ListSuppressedDestinationsPaginatorOptions{}
if params.PageSize != nil {
options.Limit = *params.PageSize
}
for _, fn := range optFns {
fn(&options)
}
return &ListSuppressedDestinationsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListSuppressedDestinationsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListSuppressedDestinations page.
func (p *ListSuppressedDestinationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSuppressedDestinationsOutput, 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.PageSize = limit
result, err := p.client.ListSuppressedDestinations(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_opListSuppressedDestinations(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "ListSuppressedDestinations",
}
}
| 247 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieve a list of the tags (keys and values) that are associated with a
// specified resource. A tag is a label that you optionally define and associate
// with a resource. Each tag consists of a required tag key and an optional
// associated tag value. A tag key is a general label that acts as a category for
// more specific tag values. A tag value acts as a descriptor within a tag key.
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 that you want to retrieve tag
// information for.
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type ListTagsForResourceOutput struct {
// An array that lists all the tags that are associated with the resource. Each
// tag consists of a required tag key ( Key ) and an associated tag value ( Value )
//
// This member is required.
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: "ses",
OperationName: "ListTagsForResource",
}
}
| 133 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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"
)
// Enable or disable the automatic warm-up feature for dedicated IP addresses.
func (c *Client) PutAccountDedicatedIpWarmupAttributes(ctx context.Context, params *PutAccountDedicatedIpWarmupAttributesInput, optFns ...func(*Options)) (*PutAccountDedicatedIpWarmupAttributesOutput, error) {
if params == nil {
params = &PutAccountDedicatedIpWarmupAttributesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutAccountDedicatedIpWarmupAttributes", params, optFns, c.addOperationPutAccountDedicatedIpWarmupAttributesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutAccountDedicatedIpWarmupAttributesOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to enable or disable the automatic IP address warm-up feature.
type PutAccountDedicatedIpWarmupAttributesInput struct {
// Enables or disables the automatic warm-up feature for dedicated IP addresses
// that are associated with your Amazon SES account in the current Amazon Web
// Services Region. Set to true to enable the automatic warm-up feature, or set to
// false to disable it.
AutoWarmupEnabled bool
noSmithyDocumentSerde
}
// An HTTP 200 response if the request succeeds, or an error message if the
// request fails.
type PutAccountDedicatedIpWarmupAttributesOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutAccountDedicatedIpWarmupAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutAccountDedicatedIpWarmupAttributes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutAccountDedicatedIpWarmupAttributes{}, 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_opPutAccountDedicatedIpWarmupAttributes(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_opPutAccountDedicatedIpWarmupAttributes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "PutAccountDedicatedIpWarmupAttributes",
}
}
| 121 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Update your Amazon SES account details.
func (c *Client) PutAccountDetails(ctx context.Context, params *PutAccountDetailsInput, optFns ...func(*Options)) (*PutAccountDetailsOutput, error) {
if params == nil {
params = &PutAccountDetailsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutAccountDetails", params, optFns, c.addOperationPutAccountDetailsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutAccountDetailsOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to submit new account details.
type PutAccountDetailsInput struct {
// The type of email your account will send.
//
// This member is required.
MailType types.MailType
// A description of the types of email that you plan to send.
//
// This member is required.
UseCaseDescription *string
// The URL of your website. This information helps us better understand the type
// of content that you plan to send.
//
// This member is required.
WebsiteURL *string
// Additional email addresses that you would like to be notified regarding Amazon
// SES matters.
AdditionalContactEmailAddresses []string
// The language you would prefer to be contacted with.
ContactLanguage types.ContactLanguage
// Indicates whether or not your account should have production access in the
// current Amazon Web Services Region. If the value is false , then your account is
// in the sandbox. When your account is in the sandbox, you can only send email to
// verified identities. Additionally, the maximum number of emails you can send in
// a 24-hour period (your sending quota) is 200, and the maximum number of emails
// you can send per second (your maximum sending rate) is 1. If the value is true ,
// then your account has production access. When your account has production
// access, you can send email to any address. The sending quota and maximum sending
// rate for your account vary based on your specific use case.
ProductionAccessEnabled *bool
noSmithyDocumentSerde
}
// An HTTP 200 response if the request succeeds, or an error message if the
// request fails.
type PutAccountDetailsOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutAccountDetailsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutAccountDetails{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutAccountDetails{}, 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 = addOpPutAccountDetailsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutAccountDetails(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_opPutAccountDetails(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "PutAccountDetails",
}
}
| 153 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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"
)
// Enable or disable the ability of your account to send email.
func (c *Client) PutAccountSendingAttributes(ctx context.Context, params *PutAccountSendingAttributesInput, optFns ...func(*Options)) (*PutAccountSendingAttributesOutput, error) {
if params == nil {
params = &PutAccountSendingAttributesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutAccountSendingAttributes", params, optFns, c.addOperationPutAccountSendingAttributesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutAccountSendingAttributesOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to change the ability of your account to send email.
type PutAccountSendingAttributesInput struct {
// Enables or disables your account's ability to send email. Set to true to enable
// email sending, or set to false to disable email sending. If Amazon Web Services
// paused your account's ability to send email, you can't use this operation to
// resume your account's ability to send email.
SendingEnabled bool
noSmithyDocumentSerde
}
// An HTTP 200 response if the request succeeds, or an error message if the
// request fails.
type PutAccountSendingAttributesOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutAccountSendingAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutAccountSendingAttributes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutAccountSendingAttributes{}, 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_opPutAccountSendingAttributes(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_opPutAccountSendingAttributes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "PutAccountSendingAttributes",
}
}
| 121 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Change the settings for the account-level suppression list.
func (c *Client) PutAccountSuppressionAttributes(ctx context.Context, params *PutAccountSuppressionAttributesInput, optFns ...func(*Options)) (*PutAccountSuppressionAttributesOutput, error) {
if params == nil {
params = &PutAccountSuppressionAttributesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutAccountSuppressionAttributes", params, optFns, c.addOperationPutAccountSuppressionAttributesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutAccountSuppressionAttributesOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to change your account's suppression preferences.
type PutAccountSuppressionAttributesInput struct {
// A list that contains the reasons that email addresses will be automatically
// added to the suppression list for your account. This list can contain any or all
// of the following:
// - COMPLAINT – Amazon SES adds an email address to the suppression list for
// your account when a message sent to that address results in a complaint.
// - BOUNCE – Amazon SES adds an email address to the suppression list for your
// account when a message sent to that address results in a hard bounce.
SuppressedReasons []types.SuppressionListReason
noSmithyDocumentSerde
}
// An HTTP 200 response if the request succeeds, or an error message if the
// request fails.
type PutAccountSuppressionAttributesOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutAccountSuppressionAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutAccountSuppressionAttributes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutAccountSuppressionAttributes{}, 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_opPutAccountSuppressionAttributes(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_opPutAccountSuppressionAttributes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "PutAccountSuppressionAttributes",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Update your Amazon SES account VDM attributes. You can execute this operation
// no more than once per second.
func (c *Client) PutAccountVdmAttributes(ctx context.Context, params *PutAccountVdmAttributesInput, optFns ...func(*Options)) (*PutAccountVdmAttributesOutput, error) {
if params == nil {
params = &PutAccountVdmAttributesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutAccountVdmAttributes", params, optFns, c.addOperationPutAccountVdmAttributesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutAccountVdmAttributesOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to submit new account VDM attributes.
type PutAccountVdmAttributesInput struct {
// The VDM attributes that you wish to apply to your Amazon SES account.
//
// This member is required.
VdmAttributes *types.VdmAttributes
noSmithyDocumentSerde
}
type PutAccountVdmAttributesOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutAccountVdmAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutAccountVdmAttributes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutAccountVdmAttributes{}, 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 = addOpPutAccountVdmAttributesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutAccountVdmAttributes(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_opPutAccountVdmAttributes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "PutAccountVdmAttributes",
}
}
| 123 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Associate a configuration set with a dedicated IP pool. You can use dedicated
// IP pools to create groups of dedicated IP addresses for sending specific types
// of email.
func (c *Client) PutConfigurationSetDeliveryOptions(ctx context.Context, params *PutConfigurationSetDeliveryOptionsInput, optFns ...func(*Options)) (*PutConfigurationSetDeliveryOptionsOutput, error) {
if params == nil {
params = &PutConfigurationSetDeliveryOptionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutConfigurationSetDeliveryOptions", params, optFns, c.addOperationPutConfigurationSetDeliveryOptionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutConfigurationSetDeliveryOptionsOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to associate a configuration set with a dedicated IP pool.
type PutConfigurationSetDeliveryOptionsInput struct {
// The name of the configuration set to associate with a dedicated IP pool.
//
// This member is required.
ConfigurationSetName *string
// The name of the dedicated IP pool to associate with the configuration set.
SendingPoolName *string
// Specifies whether messages that use the configuration set are required to use
// Transport Layer Security (TLS). If the value is Require , messages are only
// delivered if a TLS connection can be established. If the value is Optional ,
// messages can be delivered in plain text if a TLS connection can't be
// established.
TlsPolicy types.TlsPolicy
noSmithyDocumentSerde
}
// An HTTP 200 response if the request succeeds, or an error message if the
// request fails.
type PutConfigurationSetDeliveryOptionsOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutConfigurationSetDeliveryOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutConfigurationSetDeliveryOptions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutConfigurationSetDeliveryOptions{}, 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 = addOpPutConfigurationSetDeliveryOptionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutConfigurationSetDeliveryOptions(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_opPutConfigurationSetDeliveryOptions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "PutConfigurationSetDeliveryOptions",
}
}
| 136 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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"
)
// Enable or disable collection of reputation metrics for emails that you send
// using a particular configuration set in a specific Amazon Web Services Region.
func (c *Client) PutConfigurationSetReputationOptions(ctx context.Context, params *PutConfigurationSetReputationOptionsInput, optFns ...func(*Options)) (*PutConfigurationSetReputationOptionsOutput, error) {
if params == nil {
params = &PutConfigurationSetReputationOptionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutConfigurationSetReputationOptions", params, optFns, c.addOperationPutConfigurationSetReputationOptionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutConfigurationSetReputationOptionsOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to enable or disable tracking of reputation metrics for a
// configuration set.
type PutConfigurationSetReputationOptionsInput struct {
// The name of the configuration set.
//
// This member is required.
ConfigurationSetName *string
// If true , tracking of reputation metrics is enabled for the configuration set.
// If false , tracking of reputation metrics is disabled for the configuration set.
ReputationMetricsEnabled bool
noSmithyDocumentSerde
}
// An HTTP 200 response if the request succeeds, or an error message if the
// request fails.
type PutConfigurationSetReputationOptionsOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutConfigurationSetReputationOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutConfigurationSetReputationOptions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutConfigurationSetReputationOptions{}, 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 = addOpPutConfigurationSetReputationOptionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutConfigurationSetReputationOptions(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_opPutConfigurationSetReputationOptions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "PutConfigurationSetReputationOptions",
}
}
| 129 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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"
)
// Enable or disable email sending for messages that use a particular
// configuration set in a specific Amazon Web Services Region.
func (c *Client) PutConfigurationSetSendingOptions(ctx context.Context, params *PutConfigurationSetSendingOptionsInput, optFns ...func(*Options)) (*PutConfigurationSetSendingOptionsOutput, error) {
if params == nil {
params = &PutConfigurationSetSendingOptionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutConfigurationSetSendingOptions", params, optFns, c.addOperationPutConfigurationSetSendingOptionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutConfigurationSetSendingOptionsOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to enable or disable the ability of Amazon SES to send emails that
// use a specific configuration set.
type PutConfigurationSetSendingOptionsInput struct {
// The name of the configuration set to enable or disable email sending for.
//
// This member is required.
ConfigurationSetName *string
// If true , email sending is enabled for the configuration set. If false , email
// sending is disabled for the configuration set.
SendingEnabled bool
noSmithyDocumentSerde
}
// An HTTP 200 response if the request succeeds, or an error message if the
// request fails.
type PutConfigurationSetSendingOptionsOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutConfigurationSetSendingOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutConfigurationSetSendingOptions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutConfigurationSetSendingOptions{}, 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 = addOpPutConfigurationSetSendingOptionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutConfigurationSetSendingOptions(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_opPutConfigurationSetSendingOptions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "PutConfigurationSetSendingOptions",
}
}
| 129 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Specify the account suppression list preferences for a configuration set.
func (c *Client) PutConfigurationSetSuppressionOptions(ctx context.Context, params *PutConfigurationSetSuppressionOptionsInput, optFns ...func(*Options)) (*PutConfigurationSetSuppressionOptionsOutput, error) {
if params == nil {
params = &PutConfigurationSetSuppressionOptionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutConfigurationSetSuppressionOptions", params, optFns, c.addOperationPutConfigurationSetSuppressionOptionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutConfigurationSetSuppressionOptionsOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to change the account suppression list preferences for a specific
// configuration set.
type PutConfigurationSetSuppressionOptionsInput struct {
// The name of the configuration set to change the suppression list preferences
// for.
//
// This member is required.
ConfigurationSetName *string
// A list that contains the reasons that email addresses are automatically added
// to the suppression list for your account. This list can contain any or all of
// the following:
// - COMPLAINT – Amazon SES adds an email address to the suppression list for
// your account when a message sent to that address results in a complaint.
// - BOUNCE – Amazon SES adds an email address to the suppression list for your
// account when a message sent to that address results in a hard bounce.
SuppressedReasons []types.SuppressionListReason
noSmithyDocumentSerde
}
// An HTTP 200 response if the request succeeds, or an error message if the
// request fails.
type PutConfigurationSetSuppressionOptionsOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutConfigurationSetSuppressionOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutConfigurationSetSuppressionOptions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutConfigurationSetSuppressionOptions{}, 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 = addOpPutConfigurationSetSuppressionOptionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutConfigurationSetSuppressionOptions(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_opPutConfigurationSetSuppressionOptions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "PutConfigurationSetSuppressionOptions",
}
}
| 135 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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"
)
// Specify a custom domain to use for open and click tracking elements in email
// that you send.
func (c *Client) PutConfigurationSetTrackingOptions(ctx context.Context, params *PutConfigurationSetTrackingOptionsInput, optFns ...func(*Options)) (*PutConfigurationSetTrackingOptionsOutput, error) {
if params == nil {
params = &PutConfigurationSetTrackingOptionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutConfigurationSetTrackingOptions", params, optFns, c.addOperationPutConfigurationSetTrackingOptionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutConfigurationSetTrackingOptionsOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to add a custom domain for tracking open and click events to a
// configuration set.
type PutConfigurationSetTrackingOptionsInput struct {
// The name of the configuration set.
//
// This member is required.
ConfigurationSetName *string
// The domain to use to track open and click events.
CustomRedirectDomain *string
noSmithyDocumentSerde
}
// An HTTP 200 response if the request succeeds, or an error message if the
// request fails.
type PutConfigurationSetTrackingOptionsOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutConfigurationSetTrackingOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutConfigurationSetTrackingOptions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutConfigurationSetTrackingOptions{}, 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 = addOpPutConfigurationSetTrackingOptionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutConfigurationSetTrackingOptions(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_opPutConfigurationSetTrackingOptions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "PutConfigurationSetTrackingOptions",
}
}
| 128 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Specify VDM preferences for email that you send using the configuration set.
// You can execute this operation no more than once per second.
func (c *Client) PutConfigurationSetVdmOptions(ctx context.Context, params *PutConfigurationSetVdmOptionsInput, optFns ...func(*Options)) (*PutConfigurationSetVdmOptionsOutput, error) {
if params == nil {
params = &PutConfigurationSetVdmOptionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutConfigurationSetVdmOptions", params, optFns, c.addOperationPutConfigurationSetVdmOptionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutConfigurationSetVdmOptionsOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to add specific VDM settings to a configuration set.
type PutConfigurationSetVdmOptionsInput struct {
// The name of the configuration set.
//
// This member is required.
ConfigurationSetName *string
// The VDM options to apply to the configuration set.
VdmOptions *types.VdmOptions
noSmithyDocumentSerde
}
// An HTTP 200 response if the request succeeds, or an error message if the
// request fails.
type PutConfigurationSetVdmOptionsOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutConfigurationSetVdmOptionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutConfigurationSetVdmOptions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutConfigurationSetVdmOptions{}, 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 = addOpPutConfigurationSetVdmOptionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutConfigurationSetVdmOptions(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_opPutConfigurationSetVdmOptions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "PutConfigurationSetVdmOptions",
}
}
| 128 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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"
)
// Move a dedicated IP address to an existing dedicated IP pool. The dedicated IP
// address that you specify must already exist, and must be associated with your
// Amazon Web Services account. The dedicated IP pool you specify must already
// exist. You can create a new pool by using the CreateDedicatedIpPool operation.
func (c *Client) PutDedicatedIpInPool(ctx context.Context, params *PutDedicatedIpInPoolInput, optFns ...func(*Options)) (*PutDedicatedIpInPoolOutput, error) {
if params == nil {
params = &PutDedicatedIpInPoolInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutDedicatedIpInPool", params, optFns, c.addOperationPutDedicatedIpInPoolMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutDedicatedIpInPoolOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to move a dedicated IP address to a dedicated IP pool.
type PutDedicatedIpInPoolInput struct {
// The name of the IP pool that you want to add the dedicated IP address to. You
// have to specify an IP pool that already exists.
//
// This member is required.
DestinationPoolName *string
// The IP address that you want to move to the dedicated IP pool. The value you
// specify has to be a dedicated IP address that's associated with your Amazon Web
// Services account.
//
// This member is required.
Ip *string
noSmithyDocumentSerde
}
// An HTTP 200 response if the request succeeds, or an error message if the
// request fails.
type PutDedicatedIpInPoolOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutDedicatedIpInPoolMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutDedicatedIpInPool{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutDedicatedIpInPool{}, 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 = addOpPutDedicatedIpInPoolValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutDedicatedIpInPool(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_opPutDedicatedIpInPool(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "PutDedicatedIpInPool",
}
}
| 134 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Used to convert a dedicated IP pool to a different scaling mode. MANAGED pools
// cannot be converted to STANDARD scaling mode.
func (c *Client) PutDedicatedIpPoolScalingAttributes(ctx context.Context, params *PutDedicatedIpPoolScalingAttributesInput, optFns ...func(*Options)) (*PutDedicatedIpPoolScalingAttributesOutput, error) {
if params == nil {
params = &PutDedicatedIpPoolScalingAttributesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutDedicatedIpPoolScalingAttributes", params, optFns, c.addOperationPutDedicatedIpPoolScalingAttributesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutDedicatedIpPoolScalingAttributesOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to convert a dedicated IP pool to a different scaling mode.
type PutDedicatedIpPoolScalingAttributesInput struct {
// The name of the dedicated IP pool.
//
// This member is required.
PoolName *string
// The scaling mode to apply to the dedicated IP pool. Changing the scaling mode
// from MANAGED to STANDARD is not supported.
//
// This member is required.
ScalingMode types.ScalingMode
noSmithyDocumentSerde
}
// An HTTP 200 response if the request succeeds, or an error message if the
// request fails.
type PutDedicatedIpPoolScalingAttributesOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutDedicatedIpPoolScalingAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutDedicatedIpPoolScalingAttributes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutDedicatedIpPoolScalingAttributes{}, 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 = addOpPutDedicatedIpPoolScalingAttributesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutDedicatedIpPoolScalingAttributes(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_opPutDedicatedIpPoolScalingAttributes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "PutDedicatedIpPoolScalingAttributes",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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"
)
func (c *Client) PutDedicatedIpWarmupAttributes(ctx context.Context, params *PutDedicatedIpWarmupAttributesInput, optFns ...func(*Options)) (*PutDedicatedIpWarmupAttributesOutput, error) {
if params == nil {
params = &PutDedicatedIpWarmupAttributesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutDedicatedIpWarmupAttributes", params, optFns, c.addOperationPutDedicatedIpWarmupAttributesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutDedicatedIpWarmupAttributesOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to change the warm-up attributes for a dedicated IP address. This
// operation is useful when you want to resume the warm-up process for an existing
// IP address.
type PutDedicatedIpWarmupAttributesInput struct {
// The dedicated IP address that you want to update the warm-up attributes for.
//
// This member is required.
Ip *string
// The warm-up percentage that you want to associate with the dedicated IP address.
//
// This member is required.
WarmupPercentage *int32
noSmithyDocumentSerde
}
// An HTTP 200 response if the request succeeds, or an error message if the
// request fails.
type PutDedicatedIpWarmupAttributesOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutDedicatedIpWarmupAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutDedicatedIpWarmupAttributes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutDedicatedIpWarmupAttributes{}, 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 = addOpPutDedicatedIpWarmupAttributesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutDedicatedIpWarmupAttributes(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_opPutDedicatedIpWarmupAttributes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "PutDedicatedIpWarmupAttributes",
}
}
| 129 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Enable or disable the Deliverability dashboard. When you enable the
// Deliverability dashboard, you gain access to reputation, deliverability, and
// other metrics for the domains that you use to send email. You also gain the
// ability to perform predictive inbox placement tests. When you use the
// Deliverability dashboard, you pay a monthly subscription charge, in addition to
// any other fees that you accrue by using Amazon SES and other Amazon Web Services
// services. For more information about the features and cost of a Deliverability
// dashboard subscription, see Amazon SES Pricing (http://aws.amazon.com/ses/pricing/)
// .
func (c *Client) PutDeliverabilityDashboardOption(ctx context.Context, params *PutDeliverabilityDashboardOptionInput, optFns ...func(*Options)) (*PutDeliverabilityDashboardOptionOutput, error) {
if params == nil {
params = &PutDeliverabilityDashboardOptionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutDeliverabilityDashboardOption", params, optFns, c.addOperationPutDeliverabilityDashboardOptionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutDeliverabilityDashboardOptionOutput)
out.ResultMetadata = metadata
return out, nil
}
// Enable or disable the Deliverability dashboard. When you enable the
// Deliverability dashboard, you gain access to reputation, deliverability, and
// other metrics for the domains that you use to send email using Amazon SES API
// v2. You also gain the ability to perform predictive inbox placement tests. When
// you use the Deliverability dashboard, you pay a monthly subscription charge, in
// addition to any other fees that you accrue by using Amazon SES and other Amazon
// Web Services services. For more information about the features and cost of a
// Deliverability dashboard subscription, see Amazon Pinpoint Pricing (http://aws.amazon.com/pinpoint/pricing/)
// .
type PutDeliverabilityDashboardOptionInput struct {
// Specifies whether to enable the Deliverability dashboard. To enable the
// dashboard, set this value to true .
//
// This member is required.
DashboardEnabled bool
// An array of objects, one for each verified domain that you use to send email
// and enabled the Deliverability dashboard for.
SubscribedDomains []types.DomainDeliverabilityTrackingOption
noSmithyDocumentSerde
}
// A response that indicates whether the Deliverability dashboard is enabled.
type PutDeliverabilityDashboardOptionOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutDeliverabilityDashboardOptionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutDeliverabilityDashboardOption{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutDeliverabilityDashboardOption{}, 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 = addOpPutDeliverabilityDashboardOptionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutDeliverabilityDashboardOption(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_opPutDeliverabilityDashboardOption(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "PutDeliverabilityDashboardOption",
}
}
| 144 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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"
)
// Used to associate a configuration set with an email identity.
func (c *Client) PutEmailIdentityConfigurationSetAttributes(ctx context.Context, params *PutEmailIdentityConfigurationSetAttributesInput, optFns ...func(*Options)) (*PutEmailIdentityConfigurationSetAttributesOutput, error) {
if params == nil {
params = &PutEmailIdentityConfigurationSetAttributesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutEmailIdentityConfigurationSetAttributes", params, optFns, c.addOperationPutEmailIdentityConfigurationSetAttributesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutEmailIdentityConfigurationSetAttributesOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to associate a configuration set with an email identity.
type PutEmailIdentityConfigurationSetAttributesInput struct {
// The email address or domain to associate with a configuration set.
//
// This member is required.
EmailIdentity *string
// The configuration set to associate with an email identity.
ConfigurationSetName *string
noSmithyDocumentSerde
}
// If the action is successful, the service sends back an HTTP 200 response with
// an empty HTTP body.
type PutEmailIdentityConfigurationSetAttributesOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutEmailIdentityConfigurationSetAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutEmailIdentityConfigurationSetAttributes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutEmailIdentityConfigurationSetAttributes{}, 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 = addOpPutEmailIdentityConfigurationSetAttributesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutEmailIdentityConfigurationSetAttributes(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_opPutEmailIdentityConfigurationSetAttributes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "PutEmailIdentityConfigurationSetAttributes",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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"
)
// Used to enable or disable DKIM authentication for an email identity.
func (c *Client) PutEmailIdentityDkimAttributes(ctx context.Context, params *PutEmailIdentityDkimAttributesInput, optFns ...func(*Options)) (*PutEmailIdentityDkimAttributesOutput, error) {
if params == nil {
params = &PutEmailIdentityDkimAttributesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutEmailIdentityDkimAttributes", params, optFns, c.addOperationPutEmailIdentityDkimAttributesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutEmailIdentityDkimAttributesOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to enable or disable DKIM signing of email that you send from an
// email identity.
type PutEmailIdentityDkimAttributesInput struct {
// The email identity.
//
// This member is required.
EmailIdentity *string
// Sets the DKIM signing configuration for the identity. When you set this value
// true , then the messages that are sent from the identity are signed using DKIM.
// If you set this value to false , your messages are sent without DKIM signing.
SigningEnabled bool
noSmithyDocumentSerde
}
// An HTTP 200 response if the request succeeds, or an error message if the
// request fails.
type PutEmailIdentityDkimAttributesOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutEmailIdentityDkimAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutEmailIdentityDkimAttributes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutEmailIdentityDkimAttributes{}, 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 = addOpPutEmailIdentityDkimAttributesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutEmailIdentityDkimAttributes(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_opPutEmailIdentityDkimAttributes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "PutEmailIdentityDkimAttributes",
}
}
| 129 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Used to configure or change the DKIM authentication settings for an email
// domain identity. You can use this operation to do any of the following:
// - Update the signing attributes for an identity that uses Bring Your Own DKIM
// (BYODKIM).
// - Update the key length that should be used for Easy DKIM.
// - Change from using no DKIM authentication to using Easy DKIM.
// - Change from using no DKIM authentication to using BYODKIM.
// - Change from using Easy DKIM to using BYODKIM.
// - Change from using BYODKIM to using Easy DKIM.
func (c *Client) PutEmailIdentityDkimSigningAttributes(ctx context.Context, params *PutEmailIdentityDkimSigningAttributesInput, optFns ...func(*Options)) (*PutEmailIdentityDkimSigningAttributesOutput, error) {
if params == nil {
params = &PutEmailIdentityDkimSigningAttributesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutEmailIdentityDkimSigningAttributes", params, optFns, c.addOperationPutEmailIdentityDkimSigningAttributesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutEmailIdentityDkimSigningAttributesOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to change the DKIM attributes for an email identity.
type PutEmailIdentityDkimSigningAttributesInput struct {
// The email identity.
//
// This member is required.
EmailIdentity *string
// The method to use to configure DKIM for the identity. There are the following
// possible values:
// - AWS_SES – Configure DKIM for the identity by using Easy DKIM (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim.html)
// .
// - EXTERNAL – Configure DKIM for the identity by using Bring Your Own DKIM
// (BYODKIM).
//
// This member is required.
SigningAttributesOrigin types.DkimSigningAttributesOrigin
// An object that contains information about the private key and selector that you
// want to use to configure DKIM for the identity for Bring Your Own DKIM (BYODKIM)
// for the identity, or, configures the key length to be used for Easy DKIM (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim.html)
// .
SigningAttributes *types.DkimSigningAttributes
noSmithyDocumentSerde
}
// If the action is successful, the service sends back an HTTP 200 response. The
// following data is returned in JSON format by the service.
type PutEmailIdentityDkimSigningAttributesOutput struct {
// The DKIM authentication status of the identity. Amazon SES determines the
// authentication status by searching for specific records in the DNS configuration
// for your domain. If you used Easy DKIM (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim.html)
// to set up DKIM authentication, Amazon SES tries to find three unique CNAME
// records in the DNS configuration for your domain. If you provided a public key
// to perform DKIM authentication, Amazon SES tries to find a TXT record that uses
// the selector that you specified. The value of the TXT record must be a public
// key that's paired with the private key that you specified in the process of
// creating the identity. The status can be one of the following:
// - PENDING – The verification process was initiated, but Amazon SES hasn't yet
// detected the DKIM records in the DNS configuration for the domain.
// - SUCCESS – The verification process completed successfully.
// - FAILED – The verification process failed. This typically occurs when Amazon
// SES fails to find the DKIM records in the DNS configuration of the domain.
// - TEMPORARY_FAILURE – A temporary issue is preventing Amazon SES from
// determining the DKIM authentication status of the domain.
// - NOT_STARTED – The DKIM verification process hasn't been initiated for the
// domain.
DkimStatus types.DkimStatus
// If you used Easy DKIM (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim.html)
// to configure DKIM authentication for the domain, then this object contains a set
// of unique strings that you use to create a set of CNAME records that you add to
// the DNS configuration for your domain. When Amazon SES detects these records in
// the DNS configuration for your domain, the DKIM authentication process is
// complete. If you configured DKIM authentication for the domain by providing your
// own public-private key pair, then this object contains the selector that's
// associated with your public key. Regardless of the DKIM authentication method
// you use, Amazon SES searches for the appropriate records in the DNS
// configuration of the domain for up to 72 hours.
DkimTokens []string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutEmailIdentityDkimSigningAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutEmailIdentityDkimSigningAttributes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutEmailIdentityDkimSigningAttributes{}, 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 = addOpPutEmailIdentityDkimSigningAttributesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutEmailIdentityDkimSigningAttributes(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_opPutEmailIdentityDkimSigningAttributes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "PutEmailIdentityDkimSigningAttributes",
}
}
| 181 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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"
)
// Used to enable or disable feedback forwarding for an identity. This setting
// determines what happens when an identity is used to send an email that results
// in a bounce or complaint event. If the value is true , you receive email
// notifications when bounce or complaint events occur. These notifications are
// sent to the address that you specified in the Return-Path header of the
// original email. You're required to have a method of tracking bounces and
// complaints. If you haven't set up another mechanism for receiving bounce or
// complaint notifications (for example, by setting up an event destination), you
// receive an email notification when these events occur (even if this setting is
// disabled).
func (c *Client) PutEmailIdentityFeedbackAttributes(ctx context.Context, params *PutEmailIdentityFeedbackAttributesInput, optFns ...func(*Options)) (*PutEmailIdentityFeedbackAttributesOutput, error) {
if params == nil {
params = &PutEmailIdentityFeedbackAttributesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutEmailIdentityFeedbackAttributes", params, optFns, c.addOperationPutEmailIdentityFeedbackAttributesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutEmailIdentityFeedbackAttributesOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to set the attributes that control how bounce and complaint events
// are processed.
type PutEmailIdentityFeedbackAttributesInput struct {
// The email identity.
//
// This member is required.
EmailIdentity *string
// Sets the feedback forwarding configuration for the identity. If the value is
// true , you receive email notifications when bounce or complaint events occur.
// These notifications are sent to the address that you specified in the
// Return-Path header of the original email. You're required to have a method of
// tracking bounces and complaints. If you haven't set up another mechanism for
// receiving bounce or complaint notifications (for example, by setting up an event
// destination), you receive an email notification when these events occur (even if
// this setting is disabled).
EmailForwardingEnabled bool
noSmithyDocumentSerde
}
// An HTTP 200 response if the request succeeds, or an error message if the
// request fails.
type PutEmailIdentityFeedbackAttributesOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutEmailIdentityFeedbackAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutEmailIdentityFeedbackAttributes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutEmailIdentityFeedbackAttributes{}, 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 = addOpPutEmailIdentityFeedbackAttributesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutEmailIdentityFeedbackAttributes(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_opPutEmailIdentityFeedbackAttributes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "PutEmailIdentityFeedbackAttributes",
}
}
| 143 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Used to enable or disable the custom Mail-From domain configuration for an
// email identity.
func (c *Client) PutEmailIdentityMailFromAttributes(ctx context.Context, params *PutEmailIdentityMailFromAttributesInput, optFns ...func(*Options)) (*PutEmailIdentityMailFromAttributesOutput, error) {
if params == nil {
params = &PutEmailIdentityMailFromAttributesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutEmailIdentityMailFromAttributes", params, optFns, c.addOperationPutEmailIdentityMailFromAttributesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutEmailIdentityMailFromAttributesOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to configure the custom MAIL FROM domain for a verified identity.
type PutEmailIdentityMailFromAttributesInput struct {
// The verified email identity.
//
// This member is required.
EmailIdentity *string
// The action to take if the required MX record isn't found when you send an
// email. When you set this value to UseDefaultValue , the mail is sent using
// amazonses.com as the MAIL FROM domain. When you set this value to RejectMessage
// , the Amazon SES API v2 returns a MailFromDomainNotVerified error, and doesn't
// attempt to deliver the email. These behaviors are taken when the custom MAIL
// FROM domain configuration is in the Pending , Failed , and TemporaryFailure
// states.
BehaviorOnMxFailure types.BehaviorOnMxFailure
// The custom MAIL FROM domain that you want the verified identity to use. The
// MAIL FROM domain must meet the following criteria:
// - It has to be a subdomain of the verified identity.
// - It can't be used to receive email.
// - It can't be used in a "From" address if the MAIL FROM domain is a
// destination for feedback forwarding emails.
MailFromDomain *string
noSmithyDocumentSerde
}
// An HTTP 200 response if the request succeeds, or an error message if the
// request fails.
type PutEmailIdentityMailFromAttributesOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutEmailIdentityMailFromAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutEmailIdentityMailFromAttributes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutEmailIdentityMailFromAttributes{}, 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 = addOpPutEmailIdentityMailFromAttributesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutEmailIdentityMailFromAttributes(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_opPutEmailIdentityMailFromAttributes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "PutEmailIdentityMailFromAttributes",
}
}
| 142 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds an email address to the suppression list for your account.
func (c *Client) PutSuppressedDestination(ctx context.Context, params *PutSuppressedDestinationInput, optFns ...func(*Options)) (*PutSuppressedDestinationOutput, error) {
if params == nil {
params = &PutSuppressedDestinationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutSuppressedDestination", params, optFns, c.addOperationPutSuppressedDestinationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutSuppressedDestinationOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to add an email destination to the suppression list for your account.
type PutSuppressedDestinationInput struct {
// The email address that should be added to the suppression list for your account.
//
// This member is required.
EmailAddress *string
// The factors that should cause the email address to be added to the suppression
// list for your account.
//
// This member is required.
Reason types.SuppressionListReason
noSmithyDocumentSerde
}
// An HTTP 200 response if the request succeeds, or an error message if the
// request fails.
type PutSuppressedDestinationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutSuppressedDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutSuppressedDestination{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutSuppressedDestination{}, 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 = addOpPutSuppressedDestinationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutSuppressedDestination(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_opPutSuppressedDestination(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "PutSuppressedDestination",
}
}
| 130 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Composes an email message to multiple destinations.
func (c *Client) SendBulkEmail(ctx context.Context, params *SendBulkEmailInput, optFns ...func(*Options)) (*SendBulkEmailOutput, error) {
if params == nil {
params = &SendBulkEmailInput{}
}
result, metadata, err := c.invokeOperation(ctx, "SendBulkEmail", params, optFns, c.addOperationSendBulkEmailMiddlewares)
if err != nil {
return nil, err
}
out := result.(*SendBulkEmailOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents a request to send email messages to multiple destinations using
// Amazon SES. For more information, see the Amazon SES Developer Guide (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-personalized-email-api.html)
// .
type SendBulkEmailInput struct {
// The list of bulk email entry objects.
//
// This member is required.
BulkEmailEntries []types.BulkEmailEntry
// An object that contains the body of the message. You can specify a template
// message.
//
// This member is required.
DefaultContent *types.BulkEmailContent
// The name of the configuration set to use when sending the email.
ConfigurationSetName *string
// A list of tags, in the form of name/value pairs, to apply to an email that you
// send using the SendEmail operation. Tags correspond to characteristics of the
// email that you define, so that you can publish email sending events.
DefaultEmailTags []types.MessageTag
// The address that you want bounce and complaint notifications to be sent to.
FeedbackForwardingEmailAddress *string
// This parameter is used only for sending authorization. It is the ARN of the
// identity that is associated with the sending authorization policy that permits
// you to use the email address specified in the FeedbackForwardingEmailAddress
// parameter. For example, if the owner of example.com (which has ARN
// arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it
// that authorizes you to use [email protected], then you would specify the
// FeedbackForwardingEmailAddressIdentityArn to be
// arn:aws:ses:us-east-1:123456789012:identity/example.com, and the
// FeedbackForwardingEmailAddress to be [email protected]. For more information
// about sending authorization, see the Amazon SES Developer Guide (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html)
// .
FeedbackForwardingEmailAddressIdentityArn *string
// The email address to use as the "From" address for the email. The address that
// you specify has to be verified.
FromEmailAddress *string
// This parameter is used only for sending authorization. It is the ARN of the
// identity that is associated with the sending authorization policy that permits
// you to use the email address specified in the FromEmailAddress parameter. For
// example, if the owner of example.com (which has ARN
// arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it
// that authorizes you to use [email protected], then you would specify the
// FromEmailAddressIdentityArn to be
// arn:aws:ses:us-east-1:123456789012:identity/example.com, and the
// FromEmailAddress to be [email protected]. For more information about sending
// authorization, see the Amazon SES Developer Guide (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html)
// .
FromEmailAddressIdentityArn *string
// The "Reply-to" email addresses for the message. When the recipient replies to
// the message, each Reply-to address receives the reply.
ReplyToAddresses []string
noSmithyDocumentSerde
}
// The following data is returned in JSON format by the service.
type SendBulkEmailOutput struct {
// One object per intended recipient. Check each response object and retry any
// messages with a failure status.
//
// This member is required.
BulkEmailEntryResults []types.BulkEmailEntryResult
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationSendBulkEmailMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpSendBulkEmail{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSendBulkEmail{}, 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 = addOpSendBulkEmailValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSendBulkEmail(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_opSendBulkEmail(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "SendBulkEmail",
}
}
| 183 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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 an email address to the list of identities for your Amazon SES account in
// the current Amazon Web Services Region and attempts to verify it. As a result of
// executing this operation, a customized verification email is sent to the
// specified address. To use this operation, you must first create a custom
// verification email template. For more information about creating and using
// custom verification email templates, see Using custom verification email
// templates (https://docs.aws.amazon.com/ses/latest/dg/creating-identities.html#send-email-verify-address-custom)
// in the Amazon SES Developer Guide. You can execute this operation no more than
// once per second.
func (c *Client) SendCustomVerificationEmail(ctx context.Context, params *SendCustomVerificationEmailInput, optFns ...func(*Options)) (*SendCustomVerificationEmailOutput, error) {
if params == nil {
params = &SendCustomVerificationEmailInput{}
}
result, metadata, err := c.invokeOperation(ctx, "SendCustomVerificationEmail", params, optFns, c.addOperationSendCustomVerificationEmailMiddlewares)
if err != nil {
return nil, err
}
out := result.(*SendCustomVerificationEmailOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents a request to send a custom verification email to a specified
// recipient.
type SendCustomVerificationEmailInput struct {
// The email address to verify.
//
// This member is required.
EmailAddress *string
// The name of the custom verification email template to use when sending the
// verification email.
//
// This member is required.
TemplateName *string
// Name of a configuration set to use when sending the verification email.
ConfigurationSetName *string
noSmithyDocumentSerde
}
// The following element is returned by the service.
type SendCustomVerificationEmailOutput struct {
// The unique message identifier returned from the SendCustomVerificationEmail
// operation.
MessageId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationSendCustomVerificationEmailMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpSendCustomVerificationEmail{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSendCustomVerificationEmail{}, 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 = addOpSendCustomVerificationEmailValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSendCustomVerificationEmail(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_opSendCustomVerificationEmail(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "SendCustomVerificationEmail",
}
}
| 145 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Sends an email message. You can use the Amazon SES API v2 to send the following
// types of messages:
// - Simple – A standard email message. When you create this type of message,
// you specify the sender, the recipient, and the message body, and Amazon SES
// assembles the message for you.
// - Raw – A raw, MIME-formatted email message. When you send this type of
// email, you have to specify all of the message headers, as well as the message
// body. You can use this message type to send messages that contain attachments.
// The message that you specify has to be a valid MIME message.
// - Templated – A message that contains personalization tags. When you send
// this type of email, Amazon SES API v2 automatically replaces the tags with
// values that you specify.
func (c *Client) SendEmail(ctx context.Context, params *SendEmailInput, optFns ...func(*Options)) (*SendEmailOutput, error) {
if params == nil {
params = &SendEmailInput{}
}
result, metadata, err := c.invokeOperation(ctx, "SendEmail", params, optFns, c.addOperationSendEmailMiddlewares)
if err != nil {
return nil, err
}
out := result.(*SendEmailOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents a request to send a single formatted email using Amazon SES. For
// more information, see the Amazon SES Developer Guide (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-formatted.html)
// .
type SendEmailInput struct {
// An object that contains the body of the message. You can send either a Simple
// message Raw message or a template Message.
//
// This member is required.
Content *types.EmailContent
// The name of the configuration set to use when sending the email.
ConfigurationSetName *string
// An object that contains the recipients of the email message.
Destination *types.Destination
// A list of tags, in the form of name/value pairs, to apply to an email that you
// send using the SendEmail operation. Tags correspond to characteristics of the
// email that you define, so that you can publish email sending events.
EmailTags []types.MessageTag
// The address that you want bounce and complaint notifications to be sent to.
FeedbackForwardingEmailAddress *string
// This parameter is used only for sending authorization. It is the ARN of the
// identity that is associated with the sending authorization policy that permits
// you to use the email address specified in the FeedbackForwardingEmailAddress
// parameter. For example, if the owner of example.com (which has ARN
// arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it
// that authorizes you to use [email protected], then you would specify the
// FeedbackForwardingEmailAddressIdentityArn to be
// arn:aws:ses:us-east-1:123456789012:identity/example.com, and the
// FeedbackForwardingEmailAddress to be [email protected]. For more information
// about sending authorization, see the Amazon SES Developer Guide (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html)
// .
FeedbackForwardingEmailAddressIdentityArn *string
// The email address to use as the "From" address for the email. The address that
// you specify has to be verified.
FromEmailAddress *string
// This parameter is used only for sending authorization. It is the ARN of the
// identity that is associated with the sending authorization policy that permits
// you to use the email address specified in the FromEmailAddress parameter. For
// example, if the owner of example.com (which has ARN
// arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it
// that authorizes you to use [email protected], then you would specify the
// FromEmailAddressIdentityArn to be
// arn:aws:ses:us-east-1:123456789012:identity/example.com, and the
// FromEmailAddress to be [email protected]. For more information about sending
// authorization, see the Amazon SES Developer Guide (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html)
// . For Raw emails, the FromEmailAddressIdentityArn value overrides the
// X-SES-SOURCE-ARN and X-SES-FROM-ARN headers specified in raw email message
// content.
FromEmailAddressIdentityArn *string
// An object used to specify a list or topic to which an email belongs, which will
// be used when a contact chooses to unsubscribe.
ListManagementOptions *types.ListManagementOptions
// The "Reply-to" email addresses for the message. When the recipient replies to
// the message, each Reply-to address receives the reply.
ReplyToAddresses []string
noSmithyDocumentSerde
}
// A unique message ID that you receive when an email is accepted for sending.
type SendEmailOutput struct {
// A unique identifier for the message that is generated when the message is
// accepted. It's possible for Amazon SES to accept a message without sending it.
// This can happen when the message that you're trying to send has an attachment
// contains a virus, or when you send a templated email that contains invalid
// personalization content, for example.
MessageId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationSendEmailMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpSendEmail{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSendEmail{}, 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 = addOpSendEmailValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSendEmail(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_opSendEmail(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "SendEmail",
}
}
| 199 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Add one or more tags (keys and values) to a specified resource. A tag is a
// label that you optionally define and associate with a resource. Tags can help
// you categorize and manage resources in different ways, such as by purpose,
// owner, environment, or other criteria. A resource can have as many as 50 tags.
// Each tag consists of a required tag key and an associated tag value, both of
// which you define. A tag key is a general label that acts as a category for more
// specific tag values. A tag value acts as a descriptor within a tag key.
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 resource that you want to add one or more
// tags to.
//
// This member is required.
ResourceArn *string
// A list of the tags that you want to add to the resource. A tag consists of a
// required tag key ( Key ) and an associated tag value ( Value ). The maximum
// length of a tag key is 128 characters. The maximum length of a tag value is 256
// characters.
//
// 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: "ses",
OperationName: "TagResource",
}
}
| 136 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a preview of the MIME content of an email when provided with a template
// and a set of replacement data. You can execute this operation no more than once
// per second.
func (c *Client) TestRenderEmailTemplate(ctx context.Context, params *TestRenderEmailTemplateInput, optFns ...func(*Options)) (*TestRenderEmailTemplateOutput, error) {
if params == nil {
params = &TestRenderEmailTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "TestRenderEmailTemplate", params, optFns, c.addOperationTestRenderEmailTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*TestRenderEmailTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
// >Represents a request to create a preview of the MIME content of an email when
// provided with a template and a set of replacement data.
type TestRenderEmailTemplateInput struct {
// A list of replacement values to apply to the template. This parameter is a JSON
// object, typically consisting of key-value pairs in which the keys correspond to
// replacement tags in the email template.
//
// This member is required.
TemplateData *string
// The name of the template.
//
// This member is required.
TemplateName *string
noSmithyDocumentSerde
}
// The following element is returned by the service.
type TestRenderEmailTemplateOutput struct {
// The complete MIME message rendered by applying the data in the TemplateData
// parameter to the template specified in the TemplateName parameter.
//
// This member is required.
RenderedTemplate *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationTestRenderEmailTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpTestRenderEmailTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTestRenderEmailTemplate{}, 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 = addOpTestRenderEmailTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTestRenderEmailTemplate(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_opTestRenderEmailTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "TestRenderEmailTemplate",
}
}
| 139 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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"
)
// Remove one or more tags (keys and values) from a specified resource.
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 that you want to remove one or
// more tags from.
//
// This member is required.
ResourceArn *string
// The tags (tag keys) that you want to remove from the resource. When you specify
// a tag key, the action removes both that key and its associated tag value. To
// remove more than one tag from the resource, append the TagKeys parameter and
// argument for each additional tag to remove, separated by an ampersand. For
// example: /v2/email/tags?ResourceArn=ResourceArn&TagKeys=Key1&TagKeys=Key2
//
// 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: "ses",
OperationName: "UntagResource",
}
}
| 130 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Update the configuration of an event destination for a configuration set.
// Events include message sends, deliveries, opens, clicks, bounces, and
// complaints. Event destinations are places that you can send information about
// these events to. For example, you can send event data to Amazon SNS to receive
// notifications when you receive bounces or complaints, or you can use Amazon
// Kinesis Data Firehose to stream data to Amazon S3 for long-term storage.
func (c *Client) UpdateConfigurationSetEventDestination(ctx context.Context, params *UpdateConfigurationSetEventDestinationInput, optFns ...func(*Options)) (*UpdateConfigurationSetEventDestinationOutput, error) {
if params == nil {
params = &UpdateConfigurationSetEventDestinationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateConfigurationSetEventDestination", params, optFns, c.addOperationUpdateConfigurationSetEventDestinationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateConfigurationSetEventDestinationOutput)
out.ResultMetadata = metadata
return out, nil
}
// A request to change the settings for an event destination for a configuration
// set.
type UpdateConfigurationSetEventDestinationInput struct {
// The name of the configuration set that contains the event destination to modify.
//
// This member is required.
ConfigurationSetName *string
// An object that defines the event destination.
//
// This member is required.
EventDestination *types.EventDestinationDefinition
// The name of the event destination.
//
// This member is required.
EventDestinationName *string
noSmithyDocumentSerde
}
// An HTTP 200 response if the request succeeds, or an error message if the
// request fails.
type UpdateConfigurationSetEventDestinationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateConfigurationSetEventDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateConfigurationSetEventDestination{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateConfigurationSetEventDestination{}, 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 = addOpUpdateConfigurationSetEventDestinationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateConfigurationSetEventDestination(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_opUpdateConfigurationSetEventDestination(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "UpdateConfigurationSetEventDestination",
}
}
| 140 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates a contact's preferences for a list. It is not necessary to specify all
// existing topic preferences in the TopicPreferences object, just the ones that
// need updating.
func (c *Client) UpdateContact(ctx context.Context, params *UpdateContactInput, optFns ...func(*Options)) (*UpdateContactOutput, error) {
if params == nil {
params = &UpdateContactInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateContact", params, optFns, c.addOperationUpdateContactMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateContactOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateContactInput struct {
// The name of the contact list.
//
// This member is required.
ContactListName *string
// The contact's email address.
//
// This member is required.
EmailAddress *string
// The attribute data attached to a contact.
AttributesData *string
// The contact's preference for being opted-in to or opted-out of a topic.
TopicPreferences []types.TopicPreference
// A boolean value status noting if the contact is unsubscribed from all contact
// list topics.
UnsubscribeAll bool
noSmithyDocumentSerde
}
type UpdateContactOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateContactMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateContact{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateContact{}, 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 = addOpUpdateContactValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateContact(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_opUpdateContact(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "UpdateContact",
}
}
| 138 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates contact list metadata. This operation does a complete replacement.
func (c *Client) UpdateContactList(ctx context.Context, params *UpdateContactListInput, optFns ...func(*Options)) (*UpdateContactListOutput, error) {
if params == nil {
params = &UpdateContactListInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateContactList", params, optFns, c.addOperationUpdateContactListMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateContactListOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateContactListInput struct {
// The name of the contact list.
//
// This member is required.
ContactListName *string
// A description of what the contact list is about.
Description *string
// An interest group, theme, or label within a list. A contact list can have
// multiple topics.
Topics []types.Topic
noSmithyDocumentSerde
}
type UpdateContactListOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateContactListMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateContactList{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateContactList{}, 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 = addOpUpdateContactListValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateContactList(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_opUpdateContactList(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "UpdateContactList",
}
}
| 128 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates an existing custom verification email template. For more information
// about custom verification email templates, see Using custom verification email
// templates (https://docs.aws.amazon.com/ses/latest/dg/creating-identities.html#send-email-verify-address-custom)
// in the Amazon SES Developer Guide. You can execute this operation no more than
// once per second.
func (c *Client) UpdateCustomVerificationEmailTemplate(ctx context.Context, params *UpdateCustomVerificationEmailTemplateInput, optFns ...func(*Options)) (*UpdateCustomVerificationEmailTemplateOutput, error) {
if params == nil {
params = &UpdateCustomVerificationEmailTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateCustomVerificationEmailTemplate", params, optFns, c.addOperationUpdateCustomVerificationEmailTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateCustomVerificationEmailTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents a request to update an existing custom verification email template.
type UpdateCustomVerificationEmailTemplateInput struct {
// The URL that the recipient of the verification email is sent to if his or her
// address is not successfully verified.
//
// This member is required.
FailureRedirectionURL *string
// The email address that the custom verification email is sent from.
//
// This member is required.
FromEmailAddress *string
// The URL that the recipient of the verification email is sent to if his or her
// address is successfully verified.
//
// This member is required.
SuccessRedirectionURL *string
// The content of the custom verification email. The total size of the email must
// be less than 10 MB. The message body may contain HTML, with some limitations.
// For more information, see Custom verification email frequently asked questions (https://docs.aws.amazon.com/ses/latest/dg/creating-identities.html#send-email-verify-address-custom-faq)
// in the Amazon SES Developer Guide.
//
// This member is required.
TemplateContent *string
// The name of the custom verification email template that you want to update.
//
// This member is required.
TemplateName *string
// The subject line of the custom verification email.
//
// This member is required.
TemplateSubject *string
noSmithyDocumentSerde
}
// If the action is successful, the service sends back an HTTP 200 response with
// an empty HTTP body.
type UpdateCustomVerificationEmailTemplateOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateCustomVerificationEmailTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateCustomVerificationEmailTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateCustomVerificationEmailTemplate{}, 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 = addOpUpdateCustomVerificationEmailTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateCustomVerificationEmailTemplate(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_opUpdateCustomVerificationEmailTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "UpdateCustomVerificationEmailTemplate",
}
}
| 157 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the specified sending authorization policy for the given identity (an
// email address or a domain). This API returns successfully even if a policy with
// the specified name does not exist. This API is for the identity owner only. If
// you have not verified the identity, this API will return an error. Sending
// authorization is a feature that enables an identity owner to authorize other
// senders to use its identities. For information about using sending
// authorization, see the Amazon SES Developer Guide (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization.html)
// . You can execute this operation no more than once per second.
func (c *Client) UpdateEmailIdentityPolicy(ctx context.Context, params *UpdateEmailIdentityPolicyInput, optFns ...func(*Options)) (*UpdateEmailIdentityPolicyOutput, error) {
if params == nil {
params = &UpdateEmailIdentityPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateEmailIdentityPolicy", params, optFns, c.addOperationUpdateEmailIdentityPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateEmailIdentityPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents a request to update a sending authorization policy for an identity.
// Sending authorization is an Amazon SES feature that enables you to authorize
// other senders to use your identities. For information, see the Amazon SES
// Developer Guide (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-identity-owner-tasks-management.html)
// .
type UpdateEmailIdentityPolicyInput struct {
// The email identity.
//
// This member is required.
EmailIdentity *string
// The text of the policy in JSON format. The policy cannot exceed 4 KB. For
// information about the syntax of sending authorization policies, see the Amazon
// SES Developer Guide (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-authorization-policies.html)
// .
//
// This member is required.
Policy *string
// The name of the policy. The policy name cannot exceed 64 characters and can
// only include alphanumeric characters, dashes, and underscores.
//
// This member is required.
PolicyName *string
noSmithyDocumentSerde
}
// An HTTP 200 response if the request succeeds, or an error message if the
// request fails.
type UpdateEmailIdentityPolicyOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateEmailIdentityPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateEmailIdentityPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateEmailIdentityPolicy{}, 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 = addOpUpdateEmailIdentityPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateEmailIdentityPolicy(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_opUpdateEmailIdentityPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "UpdateEmailIdentityPolicy",
}
}
| 148 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates an email template. Email templates enable you to send personalized
// email to one or more destinations in a single API operation. For more
// information, see the Amazon SES Developer Guide (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-personalized-email-api.html)
// . You can execute this operation no more than once per second.
func (c *Client) UpdateEmailTemplate(ctx context.Context, params *UpdateEmailTemplateInput, optFns ...func(*Options)) (*UpdateEmailTemplateOutput, error) {
if params == nil {
params = &UpdateEmailTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateEmailTemplate", params, optFns, c.addOperationUpdateEmailTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateEmailTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
// Represents a request to update an email template. For more information, see the
// Amazon SES Developer Guide (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-personalized-email-api.html)
// .
type UpdateEmailTemplateInput struct {
// The content of the email template, composed of a subject line, an HTML part,
// and a text-only part.
//
// This member is required.
TemplateContent *types.EmailTemplateContent
// The name of the template.
//
// This member is required.
TemplateName *string
noSmithyDocumentSerde
}
// If the action is successful, the service sends back an HTTP 200 response with
// an empty HTTP body.
type UpdateEmailTemplateOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateEmailTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateEmailTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateEmailTemplate{}, 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 = addOpUpdateEmailTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateEmailTemplate(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_opUpdateEmailTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "ses",
OperationName: "UpdateEmailTemplate",
}
}
| 135 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
import (
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/sesv2/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"
"math"
"strings"
"time"
)
type awsRestjson1_deserializeOpBatchGetMetricData struct {
}
func (*awsRestjson1_deserializeOpBatchGetMetricData) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpBatchGetMetricData) 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_deserializeOpErrorBatchGetMetricData(response, &metadata)
}
output := &BatchGetMetricDataOutput{}
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_deserializeOpDocumentBatchGetMetricDataOutput(&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_deserializeOpErrorBatchGetMetricData(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("InternalServiceErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServiceErrorException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentBatchGetMetricDataOutput(v **BatchGetMetricDataOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *BatchGetMetricDataOutput
if *v == nil {
sv = &BatchGetMetricDataOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Errors":
if err := awsRestjson1_deserializeDocumentMetricDataErrorList(&sv.Errors, value); err != nil {
return err
}
case "Results":
if err := awsRestjson1_deserializeDocumentMetricDataResultList(&sv.Results, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateConfigurationSet struct {
}
func (*awsRestjson1_deserializeOpCreateConfigurationSet) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateConfigurationSet) 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_deserializeOpErrorCreateConfigurationSet(response, &metadata)
}
output := &CreateConfigurationSetOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateConfigurationSet(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("AlreadyExistsException", errorCode):
return awsRestjson1_deserializeErrorAlreadyExistsException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConcurrentModificationException", errorCode):
return awsRestjson1_deserializeErrorConcurrentModificationException(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("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpCreateConfigurationSetEventDestination struct {
}
func (*awsRestjson1_deserializeOpCreateConfigurationSetEventDestination) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateConfigurationSetEventDestination) 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_deserializeOpErrorCreateConfigurationSetEventDestination(response, &metadata)
}
output := &CreateConfigurationSetEventDestinationOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateConfigurationSetEventDestination(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("AlreadyExistsException", errorCode):
return awsRestjson1_deserializeErrorAlreadyExistsException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(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("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpCreateContact struct {
}
func (*awsRestjson1_deserializeOpCreateContact) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateContact) 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_deserializeOpErrorCreateContact(response, &metadata)
}
output := &CreateContactOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateContact(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("AlreadyExistsException", errorCode):
return awsRestjson1_deserializeErrorAlreadyExistsException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpCreateContactList struct {
}
func (*awsRestjson1_deserializeOpCreateContactList) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateContactList) 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_deserializeOpErrorCreateContactList(response, &metadata)
}
output := &CreateContactListOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateContactList(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("AlreadyExistsException", errorCode):
return awsRestjson1_deserializeErrorAlreadyExistsException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpCreateCustomVerificationEmailTemplate struct {
}
func (*awsRestjson1_deserializeOpCreateCustomVerificationEmailTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateCustomVerificationEmailTemplate) 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_deserializeOpErrorCreateCustomVerificationEmailTemplate(response, &metadata)
}
output := &CreateCustomVerificationEmailTemplateOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateCustomVerificationEmailTemplate(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("AlreadyExistsException", errorCode):
return awsRestjson1_deserializeErrorAlreadyExistsException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(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("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpCreateDedicatedIpPool struct {
}
func (*awsRestjson1_deserializeOpCreateDedicatedIpPool) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateDedicatedIpPool) 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_deserializeOpErrorCreateDedicatedIpPool(response, &metadata)
}
output := &CreateDedicatedIpPoolOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateDedicatedIpPool(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("AlreadyExistsException", errorCode):
return awsRestjson1_deserializeErrorAlreadyExistsException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConcurrentModificationException", errorCode):
return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpCreateDeliverabilityTestReport struct {
}
func (*awsRestjson1_deserializeOpCreateDeliverabilityTestReport) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateDeliverabilityTestReport) 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_deserializeOpErrorCreateDeliverabilityTestReport(response, &metadata)
}
output := &CreateDeliverabilityTestReportOutput{}
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_deserializeOpDocumentCreateDeliverabilityTestReportOutput(&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_deserializeOpErrorCreateDeliverabilityTestReport(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("AccountSuspendedException", errorCode):
return awsRestjson1_deserializeErrorAccountSuspendedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConcurrentModificationException", errorCode):
return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("MailFromDomainNotVerifiedException", errorCode):
return awsRestjson1_deserializeErrorMailFromDomainNotVerifiedException(response, errorBody)
case strings.EqualFold("MessageRejected", errorCode):
return awsRestjson1_deserializeErrorMessageRejected(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("SendingPausedException", errorCode):
return awsRestjson1_deserializeErrorSendingPausedException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateDeliverabilityTestReportOutput(v **CreateDeliverabilityTestReportOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateDeliverabilityTestReportOutput
if *v == nil {
sv = &CreateDeliverabilityTestReportOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DeliverabilityTestStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DeliverabilityTestStatus to be of type string, got %T instead", value)
}
sv.DeliverabilityTestStatus = types.DeliverabilityTestStatus(jtv)
}
case "ReportId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ReportId to be of type string, got %T instead", value)
}
sv.ReportId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateEmailIdentity struct {
}
func (*awsRestjson1_deserializeOpCreateEmailIdentity) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateEmailIdentity) 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_deserializeOpErrorCreateEmailIdentity(response, &metadata)
}
output := &CreateEmailIdentityOutput{}
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_deserializeOpDocumentCreateEmailIdentityOutput(&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_deserializeOpErrorCreateEmailIdentity(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("AlreadyExistsException", errorCode):
return awsRestjson1_deserializeErrorAlreadyExistsException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConcurrentModificationException", errorCode):
return awsRestjson1_deserializeErrorConcurrentModificationException(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("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateEmailIdentityOutput(v **CreateEmailIdentityOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateEmailIdentityOutput
if *v == nil {
sv = &CreateEmailIdentityOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DkimAttributes":
if err := awsRestjson1_deserializeDocumentDkimAttributes(&sv.DkimAttributes, value); err != nil {
return err
}
case "IdentityType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IdentityType to be of type string, got %T instead", value)
}
sv.IdentityType = types.IdentityType(jtv)
}
case "VerifiedForSendingStatus":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value)
}
sv.VerifiedForSendingStatus = jtv
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateEmailIdentityPolicy struct {
}
func (*awsRestjson1_deserializeOpCreateEmailIdentityPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateEmailIdentityPolicy) 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_deserializeOpErrorCreateEmailIdentityPolicy(response, &metadata)
}
output := &CreateEmailIdentityPolicyOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateEmailIdentityPolicy(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("AlreadyExistsException", errorCode):
return awsRestjson1_deserializeErrorAlreadyExistsException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(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("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpCreateEmailTemplate struct {
}
func (*awsRestjson1_deserializeOpCreateEmailTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateEmailTemplate) 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_deserializeOpErrorCreateEmailTemplate(response, &metadata)
}
output := &CreateEmailTemplateOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateEmailTemplate(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("AlreadyExistsException", errorCode):
return awsRestjson1_deserializeErrorAlreadyExistsException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpCreateImportJob struct {
}
func (*awsRestjson1_deserializeOpCreateImportJob) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateImportJob) 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_deserializeOpErrorCreateImportJob(response, &metadata)
}
output := &CreateImportJobOutput{}
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_deserializeOpDocumentCreateImportJobOutput(&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_deserializeOpErrorCreateImportJob(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("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateImportJobOutput(v **CreateImportJobOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateImportJobOutput
if *v == nil {
sv = &CreateImportJobOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "JobId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected JobId to be of type string, got %T instead", value)
}
sv.JobId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDeleteConfigurationSet struct {
}
func (*awsRestjson1_deserializeOpDeleteConfigurationSet) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteConfigurationSet) 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_deserializeOpErrorDeleteConfigurationSet(response, &metadata)
}
output := &DeleteConfigurationSetOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteConfigurationSet(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("ConcurrentModificationException", errorCode):
return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeleteConfigurationSetEventDestination struct {
}
func (*awsRestjson1_deserializeOpDeleteConfigurationSetEventDestination) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteConfigurationSetEventDestination) 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_deserializeOpErrorDeleteConfigurationSetEventDestination(response, &metadata)
}
output := &DeleteConfigurationSetEventDestinationOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteConfigurationSetEventDestination(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeleteContact struct {
}
func (*awsRestjson1_deserializeOpDeleteContact) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteContact) 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_deserializeOpErrorDeleteContact(response, &metadata)
}
output := &DeleteContactOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteContact(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeleteContactList struct {
}
func (*awsRestjson1_deserializeOpDeleteContactList) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteContactList) 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_deserializeOpErrorDeleteContactList(response, &metadata)
}
output := &DeleteContactListOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteContactList(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("ConcurrentModificationException", errorCode):
return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeleteCustomVerificationEmailTemplate struct {
}
func (*awsRestjson1_deserializeOpDeleteCustomVerificationEmailTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteCustomVerificationEmailTemplate) 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_deserializeOpErrorDeleteCustomVerificationEmailTemplate(response, &metadata)
}
output := &DeleteCustomVerificationEmailTemplateOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteCustomVerificationEmailTemplate(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeleteDedicatedIpPool struct {
}
func (*awsRestjson1_deserializeOpDeleteDedicatedIpPool) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteDedicatedIpPool) 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_deserializeOpErrorDeleteDedicatedIpPool(response, &metadata)
}
output := &DeleteDedicatedIpPoolOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteDedicatedIpPool(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("ConcurrentModificationException", errorCode):
return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeleteEmailIdentity struct {
}
func (*awsRestjson1_deserializeOpDeleteEmailIdentity) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteEmailIdentity) 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_deserializeOpErrorDeleteEmailIdentity(response, &metadata)
}
output := &DeleteEmailIdentityOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteEmailIdentity(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("ConcurrentModificationException", errorCode):
return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeleteEmailIdentityPolicy struct {
}
func (*awsRestjson1_deserializeOpDeleteEmailIdentityPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteEmailIdentityPolicy) 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_deserializeOpErrorDeleteEmailIdentityPolicy(response, &metadata)
}
output := &DeleteEmailIdentityPolicyOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteEmailIdentityPolicy(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeleteEmailTemplate struct {
}
func (*awsRestjson1_deserializeOpDeleteEmailTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteEmailTemplate) 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_deserializeOpErrorDeleteEmailTemplate(response, &metadata)
}
output := &DeleteEmailTemplateOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteEmailTemplate(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeleteSuppressedDestination struct {
}
func (*awsRestjson1_deserializeOpDeleteSuppressedDestination) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteSuppressedDestination) 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_deserializeOpErrorDeleteSuppressedDestination(response, &metadata)
}
output := &DeleteSuppressedDestinationOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteSuppressedDestination(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpGetAccount struct {
}
func (*awsRestjson1_deserializeOpGetAccount) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetAccount) 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_deserializeOpErrorGetAccount(response, &metadata)
}
output := &GetAccountOutput{}
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_deserializeOpDocumentGetAccountOutput(&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_deserializeOpErrorGetAccount(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("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetAccountOutput(v **GetAccountOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetAccountOutput
if *v == nil {
sv = &GetAccountOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DedicatedIpAutoWarmupEnabled":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value)
}
sv.DedicatedIpAutoWarmupEnabled = jtv
}
case "Details":
if err := awsRestjson1_deserializeDocumentAccountDetails(&sv.Details, value); err != nil {
return err
}
case "EnforcementStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected GeneralEnforcementStatus to be of type string, got %T instead", value)
}
sv.EnforcementStatus = ptr.String(jtv)
}
case "ProductionAccessEnabled":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value)
}
sv.ProductionAccessEnabled = jtv
}
case "SendingEnabled":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value)
}
sv.SendingEnabled = jtv
}
case "SendQuota":
if err := awsRestjson1_deserializeDocumentSendQuota(&sv.SendQuota, value); err != nil {
return err
}
case "SuppressionAttributes":
if err := awsRestjson1_deserializeDocumentSuppressionAttributes(&sv.SuppressionAttributes, value); err != nil {
return err
}
case "VdmAttributes":
if err := awsRestjson1_deserializeDocumentVdmAttributes(&sv.VdmAttributes, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetBlacklistReports struct {
}
func (*awsRestjson1_deserializeOpGetBlacklistReports) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetBlacklistReports) 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_deserializeOpErrorGetBlacklistReports(response, &metadata)
}
output := &GetBlacklistReportsOutput{}
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_deserializeOpDocumentGetBlacklistReportsOutput(&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_deserializeOpErrorGetBlacklistReports(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetBlacklistReportsOutput(v **GetBlacklistReportsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetBlacklistReportsOutput
if *v == nil {
sv = &GetBlacklistReportsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "BlacklistReport":
if err := awsRestjson1_deserializeDocumentBlacklistReport(&sv.BlacklistReport, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetConfigurationSet struct {
}
func (*awsRestjson1_deserializeOpGetConfigurationSet) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetConfigurationSet) 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_deserializeOpErrorGetConfigurationSet(response, &metadata)
}
output := &GetConfigurationSetOutput{}
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_deserializeOpDocumentGetConfigurationSetOutput(&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_deserializeOpErrorGetConfigurationSet(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetConfigurationSetOutput(v **GetConfigurationSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetConfigurationSetOutput
if *v == nil {
sv = &GetConfigurationSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ConfigurationSetName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ConfigurationSetName to be of type string, got %T instead", value)
}
sv.ConfigurationSetName = ptr.String(jtv)
}
case "DeliveryOptions":
if err := awsRestjson1_deserializeDocumentDeliveryOptions(&sv.DeliveryOptions, value); err != nil {
return err
}
case "ReputationOptions":
if err := awsRestjson1_deserializeDocumentReputationOptions(&sv.ReputationOptions, value); err != nil {
return err
}
case "SendingOptions":
if err := awsRestjson1_deserializeDocumentSendingOptions(&sv.SendingOptions, value); err != nil {
return err
}
case "SuppressionOptions":
if err := awsRestjson1_deserializeDocumentSuppressionOptions(&sv.SuppressionOptions, value); err != nil {
return err
}
case "Tags":
if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil {
return err
}
case "TrackingOptions":
if err := awsRestjson1_deserializeDocumentTrackingOptions(&sv.TrackingOptions, value); err != nil {
return err
}
case "VdmOptions":
if err := awsRestjson1_deserializeDocumentVdmOptions(&sv.VdmOptions, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetConfigurationSetEventDestinations struct {
}
func (*awsRestjson1_deserializeOpGetConfigurationSetEventDestinations) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetConfigurationSetEventDestinations) 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_deserializeOpErrorGetConfigurationSetEventDestinations(response, &metadata)
}
output := &GetConfigurationSetEventDestinationsOutput{}
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_deserializeOpDocumentGetConfigurationSetEventDestinationsOutput(&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_deserializeOpErrorGetConfigurationSetEventDestinations(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetConfigurationSetEventDestinationsOutput(v **GetConfigurationSetEventDestinationsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetConfigurationSetEventDestinationsOutput
if *v == nil {
sv = &GetConfigurationSetEventDestinationsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "EventDestinations":
if err := awsRestjson1_deserializeDocumentEventDestinations(&sv.EventDestinations, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetContact struct {
}
func (*awsRestjson1_deserializeOpGetContact) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetContact) 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_deserializeOpErrorGetContact(response, &metadata)
}
output := &GetContactOutput{}
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_deserializeOpDocumentGetContactOutput(&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_deserializeOpErrorGetContact(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetContactOutput(v **GetContactOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetContactOutput
if *v == nil {
sv = &GetContactOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AttributesData":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AttributesData to be of type string, got %T instead", value)
}
sv.AttributesData = ptr.String(jtv)
}
case "ContactListName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ContactListName to be of type string, got %T instead", value)
}
sv.ContactListName = ptr.String(jtv)
}
case "CreatedTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "EmailAddress":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EmailAddress to be of type string, got %T instead", value)
}
sv.EmailAddress = ptr.String(jtv)
}
case "LastUpdatedTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUpdatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "TopicDefaultPreferences":
if err := awsRestjson1_deserializeDocumentTopicPreferenceList(&sv.TopicDefaultPreferences, value); err != nil {
return err
}
case "TopicPreferences":
if err := awsRestjson1_deserializeDocumentTopicPreferenceList(&sv.TopicPreferences, value); err != nil {
return err
}
case "UnsubscribeAll":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected UnsubscribeAll to be of type *bool, got %T instead", value)
}
sv.UnsubscribeAll = jtv
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetContactList struct {
}
func (*awsRestjson1_deserializeOpGetContactList) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetContactList) 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_deserializeOpErrorGetContactList(response, &metadata)
}
output := &GetContactListOutput{}
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_deserializeOpDocumentGetContactListOutput(&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_deserializeOpErrorGetContactList(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetContactListOutput(v **GetContactListOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetContactListOutput
if *v == nil {
sv = &GetContactListOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ContactListName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ContactListName to be of type string, got %T instead", value)
}
sv.ContactListName = ptr.String(jtv)
}
case "CreatedTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedTimestamp = 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 "LastUpdatedTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUpdatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "Tags":
if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil {
return err
}
case "Topics":
if err := awsRestjson1_deserializeDocumentTopics(&sv.Topics, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetCustomVerificationEmailTemplate struct {
}
func (*awsRestjson1_deserializeOpGetCustomVerificationEmailTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetCustomVerificationEmailTemplate) 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_deserializeOpErrorGetCustomVerificationEmailTemplate(response, &metadata)
}
output := &GetCustomVerificationEmailTemplateOutput{}
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_deserializeOpDocumentGetCustomVerificationEmailTemplateOutput(&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_deserializeOpErrorGetCustomVerificationEmailTemplate(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetCustomVerificationEmailTemplateOutput(v **GetCustomVerificationEmailTemplateOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetCustomVerificationEmailTemplateOutput
if *v == nil {
sv = &GetCustomVerificationEmailTemplateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "FailureRedirectionURL":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FailureRedirectionURL to be of type string, got %T instead", value)
}
sv.FailureRedirectionURL = ptr.String(jtv)
}
case "FromEmailAddress":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EmailAddress to be of type string, got %T instead", value)
}
sv.FromEmailAddress = ptr.String(jtv)
}
case "SuccessRedirectionURL":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SuccessRedirectionURL to be of type string, got %T instead", value)
}
sv.SuccessRedirectionURL = ptr.String(jtv)
}
case "TemplateContent":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TemplateContent to be of type string, got %T instead", value)
}
sv.TemplateContent = ptr.String(jtv)
}
case "TemplateName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EmailTemplateName to be of type string, got %T instead", value)
}
sv.TemplateName = ptr.String(jtv)
}
case "TemplateSubject":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EmailTemplateSubject to be of type string, got %T instead", value)
}
sv.TemplateSubject = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetDedicatedIp struct {
}
func (*awsRestjson1_deserializeOpGetDedicatedIp) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetDedicatedIp) 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_deserializeOpErrorGetDedicatedIp(response, &metadata)
}
output := &GetDedicatedIpOutput{}
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_deserializeOpDocumentGetDedicatedIpOutput(&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_deserializeOpErrorGetDedicatedIp(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetDedicatedIpOutput(v **GetDedicatedIpOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetDedicatedIpOutput
if *v == nil {
sv = &GetDedicatedIpOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DedicatedIp":
if err := awsRestjson1_deserializeDocumentDedicatedIp(&sv.DedicatedIp, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetDedicatedIpPool struct {
}
func (*awsRestjson1_deserializeOpGetDedicatedIpPool) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetDedicatedIpPool) 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_deserializeOpErrorGetDedicatedIpPool(response, &metadata)
}
output := &GetDedicatedIpPoolOutput{}
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_deserializeOpDocumentGetDedicatedIpPoolOutput(&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_deserializeOpErrorGetDedicatedIpPool(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetDedicatedIpPoolOutput(v **GetDedicatedIpPoolOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetDedicatedIpPoolOutput
if *v == nil {
sv = &GetDedicatedIpPoolOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DedicatedIpPool":
if err := awsRestjson1_deserializeDocumentDedicatedIpPool(&sv.DedicatedIpPool, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetDedicatedIps struct {
}
func (*awsRestjson1_deserializeOpGetDedicatedIps) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetDedicatedIps) 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_deserializeOpErrorGetDedicatedIps(response, &metadata)
}
output := &GetDedicatedIpsOutput{}
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_deserializeOpDocumentGetDedicatedIpsOutput(&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_deserializeOpErrorGetDedicatedIps(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetDedicatedIpsOutput(v **GetDedicatedIpsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetDedicatedIpsOutput
if *v == nil {
sv = &GetDedicatedIpsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DedicatedIps":
if err := awsRestjson1_deserializeDocumentDedicatedIpList(&sv.DedicatedIps, 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_deserializeOpGetDeliverabilityDashboardOptions struct {
}
func (*awsRestjson1_deserializeOpGetDeliverabilityDashboardOptions) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetDeliverabilityDashboardOptions) 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_deserializeOpErrorGetDeliverabilityDashboardOptions(response, &metadata)
}
output := &GetDeliverabilityDashboardOptionsOutput{}
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_deserializeOpDocumentGetDeliverabilityDashboardOptionsOutput(&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_deserializeOpErrorGetDeliverabilityDashboardOptions(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("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetDeliverabilityDashboardOptionsOutput(v **GetDeliverabilityDashboardOptionsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetDeliverabilityDashboardOptionsOutput
if *v == nil {
sv = &GetDeliverabilityDashboardOptionsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AccountStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DeliverabilityDashboardAccountStatus to be of type string, got %T instead", value)
}
sv.AccountStatus = types.DeliverabilityDashboardAccountStatus(jtv)
}
case "ActiveSubscribedDomains":
if err := awsRestjson1_deserializeDocumentDomainDeliverabilityTrackingOptions(&sv.ActiveSubscribedDomains, value); err != nil {
return err
}
case "DashboardEnabled":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value)
}
sv.DashboardEnabled = jtv
}
case "PendingExpirationSubscribedDomains":
if err := awsRestjson1_deserializeDocumentDomainDeliverabilityTrackingOptions(&sv.PendingExpirationSubscribedDomains, value); err != nil {
return err
}
case "SubscriptionExpiryDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.SubscriptionExpiryDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetDeliverabilityTestReport struct {
}
func (*awsRestjson1_deserializeOpGetDeliverabilityTestReport) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetDeliverabilityTestReport) 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_deserializeOpErrorGetDeliverabilityTestReport(response, &metadata)
}
output := &GetDeliverabilityTestReportOutput{}
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_deserializeOpDocumentGetDeliverabilityTestReportOutput(&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_deserializeOpErrorGetDeliverabilityTestReport(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetDeliverabilityTestReportOutput(v **GetDeliverabilityTestReportOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetDeliverabilityTestReportOutput
if *v == nil {
sv = &GetDeliverabilityTestReportOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DeliverabilityTestReport":
if err := awsRestjson1_deserializeDocumentDeliverabilityTestReport(&sv.DeliverabilityTestReport, value); err != nil {
return err
}
case "IspPlacements":
if err := awsRestjson1_deserializeDocumentIspPlacements(&sv.IspPlacements, value); err != nil {
return err
}
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MessageContent to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "OverallPlacement":
if err := awsRestjson1_deserializeDocumentPlacementStatistics(&sv.OverallPlacement, value); err != nil {
return err
}
case "Tags":
if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetDomainDeliverabilityCampaign struct {
}
func (*awsRestjson1_deserializeOpGetDomainDeliverabilityCampaign) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetDomainDeliverabilityCampaign) 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_deserializeOpErrorGetDomainDeliverabilityCampaign(response, &metadata)
}
output := &GetDomainDeliverabilityCampaignOutput{}
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_deserializeOpDocumentGetDomainDeliverabilityCampaignOutput(&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_deserializeOpErrorGetDomainDeliverabilityCampaign(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetDomainDeliverabilityCampaignOutput(v **GetDomainDeliverabilityCampaignOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetDomainDeliverabilityCampaignOutput
if *v == nil {
sv = &GetDomainDeliverabilityCampaignOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DomainDeliverabilityCampaign":
if err := awsRestjson1_deserializeDocumentDomainDeliverabilityCampaign(&sv.DomainDeliverabilityCampaign, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetDomainStatisticsReport struct {
}
func (*awsRestjson1_deserializeOpGetDomainStatisticsReport) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetDomainStatisticsReport) 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_deserializeOpErrorGetDomainStatisticsReport(response, &metadata)
}
output := &GetDomainStatisticsReportOutput{}
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_deserializeOpDocumentGetDomainStatisticsReportOutput(&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_deserializeOpErrorGetDomainStatisticsReport(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetDomainStatisticsReportOutput(v **GetDomainStatisticsReportOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetDomainStatisticsReportOutput
if *v == nil {
sv = &GetDomainStatisticsReportOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DailyVolumes":
if err := awsRestjson1_deserializeDocumentDailyVolumes(&sv.DailyVolumes, value); err != nil {
return err
}
case "OverallVolume":
if err := awsRestjson1_deserializeDocumentOverallVolume(&sv.OverallVolume, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetEmailIdentity struct {
}
func (*awsRestjson1_deserializeOpGetEmailIdentity) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetEmailIdentity) 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_deserializeOpErrorGetEmailIdentity(response, &metadata)
}
output := &GetEmailIdentityOutput{}
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_deserializeOpDocumentGetEmailIdentityOutput(&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_deserializeOpErrorGetEmailIdentity(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetEmailIdentityOutput(v **GetEmailIdentityOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetEmailIdentityOutput
if *v == nil {
sv = &GetEmailIdentityOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ConfigurationSetName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ConfigurationSetName to be of type string, got %T instead", value)
}
sv.ConfigurationSetName = ptr.String(jtv)
}
case "DkimAttributes":
if err := awsRestjson1_deserializeDocumentDkimAttributes(&sv.DkimAttributes, value); err != nil {
return err
}
case "FeedbackForwardingStatus":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value)
}
sv.FeedbackForwardingStatus = jtv
}
case "IdentityType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IdentityType to be of type string, got %T instead", value)
}
sv.IdentityType = types.IdentityType(jtv)
}
case "MailFromAttributes":
if err := awsRestjson1_deserializeDocumentMailFromAttributes(&sv.MailFromAttributes, value); err != nil {
return err
}
case "Policies":
if err := awsRestjson1_deserializeDocumentPolicyMap(&sv.Policies, value); err != nil {
return err
}
case "Tags":
if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil {
return err
}
case "VerificationStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VerificationStatus to be of type string, got %T instead", value)
}
sv.VerificationStatus = types.VerificationStatus(jtv)
}
case "VerifiedForSendingStatus":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value)
}
sv.VerifiedForSendingStatus = jtv
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetEmailIdentityPolicies struct {
}
func (*awsRestjson1_deserializeOpGetEmailIdentityPolicies) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetEmailIdentityPolicies) 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_deserializeOpErrorGetEmailIdentityPolicies(response, &metadata)
}
output := &GetEmailIdentityPoliciesOutput{}
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_deserializeOpDocumentGetEmailIdentityPoliciesOutput(&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_deserializeOpErrorGetEmailIdentityPolicies(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetEmailIdentityPoliciesOutput(v **GetEmailIdentityPoliciesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetEmailIdentityPoliciesOutput
if *v == nil {
sv = &GetEmailIdentityPoliciesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Policies":
if err := awsRestjson1_deserializeDocumentPolicyMap(&sv.Policies, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetEmailTemplate struct {
}
func (*awsRestjson1_deserializeOpGetEmailTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetEmailTemplate) 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_deserializeOpErrorGetEmailTemplate(response, &metadata)
}
output := &GetEmailTemplateOutput{}
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_deserializeOpDocumentGetEmailTemplateOutput(&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_deserializeOpErrorGetEmailTemplate(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetEmailTemplateOutput(v **GetEmailTemplateOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetEmailTemplateOutput
if *v == nil {
sv = &GetEmailTemplateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "TemplateContent":
if err := awsRestjson1_deserializeDocumentEmailTemplateContent(&sv.TemplateContent, value); err != nil {
return err
}
case "TemplateName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EmailTemplateName to be of type string, got %T instead", value)
}
sv.TemplateName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetImportJob struct {
}
func (*awsRestjson1_deserializeOpGetImportJob) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetImportJob) 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_deserializeOpErrorGetImportJob(response, &metadata)
}
output := &GetImportJobOutput{}
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_deserializeOpDocumentGetImportJobOutput(&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_deserializeOpErrorGetImportJob(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetImportJobOutput(v **GetImportJobOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetImportJobOutput
if *v == nil {
sv = &GetImportJobOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CompletedTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CompletedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "CreatedTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "FailedRecordsCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected FailedRecordsCount to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.FailedRecordsCount = ptr.Int32(int32(i64))
}
case "FailureInfo":
if err := awsRestjson1_deserializeDocumentFailureInfo(&sv.FailureInfo, value); err != nil {
return err
}
case "ImportDataSource":
if err := awsRestjson1_deserializeDocumentImportDataSource(&sv.ImportDataSource, value); err != nil {
return err
}
case "ImportDestination":
if err := awsRestjson1_deserializeDocumentImportDestination(&sv.ImportDestination, value); err != nil {
return err
}
case "JobId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected JobId to be of type string, got %T instead", value)
}
sv.JobId = ptr.String(jtv)
}
case "JobStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value)
}
sv.JobStatus = types.JobStatus(jtv)
}
case "ProcessedRecordsCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected ProcessedRecordsCount to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ProcessedRecordsCount = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetSuppressedDestination struct {
}
func (*awsRestjson1_deserializeOpGetSuppressedDestination) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetSuppressedDestination) 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_deserializeOpErrorGetSuppressedDestination(response, &metadata)
}
output := &GetSuppressedDestinationOutput{}
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_deserializeOpDocumentGetSuppressedDestinationOutput(&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_deserializeOpErrorGetSuppressedDestination(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetSuppressedDestinationOutput(v **GetSuppressedDestinationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetSuppressedDestinationOutput
if *v == nil {
sv = &GetSuppressedDestinationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "SuppressedDestination":
if err := awsRestjson1_deserializeDocumentSuppressedDestination(&sv.SuppressedDestination, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListConfigurationSets struct {
}
func (*awsRestjson1_deserializeOpListConfigurationSets) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListConfigurationSets) 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_deserializeOpErrorListConfigurationSets(response, &metadata)
}
output := &ListConfigurationSetsOutput{}
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_deserializeOpDocumentListConfigurationSetsOutput(&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_deserializeOpErrorListConfigurationSets(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("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListConfigurationSetsOutput(v **ListConfigurationSetsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListConfigurationSetsOutput
if *v == nil {
sv = &ListConfigurationSetsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ConfigurationSets":
if err := awsRestjson1_deserializeDocumentConfigurationSetNameList(&sv.ConfigurationSets, 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_deserializeOpListContactLists struct {
}
func (*awsRestjson1_deserializeOpListContactLists) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListContactLists) 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_deserializeOpErrorListContactLists(response, &metadata)
}
output := &ListContactListsOutput{}
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_deserializeOpDocumentListContactListsOutput(&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_deserializeOpErrorListContactLists(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("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListContactListsOutput(v **ListContactListsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListContactListsOutput
if *v == nil {
sv = &ListContactListsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ContactLists":
if err := awsRestjson1_deserializeDocumentListOfContactLists(&sv.ContactLists, 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_deserializeOpListContacts struct {
}
func (*awsRestjson1_deserializeOpListContacts) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListContacts) 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_deserializeOpErrorListContacts(response, &metadata)
}
output := &ListContactsOutput{}
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_deserializeOpDocumentListContactsOutput(&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_deserializeOpErrorListContacts(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListContactsOutput(v **ListContactsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListContactsOutput
if *v == nil {
sv = &ListContactsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Contacts":
if err := awsRestjson1_deserializeDocumentListOfContacts(&sv.Contacts, 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_deserializeOpListCustomVerificationEmailTemplates struct {
}
func (*awsRestjson1_deserializeOpListCustomVerificationEmailTemplates) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListCustomVerificationEmailTemplates) 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_deserializeOpErrorListCustomVerificationEmailTemplates(response, &metadata)
}
output := &ListCustomVerificationEmailTemplatesOutput{}
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_deserializeOpDocumentListCustomVerificationEmailTemplatesOutput(&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_deserializeOpErrorListCustomVerificationEmailTemplates(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("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListCustomVerificationEmailTemplatesOutput(v **ListCustomVerificationEmailTemplatesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListCustomVerificationEmailTemplatesOutput
if *v == nil {
sv = &ListCustomVerificationEmailTemplatesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CustomVerificationEmailTemplates":
if err := awsRestjson1_deserializeDocumentCustomVerificationEmailTemplatesList(&sv.CustomVerificationEmailTemplates, 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_deserializeOpListDedicatedIpPools struct {
}
func (*awsRestjson1_deserializeOpListDedicatedIpPools) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListDedicatedIpPools) 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_deserializeOpErrorListDedicatedIpPools(response, &metadata)
}
output := &ListDedicatedIpPoolsOutput{}
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_deserializeOpDocumentListDedicatedIpPoolsOutput(&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_deserializeOpErrorListDedicatedIpPools(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("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListDedicatedIpPoolsOutput(v **ListDedicatedIpPoolsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListDedicatedIpPoolsOutput
if *v == nil {
sv = &ListDedicatedIpPoolsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DedicatedIpPools":
if err := awsRestjson1_deserializeDocumentListOfDedicatedIpPools(&sv.DedicatedIpPools, 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_deserializeOpListDeliverabilityTestReports struct {
}
func (*awsRestjson1_deserializeOpListDeliverabilityTestReports) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListDeliverabilityTestReports) 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_deserializeOpErrorListDeliverabilityTestReports(response, &metadata)
}
output := &ListDeliverabilityTestReportsOutput{}
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_deserializeOpDocumentListDeliverabilityTestReportsOutput(&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_deserializeOpErrorListDeliverabilityTestReports(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListDeliverabilityTestReportsOutput(v **ListDeliverabilityTestReportsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListDeliverabilityTestReportsOutput
if *v == nil {
sv = &ListDeliverabilityTestReportsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DeliverabilityTestReports":
if err := awsRestjson1_deserializeDocumentDeliverabilityTestReports(&sv.DeliverabilityTestReports, 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_deserializeOpListDomainDeliverabilityCampaigns struct {
}
func (*awsRestjson1_deserializeOpListDomainDeliverabilityCampaigns) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListDomainDeliverabilityCampaigns) 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_deserializeOpErrorListDomainDeliverabilityCampaigns(response, &metadata)
}
output := &ListDomainDeliverabilityCampaignsOutput{}
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_deserializeOpDocumentListDomainDeliverabilityCampaignsOutput(&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_deserializeOpErrorListDomainDeliverabilityCampaigns(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListDomainDeliverabilityCampaignsOutput(v **ListDomainDeliverabilityCampaignsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListDomainDeliverabilityCampaignsOutput
if *v == nil {
sv = &ListDomainDeliverabilityCampaignsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DomainDeliverabilityCampaigns":
if err := awsRestjson1_deserializeDocumentDomainDeliverabilityCampaignList(&sv.DomainDeliverabilityCampaigns, 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_deserializeOpListEmailIdentities struct {
}
func (*awsRestjson1_deserializeOpListEmailIdentities) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListEmailIdentities) 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_deserializeOpErrorListEmailIdentities(response, &metadata)
}
output := &ListEmailIdentitiesOutput{}
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_deserializeOpDocumentListEmailIdentitiesOutput(&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_deserializeOpErrorListEmailIdentities(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("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListEmailIdentitiesOutput(v **ListEmailIdentitiesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListEmailIdentitiesOutput
if *v == nil {
sv = &ListEmailIdentitiesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "EmailIdentities":
if err := awsRestjson1_deserializeDocumentIdentityInfoList(&sv.EmailIdentities, 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_deserializeOpListEmailTemplates struct {
}
func (*awsRestjson1_deserializeOpListEmailTemplates) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListEmailTemplates) 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_deserializeOpErrorListEmailTemplates(response, &metadata)
}
output := &ListEmailTemplatesOutput{}
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_deserializeOpDocumentListEmailTemplatesOutput(&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_deserializeOpErrorListEmailTemplates(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("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListEmailTemplatesOutput(v **ListEmailTemplatesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListEmailTemplatesOutput
if *v == nil {
sv = &ListEmailTemplatesOutput{}
} 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 "TemplatesMetadata":
if err := awsRestjson1_deserializeDocumentEmailTemplateMetadataList(&sv.TemplatesMetadata, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListImportJobs struct {
}
func (*awsRestjson1_deserializeOpListImportJobs) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListImportJobs) 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_deserializeOpErrorListImportJobs(response, &metadata)
}
output := &ListImportJobsOutput{}
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_deserializeOpDocumentListImportJobsOutput(&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_deserializeOpErrorListImportJobs(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("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListImportJobsOutput(v **ListImportJobsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListImportJobsOutput
if *v == nil {
sv = &ListImportJobsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ImportJobs":
if err := awsRestjson1_deserializeDocumentImportJobSummaryList(&sv.ImportJobs, 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_deserializeOpListRecommendations struct {
}
func (*awsRestjson1_deserializeOpListRecommendations) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListRecommendations) 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_deserializeOpErrorListRecommendations(response, &metadata)
}
output := &ListRecommendationsOutput{}
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_deserializeOpDocumentListRecommendationsOutput(&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_deserializeOpErrorListRecommendations(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListRecommendationsOutput(v **ListRecommendationsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListRecommendationsOutput
if *v == nil {
sv = &ListRecommendationsOutput{}
} 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 "Recommendations":
if err := awsRestjson1_deserializeDocumentRecommendationsList(&sv.Recommendations, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListSuppressedDestinations struct {
}
func (*awsRestjson1_deserializeOpListSuppressedDestinations) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListSuppressedDestinations) 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_deserializeOpErrorListSuppressedDestinations(response, &metadata)
}
output := &ListSuppressedDestinationsOutput{}
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_deserializeOpDocumentListSuppressedDestinationsOutput(&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_deserializeOpErrorListSuppressedDestinations(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("InvalidNextTokenException", errorCode):
return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListSuppressedDestinationsOutput(v **ListSuppressedDestinationsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListSuppressedDestinationsOutput
if *v == nil {
sv = &ListSuppressedDestinationsOutput{}
} 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 "SuppressedDestinationSummaries":
if err := awsRestjson1_deserializeDocumentSuppressedDestinationSummaries(&sv.SuppressedDestinationSummaries, 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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(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_deserializeOpPutAccountDedicatedIpWarmupAttributes struct {
}
func (*awsRestjson1_deserializeOpPutAccountDedicatedIpWarmupAttributes) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutAccountDedicatedIpWarmupAttributes) 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_deserializeOpErrorPutAccountDedicatedIpWarmupAttributes(response, &metadata)
}
output := &PutAccountDedicatedIpWarmupAttributesOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorPutAccountDedicatedIpWarmupAttributes(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("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpPutAccountDetails struct {
}
func (*awsRestjson1_deserializeOpPutAccountDetails) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutAccountDetails) 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_deserializeOpErrorPutAccountDetails(response, &metadata)
}
output := &PutAccountDetailsOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorPutAccountDetails(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("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpPutAccountSendingAttributes struct {
}
func (*awsRestjson1_deserializeOpPutAccountSendingAttributes) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutAccountSendingAttributes) 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_deserializeOpErrorPutAccountSendingAttributes(response, &metadata)
}
output := &PutAccountSendingAttributesOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorPutAccountSendingAttributes(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("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpPutAccountSuppressionAttributes struct {
}
func (*awsRestjson1_deserializeOpPutAccountSuppressionAttributes) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutAccountSuppressionAttributes) 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_deserializeOpErrorPutAccountSuppressionAttributes(response, &metadata)
}
output := &PutAccountSuppressionAttributesOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorPutAccountSuppressionAttributes(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("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpPutAccountVdmAttributes struct {
}
func (*awsRestjson1_deserializeOpPutAccountVdmAttributes) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutAccountVdmAttributes) 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_deserializeOpErrorPutAccountVdmAttributes(response, &metadata)
}
output := &PutAccountVdmAttributesOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorPutAccountVdmAttributes(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("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpPutConfigurationSetDeliveryOptions struct {
}
func (*awsRestjson1_deserializeOpPutConfigurationSetDeliveryOptions) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutConfigurationSetDeliveryOptions) 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_deserializeOpErrorPutConfigurationSetDeliveryOptions(response, &metadata)
}
output := &PutConfigurationSetDeliveryOptionsOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorPutConfigurationSetDeliveryOptions(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpPutConfigurationSetReputationOptions struct {
}
func (*awsRestjson1_deserializeOpPutConfigurationSetReputationOptions) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutConfigurationSetReputationOptions) 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_deserializeOpErrorPutConfigurationSetReputationOptions(response, &metadata)
}
output := &PutConfigurationSetReputationOptionsOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorPutConfigurationSetReputationOptions(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpPutConfigurationSetSendingOptions struct {
}
func (*awsRestjson1_deserializeOpPutConfigurationSetSendingOptions) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutConfigurationSetSendingOptions) 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_deserializeOpErrorPutConfigurationSetSendingOptions(response, &metadata)
}
output := &PutConfigurationSetSendingOptionsOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorPutConfigurationSetSendingOptions(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpPutConfigurationSetSuppressionOptions struct {
}
func (*awsRestjson1_deserializeOpPutConfigurationSetSuppressionOptions) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutConfigurationSetSuppressionOptions) 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_deserializeOpErrorPutConfigurationSetSuppressionOptions(response, &metadata)
}
output := &PutConfigurationSetSuppressionOptionsOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorPutConfigurationSetSuppressionOptions(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpPutConfigurationSetTrackingOptions struct {
}
func (*awsRestjson1_deserializeOpPutConfigurationSetTrackingOptions) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutConfigurationSetTrackingOptions) 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_deserializeOpErrorPutConfigurationSetTrackingOptions(response, &metadata)
}
output := &PutConfigurationSetTrackingOptionsOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorPutConfigurationSetTrackingOptions(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpPutConfigurationSetVdmOptions struct {
}
func (*awsRestjson1_deserializeOpPutConfigurationSetVdmOptions) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutConfigurationSetVdmOptions) 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_deserializeOpErrorPutConfigurationSetVdmOptions(response, &metadata)
}
output := &PutConfigurationSetVdmOptionsOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorPutConfigurationSetVdmOptions(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpPutDedicatedIpInPool struct {
}
func (*awsRestjson1_deserializeOpPutDedicatedIpInPool) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutDedicatedIpInPool) 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_deserializeOpErrorPutDedicatedIpInPool(response, &metadata)
}
output := &PutDedicatedIpInPoolOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorPutDedicatedIpInPool(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpPutDedicatedIpPoolScalingAttributes struct {
}
func (*awsRestjson1_deserializeOpPutDedicatedIpPoolScalingAttributes) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutDedicatedIpPoolScalingAttributes) 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_deserializeOpErrorPutDedicatedIpPoolScalingAttributes(response, &metadata)
}
output := &PutDedicatedIpPoolScalingAttributesOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorPutDedicatedIpPoolScalingAttributes(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("ConcurrentModificationException", errorCode):
return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpPutDedicatedIpWarmupAttributes struct {
}
func (*awsRestjson1_deserializeOpPutDedicatedIpWarmupAttributes) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutDedicatedIpWarmupAttributes) 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_deserializeOpErrorPutDedicatedIpWarmupAttributes(response, &metadata)
}
output := &PutDedicatedIpWarmupAttributesOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorPutDedicatedIpWarmupAttributes(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpPutDeliverabilityDashboardOption struct {
}
func (*awsRestjson1_deserializeOpPutDeliverabilityDashboardOption) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutDeliverabilityDashboardOption) 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_deserializeOpErrorPutDeliverabilityDashboardOption(response, &metadata)
}
output := &PutDeliverabilityDashboardOptionOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorPutDeliverabilityDashboardOption(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("AlreadyExistsException", errorCode):
return awsRestjson1_deserializeErrorAlreadyExistsException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(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("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpPutEmailIdentityConfigurationSetAttributes struct {
}
func (*awsRestjson1_deserializeOpPutEmailIdentityConfigurationSetAttributes) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutEmailIdentityConfigurationSetAttributes) 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_deserializeOpErrorPutEmailIdentityConfigurationSetAttributes(response, &metadata)
}
output := &PutEmailIdentityConfigurationSetAttributesOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorPutEmailIdentityConfigurationSetAttributes(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpPutEmailIdentityDkimAttributes struct {
}
func (*awsRestjson1_deserializeOpPutEmailIdentityDkimAttributes) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutEmailIdentityDkimAttributes) 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_deserializeOpErrorPutEmailIdentityDkimAttributes(response, &metadata)
}
output := &PutEmailIdentityDkimAttributesOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorPutEmailIdentityDkimAttributes(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpPutEmailIdentityDkimSigningAttributes struct {
}
func (*awsRestjson1_deserializeOpPutEmailIdentityDkimSigningAttributes) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutEmailIdentityDkimSigningAttributes) 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_deserializeOpErrorPutEmailIdentityDkimSigningAttributes(response, &metadata)
}
output := &PutEmailIdentityDkimSigningAttributesOutput{}
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_deserializeOpDocumentPutEmailIdentityDkimSigningAttributesOutput(&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_deserializeOpErrorPutEmailIdentityDkimSigningAttributes(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentPutEmailIdentityDkimSigningAttributesOutput(v **PutEmailIdentityDkimSigningAttributesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *PutEmailIdentityDkimSigningAttributesOutput
if *v == nil {
sv = &PutEmailIdentityDkimSigningAttributesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DkimStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DkimStatus to be of type string, got %T instead", value)
}
sv.DkimStatus = types.DkimStatus(jtv)
}
case "DkimTokens":
if err := awsRestjson1_deserializeDocumentDnsTokenList(&sv.DkimTokens, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpPutEmailIdentityFeedbackAttributes struct {
}
func (*awsRestjson1_deserializeOpPutEmailIdentityFeedbackAttributes) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutEmailIdentityFeedbackAttributes) 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_deserializeOpErrorPutEmailIdentityFeedbackAttributes(response, &metadata)
}
output := &PutEmailIdentityFeedbackAttributesOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorPutEmailIdentityFeedbackAttributes(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpPutEmailIdentityMailFromAttributes struct {
}
func (*awsRestjson1_deserializeOpPutEmailIdentityMailFromAttributes) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutEmailIdentityMailFromAttributes) 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_deserializeOpErrorPutEmailIdentityMailFromAttributes(response, &metadata)
}
output := &PutEmailIdentityMailFromAttributesOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorPutEmailIdentityMailFromAttributes(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpPutSuppressedDestination struct {
}
func (*awsRestjson1_deserializeOpPutSuppressedDestination) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutSuppressedDestination) 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_deserializeOpErrorPutSuppressedDestination(response, &metadata)
}
output := &PutSuppressedDestinationOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorPutSuppressedDestination(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("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpSendBulkEmail struct {
}
func (*awsRestjson1_deserializeOpSendBulkEmail) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpSendBulkEmail) 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_deserializeOpErrorSendBulkEmail(response, &metadata)
}
output := &SendBulkEmailOutput{}
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_deserializeOpDocumentSendBulkEmailOutput(&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_deserializeOpErrorSendBulkEmail(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("AccountSuspendedException", errorCode):
return awsRestjson1_deserializeErrorAccountSuspendedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("MailFromDomainNotVerifiedException", errorCode):
return awsRestjson1_deserializeErrorMailFromDomainNotVerifiedException(response, errorBody)
case strings.EqualFold("MessageRejected", errorCode):
return awsRestjson1_deserializeErrorMessageRejected(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("SendingPausedException", errorCode):
return awsRestjson1_deserializeErrorSendingPausedException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentSendBulkEmailOutput(v **SendBulkEmailOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *SendBulkEmailOutput
if *v == nil {
sv = &SendBulkEmailOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "BulkEmailEntryResults":
if err := awsRestjson1_deserializeDocumentBulkEmailEntryResultList(&sv.BulkEmailEntryResults, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpSendCustomVerificationEmail struct {
}
func (*awsRestjson1_deserializeOpSendCustomVerificationEmail) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpSendCustomVerificationEmail) 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_deserializeOpErrorSendCustomVerificationEmail(response, &metadata)
}
output := &SendCustomVerificationEmailOutput{}
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_deserializeOpDocumentSendCustomVerificationEmailOutput(&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_deserializeOpErrorSendCustomVerificationEmail(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("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("MailFromDomainNotVerifiedException", errorCode):
return awsRestjson1_deserializeErrorMailFromDomainNotVerifiedException(response, errorBody)
case strings.EqualFold("MessageRejected", errorCode):
return awsRestjson1_deserializeErrorMessageRejected(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("SendingPausedException", errorCode):
return awsRestjson1_deserializeErrorSendingPausedException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentSendCustomVerificationEmailOutput(v **SendCustomVerificationEmailOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *SendCustomVerificationEmailOutput
if *v == nil {
sv = &SendCustomVerificationEmailOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "MessageId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OutboundMessageId to be of type string, got %T instead", value)
}
sv.MessageId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpSendEmail struct {
}
func (*awsRestjson1_deserializeOpSendEmail) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpSendEmail) 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_deserializeOpErrorSendEmail(response, &metadata)
}
output := &SendEmailOutput{}
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_deserializeOpDocumentSendEmailOutput(&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_deserializeOpErrorSendEmail(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("AccountSuspendedException", errorCode):
return awsRestjson1_deserializeErrorAccountSuspendedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("LimitExceededException", errorCode):
return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody)
case strings.EqualFold("MailFromDomainNotVerifiedException", errorCode):
return awsRestjson1_deserializeErrorMailFromDomainNotVerifiedException(response, errorBody)
case strings.EqualFold("MessageRejected", errorCode):
return awsRestjson1_deserializeErrorMessageRejected(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("SendingPausedException", errorCode):
return awsRestjson1_deserializeErrorSendingPausedException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentSendEmailOutput(v **SendEmailOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *SendEmailOutput
if *v == nil {
sv = &SendEmailOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "MessageId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OutboundMessageId to be of type string, got %T instead", value)
}
sv.MessageId = 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("ConcurrentModificationException", errorCode):
return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpTestRenderEmailTemplate struct {
}
func (*awsRestjson1_deserializeOpTestRenderEmailTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpTestRenderEmailTemplate) 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_deserializeOpErrorTestRenderEmailTemplate(response, &metadata)
}
output := &TestRenderEmailTemplateOutput{}
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_deserializeOpDocumentTestRenderEmailTemplateOutput(&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_deserializeOpErrorTestRenderEmailTemplate(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentTestRenderEmailTemplateOutput(v **TestRenderEmailTemplateOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *TestRenderEmailTemplateOutput
if *v == nil {
sv = &TestRenderEmailTemplateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "RenderedTemplate":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RenderedEmailTemplate to be of type string, got %T instead", value)
}
sv.RenderedTemplate = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
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("ConcurrentModificationException", errorCode):
return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpUpdateConfigurationSetEventDestination struct {
}
func (*awsRestjson1_deserializeOpUpdateConfigurationSetEventDestination) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateConfigurationSetEventDestination) 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_deserializeOpErrorUpdateConfigurationSetEventDestination(response, &metadata)
}
output := &UpdateConfigurationSetEventDestinationOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorUpdateConfigurationSetEventDestination(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpUpdateContact struct {
}
func (*awsRestjson1_deserializeOpUpdateContact) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateContact) 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_deserializeOpErrorUpdateContact(response, &metadata)
}
output := &UpdateContactOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorUpdateContact(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("ConcurrentModificationException", errorCode):
return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpUpdateContactList struct {
}
func (*awsRestjson1_deserializeOpUpdateContactList) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateContactList) 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_deserializeOpErrorUpdateContactList(response, &metadata)
}
output := &UpdateContactListOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorUpdateContactList(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("ConcurrentModificationException", errorCode):
return awsRestjson1_deserializeErrorConcurrentModificationException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpUpdateCustomVerificationEmailTemplate struct {
}
func (*awsRestjson1_deserializeOpUpdateCustomVerificationEmailTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateCustomVerificationEmailTemplate) 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_deserializeOpErrorUpdateCustomVerificationEmailTemplate(response, &metadata)
}
output := &UpdateCustomVerificationEmailTemplateOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorUpdateCustomVerificationEmailTemplate(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpUpdateEmailIdentityPolicy struct {
}
func (*awsRestjson1_deserializeOpUpdateEmailIdentityPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateEmailIdentityPolicy) 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_deserializeOpErrorUpdateEmailIdentityPolicy(response, &metadata)
}
output := &UpdateEmailIdentityPolicyOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorUpdateEmailIdentityPolicy(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpUpdateEmailTemplate struct {
}
func (*awsRestjson1_deserializeOpUpdateEmailTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateEmailTemplate) 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_deserializeOpErrorUpdateEmailTemplate(response, &metadata)
}
output := &UpdateEmailTemplateOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorUpdateEmailTemplate(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("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeErrorAccountSuspendedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.AccountSuspendedException{}
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_deserializeDocumentAccountSuspendedException(&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_deserializeErrorAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.AlreadyExistsException{}
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_deserializeDocumentAlreadyExistsException(&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_deserializeErrorConcurrentModificationException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ConcurrentModificationException{}
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_deserializeDocumentConcurrentModificationException(&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_deserializeErrorInternalServiceErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.InternalServiceErrorException{}
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_deserializeDocumentInternalServiceErrorException(&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_deserializeErrorInvalidNextTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.InvalidNextTokenException{}
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_deserializeDocumentInvalidNextTokenException(&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)
return output
}
func awsRestjson1_deserializeErrorMailFromDomainNotVerifiedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.MailFromDomainNotVerifiedException{}
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_deserializeDocumentMailFromDomainNotVerifiedException(&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_deserializeErrorMessageRejected(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.MessageRejected{}
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_deserializeDocumentMessageRejected(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.NotFoundException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentNotFoundException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorSendingPausedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.SendingPausedException{}
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_deserializeDocumentSendingPausedException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorTooManyRequestsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.TooManyRequestsException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentTooManyRequestsException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeDocumentAccountDetails(v **types.AccountDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.AccountDetails
if *v == nil {
sv = &types.AccountDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "AdditionalContactEmailAddresses":
if err := awsRestjson1_deserializeDocumentAdditionalContactEmailAddresses(&sv.AdditionalContactEmailAddresses, value); err != nil {
return err
}
case "ContactLanguage":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ContactLanguage to be of type string, got %T instead", value)
}
sv.ContactLanguage = types.ContactLanguage(jtv)
}
case "MailType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MailType to be of type string, got %T instead", value)
}
sv.MailType = types.MailType(jtv)
}
case "ReviewDetails":
if err := awsRestjson1_deserializeDocumentReviewDetails(&sv.ReviewDetails, value); err != nil {
return err
}
case "UseCaseDescription":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UseCaseDescription to be of type string, got %T instead", value)
}
sv.UseCaseDescription = ptr.String(jtv)
}
case "WebsiteURL":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WebsiteURL to be of type string, got %T instead", value)
}
sv.WebsiteURL = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentAccountSuspendedException(v **types.AccountSuspendedException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.AccountSuspendedException
if *v == nil {
sv = &types.AccountSuspendedException{}
} 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 ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentAdditionalContactEmailAddresses(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 AdditionalContactEmailAddress to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentAlreadyExistsException(v **types.AlreadyExistsException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.AlreadyExistsException
if *v == nil {
sv = &types.AlreadyExistsException{}
} 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 ErrorMessage 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 ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentBlacklistEntries(v *[]types.BlacklistEntry, 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.BlacklistEntry
if *v == nil {
cv = []types.BlacklistEntry{}
} else {
cv = *v
}
for _, value := range shape {
var col types.BlacklistEntry
destAddr := &col
if err := awsRestjson1_deserializeDocumentBlacklistEntry(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentBlacklistEntry(v **types.BlacklistEntry, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.BlacklistEntry
if *v == nil {
sv = &types.BlacklistEntry{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BlacklistingDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "ListingTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.ListingTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "RblName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RblName to be of type string, got %T instead", value)
}
sv.RblName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentBlacklistReport(v *map[string][]types.BlacklistEntry, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %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][]types.BlacklistEntry
if *v == nil {
mv = map[string][]types.BlacklistEntry{}
} else {
mv = *v
}
for key, value := range shape {
var parsedVal []types.BlacklistEntry
mapVar := parsedVal
if err := awsRestjson1_deserializeDocumentBlacklistEntries(&mapVar, value); err != nil {
return err
}
parsedVal = mapVar
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentBulkEmailEntryResult(v **types.BulkEmailEntryResult, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.BulkEmailEntryResult
if *v == nil {
sv = &types.BulkEmailEntryResult{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Error":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Error = ptr.String(jtv)
}
case "MessageId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OutboundMessageId to be of type string, got %T instead", value)
}
sv.MessageId = ptr.String(jtv)
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BulkEmailStatus to be of type string, got %T instead", value)
}
sv.Status = types.BulkEmailStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentBulkEmailEntryResultList(v *[]types.BulkEmailEntryResult, 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.BulkEmailEntryResult
if *v == nil {
cv = []types.BulkEmailEntryResult{}
} else {
cv = *v
}
for _, value := range shape {
var col types.BulkEmailEntryResult
destAddr := &col
if err := awsRestjson1_deserializeDocumentBulkEmailEntryResult(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentCloudWatchDestination(v **types.CloudWatchDestination, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.CloudWatchDestination
if *v == nil {
sv = &types.CloudWatchDestination{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DimensionConfigurations":
if err := awsRestjson1_deserializeDocumentCloudWatchDimensionConfigurations(&sv.DimensionConfigurations, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentCloudWatchDimensionConfiguration(v **types.CloudWatchDimensionConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.CloudWatchDimensionConfiguration
if *v == nil {
sv = &types.CloudWatchDimensionConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DefaultDimensionValue":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DefaultDimensionValue to be of type string, got %T instead", value)
}
sv.DefaultDimensionValue = ptr.String(jtv)
}
case "DimensionName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DimensionName to be of type string, got %T instead", value)
}
sv.DimensionName = ptr.String(jtv)
}
case "DimensionValueSource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DimensionValueSource to be of type string, got %T instead", value)
}
sv.DimensionValueSource = types.DimensionValueSource(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentCloudWatchDimensionConfigurations(v *[]types.CloudWatchDimensionConfiguration, 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.CloudWatchDimensionConfiguration
if *v == nil {
cv = []types.CloudWatchDimensionConfiguration{}
} else {
cv = *v
}
for _, value := range shape {
var col types.CloudWatchDimensionConfiguration
destAddr := &col
if err := awsRestjson1_deserializeDocumentCloudWatchDimensionConfiguration(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentConcurrentModificationException(v **types.ConcurrentModificationException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ConcurrentModificationException
if *v == nil {
sv = &types.ConcurrentModificationException{}
} 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 ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentConfigurationSetNameList(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 ConfigurationSetName to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
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 ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentContact(v **types.Contact, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.Contact
if *v == nil {
sv = &types.Contact{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "EmailAddress":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EmailAddress to be of type string, got %T instead", value)
}
sv.EmailAddress = ptr.String(jtv)
}
case "LastUpdatedTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUpdatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "TopicDefaultPreferences":
if err := awsRestjson1_deserializeDocumentTopicPreferenceList(&sv.TopicDefaultPreferences, value); err != nil {
return err
}
case "TopicPreferences":
if err := awsRestjson1_deserializeDocumentTopicPreferenceList(&sv.TopicPreferences, value); err != nil {
return err
}
case "UnsubscribeAll":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected UnsubscribeAll to be of type *bool, got %T instead", value)
}
sv.UnsubscribeAll = jtv
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentContactList(v **types.ContactList, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ContactList
if *v == nil {
sv = &types.ContactList{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ContactListName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ContactListName to be of type string, got %T instead", value)
}
sv.ContactListName = ptr.String(jtv)
}
case "LastUpdatedTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUpdatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentContactListDestination(v **types.ContactListDestination, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ContactListDestination
if *v == nil {
sv = &types.ContactListDestination{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ContactListImportAction":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ContactListImportAction to be of type string, got %T instead", value)
}
sv.ContactListImportAction = types.ContactListImportAction(jtv)
}
case "ContactListName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ContactListName to be of type string, got %T instead", value)
}
sv.ContactListName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentCustomVerificationEmailTemplateMetadata(v **types.CustomVerificationEmailTemplateMetadata, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.CustomVerificationEmailTemplateMetadata
if *v == nil {
sv = &types.CustomVerificationEmailTemplateMetadata{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "FailureRedirectionURL":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FailureRedirectionURL to be of type string, got %T instead", value)
}
sv.FailureRedirectionURL = ptr.String(jtv)
}
case "FromEmailAddress":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EmailAddress to be of type string, got %T instead", value)
}
sv.FromEmailAddress = ptr.String(jtv)
}
case "SuccessRedirectionURL":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SuccessRedirectionURL to be of type string, got %T instead", value)
}
sv.SuccessRedirectionURL = ptr.String(jtv)
}
case "TemplateName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EmailTemplateName to be of type string, got %T instead", value)
}
sv.TemplateName = ptr.String(jtv)
}
case "TemplateSubject":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EmailTemplateSubject to be of type string, got %T instead", value)
}
sv.TemplateSubject = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentCustomVerificationEmailTemplatesList(v *[]types.CustomVerificationEmailTemplateMetadata, 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.CustomVerificationEmailTemplateMetadata
if *v == nil {
cv = []types.CustomVerificationEmailTemplateMetadata{}
} else {
cv = *v
}
for _, value := range shape {
var col types.CustomVerificationEmailTemplateMetadata
destAddr := &col
if err := awsRestjson1_deserializeDocumentCustomVerificationEmailTemplateMetadata(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentDailyVolume(v **types.DailyVolume, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.DailyVolume
if *v == nil {
sv = &types.DailyVolume{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DomainIspPlacements":
if err := awsRestjson1_deserializeDocumentDomainIspPlacements(&sv.DomainIspPlacements, value); err != nil {
return err
}
case "StartDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.StartDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "VolumeStatistics":
if err := awsRestjson1_deserializeDocumentVolumeStatistics(&sv.VolumeStatistics, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDailyVolumes(v *[]types.DailyVolume, 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.DailyVolume
if *v == nil {
cv = []types.DailyVolume{}
} else {
cv = *v
}
for _, value := range shape {
var col types.DailyVolume
destAddr := &col
if err := awsRestjson1_deserializeDocumentDailyVolume(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentDashboardAttributes(v **types.DashboardAttributes, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.DashboardAttributes
if *v == nil {
sv = &types.DashboardAttributes{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "EngagementMetrics":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FeatureStatus to be of type string, got %T instead", value)
}
sv.EngagementMetrics = types.FeatureStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDashboardOptions(v **types.DashboardOptions, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.DashboardOptions
if *v == nil {
sv = &types.DashboardOptions{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "EngagementMetrics":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FeatureStatus to be of type string, got %T instead", value)
}
sv.EngagementMetrics = types.FeatureStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDedicatedIp(v **types.DedicatedIp, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.DedicatedIp
if *v == nil {
sv = &types.DedicatedIp{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Ip":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Ip to be of type string, got %T instead", value)
}
sv.Ip = ptr.String(jtv)
}
case "PoolName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PoolName to be of type string, got %T instead", value)
}
sv.PoolName = ptr.String(jtv)
}
case "WarmupPercentage":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Percentage100Wrapper to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.WarmupPercentage = ptr.Int32(int32(i64))
}
case "WarmupStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected WarmupStatus to be of type string, got %T instead", value)
}
sv.WarmupStatus = types.WarmupStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDedicatedIpList(v *[]types.DedicatedIp, 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.DedicatedIp
if *v == nil {
cv = []types.DedicatedIp{}
} else {
cv = *v
}
for _, value := range shape {
var col types.DedicatedIp
destAddr := &col
if err := awsRestjson1_deserializeDocumentDedicatedIp(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentDedicatedIpPool(v **types.DedicatedIpPool, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.DedicatedIpPool
if *v == nil {
sv = &types.DedicatedIpPool{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "PoolName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PoolName to be of type string, got %T instead", value)
}
sv.PoolName = ptr.String(jtv)
}
case "ScalingMode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ScalingMode to be of type string, got %T instead", value)
}
sv.ScalingMode = types.ScalingMode(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDeliverabilityTestReport(v **types.DeliverabilityTestReport, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.DeliverabilityTestReport
if *v == nil {
sv = &types.DeliverabilityTestReport{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreateDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreateDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "DeliverabilityTestStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DeliverabilityTestStatus to be of type string, got %T instead", value)
}
sv.DeliverabilityTestStatus = types.DeliverabilityTestStatus(jtv)
}
case "FromEmailAddress":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EmailAddress to be of type string, got %T instead", value)
}
sv.FromEmailAddress = ptr.String(jtv)
}
case "ReportId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ReportId to be of type string, got %T instead", value)
}
sv.ReportId = ptr.String(jtv)
}
case "ReportName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ReportName to be of type string, got %T instead", value)
}
sv.ReportName = ptr.String(jtv)
}
case "Subject":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DeliverabilityTestSubject to be of type string, got %T instead", value)
}
sv.Subject = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDeliverabilityTestReports(v *[]types.DeliverabilityTestReport, 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.DeliverabilityTestReport
if *v == nil {
cv = []types.DeliverabilityTestReport{}
} else {
cv = *v
}
for _, value := range shape {
var col types.DeliverabilityTestReport
destAddr := &col
if err := awsRestjson1_deserializeDocumentDeliverabilityTestReport(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentDeliveryOptions(v **types.DeliveryOptions, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.DeliveryOptions
if *v == nil {
sv = &types.DeliveryOptions{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "SendingPoolName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected PoolName to be of type string, got %T instead", value)
}
sv.SendingPoolName = ptr.String(jtv)
}
case "TlsPolicy":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TlsPolicy to be of type string, got %T instead", value)
}
sv.TlsPolicy = types.TlsPolicy(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDkimAttributes(v **types.DkimAttributes, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.DkimAttributes
if *v == nil {
sv = &types.DkimAttributes{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CurrentSigningKeyLength":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DkimSigningKeyLength to be of type string, got %T instead", value)
}
sv.CurrentSigningKeyLength = types.DkimSigningKeyLength(jtv)
}
case "LastKeyGenerationTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastKeyGenerationTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "NextSigningKeyLength":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DkimSigningKeyLength to be of type string, got %T instead", value)
}
sv.NextSigningKeyLength = types.DkimSigningKeyLength(jtv)
}
case "SigningAttributesOrigin":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DkimSigningAttributesOrigin to be of type string, got %T instead", value)
}
sv.SigningAttributesOrigin = types.DkimSigningAttributesOrigin(jtv)
}
case "SigningEnabled":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value)
}
sv.SigningEnabled = jtv
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DkimStatus to be of type string, got %T instead", value)
}
sv.Status = types.DkimStatus(jtv)
}
case "Tokens":
if err := awsRestjson1_deserializeDocumentDnsTokenList(&sv.Tokens, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDnsTokenList(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 DnsToken to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentDomainDeliverabilityCampaign(v **types.DomainDeliverabilityCampaign, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.DomainDeliverabilityCampaign
if *v == nil {
sv = &types.DomainDeliverabilityCampaign{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CampaignId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CampaignId to be of type string, got %T instead", value)
}
sv.CampaignId = ptr.String(jtv)
}
case "DeleteRate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.DeleteRate = 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.DeleteRate = ptr.Float64(f64)
default:
return fmt.Errorf("expected Percentage to be a JSON Number, got %T instead", value)
}
}
case "Esps":
if err := awsRestjson1_deserializeDocumentEsps(&sv.Esps, value); err != nil {
return err
}
case "FirstSeenDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.FirstSeenDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "FromAddress":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Identity to be of type string, got %T instead", value)
}
sv.FromAddress = ptr.String(jtv)
}
case "ImageUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ImageUrl to be of type string, got %T instead", value)
}
sv.ImageUrl = ptr.String(jtv)
}
case "InboxCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Volume to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.InboxCount = ptr.Int64(i64)
}
case "LastSeenDateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastSeenDateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "ProjectedVolume":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Volume to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ProjectedVolume = ptr.Int64(i64)
}
case "ReadDeleteRate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.ReadDeleteRate = 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.ReadDeleteRate = ptr.Float64(f64)
default:
return fmt.Errorf("expected Percentage to be a JSON Number, got %T instead", value)
}
}
case "ReadRate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.ReadRate = 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.ReadRate = ptr.Float64(f64)
default:
return fmt.Errorf("expected Percentage to be a JSON Number, got %T instead", value)
}
}
case "SendingIps":
if err := awsRestjson1_deserializeDocumentIpList(&sv.SendingIps, value); err != nil {
return err
}
case "SpamCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Volume to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.SpamCount = ptr.Int64(i64)
}
case "Subject":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Subject to be of type string, got %T instead", value)
}
sv.Subject = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDomainDeliverabilityCampaignList(v *[]types.DomainDeliverabilityCampaign, 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.DomainDeliverabilityCampaign
if *v == nil {
cv = []types.DomainDeliverabilityCampaign{}
} else {
cv = *v
}
for _, value := range shape {
var col types.DomainDeliverabilityCampaign
destAddr := &col
if err := awsRestjson1_deserializeDocumentDomainDeliverabilityCampaign(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentDomainDeliverabilityTrackingOption(v **types.DomainDeliverabilityTrackingOption, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.DomainDeliverabilityTrackingOption
if *v == nil {
sv = &types.DomainDeliverabilityTrackingOption{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Domain":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Domain to be of type string, got %T instead", value)
}
sv.Domain = ptr.String(jtv)
}
case "InboxPlacementTrackingOption":
if err := awsRestjson1_deserializeDocumentInboxPlacementTrackingOption(&sv.InboxPlacementTrackingOption, value); err != nil {
return err
}
case "SubscriptionStartDate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.SubscriptionStartDate = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDomainDeliverabilityTrackingOptions(v *[]types.DomainDeliverabilityTrackingOption, 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.DomainDeliverabilityTrackingOption
if *v == nil {
cv = []types.DomainDeliverabilityTrackingOption{}
} else {
cv = *v
}
for _, value := range shape {
var col types.DomainDeliverabilityTrackingOption
destAddr := &col
if err := awsRestjson1_deserializeDocumentDomainDeliverabilityTrackingOption(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentDomainIspPlacement(v **types.DomainIspPlacement, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.DomainIspPlacement
if *v == nil {
sv = &types.DomainIspPlacement{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "InboxPercentage":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.InboxPercentage = 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.InboxPercentage = ptr.Float64(f64)
default:
return fmt.Errorf("expected Percentage to be a JSON Number, got %T instead", value)
}
}
case "InboxRawCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Volume to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.InboxRawCount = ptr.Int64(i64)
}
case "IspName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IspName to be of type string, got %T instead", value)
}
sv.IspName = ptr.String(jtv)
}
case "SpamPercentage":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.SpamPercentage = 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.SpamPercentage = ptr.Float64(f64)
default:
return fmt.Errorf("expected Percentage to be a JSON Number, got %T instead", value)
}
}
case "SpamRawCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Volume to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.SpamRawCount = ptr.Int64(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDomainIspPlacements(v *[]types.DomainIspPlacement, 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.DomainIspPlacement
if *v == nil {
cv = []types.DomainIspPlacement{}
} else {
cv = *v
}
for _, value := range shape {
var col types.DomainIspPlacement
destAddr := &col
if err := awsRestjson1_deserializeDocumentDomainIspPlacement(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentEmailTemplateContent(v **types.EmailTemplateContent, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.EmailTemplateContent
if *v == nil {
sv = &types.EmailTemplateContent{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Html":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EmailTemplateHtml to be of type string, got %T instead", value)
}
sv.Html = ptr.String(jtv)
}
case "Subject":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EmailTemplateSubject to be of type string, got %T instead", value)
}
sv.Subject = ptr.String(jtv)
}
case "Text":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EmailTemplateText to be of type string, got %T instead", value)
}
sv.Text = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentEmailTemplateMetadata(v **types.EmailTemplateMetadata, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.EmailTemplateMetadata
if *v == nil {
sv = &types.EmailTemplateMetadata{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreatedTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "TemplateName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EmailTemplateName to be of type string, got %T instead", value)
}
sv.TemplateName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentEmailTemplateMetadataList(v *[]types.EmailTemplateMetadata, 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.EmailTemplateMetadata
if *v == nil {
cv = []types.EmailTemplateMetadata{}
} else {
cv = *v
}
for _, value := range shape {
var col types.EmailTemplateMetadata
destAddr := &col
if err := awsRestjson1_deserializeDocumentEmailTemplateMetadata(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentEsps(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 Esp to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentEventDestination(v **types.EventDestination, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.EventDestination
if *v == nil {
sv = &types.EventDestination{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CloudWatchDestination":
if err := awsRestjson1_deserializeDocumentCloudWatchDestination(&sv.CloudWatchDestination, value); err != nil {
return err
}
case "Enabled":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value)
}
sv.Enabled = jtv
}
case "KinesisFirehoseDestination":
if err := awsRestjson1_deserializeDocumentKinesisFirehoseDestination(&sv.KinesisFirehoseDestination, value); err != nil {
return err
}
case "MatchingEventTypes":
if err := awsRestjson1_deserializeDocumentEventTypes(&sv.MatchingEventTypes, value); err != nil {
return err
}
case "Name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EventDestinationName to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "PinpointDestination":
if err := awsRestjson1_deserializeDocumentPinpointDestination(&sv.PinpointDestination, value); err != nil {
return err
}
case "SnsDestination":
if err := awsRestjson1_deserializeDocumentSnsDestination(&sv.SnsDestination, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentEventDestinations(v *[]types.EventDestination, 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.EventDestination
if *v == nil {
cv = []types.EventDestination{}
} else {
cv = *v
}
for _, value := range shape {
var col types.EventDestination
destAddr := &col
if err := awsRestjson1_deserializeDocumentEventDestination(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentEventTypes(v *[]types.EventType, 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.EventType
if *v == nil {
cv = []types.EventType{}
} else {
cv = *v
}
for _, value := range shape {
var col types.EventType
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EventType to be of type string, got %T instead", value)
}
col = types.EventType(jtv)
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentFailureInfo(v **types.FailureInfo, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.FailureInfo
if *v == nil {
sv = &types.FailureInfo{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ErrorMessage":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.ErrorMessage = ptr.String(jtv)
}
case "FailedRecordsS3Url":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FailedRecordsS3Url to be of type string, got %T instead", value)
}
sv.FailedRecordsS3Url = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentGuardianAttributes(v **types.GuardianAttributes, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.GuardianAttributes
if *v == nil {
sv = &types.GuardianAttributes{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "OptimizedSharedDelivery":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FeatureStatus to be of type string, got %T instead", value)
}
sv.OptimizedSharedDelivery = types.FeatureStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentGuardianOptions(v **types.GuardianOptions, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.GuardianOptions
if *v == nil {
sv = &types.GuardianOptions{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "OptimizedSharedDelivery":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FeatureStatus to be of type string, got %T instead", value)
}
sv.OptimizedSharedDelivery = types.FeatureStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentIdentityInfo(v **types.IdentityInfo, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.IdentityInfo
if *v == nil {
sv = &types.IdentityInfo{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "IdentityName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Identity to be of type string, got %T instead", value)
}
sv.IdentityName = ptr.String(jtv)
}
case "IdentityType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IdentityType to be of type string, got %T instead", value)
}
sv.IdentityType = types.IdentityType(jtv)
}
case "SendingEnabled":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value)
}
sv.SendingEnabled = jtv
}
case "VerificationStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected VerificationStatus to be of type string, got %T instead", value)
}
sv.VerificationStatus = types.VerificationStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentIdentityInfoList(v *[]types.IdentityInfo, 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.IdentityInfo
if *v == nil {
cv = []types.IdentityInfo{}
} else {
cv = *v
}
for _, value := range shape {
var col types.IdentityInfo
destAddr := &col
if err := awsRestjson1_deserializeDocumentIdentityInfo(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentImportDataSource(v **types.ImportDataSource, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ImportDataSource
if *v == nil {
sv = &types.ImportDataSource{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DataFormat":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DataFormat to be of type string, got %T instead", value)
}
sv.DataFormat = types.DataFormat(jtv)
}
case "S3Url":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected S3Url to be of type string, got %T instead", value)
}
sv.S3Url = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentImportDestination(v **types.ImportDestination, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ImportDestination
if *v == nil {
sv = &types.ImportDestination{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ContactListDestination":
if err := awsRestjson1_deserializeDocumentContactListDestination(&sv.ContactListDestination, value); err != nil {
return err
}
case "SuppressionListDestination":
if err := awsRestjson1_deserializeDocumentSuppressionListDestination(&sv.SuppressionListDestination, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentImportJobSummary(v **types.ImportJobSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ImportJobSummary
if *v == nil {
sv = &types.ImportJobSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreatedTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "FailedRecordsCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected FailedRecordsCount to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.FailedRecordsCount = ptr.Int32(int32(i64))
}
case "ImportDestination":
if err := awsRestjson1_deserializeDocumentImportDestination(&sv.ImportDestination, value); err != nil {
return err
}
case "JobId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected JobId to be of type string, got %T instead", value)
}
sv.JobId = ptr.String(jtv)
}
case "JobStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected JobStatus to be of type string, got %T instead", value)
}
sv.JobStatus = types.JobStatus(jtv)
}
case "ProcessedRecordsCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected ProcessedRecordsCount to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ProcessedRecordsCount = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentImportJobSummaryList(v *[]types.ImportJobSummary, 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.ImportJobSummary
if *v == nil {
cv = []types.ImportJobSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ImportJobSummary
destAddr := &col
if err := awsRestjson1_deserializeDocumentImportJobSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentInboxPlacementTrackingOption(v **types.InboxPlacementTrackingOption, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.InboxPlacementTrackingOption
if *v == nil {
sv = &types.InboxPlacementTrackingOption{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Global":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value)
}
sv.Global = jtv
}
case "TrackedIsps":
if err := awsRestjson1_deserializeDocumentIspNameList(&sv.TrackedIsps, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentInternalServiceErrorException(v **types.InternalServiceErrorException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.InternalServiceErrorException
if *v == nil {
sv = &types.InternalServiceErrorException{}
} 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 ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentInvalidNextTokenException(v **types.InvalidNextTokenException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.InvalidNextTokenException
if *v == nil {
sv = &types.InvalidNextTokenException{}
} 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 ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentIpList(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 Ip to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentIspNameList(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 IspName to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentIspPlacement(v **types.IspPlacement, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.IspPlacement
if *v == nil {
sv = &types.IspPlacement{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "IspName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IspName to be of type string, got %T instead", value)
}
sv.IspName = ptr.String(jtv)
}
case "PlacementStatistics":
if err := awsRestjson1_deserializeDocumentPlacementStatistics(&sv.PlacementStatistics, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentIspPlacements(v *[]types.IspPlacement, 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.IspPlacement
if *v == nil {
cv = []types.IspPlacement{}
} else {
cv = *v
}
for _, value := range shape {
var col types.IspPlacement
destAddr := &col
if err := awsRestjson1_deserializeDocumentIspPlacement(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentKinesisFirehoseDestination(v **types.KinesisFirehoseDestination, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.KinesisFirehoseDestination
if *v == nil {
sv = &types.KinesisFirehoseDestination{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DeliveryStreamArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value)
}
sv.DeliveryStreamArn = ptr.String(jtv)
}
case "IamRoleArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value)
}
sv.IamRoleArn = 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 ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentListOfContactLists(v *[]types.ContactList, 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.ContactList
if *v == nil {
cv = []types.ContactList{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ContactList
destAddr := &col
if err := awsRestjson1_deserializeDocumentContactList(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentListOfContacts(v *[]types.Contact, 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.Contact
if *v == nil {
cv = []types.Contact{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Contact
destAddr := &col
if err := awsRestjson1_deserializeDocumentContact(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentListOfDedicatedIpPools(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 PoolName to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentMailFromAttributes(v **types.MailFromAttributes, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.MailFromAttributes
if *v == nil {
sv = &types.MailFromAttributes{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "BehaviorOnMxFailure":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected BehaviorOnMxFailure to be of type string, got %T instead", value)
}
sv.BehaviorOnMxFailure = types.BehaviorOnMxFailure(jtv)
}
case "MailFromDomain":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MailFromDomainName to be of type string, got %T instead", value)
}
sv.MailFromDomain = ptr.String(jtv)
}
case "MailFromDomainStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected MailFromDomainStatus to be of type string, got %T instead", value)
}
sv.MailFromDomainStatus = types.MailFromDomainStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentMailFromDomainNotVerifiedException(v **types.MailFromDomainNotVerifiedException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.MailFromDomainNotVerifiedException
if *v == nil {
sv = &types.MailFromDomainNotVerifiedException{}
} 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 ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentMessageRejected(v **types.MessageRejected, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.MessageRejected
if *v == nil {
sv = &types.MessageRejected{}
} 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 ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentMetricDataError(v **types.MetricDataError, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.MetricDataError
if *v == nil {
sv = &types.MetricDataError{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Code":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected QueryErrorCode to be of type string, got %T instead", value)
}
sv.Code = types.QueryErrorCode(jtv)
}
case "Id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected QueryIdentifier to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "Message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected QueryErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentMetricDataErrorList(v *[]types.MetricDataError, 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.MetricDataError
if *v == nil {
cv = []types.MetricDataError{}
} else {
cv = *v
}
for _, value := range shape {
var col types.MetricDataError
destAddr := &col
if err := awsRestjson1_deserializeDocumentMetricDataError(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentMetricDataResult(v **types.MetricDataResult, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.MetricDataResult
if *v == nil {
sv = &types.MetricDataResult{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Id":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected QueryIdentifier to be of type string, got %T instead", value)
}
sv.Id = ptr.String(jtv)
}
case "Timestamps":
if err := awsRestjson1_deserializeDocumentTimestampList(&sv.Timestamps, value); err != nil {
return err
}
case "Values":
if err := awsRestjson1_deserializeDocumentMetricValueList(&sv.Values, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentMetricDataResultList(v *[]types.MetricDataResult, 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.MetricDataResult
if *v == nil {
cv = []types.MetricDataResult{}
} else {
cv = *v
}
for _, value := range shape {
var col types.MetricDataResult
destAddr := &col
if err := awsRestjson1_deserializeDocumentMetricDataResult(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentMetricValueList(v *[]int64, 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 []int64
if *v == nil {
cv = []int64{}
} else {
cv = *v
}
for _, value := range shape {
var col int64
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Counter to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
col = i64
}
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 ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentOverallVolume(v **types.OverallVolume, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.OverallVolume
if *v == nil {
sv = &types.OverallVolume{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DomainIspPlacements":
if err := awsRestjson1_deserializeDocumentDomainIspPlacements(&sv.DomainIspPlacements, value); err != nil {
return err
}
case "ReadRatePercent":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.ReadRatePercent = 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.ReadRatePercent = ptr.Float64(f64)
default:
return fmt.Errorf("expected Percentage to be a JSON Number, got %T instead", value)
}
}
case "VolumeStatistics":
if err := awsRestjson1_deserializeDocumentVolumeStatistics(&sv.VolumeStatistics, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentPinpointDestination(v **types.PinpointDestination, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.PinpointDestination
if *v == nil {
sv = &types.PinpointDestination{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "ApplicationArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value)
}
sv.ApplicationArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentPlacementStatistics(v **types.PlacementStatistics, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.PlacementStatistics
if *v == nil {
sv = &types.PlacementStatistics{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DkimPercentage":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.DkimPercentage = 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.DkimPercentage = ptr.Float64(f64)
default:
return fmt.Errorf("expected Percentage to be a JSON Number, got %T instead", value)
}
}
case "InboxPercentage":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.InboxPercentage = 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.InboxPercentage = ptr.Float64(f64)
default:
return fmt.Errorf("expected Percentage to be a JSON Number, got %T instead", value)
}
}
case "MissingPercentage":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.MissingPercentage = 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.MissingPercentage = ptr.Float64(f64)
default:
return fmt.Errorf("expected Percentage to be a JSON Number, got %T instead", value)
}
}
case "SpamPercentage":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.SpamPercentage = 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.SpamPercentage = ptr.Float64(f64)
default:
return fmt.Errorf("expected Percentage to be a JSON Number, got %T instead", value)
}
}
case "SpfPercentage":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.SpfPercentage = 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.SpfPercentage = ptr.Float64(f64)
default:
return fmt.Errorf("expected Percentage to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentPolicyMap(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 Policy to be of type string, got %T instead", value)
}
parsedVal = jtv
}
mv[key] = parsedVal
}
*v = mv
return nil
}
func awsRestjson1_deserializeDocumentRecommendation(v **types.Recommendation, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.Recommendation
if *v == nil {
sv = &types.Recommendation{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CreatedTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.CreatedTimestamp = 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 RecommendationDescription to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "Impact":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RecommendationImpact to be of type string, got %T instead", value)
}
sv.Impact = types.RecommendationImpact(jtv)
}
case "LastUpdatedTimestamp":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUpdatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "ResourceArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value)
}
sv.ResourceArn = ptr.String(jtv)
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RecommendationStatus to be of type string, got %T instead", value)
}
sv.Status = types.RecommendationStatus(jtv)
}
case "Type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RecommendationType to be of type string, got %T instead", value)
}
sv.Type = types.RecommendationType(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentRecommendationsList(v *[]types.Recommendation, 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.Recommendation
if *v == nil {
cv = []types.Recommendation{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Recommendation
destAddr := &col
if err := awsRestjson1_deserializeDocumentRecommendation(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentReputationOptions(v **types.ReputationOptions, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ReputationOptions
if *v == nil {
sv = &types.ReputationOptions{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "LastFreshStart":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastFreshStart = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected LastFreshStart to be a JSON Number, got %T instead", value)
}
}
case "ReputationMetricsEnabled":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value)
}
sv.ReputationMetricsEnabled = jtv
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentReviewDetails(v **types.ReviewDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.ReviewDetails
if *v == nil {
sv = &types.ReviewDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CaseId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CaseId to be of type string, got %T instead", value)
}
sv.CaseId = ptr.String(jtv)
}
case "Status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ReviewStatus to be of type string, got %T instead", value)
}
sv.Status = types.ReviewStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSendingOptions(v **types.SendingOptions, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.SendingOptions
if *v == nil {
sv = &types.SendingOptions{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "SendingEnabled":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value)
}
sv.SendingEnabled = jtv
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSendingPausedException(v **types.SendingPausedException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.SendingPausedException
if *v == nil {
sv = &types.SendingPausedException{}
} 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 ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSendQuota(v **types.SendQuota, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.SendQuota
if *v == nil {
sv = &types.SendQuota{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Max24HourSend":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.Max24HourSend = 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.Max24HourSend = f64
default:
return fmt.Errorf("expected Max24HourSend to be a JSON Number, got %T instead", value)
}
}
case "MaxSendRate":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.MaxSendRate = 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.MaxSendRate = f64
default:
return fmt.Errorf("expected MaxSendRate to be a JSON Number, got %T instead", value)
}
}
case "SentLast24Hours":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.SentLast24Hours = 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.SentLast24Hours = f64
default:
return fmt.Errorf("expected SentLast24Hours to be a JSON Number, got %T instead", value)
}
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSnsDestination(v **types.SnsDestination, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.SnsDestination
if *v == nil {
sv = &types.SnsDestination{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "TopicArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value)
}
sv.TopicArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSuppressedDestination(v **types.SuppressedDestination, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.SuppressedDestination
if *v == nil {
sv = &types.SuppressedDestination{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "Attributes":
if err := awsRestjson1_deserializeDocumentSuppressedDestinationAttributes(&sv.Attributes, value); err != nil {
return err
}
case "EmailAddress":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EmailAddress to be of type string, got %T instead", value)
}
sv.EmailAddress = ptr.String(jtv)
}
case "LastUpdateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUpdateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "Reason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SuppressionListReason to be of type string, got %T instead", value)
}
sv.Reason = types.SuppressionListReason(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSuppressedDestinationAttributes(v **types.SuppressedDestinationAttributes, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.SuppressedDestinationAttributes
if *v == nil {
sv = &types.SuppressedDestinationAttributes{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "FeedbackId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FeedbackId to be of type string, got %T instead", value)
}
sv.FeedbackId = ptr.String(jtv)
}
case "MessageId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OutboundMessageId to be of type string, got %T instead", value)
}
sv.MessageId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSuppressedDestinationSummaries(v *[]types.SuppressedDestinationSummary, 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.SuppressedDestinationSummary
if *v == nil {
cv = []types.SuppressedDestinationSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SuppressedDestinationSummary
destAddr := &col
if err := awsRestjson1_deserializeDocumentSuppressedDestinationSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentSuppressedDestinationSummary(v **types.SuppressedDestinationSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.SuppressedDestinationSummary
if *v == nil {
sv = &types.SuppressedDestinationSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "EmailAddress":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected EmailAddress to be of type string, got %T instead", value)
}
sv.EmailAddress = ptr.String(jtv)
}
case "LastUpdateTime":
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
sv.LastUpdateTime = ptr.Time(smithytime.ParseEpochSeconds(f64))
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
case "Reason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SuppressionListReason to be of type string, got %T instead", value)
}
sv.Reason = types.SuppressionListReason(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSuppressionAttributes(v **types.SuppressionAttributes, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.SuppressionAttributes
if *v == nil {
sv = &types.SuppressionAttributes{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "SuppressedReasons":
if err := awsRestjson1_deserializeDocumentSuppressionListReasons(&sv.SuppressedReasons, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSuppressionListDestination(v **types.SuppressionListDestination, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.SuppressionListDestination
if *v == nil {
sv = &types.SuppressionListDestination{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "SuppressionListImportAction":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SuppressionListImportAction to be of type string, got %T instead", value)
}
sv.SuppressionListImportAction = types.SuppressionListImportAction(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSuppressionListReasons(v *[]types.SuppressionListReason, 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.SuppressionListReason
if *v == nil {
cv = []types.SuppressionListReason{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SuppressionListReason
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SuppressionListReason to be of type string, got %T instead", value)
}
col = types.SuppressionListReason(jtv)
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentSuppressionOptions(v **types.SuppressionOptions, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.SuppressionOptions
if *v == nil {
sv = &types.SuppressionOptions{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "SuppressedReasons":
if err := awsRestjson1_deserializeDocumentSuppressionListReasons(&sv.SuppressedReasons, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
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_deserializeDocumentTimestampList(v *[]time.Time, 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 []time.Time
if *v == nil {
cv = []time.Time{}
} else {
cv = *v
}
for _, value := range shape {
var col time.Time
if value != nil {
switch jtv := value.(type) {
case json.Number:
f64, err := jtv.Float64()
if err != nil {
return err
}
col = smithytime.ParseEpochSeconds(f64)
default:
return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value)
}
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentTooManyRequestsException(v **types.TooManyRequestsException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TooManyRequestsException
if *v == nil {
sv = &types.TooManyRequestsException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentTopic(v **types.Topic, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.Topic
if *v == nil {
sv = &types.Topic{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DefaultSubscriptionStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SubscriptionStatus to be of type string, got %T instead", value)
}
sv.DefaultSubscriptionStatus = types.SubscriptionStatus(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 "DisplayName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DisplayName to be of type string, got %T instead", value)
}
sv.DisplayName = ptr.String(jtv)
}
case "TopicName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TopicName to be of type string, got %T instead", value)
}
sv.TopicName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentTopicPreference(v **types.TopicPreference, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.TopicPreference
if *v == nil {
sv = &types.TopicPreference{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "SubscriptionStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SubscriptionStatus to be of type string, got %T instead", value)
}
sv.SubscriptionStatus = types.SubscriptionStatus(jtv)
}
case "TopicName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected TopicName to be of type string, got %T instead", value)
}
sv.TopicName = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentTopicPreferenceList(v *[]types.TopicPreference, 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.TopicPreference
if *v == nil {
cv = []types.TopicPreference{}
} else {
cv = *v
}
for _, value := range shape {
var col types.TopicPreference
destAddr := &col
if err := awsRestjson1_deserializeDocumentTopicPreference(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentTopics(v *[]types.Topic, 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.Topic
if *v == nil {
cv = []types.Topic{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Topic
destAddr := &col
if err := awsRestjson1_deserializeDocumentTopic(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentTrackingOptions(v **types.TrackingOptions, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.TrackingOptions
if *v == nil {
sv = &types.TrackingOptions{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "CustomRedirectDomain":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CustomRedirectDomain to be of type string, got %T instead", value)
}
sv.CustomRedirectDomain = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentVdmAttributes(v **types.VdmAttributes, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.VdmAttributes
if *v == nil {
sv = &types.VdmAttributes{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DashboardAttributes":
if err := awsRestjson1_deserializeDocumentDashboardAttributes(&sv.DashboardAttributes, value); err != nil {
return err
}
case "GuardianAttributes":
if err := awsRestjson1_deserializeDocumentGuardianAttributes(&sv.GuardianAttributes, value); err != nil {
return err
}
case "VdmEnabled":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected FeatureStatus to be of type string, got %T instead", value)
}
sv.VdmEnabled = types.FeatureStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentVdmOptions(v **types.VdmOptions, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.VdmOptions
if *v == nil {
sv = &types.VdmOptions{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "DashboardOptions":
if err := awsRestjson1_deserializeDocumentDashboardOptions(&sv.DashboardOptions, value); err != nil {
return err
}
case "GuardianOptions":
if err := awsRestjson1_deserializeDocumentGuardianOptions(&sv.GuardianOptions, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentVolumeStatistics(v **types.VolumeStatistics, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", 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.VolumeStatistics
if *v == nil {
sv = &types.VolumeStatistics{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "InboxRawCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Volume to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.InboxRawCount = ptr.Int64(i64)
}
case "ProjectedInbox":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Volume to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ProjectedInbox = ptr.Int64(i64)
}
case "ProjectedSpam":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Volume to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ProjectedSpam = ptr.Int64(i64)
}
case "SpamRawCount":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Volume to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.SpamRawCount = ptr.Int64(i64)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
| 17,229 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package sesv2 provides the API client, operations, and parameter types for
// Amazon Simple Email Service.
//
// Amazon SES API v2 Amazon SES (http://aws.amazon.com/ses) is an Amazon Web
// Services service that you can use to send email messages to your customers. If
// you're new to Amazon SES API v2, you might find it helpful to review the Amazon
// Simple Email Service Developer Guide (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/)
// . The Amazon SES Developer Guide provides information and code samples that
// demonstrate how to use Amazon SES API v2 features programmatically.
package sesv2
| 13 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
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/sesv2/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 = "ses"
}
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 sesv2
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.18.2"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/sesv2/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"
)
type awsRestjson1_serializeOpBatchGetMetricData struct {
}
func (*awsRestjson1_serializeOpBatchGetMetricData) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpBatchGetMetricData) 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.(*BatchGetMetricDataInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/metrics/batch")
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_serializeOpDocumentBatchGetMetricDataInput(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_serializeOpHttpBindingsBatchGetMetricDataInput(v *BatchGetMetricDataInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentBatchGetMetricDataInput(v *BatchGetMetricDataInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Queries != nil {
ok := object.Key("Queries")
if err := awsRestjson1_serializeDocumentBatchGetMetricDataQueries(v.Queries, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateConfigurationSet struct {
}
func (*awsRestjson1_serializeOpCreateConfigurationSet) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateConfigurationSet) 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.(*CreateConfigurationSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/configuration-sets")
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_serializeOpDocumentCreateConfigurationSetInput(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_serializeOpHttpBindingsCreateConfigurationSetInput(v *CreateConfigurationSetInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateConfigurationSetInput(v *CreateConfigurationSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ConfigurationSetName != nil {
ok := object.Key("ConfigurationSetName")
ok.String(*v.ConfigurationSetName)
}
if v.DeliveryOptions != nil {
ok := object.Key("DeliveryOptions")
if err := awsRestjson1_serializeDocumentDeliveryOptions(v.DeliveryOptions, ok); err != nil {
return err
}
}
if v.ReputationOptions != nil {
ok := object.Key("ReputationOptions")
if err := awsRestjson1_serializeDocumentReputationOptions(v.ReputationOptions, ok); err != nil {
return err
}
}
if v.SendingOptions != nil {
ok := object.Key("SendingOptions")
if err := awsRestjson1_serializeDocumentSendingOptions(v.SendingOptions, ok); err != nil {
return err
}
}
if v.SuppressionOptions != nil {
ok := object.Key("SuppressionOptions")
if err := awsRestjson1_serializeDocumentSuppressionOptions(v.SuppressionOptions, ok); err != nil {
return err
}
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
if v.TrackingOptions != nil {
ok := object.Key("TrackingOptions")
if err := awsRestjson1_serializeDocumentTrackingOptions(v.TrackingOptions, ok); err != nil {
return err
}
}
if v.VdmOptions != nil {
ok := object.Key("VdmOptions")
if err := awsRestjson1_serializeDocumentVdmOptions(v.VdmOptions, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateConfigurationSetEventDestination struct {
}
func (*awsRestjson1_serializeOpCreateConfigurationSetEventDestination) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateConfigurationSetEventDestination) 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.(*CreateConfigurationSetEventDestinationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/configuration-sets/{ConfigurationSetName}/event-destinations")
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_serializeOpHttpBindingsCreateConfigurationSetEventDestinationInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateConfigurationSetEventDestinationInput(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_serializeOpHttpBindingsCreateConfigurationSetEventDestinationInput(v *CreateConfigurationSetEventDestinationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ConfigurationSetName == nil || len(*v.ConfigurationSetName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigurationSetName must not be empty")}
}
if v.ConfigurationSetName != nil {
if err := encoder.SetURI("ConfigurationSetName").String(*v.ConfigurationSetName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateConfigurationSetEventDestinationInput(v *CreateConfigurationSetEventDestinationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EventDestination != nil {
ok := object.Key("EventDestination")
if err := awsRestjson1_serializeDocumentEventDestinationDefinition(v.EventDestination, ok); err != nil {
return err
}
}
if v.EventDestinationName != nil {
ok := object.Key("EventDestinationName")
ok.String(*v.EventDestinationName)
}
return nil
}
type awsRestjson1_serializeOpCreateContact struct {
}
func (*awsRestjson1_serializeOpCreateContact) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateContact) 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.(*CreateContactInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/contact-lists/{ContactListName}/contacts")
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_serializeOpHttpBindingsCreateContactInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateContactInput(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_serializeOpHttpBindingsCreateContactInput(v *CreateContactInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ContactListName == nil || len(*v.ContactListName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ContactListName must not be empty")}
}
if v.ContactListName != nil {
if err := encoder.SetURI("ContactListName").String(*v.ContactListName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateContactInput(v *CreateContactInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AttributesData != nil {
ok := object.Key("AttributesData")
ok.String(*v.AttributesData)
}
if v.EmailAddress != nil {
ok := object.Key("EmailAddress")
ok.String(*v.EmailAddress)
}
if v.TopicPreferences != nil {
ok := object.Key("TopicPreferences")
if err := awsRestjson1_serializeDocumentTopicPreferenceList(v.TopicPreferences, ok); err != nil {
return err
}
}
if v.UnsubscribeAll {
ok := object.Key("UnsubscribeAll")
ok.Boolean(v.UnsubscribeAll)
}
return nil
}
type awsRestjson1_serializeOpCreateContactList struct {
}
func (*awsRestjson1_serializeOpCreateContactList) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateContactList) 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.(*CreateContactListInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/contact-lists")
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_serializeOpDocumentCreateContactListInput(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_serializeOpHttpBindingsCreateContactListInput(v *CreateContactListInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateContactListInput(v *CreateContactListInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContactListName != nil {
ok := object.Key("ContactListName")
ok.String(*v.ContactListName)
}
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
}
}
if v.Topics != nil {
ok := object.Key("Topics")
if err := awsRestjson1_serializeDocumentTopics(v.Topics, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateCustomVerificationEmailTemplate struct {
}
func (*awsRestjson1_serializeOpCreateCustomVerificationEmailTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateCustomVerificationEmailTemplate) 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.(*CreateCustomVerificationEmailTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/custom-verification-email-templates")
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_serializeOpDocumentCreateCustomVerificationEmailTemplateInput(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_serializeOpHttpBindingsCreateCustomVerificationEmailTemplateInput(v *CreateCustomVerificationEmailTemplateInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateCustomVerificationEmailTemplateInput(v *CreateCustomVerificationEmailTemplateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FailureRedirectionURL != nil {
ok := object.Key("FailureRedirectionURL")
ok.String(*v.FailureRedirectionURL)
}
if v.FromEmailAddress != nil {
ok := object.Key("FromEmailAddress")
ok.String(*v.FromEmailAddress)
}
if v.SuccessRedirectionURL != nil {
ok := object.Key("SuccessRedirectionURL")
ok.String(*v.SuccessRedirectionURL)
}
if v.TemplateContent != nil {
ok := object.Key("TemplateContent")
ok.String(*v.TemplateContent)
}
if v.TemplateName != nil {
ok := object.Key("TemplateName")
ok.String(*v.TemplateName)
}
if v.TemplateSubject != nil {
ok := object.Key("TemplateSubject")
ok.String(*v.TemplateSubject)
}
return nil
}
type awsRestjson1_serializeOpCreateDedicatedIpPool struct {
}
func (*awsRestjson1_serializeOpCreateDedicatedIpPool) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateDedicatedIpPool) 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.(*CreateDedicatedIpPoolInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/dedicated-ip-pools")
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_serializeOpDocumentCreateDedicatedIpPoolInput(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_serializeOpHttpBindingsCreateDedicatedIpPoolInput(v *CreateDedicatedIpPoolInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateDedicatedIpPoolInput(v *CreateDedicatedIpPoolInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.PoolName != nil {
ok := object.Key("PoolName")
ok.String(*v.PoolName)
}
if len(v.ScalingMode) > 0 {
ok := object.Key("ScalingMode")
ok.String(string(v.ScalingMode))
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateDeliverabilityTestReport struct {
}
func (*awsRestjson1_serializeOpCreateDeliverabilityTestReport) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateDeliverabilityTestReport) 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.(*CreateDeliverabilityTestReportInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/deliverability-dashboard/test")
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_serializeOpDocumentCreateDeliverabilityTestReportInput(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_serializeOpHttpBindingsCreateDeliverabilityTestReportInput(v *CreateDeliverabilityTestReportInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateDeliverabilityTestReportInput(v *CreateDeliverabilityTestReportInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Content != nil {
ok := object.Key("Content")
if err := awsRestjson1_serializeDocumentEmailContent(v.Content, ok); err != nil {
return err
}
}
if v.FromEmailAddress != nil {
ok := object.Key("FromEmailAddress")
ok.String(*v.FromEmailAddress)
}
if v.ReportName != nil {
ok := object.Key("ReportName")
ok.String(*v.ReportName)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateEmailIdentity struct {
}
func (*awsRestjson1_serializeOpCreateEmailIdentity) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateEmailIdentity) 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.(*CreateEmailIdentityInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/identities")
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_serializeOpDocumentCreateEmailIdentityInput(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_serializeOpHttpBindingsCreateEmailIdentityInput(v *CreateEmailIdentityInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateEmailIdentityInput(v *CreateEmailIdentityInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ConfigurationSetName != nil {
ok := object.Key("ConfigurationSetName")
ok.String(*v.ConfigurationSetName)
}
if v.DkimSigningAttributes != nil {
ok := object.Key("DkimSigningAttributes")
if err := awsRestjson1_serializeDocumentDkimSigningAttributes(v.DkimSigningAttributes, ok); err != nil {
return err
}
}
if v.EmailIdentity != nil {
ok := object.Key("EmailIdentity")
ok.String(*v.EmailIdentity)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateEmailIdentityPolicy struct {
}
func (*awsRestjson1_serializeOpCreateEmailIdentityPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateEmailIdentityPolicy) 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.(*CreateEmailIdentityPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/identities/{EmailIdentity}/policies/{PolicyName}")
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_serializeOpHttpBindingsCreateEmailIdentityPolicyInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateEmailIdentityPolicyInput(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_serializeOpHttpBindingsCreateEmailIdentityPolicyInput(v *CreateEmailIdentityPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.EmailIdentity == nil || len(*v.EmailIdentity) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member EmailIdentity must not be empty")}
}
if v.EmailIdentity != nil {
if err := encoder.SetURI("EmailIdentity").String(*v.EmailIdentity); err != nil {
return err
}
}
if v.PolicyName == nil || len(*v.PolicyName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member PolicyName must not be empty")}
}
if v.PolicyName != nil {
if err := encoder.SetURI("PolicyName").String(*v.PolicyName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateEmailIdentityPolicyInput(v *CreateEmailIdentityPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Policy != nil {
ok := object.Key("Policy")
ok.String(*v.Policy)
}
return nil
}
type awsRestjson1_serializeOpCreateEmailTemplate struct {
}
func (*awsRestjson1_serializeOpCreateEmailTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateEmailTemplate) 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.(*CreateEmailTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/templates")
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_serializeOpDocumentCreateEmailTemplateInput(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_serializeOpHttpBindingsCreateEmailTemplateInput(v *CreateEmailTemplateInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateEmailTemplateInput(v *CreateEmailTemplateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.TemplateContent != nil {
ok := object.Key("TemplateContent")
if err := awsRestjson1_serializeDocumentEmailTemplateContent(v.TemplateContent, ok); err != nil {
return err
}
}
if v.TemplateName != nil {
ok := object.Key("TemplateName")
ok.String(*v.TemplateName)
}
return nil
}
type awsRestjson1_serializeOpCreateImportJob struct {
}
func (*awsRestjson1_serializeOpCreateImportJob) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateImportJob) 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.(*CreateImportJobInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/import-jobs")
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_serializeOpDocumentCreateImportJobInput(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_serializeOpHttpBindingsCreateImportJobInput(v *CreateImportJobInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateImportJobInput(v *CreateImportJobInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ImportDataSource != nil {
ok := object.Key("ImportDataSource")
if err := awsRestjson1_serializeDocumentImportDataSource(v.ImportDataSource, ok); err != nil {
return err
}
}
if v.ImportDestination != nil {
ok := object.Key("ImportDestination")
if err := awsRestjson1_serializeDocumentImportDestination(v.ImportDestination, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteConfigurationSet struct {
}
func (*awsRestjson1_serializeOpDeleteConfigurationSet) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteConfigurationSet) 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.(*DeleteConfigurationSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/configuration-sets/{ConfigurationSetName}")
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_serializeOpHttpBindingsDeleteConfigurationSetInput(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_serializeOpHttpBindingsDeleteConfigurationSetInput(v *DeleteConfigurationSetInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ConfigurationSetName == nil || len(*v.ConfigurationSetName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigurationSetName must not be empty")}
}
if v.ConfigurationSetName != nil {
if err := encoder.SetURI("ConfigurationSetName").String(*v.ConfigurationSetName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteConfigurationSetEventDestination struct {
}
func (*awsRestjson1_serializeOpDeleteConfigurationSetEventDestination) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteConfigurationSetEventDestination) 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.(*DeleteConfigurationSetEventDestinationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/configuration-sets/{ConfigurationSetName}/event-destinations/{EventDestinationName}")
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_serializeOpHttpBindingsDeleteConfigurationSetEventDestinationInput(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_serializeOpHttpBindingsDeleteConfigurationSetEventDestinationInput(v *DeleteConfigurationSetEventDestinationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ConfigurationSetName == nil || len(*v.ConfigurationSetName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigurationSetName must not be empty")}
}
if v.ConfigurationSetName != nil {
if err := encoder.SetURI("ConfigurationSetName").String(*v.ConfigurationSetName); err != nil {
return err
}
}
if v.EventDestinationName == nil || len(*v.EventDestinationName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member EventDestinationName must not be empty")}
}
if v.EventDestinationName != nil {
if err := encoder.SetURI("EventDestinationName").String(*v.EventDestinationName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteContact struct {
}
func (*awsRestjson1_serializeOpDeleteContact) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteContact) 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.(*DeleteContactInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/contact-lists/{ContactListName}/contacts/{EmailAddress}")
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_serializeOpHttpBindingsDeleteContactInput(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_serializeOpHttpBindingsDeleteContactInput(v *DeleteContactInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ContactListName == nil || len(*v.ContactListName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ContactListName must not be empty")}
}
if v.ContactListName != nil {
if err := encoder.SetURI("ContactListName").String(*v.ContactListName); err != nil {
return err
}
}
if v.EmailAddress == nil || len(*v.EmailAddress) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member EmailAddress must not be empty")}
}
if v.EmailAddress != nil {
if err := encoder.SetURI("EmailAddress").String(*v.EmailAddress); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteContactList struct {
}
func (*awsRestjson1_serializeOpDeleteContactList) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteContactList) 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.(*DeleteContactListInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/contact-lists/{ContactListName}")
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_serializeOpHttpBindingsDeleteContactListInput(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_serializeOpHttpBindingsDeleteContactListInput(v *DeleteContactListInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ContactListName == nil || len(*v.ContactListName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ContactListName must not be empty")}
}
if v.ContactListName != nil {
if err := encoder.SetURI("ContactListName").String(*v.ContactListName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteCustomVerificationEmailTemplate struct {
}
func (*awsRestjson1_serializeOpDeleteCustomVerificationEmailTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteCustomVerificationEmailTemplate) 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.(*DeleteCustomVerificationEmailTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/custom-verification-email-templates/{TemplateName}")
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_serializeOpHttpBindingsDeleteCustomVerificationEmailTemplateInput(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_serializeOpHttpBindingsDeleteCustomVerificationEmailTemplateInput(v *DeleteCustomVerificationEmailTemplateInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TemplateName == nil || len(*v.TemplateName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member TemplateName must not be empty")}
}
if v.TemplateName != nil {
if err := encoder.SetURI("TemplateName").String(*v.TemplateName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteDedicatedIpPool struct {
}
func (*awsRestjson1_serializeOpDeleteDedicatedIpPool) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteDedicatedIpPool) 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.(*DeleteDedicatedIpPoolInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/dedicated-ip-pools/{PoolName}")
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_serializeOpHttpBindingsDeleteDedicatedIpPoolInput(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_serializeOpHttpBindingsDeleteDedicatedIpPoolInput(v *DeleteDedicatedIpPoolInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.PoolName == nil || len(*v.PoolName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member PoolName must not be empty")}
}
if v.PoolName != nil {
if err := encoder.SetURI("PoolName").String(*v.PoolName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteEmailIdentity struct {
}
func (*awsRestjson1_serializeOpDeleteEmailIdentity) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteEmailIdentity) 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.(*DeleteEmailIdentityInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/identities/{EmailIdentity}")
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_serializeOpHttpBindingsDeleteEmailIdentityInput(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_serializeOpHttpBindingsDeleteEmailIdentityInput(v *DeleteEmailIdentityInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.EmailIdentity == nil || len(*v.EmailIdentity) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member EmailIdentity must not be empty")}
}
if v.EmailIdentity != nil {
if err := encoder.SetURI("EmailIdentity").String(*v.EmailIdentity); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteEmailIdentityPolicy struct {
}
func (*awsRestjson1_serializeOpDeleteEmailIdentityPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteEmailIdentityPolicy) 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.(*DeleteEmailIdentityPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/identities/{EmailIdentity}/policies/{PolicyName}")
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_serializeOpHttpBindingsDeleteEmailIdentityPolicyInput(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_serializeOpHttpBindingsDeleteEmailIdentityPolicyInput(v *DeleteEmailIdentityPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.EmailIdentity == nil || len(*v.EmailIdentity) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member EmailIdentity must not be empty")}
}
if v.EmailIdentity != nil {
if err := encoder.SetURI("EmailIdentity").String(*v.EmailIdentity); err != nil {
return err
}
}
if v.PolicyName == nil || len(*v.PolicyName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member PolicyName must not be empty")}
}
if v.PolicyName != nil {
if err := encoder.SetURI("PolicyName").String(*v.PolicyName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteEmailTemplate struct {
}
func (*awsRestjson1_serializeOpDeleteEmailTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteEmailTemplate) 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.(*DeleteEmailTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/templates/{TemplateName}")
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_serializeOpHttpBindingsDeleteEmailTemplateInput(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_serializeOpHttpBindingsDeleteEmailTemplateInput(v *DeleteEmailTemplateInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TemplateName == nil || len(*v.TemplateName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member TemplateName must not be empty")}
}
if v.TemplateName != nil {
if err := encoder.SetURI("TemplateName").String(*v.TemplateName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteSuppressedDestination struct {
}
func (*awsRestjson1_serializeOpDeleteSuppressedDestination) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteSuppressedDestination) 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.(*DeleteSuppressedDestinationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/suppression/addresses/{EmailAddress}")
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_serializeOpHttpBindingsDeleteSuppressedDestinationInput(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_serializeOpHttpBindingsDeleteSuppressedDestinationInput(v *DeleteSuppressedDestinationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.EmailAddress == nil || len(*v.EmailAddress) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member EmailAddress must not be empty")}
}
if v.EmailAddress != nil {
if err := encoder.SetURI("EmailAddress").String(*v.EmailAddress); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetAccount struct {
}
func (*awsRestjson1_serializeOpGetAccount) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetAccount) 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.(*GetAccountInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/account")
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_serializeOpHttpBindingsGetAccountInput(v *GetAccountInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpGetBlacklistReports struct {
}
func (*awsRestjson1_serializeOpGetBlacklistReports) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetBlacklistReports) 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.(*GetBlacklistReportsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/deliverability-dashboard/blacklist-report")
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_serializeOpHttpBindingsGetBlacklistReportsInput(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_serializeOpHttpBindingsGetBlacklistReportsInput(v *GetBlacklistReportsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.BlacklistItemNames != nil {
for i := range v.BlacklistItemNames {
encoder.AddQuery("BlacklistItemNames").String(v.BlacklistItemNames[i])
}
}
return nil
}
type awsRestjson1_serializeOpGetConfigurationSet struct {
}
func (*awsRestjson1_serializeOpGetConfigurationSet) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetConfigurationSet) 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.(*GetConfigurationSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/configuration-sets/{ConfigurationSetName}")
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_serializeOpHttpBindingsGetConfigurationSetInput(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_serializeOpHttpBindingsGetConfigurationSetInput(v *GetConfigurationSetInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ConfigurationSetName == nil || len(*v.ConfigurationSetName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigurationSetName must not be empty")}
}
if v.ConfigurationSetName != nil {
if err := encoder.SetURI("ConfigurationSetName").String(*v.ConfigurationSetName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetConfigurationSetEventDestinations struct {
}
func (*awsRestjson1_serializeOpGetConfigurationSetEventDestinations) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetConfigurationSetEventDestinations) 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.(*GetConfigurationSetEventDestinationsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/configuration-sets/{ConfigurationSetName}/event-destinations")
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_serializeOpHttpBindingsGetConfigurationSetEventDestinationsInput(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_serializeOpHttpBindingsGetConfigurationSetEventDestinationsInput(v *GetConfigurationSetEventDestinationsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ConfigurationSetName == nil || len(*v.ConfigurationSetName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigurationSetName must not be empty")}
}
if v.ConfigurationSetName != nil {
if err := encoder.SetURI("ConfigurationSetName").String(*v.ConfigurationSetName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetContact struct {
}
func (*awsRestjson1_serializeOpGetContact) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetContact) 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.(*GetContactInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/contact-lists/{ContactListName}/contacts/{EmailAddress}")
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_serializeOpHttpBindingsGetContactInput(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_serializeOpHttpBindingsGetContactInput(v *GetContactInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ContactListName == nil || len(*v.ContactListName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ContactListName must not be empty")}
}
if v.ContactListName != nil {
if err := encoder.SetURI("ContactListName").String(*v.ContactListName); err != nil {
return err
}
}
if v.EmailAddress == nil || len(*v.EmailAddress) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member EmailAddress must not be empty")}
}
if v.EmailAddress != nil {
if err := encoder.SetURI("EmailAddress").String(*v.EmailAddress); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetContactList struct {
}
func (*awsRestjson1_serializeOpGetContactList) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetContactList) 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.(*GetContactListInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/contact-lists/{ContactListName}")
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_serializeOpHttpBindingsGetContactListInput(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_serializeOpHttpBindingsGetContactListInput(v *GetContactListInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ContactListName == nil || len(*v.ContactListName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ContactListName must not be empty")}
}
if v.ContactListName != nil {
if err := encoder.SetURI("ContactListName").String(*v.ContactListName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetCustomVerificationEmailTemplate struct {
}
func (*awsRestjson1_serializeOpGetCustomVerificationEmailTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetCustomVerificationEmailTemplate) 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.(*GetCustomVerificationEmailTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/custom-verification-email-templates/{TemplateName}")
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_serializeOpHttpBindingsGetCustomVerificationEmailTemplateInput(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_serializeOpHttpBindingsGetCustomVerificationEmailTemplateInput(v *GetCustomVerificationEmailTemplateInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TemplateName == nil || len(*v.TemplateName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member TemplateName must not be empty")}
}
if v.TemplateName != nil {
if err := encoder.SetURI("TemplateName").String(*v.TemplateName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetDedicatedIp struct {
}
func (*awsRestjson1_serializeOpGetDedicatedIp) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetDedicatedIp) 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.(*GetDedicatedIpInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/dedicated-ips/{Ip}")
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_serializeOpHttpBindingsGetDedicatedIpInput(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_serializeOpHttpBindingsGetDedicatedIpInput(v *GetDedicatedIpInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Ip == nil || len(*v.Ip) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Ip must not be empty")}
}
if v.Ip != nil {
if err := encoder.SetURI("Ip").String(*v.Ip); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetDedicatedIpPool struct {
}
func (*awsRestjson1_serializeOpGetDedicatedIpPool) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetDedicatedIpPool) 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.(*GetDedicatedIpPoolInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/dedicated-ip-pools/{PoolName}")
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_serializeOpHttpBindingsGetDedicatedIpPoolInput(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_serializeOpHttpBindingsGetDedicatedIpPoolInput(v *GetDedicatedIpPoolInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.PoolName == nil || len(*v.PoolName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member PoolName must not be empty")}
}
if v.PoolName != nil {
if err := encoder.SetURI("PoolName").String(*v.PoolName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetDedicatedIps struct {
}
func (*awsRestjson1_serializeOpGetDedicatedIps) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetDedicatedIps) 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.(*GetDedicatedIpsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/dedicated-ips")
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_serializeOpHttpBindingsGetDedicatedIpsInput(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_serializeOpHttpBindingsGetDedicatedIpsInput(v *GetDedicatedIpsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.NextToken != nil {
encoder.SetQuery("NextToken").String(*v.NextToken)
}
if v.PageSize != nil {
encoder.SetQuery("PageSize").Integer(*v.PageSize)
}
if v.PoolName != nil {
encoder.SetQuery("PoolName").String(*v.PoolName)
}
return nil
}
type awsRestjson1_serializeOpGetDeliverabilityDashboardOptions struct {
}
func (*awsRestjson1_serializeOpGetDeliverabilityDashboardOptions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetDeliverabilityDashboardOptions) 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.(*GetDeliverabilityDashboardOptionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/deliverability-dashboard")
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_serializeOpHttpBindingsGetDeliverabilityDashboardOptionsInput(v *GetDeliverabilityDashboardOptionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpGetDeliverabilityTestReport struct {
}
func (*awsRestjson1_serializeOpGetDeliverabilityTestReport) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetDeliverabilityTestReport) 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.(*GetDeliverabilityTestReportInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/deliverability-dashboard/test-reports/{ReportId}")
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_serializeOpHttpBindingsGetDeliverabilityTestReportInput(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_serializeOpHttpBindingsGetDeliverabilityTestReportInput(v *GetDeliverabilityTestReportInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ReportId == nil || len(*v.ReportId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ReportId must not be empty")}
}
if v.ReportId != nil {
if err := encoder.SetURI("ReportId").String(*v.ReportId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetDomainDeliverabilityCampaign struct {
}
func (*awsRestjson1_serializeOpGetDomainDeliverabilityCampaign) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetDomainDeliverabilityCampaign) 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.(*GetDomainDeliverabilityCampaignInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/deliverability-dashboard/campaigns/{CampaignId}")
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_serializeOpHttpBindingsGetDomainDeliverabilityCampaignInput(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_serializeOpHttpBindingsGetDomainDeliverabilityCampaignInput(v *GetDomainDeliverabilityCampaignInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.CampaignId == nil || len(*v.CampaignId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member CampaignId must not be empty")}
}
if v.CampaignId != nil {
if err := encoder.SetURI("CampaignId").String(*v.CampaignId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetDomainStatisticsReport struct {
}
func (*awsRestjson1_serializeOpGetDomainStatisticsReport) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetDomainStatisticsReport) 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.(*GetDomainStatisticsReportInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/deliverability-dashboard/statistics-report/{Domain}")
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_serializeOpHttpBindingsGetDomainStatisticsReportInput(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_serializeOpHttpBindingsGetDomainStatisticsReportInput(v *GetDomainStatisticsReportInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Domain == nil || len(*v.Domain) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Domain must not be empty")}
}
if v.Domain != nil {
if err := encoder.SetURI("Domain").String(*v.Domain); err != nil {
return err
}
}
if v.EndDate != nil {
encoder.SetQuery("EndDate").String(smithytime.FormatDateTime(*v.EndDate))
}
if v.StartDate != nil {
encoder.SetQuery("StartDate").String(smithytime.FormatDateTime(*v.StartDate))
}
return nil
}
type awsRestjson1_serializeOpGetEmailIdentity struct {
}
func (*awsRestjson1_serializeOpGetEmailIdentity) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetEmailIdentity) 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.(*GetEmailIdentityInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/identities/{EmailIdentity}")
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_serializeOpHttpBindingsGetEmailIdentityInput(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_serializeOpHttpBindingsGetEmailIdentityInput(v *GetEmailIdentityInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.EmailIdentity == nil || len(*v.EmailIdentity) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member EmailIdentity must not be empty")}
}
if v.EmailIdentity != nil {
if err := encoder.SetURI("EmailIdentity").String(*v.EmailIdentity); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetEmailIdentityPolicies struct {
}
func (*awsRestjson1_serializeOpGetEmailIdentityPolicies) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetEmailIdentityPolicies) 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.(*GetEmailIdentityPoliciesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/identities/{EmailIdentity}/policies")
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_serializeOpHttpBindingsGetEmailIdentityPoliciesInput(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_serializeOpHttpBindingsGetEmailIdentityPoliciesInput(v *GetEmailIdentityPoliciesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.EmailIdentity == nil || len(*v.EmailIdentity) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member EmailIdentity must not be empty")}
}
if v.EmailIdentity != nil {
if err := encoder.SetURI("EmailIdentity").String(*v.EmailIdentity); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetEmailTemplate struct {
}
func (*awsRestjson1_serializeOpGetEmailTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetEmailTemplate) 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.(*GetEmailTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/templates/{TemplateName}")
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_serializeOpHttpBindingsGetEmailTemplateInput(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_serializeOpHttpBindingsGetEmailTemplateInput(v *GetEmailTemplateInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TemplateName == nil || len(*v.TemplateName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member TemplateName must not be empty")}
}
if v.TemplateName != nil {
if err := encoder.SetURI("TemplateName").String(*v.TemplateName); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetImportJob struct {
}
func (*awsRestjson1_serializeOpGetImportJob) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetImportJob) 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.(*GetImportJobInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/import-jobs/{JobId}")
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_serializeOpHttpBindingsGetImportJobInput(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_serializeOpHttpBindingsGetImportJobInput(v *GetImportJobInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.JobId == nil || len(*v.JobId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member JobId must not be empty")}
}
if v.JobId != nil {
if err := encoder.SetURI("JobId").String(*v.JobId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetSuppressedDestination struct {
}
func (*awsRestjson1_serializeOpGetSuppressedDestination) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetSuppressedDestination) 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.(*GetSuppressedDestinationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/suppression/addresses/{EmailAddress}")
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_serializeOpHttpBindingsGetSuppressedDestinationInput(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_serializeOpHttpBindingsGetSuppressedDestinationInput(v *GetSuppressedDestinationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.EmailAddress == nil || len(*v.EmailAddress) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member EmailAddress must not be empty")}
}
if v.EmailAddress != nil {
if err := encoder.SetURI("EmailAddress").String(*v.EmailAddress); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListConfigurationSets struct {
}
func (*awsRestjson1_serializeOpListConfigurationSets) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListConfigurationSets) 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.(*ListConfigurationSetsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/configuration-sets")
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_serializeOpHttpBindingsListConfigurationSetsInput(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_serializeOpHttpBindingsListConfigurationSetsInput(v *ListConfigurationSetsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.NextToken != nil {
encoder.SetQuery("NextToken").String(*v.NextToken)
}
if v.PageSize != nil {
encoder.SetQuery("PageSize").Integer(*v.PageSize)
}
return nil
}
type awsRestjson1_serializeOpListContactLists struct {
}
func (*awsRestjson1_serializeOpListContactLists) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListContactLists) 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.(*ListContactListsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/contact-lists")
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_serializeOpHttpBindingsListContactListsInput(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_serializeOpHttpBindingsListContactListsInput(v *ListContactListsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.NextToken != nil {
encoder.SetQuery("NextToken").String(*v.NextToken)
}
if v.PageSize != nil {
encoder.SetQuery("PageSize").Integer(*v.PageSize)
}
return nil
}
type awsRestjson1_serializeOpListContacts struct {
}
func (*awsRestjson1_serializeOpListContacts) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListContacts) 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.(*ListContactsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/contact-lists/{ContactListName}/contacts")
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_serializeOpHttpBindingsListContactsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListContactsInput(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_serializeOpHttpBindingsListContactsInput(v *ListContactsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ContactListName == nil || len(*v.ContactListName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ContactListName must not be empty")}
}
if v.ContactListName != nil {
if err := encoder.SetURI("ContactListName").String(*v.ContactListName); err != nil {
return err
}
}
if v.NextToken != nil {
encoder.SetQuery("NextToken").String(*v.NextToken)
}
if v.PageSize != nil {
encoder.SetQuery("PageSize").Integer(*v.PageSize)
}
return nil
}
func awsRestjson1_serializeOpDocumentListContactsInput(v *ListContactsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filter != nil {
ok := object.Key("Filter")
if err := awsRestjson1_serializeDocumentListContactsFilter(v.Filter, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListCustomVerificationEmailTemplates struct {
}
func (*awsRestjson1_serializeOpListCustomVerificationEmailTemplates) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListCustomVerificationEmailTemplates) 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.(*ListCustomVerificationEmailTemplatesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/custom-verification-email-templates")
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_serializeOpHttpBindingsListCustomVerificationEmailTemplatesInput(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_serializeOpHttpBindingsListCustomVerificationEmailTemplatesInput(v *ListCustomVerificationEmailTemplatesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.NextToken != nil {
encoder.SetQuery("NextToken").String(*v.NextToken)
}
if v.PageSize != nil {
encoder.SetQuery("PageSize").Integer(*v.PageSize)
}
return nil
}
type awsRestjson1_serializeOpListDedicatedIpPools struct {
}
func (*awsRestjson1_serializeOpListDedicatedIpPools) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListDedicatedIpPools) 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.(*ListDedicatedIpPoolsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/dedicated-ip-pools")
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_serializeOpHttpBindingsListDedicatedIpPoolsInput(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_serializeOpHttpBindingsListDedicatedIpPoolsInput(v *ListDedicatedIpPoolsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.NextToken != nil {
encoder.SetQuery("NextToken").String(*v.NextToken)
}
if v.PageSize != nil {
encoder.SetQuery("PageSize").Integer(*v.PageSize)
}
return nil
}
type awsRestjson1_serializeOpListDeliverabilityTestReports struct {
}
func (*awsRestjson1_serializeOpListDeliverabilityTestReports) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListDeliverabilityTestReports) 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.(*ListDeliverabilityTestReportsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/deliverability-dashboard/test-reports")
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_serializeOpHttpBindingsListDeliverabilityTestReportsInput(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_serializeOpHttpBindingsListDeliverabilityTestReportsInput(v *ListDeliverabilityTestReportsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.NextToken != nil {
encoder.SetQuery("NextToken").String(*v.NextToken)
}
if v.PageSize != nil {
encoder.SetQuery("PageSize").Integer(*v.PageSize)
}
return nil
}
type awsRestjson1_serializeOpListDomainDeliverabilityCampaigns struct {
}
func (*awsRestjson1_serializeOpListDomainDeliverabilityCampaigns) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListDomainDeliverabilityCampaigns) 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.(*ListDomainDeliverabilityCampaignsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/deliverability-dashboard/domains/{SubscribedDomain}/campaigns")
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_serializeOpHttpBindingsListDomainDeliverabilityCampaignsInput(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_serializeOpHttpBindingsListDomainDeliverabilityCampaignsInput(v *ListDomainDeliverabilityCampaignsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.EndDate != nil {
encoder.SetQuery("EndDate").String(smithytime.FormatDateTime(*v.EndDate))
}
if v.NextToken != nil {
encoder.SetQuery("NextToken").String(*v.NextToken)
}
if v.PageSize != nil {
encoder.SetQuery("PageSize").Integer(*v.PageSize)
}
if v.StartDate != nil {
encoder.SetQuery("StartDate").String(smithytime.FormatDateTime(*v.StartDate))
}
if v.SubscribedDomain == nil || len(*v.SubscribedDomain) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member SubscribedDomain must not be empty")}
}
if v.SubscribedDomain != nil {
if err := encoder.SetURI("SubscribedDomain").String(*v.SubscribedDomain); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListEmailIdentities struct {
}
func (*awsRestjson1_serializeOpListEmailIdentities) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListEmailIdentities) 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.(*ListEmailIdentitiesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/identities")
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_serializeOpHttpBindingsListEmailIdentitiesInput(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_serializeOpHttpBindingsListEmailIdentitiesInput(v *ListEmailIdentitiesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.NextToken != nil {
encoder.SetQuery("NextToken").String(*v.NextToken)
}
if v.PageSize != nil {
encoder.SetQuery("PageSize").Integer(*v.PageSize)
}
return nil
}
type awsRestjson1_serializeOpListEmailTemplates struct {
}
func (*awsRestjson1_serializeOpListEmailTemplates) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListEmailTemplates) 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.(*ListEmailTemplatesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/templates")
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_serializeOpHttpBindingsListEmailTemplatesInput(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_serializeOpHttpBindingsListEmailTemplatesInput(v *ListEmailTemplatesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.NextToken != nil {
encoder.SetQuery("NextToken").String(*v.NextToken)
}
if v.PageSize != nil {
encoder.SetQuery("PageSize").Integer(*v.PageSize)
}
return nil
}
type awsRestjson1_serializeOpListImportJobs struct {
}
func (*awsRestjson1_serializeOpListImportJobs) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListImportJobs) 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.(*ListImportJobsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/import-jobs")
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_serializeOpHttpBindingsListImportJobsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListImportJobsInput(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_serializeOpHttpBindingsListImportJobsInput(v *ListImportJobsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.NextToken != nil {
encoder.SetQuery("NextToken").String(*v.NextToken)
}
if v.PageSize != nil {
encoder.SetQuery("PageSize").Integer(*v.PageSize)
}
return nil
}
func awsRestjson1_serializeOpDocumentListImportJobsInput(v *ListImportJobsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.ImportDestinationType) > 0 {
ok := object.Key("ImportDestinationType")
ok.String(string(v.ImportDestinationType))
}
return nil
}
type awsRestjson1_serializeOpListRecommendations struct {
}
func (*awsRestjson1_serializeOpListRecommendations) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListRecommendations) 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.(*ListRecommendationsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/vdm/recommendations")
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_serializeOpDocumentListRecommendationsInput(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_serializeOpHttpBindingsListRecommendationsInput(v *ListRecommendationsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListRecommendationsInput(v *ListRecommendationsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Filter != nil {
ok := object.Key("Filter")
if err := awsRestjson1_serializeDocumentListRecommendationsFilter(v.Filter, ok); err != nil {
return err
}
}
if v.NextToken != nil {
ok := object.Key("NextToken")
ok.String(*v.NextToken)
}
if v.PageSize != nil {
ok := object.Key("PageSize")
ok.Integer(*v.PageSize)
}
return nil
}
type awsRestjson1_serializeOpListSuppressedDestinations struct {
}
func (*awsRestjson1_serializeOpListSuppressedDestinations) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListSuppressedDestinations) 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.(*ListSuppressedDestinationsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/suppression/addresses")
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_serializeOpHttpBindingsListSuppressedDestinationsInput(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_serializeOpHttpBindingsListSuppressedDestinationsInput(v *ListSuppressedDestinationsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.EndDate != nil {
encoder.SetQuery("EndDate").String(smithytime.FormatDateTime(*v.EndDate))
}
if v.NextToken != nil {
encoder.SetQuery("NextToken").String(*v.NextToken)
}
if v.PageSize != nil {
encoder.SetQuery("PageSize").Integer(*v.PageSize)
}
if v.Reasons != nil {
for i := range v.Reasons {
encoder.AddQuery("Reason").String(string(v.Reasons[i]))
}
}
if v.StartDate != nil {
encoder.SetQuery("StartDate").String(smithytime.FormatDateTime(*v.StartDate))
}
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("/v2/email/tags")
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 {
encoder.SetQuery("ResourceArn").String(*v.ResourceArn)
}
return nil
}
type awsRestjson1_serializeOpPutAccountDedicatedIpWarmupAttributes struct {
}
func (*awsRestjson1_serializeOpPutAccountDedicatedIpWarmupAttributes) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutAccountDedicatedIpWarmupAttributes) 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.(*PutAccountDedicatedIpWarmupAttributesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/account/dedicated-ips/warmup")
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}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutAccountDedicatedIpWarmupAttributesInput(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_serializeOpHttpBindingsPutAccountDedicatedIpWarmupAttributesInput(v *PutAccountDedicatedIpWarmupAttributesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentPutAccountDedicatedIpWarmupAttributesInput(v *PutAccountDedicatedIpWarmupAttributesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AutoWarmupEnabled {
ok := object.Key("AutoWarmupEnabled")
ok.Boolean(v.AutoWarmupEnabled)
}
return nil
}
type awsRestjson1_serializeOpPutAccountDetails struct {
}
func (*awsRestjson1_serializeOpPutAccountDetails) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutAccountDetails) 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.(*PutAccountDetailsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/account/details")
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_serializeOpDocumentPutAccountDetailsInput(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_serializeOpHttpBindingsPutAccountDetailsInput(v *PutAccountDetailsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentPutAccountDetailsInput(v *PutAccountDetailsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AdditionalContactEmailAddresses != nil {
ok := object.Key("AdditionalContactEmailAddresses")
if err := awsRestjson1_serializeDocumentAdditionalContactEmailAddresses(v.AdditionalContactEmailAddresses, ok); err != nil {
return err
}
}
if len(v.ContactLanguage) > 0 {
ok := object.Key("ContactLanguage")
ok.String(string(v.ContactLanguage))
}
if len(v.MailType) > 0 {
ok := object.Key("MailType")
ok.String(string(v.MailType))
}
if v.ProductionAccessEnabled != nil {
ok := object.Key("ProductionAccessEnabled")
ok.Boolean(*v.ProductionAccessEnabled)
}
if v.UseCaseDescription != nil {
ok := object.Key("UseCaseDescription")
ok.String(*v.UseCaseDescription)
}
if v.WebsiteURL != nil {
ok := object.Key("WebsiteURL")
ok.String(*v.WebsiteURL)
}
return nil
}
type awsRestjson1_serializeOpPutAccountSendingAttributes struct {
}
func (*awsRestjson1_serializeOpPutAccountSendingAttributes) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutAccountSendingAttributes) 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.(*PutAccountSendingAttributesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/account/sending")
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}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutAccountSendingAttributesInput(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_serializeOpHttpBindingsPutAccountSendingAttributesInput(v *PutAccountSendingAttributesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentPutAccountSendingAttributesInput(v *PutAccountSendingAttributesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SendingEnabled {
ok := object.Key("SendingEnabled")
ok.Boolean(v.SendingEnabled)
}
return nil
}
type awsRestjson1_serializeOpPutAccountSuppressionAttributes struct {
}
func (*awsRestjson1_serializeOpPutAccountSuppressionAttributes) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutAccountSuppressionAttributes) 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.(*PutAccountSuppressionAttributesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/account/suppression")
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}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutAccountSuppressionAttributesInput(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_serializeOpHttpBindingsPutAccountSuppressionAttributesInput(v *PutAccountSuppressionAttributesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentPutAccountSuppressionAttributesInput(v *PutAccountSuppressionAttributesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SuppressedReasons != nil {
ok := object.Key("SuppressedReasons")
if err := awsRestjson1_serializeDocumentSuppressionListReasons(v.SuppressedReasons, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpPutAccountVdmAttributes struct {
}
func (*awsRestjson1_serializeOpPutAccountVdmAttributes) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutAccountVdmAttributes) 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.(*PutAccountVdmAttributesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/account/vdm")
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}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutAccountVdmAttributesInput(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_serializeOpHttpBindingsPutAccountVdmAttributesInput(v *PutAccountVdmAttributesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentPutAccountVdmAttributesInput(v *PutAccountVdmAttributesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.VdmAttributes != nil {
ok := object.Key("VdmAttributes")
if err := awsRestjson1_serializeDocumentVdmAttributes(v.VdmAttributes, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpPutConfigurationSetDeliveryOptions struct {
}
func (*awsRestjson1_serializeOpPutConfigurationSetDeliveryOptions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutConfigurationSetDeliveryOptions) 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.(*PutConfigurationSetDeliveryOptionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/configuration-sets/{ConfigurationSetName}/delivery-options")
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_serializeOpHttpBindingsPutConfigurationSetDeliveryOptionsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutConfigurationSetDeliveryOptionsInput(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_serializeOpHttpBindingsPutConfigurationSetDeliveryOptionsInput(v *PutConfigurationSetDeliveryOptionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ConfigurationSetName == nil || len(*v.ConfigurationSetName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigurationSetName must not be empty")}
}
if v.ConfigurationSetName != nil {
if err := encoder.SetURI("ConfigurationSetName").String(*v.ConfigurationSetName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentPutConfigurationSetDeliveryOptionsInput(v *PutConfigurationSetDeliveryOptionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SendingPoolName != nil {
ok := object.Key("SendingPoolName")
ok.String(*v.SendingPoolName)
}
if len(v.TlsPolicy) > 0 {
ok := object.Key("TlsPolicy")
ok.String(string(v.TlsPolicy))
}
return nil
}
type awsRestjson1_serializeOpPutConfigurationSetReputationOptions struct {
}
func (*awsRestjson1_serializeOpPutConfigurationSetReputationOptions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutConfigurationSetReputationOptions) 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.(*PutConfigurationSetReputationOptionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/configuration-sets/{ConfigurationSetName}/reputation-options")
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_serializeOpHttpBindingsPutConfigurationSetReputationOptionsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutConfigurationSetReputationOptionsInput(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_serializeOpHttpBindingsPutConfigurationSetReputationOptionsInput(v *PutConfigurationSetReputationOptionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ConfigurationSetName == nil || len(*v.ConfigurationSetName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigurationSetName must not be empty")}
}
if v.ConfigurationSetName != nil {
if err := encoder.SetURI("ConfigurationSetName").String(*v.ConfigurationSetName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentPutConfigurationSetReputationOptionsInput(v *PutConfigurationSetReputationOptionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ReputationMetricsEnabled {
ok := object.Key("ReputationMetricsEnabled")
ok.Boolean(v.ReputationMetricsEnabled)
}
return nil
}
type awsRestjson1_serializeOpPutConfigurationSetSendingOptions struct {
}
func (*awsRestjson1_serializeOpPutConfigurationSetSendingOptions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutConfigurationSetSendingOptions) 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.(*PutConfigurationSetSendingOptionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/configuration-sets/{ConfigurationSetName}/sending")
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_serializeOpHttpBindingsPutConfigurationSetSendingOptionsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutConfigurationSetSendingOptionsInput(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_serializeOpHttpBindingsPutConfigurationSetSendingOptionsInput(v *PutConfigurationSetSendingOptionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ConfigurationSetName == nil || len(*v.ConfigurationSetName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigurationSetName must not be empty")}
}
if v.ConfigurationSetName != nil {
if err := encoder.SetURI("ConfigurationSetName").String(*v.ConfigurationSetName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentPutConfigurationSetSendingOptionsInput(v *PutConfigurationSetSendingOptionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SendingEnabled {
ok := object.Key("SendingEnabled")
ok.Boolean(v.SendingEnabled)
}
return nil
}
type awsRestjson1_serializeOpPutConfigurationSetSuppressionOptions struct {
}
func (*awsRestjson1_serializeOpPutConfigurationSetSuppressionOptions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutConfigurationSetSuppressionOptions) 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.(*PutConfigurationSetSuppressionOptionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/configuration-sets/{ConfigurationSetName}/suppression-options")
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_serializeOpHttpBindingsPutConfigurationSetSuppressionOptionsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutConfigurationSetSuppressionOptionsInput(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_serializeOpHttpBindingsPutConfigurationSetSuppressionOptionsInput(v *PutConfigurationSetSuppressionOptionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ConfigurationSetName == nil || len(*v.ConfigurationSetName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigurationSetName must not be empty")}
}
if v.ConfigurationSetName != nil {
if err := encoder.SetURI("ConfigurationSetName").String(*v.ConfigurationSetName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentPutConfigurationSetSuppressionOptionsInput(v *PutConfigurationSetSuppressionOptionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SuppressedReasons != nil {
ok := object.Key("SuppressedReasons")
if err := awsRestjson1_serializeDocumentSuppressionListReasons(v.SuppressedReasons, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpPutConfigurationSetTrackingOptions struct {
}
func (*awsRestjson1_serializeOpPutConfigurationSetTrackingOptions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutConfigurationSetTrackingOptions) 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.(*PutConfigurationSetTrackingOptionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/configuration-sets/{ConfigurationSetName}/tracking-options")
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_serializeOpHttpBindingsPutConfigurationSetTrackingOptionsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutConfigurationSetTrackingOptionsInput(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_serializeOpHttpBindingsPutConfigurationSetTrackingOptionsInput(v *PutConfigurationSetTrackingOptionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ConfigurationSetName == nil || len(*v.ConfigurationSetName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigurationSetName must not be empty")}
}
if v.ConfigurationSetName != nil {
if err := encoder.SetURI("ConfigurationSetName").String(*v.ConfigurationSetName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentPutConfigurationSetTrackingOptionsInput(v *PutConfigurationSetTrackingOptionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CustomRedirectDomain != nil {
ok := object.Key("CustomRedirectDomain")
ok.String(*v.CustomRedirectDomain)
}
return nil
}
type awsRestjson1_serializeOpPutConfigurationSetVdmOptions struct {
}
func (*awsRestjson1_serializeOpPutConfigurationSetVdmOptions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutConfigurationSetVdmOptions) 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.(*PutConfigurationSetVdmOptionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/configuration-sets/{ConfigurationSetName}/vdm-options")
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_serializeOpHttpBindingsPutConfigurationSetVdmOptionsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutConfigurationSetVdmOptionsInput(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_serializeOpHttpBindingsPutConfigurationSetVdmOptionsInput(v *PutConfigurationSetVdmOptionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ConfigurationSetName == nil || len(*v.ConfigurationSetName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigurationSetName must not be empty")}
}
if v.ConfigurationSetName != nil {
if err := encoder.SetURI("ConfigurationSetName").String(*v.ConfigurationSetName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentPutConfigurationSetVdmOptionsInput(v *PutConfigurationSetVdmOptionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.VdmOptions != nil {
ok := object.Key("VdmOptions")
if err := awsRestjson1_serializeDocumentVdmOptions(v.VdmOptions, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpPutDedicatedIpInPool struct {
}
func (*awsRestjson1_serializeOpPutDedicatedIpInPool) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutDedicatedIpInPool) 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.(*PutDedicatedIpInPoolInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/dedicated-ips/{Ip}/pool")
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_serializeOpHttpBindingsPutDedicatedIpInPoolInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutDedicatedIpInPoolInput(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_serializeOpHttpBindingsPutDedicatedIpInPoolInput(v *PutDedicatedIpInPoolInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Ip == nil || len(*v.Ip) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Ip must not be empty")}
}
if v.Ip != nil {
if err := encoder.SetURI("Ip").String(*v.Ip); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentPutDedicatedIpInPoolInput(v *PutDedicatedIpInPoolInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DestinationPoolName != nil {
ok := object.Key("DestinationPoolName")
ok.String(*v.DestinationPoolName)
}
return nil
}
type awsRestjson1_serializeOpPutDedicatedIpPoolScalingAttributes struct {
}
func (*awsRestjson1_serializeOpPutDedicatedIpPoolScalingAttributes) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutDedicatedIpPoolScalingAttributes) 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.(*PutDedicatedIpPoolScalingAttributesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/dedicated-ip-pools/{PoolName}/scaling")
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_serializeOpHttpBindingsPutDedicatedIpPoolScalingAttributesInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutDedicatedIpPoolScalingAttributesInput(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_serializeOpHttpBindingsPutDedicatedIpPoolScalingAttributesInput(v *PutDedicatedIpPoolScalingAttributesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.PoolName == nil || len(*v.PoolName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member PoolName must not be empty")}
}
if v.PoolName != nil {
if err := encoder.SetURI("PoolName").String(*v.PoolName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentPutDedicatedIpPoolScalingAttributesInput(v *PutDedicatedIpPoolScalingAttributesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.ScalingMode) > 0 {
ok := object.Key("ScalingMode")
ok.String(string(v.ScalingMode))
}
return nil
}
type awsRestjson1_serializeOpPutDedicatedIpWarmupAttributes struct {
}
func (*awsRestjson1_serializeOpPutDedicatedIpWarmupAttributes) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutDedicatedIpWarmupAttributes) 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.(*PutDedicatedIpWarmupAttributesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/dedicated-ips/{Ip}/warmup")
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_serializeOpHttpBindingsPutDedicatedIpWarmupAttributesInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutDedicatedIpWarmupAttributesInput(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_serializeOpHttpBindingsPutDedicatedIpWarmupAttributesInput(v *PutDedicatedIpWarmupAttributesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Ip == nil || len(*v.Ip) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member Ip must not be empty")}
}
if v.Ip != nil {
if err := encoder.SetURI("Ip").String(*v.Ip); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentPutDedicatedIpWarmupAttributesInput(v *PutDedicatedIpWarmupAttributesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.WarmupPercentage != nil {
ok := object.Key("WarmupPercentage")
ok.Integer(*v.WarmupPercentage)
}
return nil
}
type awsRestjson1_serializeOpPutDeliverabilityDashboardOption struct {
}
func (*awsRestjson1_serializeOpPutDeliverabilityDashboardOption) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutDeliverabilityDashboardOption) 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.(*PutDeliverabilityDashboardOptionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/deliverability-dashboard")
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}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutDeliverabilityDashboardOptionInput(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_serializeOpHttpBindingsPutDeliverabilityDashboardOptionInput(v *PutDeliverabilityDashboardOptionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentPutDeliverabilityDashboardOptionInput(v *PutDeliverabilityDashboardOptionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
{
ok := object.Key("DashboardEnabled")
ok.Boolean(v.DashboardEnabled)
}
if v.SubscribedDomains != nil {
ok := object.Key("SubscribedDomains")
if err := awsRestjson1_serializeDocumentDomainDeliverabilityTrackingOptions(v.SubscribedDomains, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpPutEmailIdentityConfigurationSetAttributes struct {
}
func (*awsRestjson1_serializeOpPutEmailIdentityConfigurationSetAttributes) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutEmailIdentityConfigurationSetAttributes) 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.(*PutEmailIdentityConfigurationSetAttributesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/identities/{EmailIdentity}/configuration-set")
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_serializeOpHttpBindingsPutEmailIdentityConfigurationSetAttributesInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutEmailIdentityConfigurationSetAttributesInput(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_serializeOpHttpBindingsPutEmailIdentityConfigurationSetAttributesInput(v *PutEmailIdentityConfigurationSetAttributesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.EmailIdentity == nil || len(*v.EmailIdentity) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member EmailIdentity must not be empty")}
}
if v.EmailIdentity != nil {
if err := encoder.SetURI("EmailIdentity").String(*v.EmailIdentity); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentPutEmailIdentityConfigurationSetAttributesInput(v *PutEmailIdentityConfigurationSetAttributesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ConfigurationSetName != nil {
ok := object.Key("ConfigurationSetName")
ok.String(*v.ConfigurationSetName)
}
return nil
}
type awsRestjson1_serializeOpPutEmailIdentityDkimAttributes struct {
}
func (*awsRestjson1_serializeOpPutEmailIdentityDkimAttributes) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutEmailIdentityDkimAttributes) 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.(*PutEmailIdentityDkimAttributesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/identities/{EmailIdentity}/dkim")
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_serializeOpHttpBindingsPutEmailIdentityDkimAttributesInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutEmailIdentityDkimAttributesInput(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_serializeOpHttpBindingsPutEmailIdentityDkimAttributesInput(v *PutEmailIdentityDkimAttributesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.EmailIdentity == nil || len(*v.EmailIdentity) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member EmailIdentity must not be empty")}
}
if v.EmailIdentity != nil {
if err := encoder.SetURI("EmailIdentity").String(*v.EmailIdentity); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentPutEmailIdentityDkimAttributesInput(v *PutEmailIdentityDkimAttributesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SigningEnabled {
ok := object.Key("SigningEnabled")
ok.Boolean(v.SigningEnabled)
}
return nil
}
type awsRestjson1_serializeOpPutEmailIdentityDkimSigningAttributes struct {
}
func (*awsRestjson1_serializeOpPutEmailIdentityDkimSigningAttributes) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutEmailIdentityDkimSigningAttributes) 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.(*PutEmailIdentityDkimSigningAttributesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/email/identities/{EmailIdentity}/dkim/signing")
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_serializeOpHttpBindingsPutEmailIdentityDkimSigningAttributesInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutEmailIdentityDkimSigningAttributesInput(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_serializeOpHttpBindingsPutEmailIdentityDkimSigningAttributesInput(v *PutEmailIdentityDkimSigningAttributesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.EmailIdentity == nil || len(*v.EmailIdentity) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member EmailIdentity must not be empty")}
}
if v.EmailIdentity != nil {
if err := encoder.SetURI("EmailIdentity").String(*v.EmailIdentity); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentPutEmailIdentityDkimSigningAttributesInput(v *PutEmailIdentityDkimSigningAttributesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SigningAttributes != nil {
ok := object.Key("SigningAttributes")
if err := awsRestjson1_serializeDocumentDkimSigningAttributes(v.SigningAttributes, ok); err != nil {
return err
}
}
if len(v.SigningAttributesOrigin) > 0 {
ok := object.Key("SigningAttributesOrigin")
ok.String(string(v.SigningAttributesOrigin))
}
return nil
}
type awsRestjson1_serializeOpPutEmailIdentityFeedbackAttributes struct {
}
func (*awsRestjson1_serializeOpPutEmailIdentityFeedbackAttributes) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutEmailIdentityFeedbackAttributes) 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.(*PutEmailIdentityFeedbackAttributesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/identities/{EmailIdentity}/feedback")
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_serializeOpHttpBindingsPutEmailIdentityFeedbackAttributesInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutEmailIdentityFeedbackAttributesInput(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_serializeOpHttpBindingsPutEmailIdentityFeedbackAttributesInput(v *PutEmailIdentityFeedbackAttributesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.EmailIdentity == nil || len(*v.EmailIdentity) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member EmailIdentity must not be empty")}
}
if v.EmailIdentity != nil {
if err := encoder.SetURI("EmailIdentity").String(*v.EmailIdentity); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentPutEmailIdentityFeedbackAttributesInput(v *PutEmailIdentityFeedbackAttributesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EmailForwardingEnabled {
ok := object.Key("EmailForwardingEnabled")
ok.Boolean(v.EmailForwardingEnabled)
}
return nil
}
type awsRestjson1_serializeOpPutEmailIdentityMailFromAttributes struct {
}
func (*awsRestjson1_serializeOpPutEmailIdentityMailFromAttributes) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutEmailIdentityMailFromAttributes) 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.(*PutEmailIdentityMailFromAttributesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/identities/{EmailIdentity}/mail-from")
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_serializeOpHttpBindingsPutEmailIdentityMailFromAttributesInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutEmailIdentityMailFromAttributesInput(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_serializeOpHttpBindingsPutEmailIdentityMailFromAttributesInput(v *PutEmailIdentityMailFromAttributesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.EmailIdentity == nil || len(*v.EmailIdentity) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member EmailIdentity must not be empty")}
}
if v.EmailIdentity != nil {
if err := encoder.SetURI("EmailIdentity").String(*v.EmailIdentity); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentPutEmailIdentityMailFromAttributesInput(v *PutEmailIdentityMailFromAttributesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.BehaviorOnMxFailure) > 0 {
ok := object.Key("BehaviorOnMxFailure")
ok.String(string(v.BehaviorOnMxFailure))
}
if v.MailFromDomain != nil {
ok := object.Key("MailFromDomain")
ok.String(*v.MailFromDomain)
}
return nil
}
type awsRestjson1_serializeOpPutSuppressedDestination struct {
}
func (*awsRestjson1_serializeOpPutSuppressedDestination) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutSuppressedDestination) 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.(*PutSuppressedDestinationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/suppression/addresses")
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}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutSuppressedDestinationInput(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_serializeOpHttpBindingsPutSuppressedDestinationInput(v *PutSuppressedDestinationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentPutSuppressedDestinationInput(v *PutSuppressedDestinationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EmailAddress != nil {
ok := object.Key("EmailAddress")
ok.String(*v.EmailAddress)
}
if len(v.Reason) > 0 {
ok := object.Key("Reason")
ok.String(string(v.Reason))
}
return nil
}
type awsRestjson1_serializeOpSendBulkEmail struct {
}
func (*awsRestjson1_serializeOpSendBulkEmail) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpSendBulkEmail) 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.(*SendBulkEmailInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/outbound-bulk-emails")
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_serializeOpDocumentSendBulkEmailInput(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_serializeOpHttpBindingsSendBulkEmailInput(v *SendBulkEmailInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentSendBulkEmailInput(v *SendBulkEmailInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BulkEmailEntries != nil {
ok := object.Key("BulkEmailEntries")
if err := awsRestjson1_serializeDocumentBulkEmailEntryList(v.BulkEmailEntries, ok); err != nil {
return err
}
}
if v.ConfigurationSetName != nil {
ok := object.Key("ConfigurationSetName")
ok.String(*v.ConfigurationSetName)
}
if v.DefaultContent != nil {
ok := object.Key("DefaultContent")
if err := awsRestjson1_serializeDocumentBulkEmailContent(v.DefaultContent, ok); err != nil {
return err
}
}
if v.DefaultEmailTags != nil {
ok := object.Key("DefaultEmailTags")
if err := awsRestjson1_serializeDocumentMessageTagList(v.DefaultEmailTags, ok); err != nil {
return err
}
}
if v.FeedbackForwardingEmailAddress != nil {
ok := object.Key("FeedbackForwardingEmailAddress")
ok.String(*v.FeedbackForwardingEmailAddress)
}
if v.FeedbackForwardingEmailAddressIdentityArn != nil {
ok := object.Key("FeedbackForwardingEmailAddressIdentityArn")
ok.String(*v.FeedbackForwardingEmailAddressIdentityArn)
}
if v.FromEmailAddress != nil {
ok := object.Key("FromEmailAddress")
ok.String(*v.FromEmailAddress)
}
if v.FromEmailAddressIdentityArn != nil {
ok := object.Key("FromEmailAddressIdentityArn")
ok.String(*v.FromEmailAddressIdentityArn)
}
if v.ReplyToAddresses != nil {
ok := object.Key("ReplyToAddresses")
if err := awsRestjson1_serializeDocumentEmailAddressList(v.ReplyToAddresses, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpSendCustomVerificationEmail struct {
}
func (*awsRestjson1_serializeOpSendCustomVerificationEmail) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpSendCustomVerificationEmail) 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.(*SendCustomVerificationEmailInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/outbound-custom-verification-emails")
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_serializeOpDocumentSendCustomVerificationEmailInput(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_serializeOpHttpBindingsSendCustomVerificationEmailInput(v *SendCustomVerificationEmailInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentSendCustomVerificationEmailInput(v *SendCustomVerificationEmailInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ConfigurationSetName != nil {
ok := object.Key("ConfigurationSetName")
ok.String(*v.ConfigurationSetName)
}
if v.EmailAddress != nil {
ok := object.Key("EmailAddress")
ok.String(*v.EmailAddress)
}
if v.TemplateName != nil {
ok := object.Key("TemplateName")
ok.String(*v.TemplateName)
}
return nil
}
type awsRestjson1_serializeOpSendEmail struct {
}
func (*awsRestjson1_serializeOpSendEmail) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpSendEmail) 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.(*SendEmailInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/outbound-emails")
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_serializeOpDocumentSendEmailInput(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_serializeOpHttpBindingsSendEmailInput(v *SendEmailInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentSendEmailInput(v *SendEmailInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ConfigurationSetName != nil {
ok := object.Key("ConfigurationSetName")
ok.String(*v.ConfigurationSetName)
}
if v.Content != nil {
ok := object.Key("Content")
if err := awsRestjson1_serializeDocumentEmailContent(v.Content, ok); err != nil {
return err
}
}
if v.Destination != nil {
ok := object.Key("Destination")
if err := awsRestjson1_serializeDocumentDestination(v.Destination, ok); err != nil {
return err
}
}
if v.EmailTags != nil {
ok := object.Key("EmailTags")
if err := awsRestjson1_serializeDocumentMessageTagList(v.EmailTags, ok); err != nil {
return err
}
}
if v.FeedbackForwardingEmailAddress != nil {
ok := object.Key("FeedbackForwardingEmailAddress")
ok.String(*v.FeedbackForwardingEmailAddress)
}
if v.FeedbackForwardingEmailAddressIdentityArn != nil {
ok := object.Key("FeedbackForwardingEmailAddressIdentityArn")
ok.String(*v.FeedbackForwardingEmailAddressIdentityArn)
}
if v.FromEmailAddress != nil {
ok := object.Key("FromEmailAddress")
ok.String(*v.FromEmailAddress)
}
if v.FromEmailAddressIdentityArn != nil {
ok := object.Key("FromEmailAddressIdentityArn")
ok.String(*v.FromEmailAddressIdentityArn)
}
if v.ListManagementOptions != nil {
ok := object.Key("ListManagementOptions")
if err := awsRestjson1_serializeDocumentListManagementOptions(v.ListManagementOptions, ok); err != nil {
return err
}
}
if v.ReplyToAddresses != nil {
ok := object.Key("ReplyToAddresses")
if err := awsRestjson1_serializeDocumentEmailAddressList(v.ReplyToAddresses, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpTagResource struct {
}
func (*awsRestjson1_serializeOpTagResource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*TagResourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/tags")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_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)
}
return nil
}
func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ResourceArn != nil {
ok := object.Key("ResourceArn")
ok.String(*v.ResourceArn)
}
if v.Tags != nil {
ok := object.Key("Tags")
if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpTestRenderEmailTemplate struct {
}
func (*awsRestjson1_serializeOpTestRenderEmailTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpTestRenderEmailTemplate) 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.(*TestRenderEmailTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/templates/{TemplateName}/render")
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_serializeOpHttpBindingsTestRenderEmailTemplateInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentTestRenderEmailTemplateInput(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_serializeOpHttpBindingsTestRenderEmailTemplateInput(v *TestRenderEmailTemplateInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TemplateName == nil || len(*v.TemplateName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member TemplateName must not be empty")}
}
if v.TemplateName != nil {
if err := encoder.SetURI("TemplateName").String(*v.TemplateName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentTestRenderEmailTemplateInput(v *TestRenderEmailTemplateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.TemplateData != nil {
ok := object.Key("TemplateData")
ok.String(*v.TemplateData)
}
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("/v2/email/tags")
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 {
encoder.SetQuery("ResourceArn").String(*v.ResourceArn)
}
if v.TagKeys != nil {
for i := range v.TagKeys {
encoder.AddQuery("TagKeys").String(v.TagKeys[i])
}
}
return nil
}
type awsRestjson1_serializeOpUpdateConfigurationSetEventDestination struct {
}
func (*awsRestjson1_serializeOpUpdateConfigurationSetEventDestination) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateConfigurationSetEventDestination) 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.(*UpdateConfigurationSetEventDestinationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/configuration-sets/{ConfigurationSetName}/event-destinations/{EventDestinationName}")
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_serializeOpHttpBindingsUpdateConfigurationSetEventDestinationInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateConfigurationSetEventDestinationInput(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_serializeOpHttpBindingsUpdateConfigurationSetEventDestinationInput(v *UpdateConfigurationSetEventDestinationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ConfigurationSetName == nil || len(*v.ConfigurationSetName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigurationSetName must not be empty")}
}
if v.ConfigurationSetName != nil {
if err := encoder.SetURI("ConfigurationSetName").String(*v.ConfigurationSetName); err != nil {
return err
}
}
if v.EventDestinationName == nil || len(*v.EventDestinationName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member EventDestinationName must not be empty")}
}
if v.EventDestinationName != nil {
if err := encoder.SetURI("EventDestinationName").String(*v.EventDestinationName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateConfigurationSetEventDestinationInput(v *UpdateConfigurationSetEventDestinationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EventDestination != nil {
ok := object.Key("EventDestination")
if err := awsRestjson1_serializeDocumentEventDestinationDefinition(v.EventDestination, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpUpdateContact struct {
}
func (*awsRestjson1_serializeOpUpdateContact) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateContact) 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.(*UpdateContactInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/contact-lists/{ContactListName}/contacts/{EmailAddress}")
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_serializeOpHttpBindingsUpdateContactInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateContactInput(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_serializeOpHttpBindingsUpdateContactInput(v *UpdateContactInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ContactListName == nil || len(*v.ContactListName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ContactListName must not be empty")}
}
if v.ContactListName != nil {
if err := encoder.SetURI("ContactListName").String(*v.ContactListName); err != nil {
return err
}
}
if v.EmailAddress == nil || len(*v.EmailAddress) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member EmailAddress must not be empty")}
}
if v.EmailAddress != nil {
if err := encoder.SetURI("EmailAddress").String(*v.EmailAddress); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateContactInput(v *UpdateContactInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AttributesData != nil {
ok := object.Key("AttributesData")
ok.String(*v.AttributesData)
}
if v.TopicPreferences != nil {
ok := object.Key("TopicPreferences")
if err := awsRestjson1_serializeDocumentTopicPreferenceList(v.TopicPreferences, ok); err != nil {
return err
}
}
if v.UnsubscribeAll {
ok := object.Key("UnsubscribeAll")
ok.Boolean(v.UnsubscribeAll)
}
return nil
}
type awsRestjson1_serializeOpUpdateContactList struct {
}
func (*awsRestjson1_serializeOpUpdateContactList) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateContactList) 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.(*UpdateContactListInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/contact-lists/{ContactListName}")
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_serializeOpHttpBindingsUpdateContactListInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateContactListInput(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_serializeOpHttpBindingsUpdateContactListInput(v *UpdateContactListInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ContactListName == nil || len(*v.ContactListName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ContactListName must not be empty")}
}
if v.ContactListName != nil {
if err := encoder.SetURI("ContactListName").String(*v.ContactListName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateContactListInput(v *UpdateContactListInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.Topics != nil {
ok := object.Key("Topics")
if err := awsRestjson1_serializeDocumentTopics(v.Topics, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpUpdateCustomVerificationEmailTemplate struct {
}
func (*awsRestjson1_serializeOpUpdateCustomVerificationEmailTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateCustomVerificationEmailTemplate) 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.(*UpdateCustomVerificationEmailTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/custom-verification-email-templates/{TemplateName}")
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_serializeOpHttpBindingsUpdateCustomVerificationEmailTemplateInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateCustomVerificationEmailTemplateInput(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_serializeOpHttpBindingsUpdateCustomVerificationEmailTemplateInput(v *UpdateCustomVerificationEmailTemplateInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TemplateName == nil || len(*v.TemplateName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member TemplateName must not be empty")}
}
if v.TemplateName != nil {
if err := encoder.SetURI("TemplateName").String(*v.TemplateName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateCustomVerificationEmailTemplateInput(v *UpdateCustomVerificationEmailTemplateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.FailureRedirectionURL != nil {
ok := object.Key("FailureRedirectionURL")
ok.String(*v.FailureRedirectionURL)
}
if v.FromEmailAddress != nil {
ok := object.Key("FromEmailAddress")
ok.String(*v.FromEmailAddress)
}
if v.SuccessRedirectionURL != nil {
ok := object.Key("SuccessRedirectionURL")
ok.String(*v.SuccessRedirectionURL)
}
if v.TemplateContent != nil {
ok := object.Key("TemplateContent")
ok.String(*v.TemplateContent)
}
if v.TemplateSubject != nil {
ok := object.Key("TemplateSubject")
ok.String(*v.TemplateSubject)
}
return nil
}
type awsRestjson1_serializeOpUpdateEmailIdentityPolicy struct {
}
func (*awsRestjson1_serializeOpUpdateEmailIdentityPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateEmailIdentityPolicy) 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.(*UpdateEmailIdentityPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/identities/{EmailIdentity}/policies/{PolicyName}")
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_serializeOpHttpBindingsUpdateEmailIdentityPolicyInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateEmailIdentityPolicyInput(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_serializeOpHttpBindingsUpdateEmailIdentityPolicyInput(v *UpdateEmailIdentityPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.EmailIdentity == nil || len(*v.EmailIdentity) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member EmailIdentity must not be empty")}
}
if v.EmailIdentity != nil {
if err := encoder.SetURI("EmailIdentity").String(*v.EmailIdentity); err != nil {
return err
}
}
if v.PolicyName == nil || len(*v.PolicyName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member PolicyName must not be empty")}
}
if v.PolicyName != nil {
if err := encoder.SetURI("PolicyName").String(*v.PolicyName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateEmailIdentityPolicyInput(v *UpdateEmailIdentityPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Policy != nil {
ok := object.Key("Policy")
ok.String(*v.Policy)
}
return nil
}
type awsRestjson1_serializeOpUpdateEmailTemplate struct {
}
func (*awsRestjson1_serializeOpUpdateEmailTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateEmailTemplate) 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.(*UpdateEmailTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v2/email/templates/{TemplateName}")
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_serializeOpHttpBindingsUpdateEmailTemplateInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateEmailTemplateInput(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_serializeOpHttpBindingsUpdateEmailTemplateInput(v *UpdateEmailTemplateInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.TemplateName == nil || len(*v.TemplateName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member TemplateName must not be empty")}
}
if v.TemplateName != nil {
if err := encoder.SetURI("TemplateName").String(*v.TemplateName); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateEmailTemplateInput(v *UpdateEmailTemplateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.TemplateContent != nil {
ok := object.Key("TemplateContent")
if err := awsRestjson1_serializeDocumentEmailTemplateContent(v.TemplateContent, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAdditionalContactEmailAddresses(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_serializeDocumentBatchGetMetricDataQueries(v []types.BatchGetMetricDataQuery, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentBatchGetMetricDataQuery(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentBatchGetMetricDataQuery(v *types.BatchGetMetricDataQuery, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Dimensions != nil {
ok := object.Key("Dimensions")
if err := awsRestjson1_serializeDocumentDimensions(v.Dimensions, ok); err != nil {
return err
}
}
if v.EndDate != nil {
ok := object.Key("EndDate")
ok.Double(smithytime.FormatEpochSeconds(*v.EndDate))
}
if v.Id != nil {
ok := object.Key("Id")
ok.String(*v.Id)
}
if len(v.Metric) > 0 {
ok := object.Key("Metric")
ok.String(string(v.Metric))
}
if len(v.Namespace) > 0 {
ok := object.Key("Namespace")
ok.String(string(v.Namespace))
}
if v.StartDate != nil {
ok := object.Key("StartDate")
ok.Double(smithytime.FormatEpochSeconds(*v.StartDate))
}
return nil
}
func awsRestjson1_serializeDocumentBody(v *types.Body, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Html != nil {
ok := object.Key("Html")
if err := awsRestjson1_serializeDocumentContent(v.Html, ok); err != nil {
return err
}
}
if v.Text != nil {
ok := object.Key("Text")
if err := awsRestjson1_serializeDocumentContent(v.Text, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentBulkEmailContent(v *types.BulkEmailContent, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Template != nil {
ok := object.Key("Template")
if err := awsRestjson1_serializeDocumentTemplate(v.Template, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentBulkEmailEntry(v *types.BulkEmailEntry, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Destination != nil {
ok := object.Key("Destination")
if err := awsRestjson1_serializeDocumentDestination(v.Destination, ok); err != nil {
return err
}
}
if v.ReplacementEmailContent != nil {
ok := object.Key("ReplacementEmailContent")
if err := awsRestjson1_serializeDocumentReplacementEmailContent(v.ReplacementEmailContent, ok); err != nil {
return err
}
}
if v.ReplacementTags != nil {
ok := object.Key("ReplacementTags")
if err := awsRestjson1_serializeDocumentMessageTagList(v.ReplacementTags, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentBulkEmailEntryList(v []types.BulkEmailEntry, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentBulkEmailEntry(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentCloudWatchDestination(v *types.CloudWatchDestination, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DimensionConfigurations != nil {
ok := object.Key("DimensionConfigurations")
if err := awsRestjson1_serializeDocumentCloudWatchDimensionConfigurations(v.DimensionConfigurations, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentCloudWatchDimensionConfiguration(v *types.CloudWatchDimensionConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DefaultDimensionValue != nil {
ok := object.Key("DefaultDimensionValue")
ok.String(*v.DefaultDimensionValue)
}
if v.DimensionName != nil {
ok := object.Key("DimensionName")
ok.String(*v.DimensionName)
}
if len(v.DimensionValueSource) > 0 {
ok := object.Key("DimensionValueSource")
ok.String(string(v.DimensionValueSource))
}
return nil
}
func awsRestjson1_serializeDocumentCloudWatchDimensionConfigurations(v []types.CloudWatchDimensionConfiguration, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentCloudWatchDimensionConfiguration(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentContactListDestination(v *types.ContactListDestination, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.ContactListImportAction) > 0 {
ok := object.Key("ContactListImportAction")
ok.String(string(v.ContactListImportAction))
}
if v.ContactListName != nil {
ok := object.Key("ContactListName")
ok.String(*v.ContactListName)
}
return nil
}
func awsRestjson1_serializeDocumentContent(v *types.Content, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Charset != nil {
ok := object.Key("Charset")
ok.String(*v.Charset)
}
if v.Data != nil {
ok := object.Key("Data")
ok.String(*v.Data)
}
return nil
}
func awsRestjson1_serializeDocumentDashboardAttributes(v *types.DashboardAttributes, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.EngagementMetrics) > 0 {
ok := object.Key("EngagementMetrics")
ok.String(string(v.EngagementMetrics))
}
return nil
}
func awsRestjson1_serializeDocumentDashboardOptions(v *types.DashboardOptions, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.EngagementMetrics) > 0 {
ok := object.Key("EngagementMetrics")
ok.String(string(v.EngagementMetrics))
}
return nil
}
func awsRestjson1_serializeDocumentDeliveryOptions(v *types.DeliveryOptions, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SendingPoolName != nil {
ok := object.Key("SendingPoolName")
ok.String(*v.SendingPoolName)
}
if len(v.TlsPolicy) > 0 {
ok := object.Key("TlsPolicy")
ok.String(string(v.TlsPolicy))
}
return nil
}
func awsRestjson1_serializeDocumentDestination(v *types.Destination, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.BccAddresses != nil {
ok := object.Key("BccAddresses")
if err := awsRestjson1_serializeDocumentEmailAddressList(v.BccAddresses, ok); err != nil {
return err
}
}
if v.CcAddresses != nil {
ok := object.Key("CcAddresses")
if err := awsRestjson1_serializeDocumentEmailAddressList(v.CcAddresses, ok); err != nil {
return err
}
}
if v.ToAddresses != nil {
ok := object.Key("ToAddresses")
if err := awsRestjson1_serializeDocumentEmailAddressList(v.ToAddresses, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentDimensions(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_serializeDocumentDkimSigningAttributes(v *types.DkimSigningAttributes, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DomainSigningPrivateKey != nil {
ok := object.Key("DomainSigningPrivateKey")
ok.String(*v.DomainSigningPrivateKey)
}
if v.DomainSigningSelector != nil {
ok := object.Key("DomainSigningSelector")
ok.String(*v.DomainSigningSelector)
}
if len(v.NextSigningKeyLength) > 0 {
ok := object.Key("NextSigningKeyLength")
ok.String(string(v.NextSigningKeyLength))
}
return nil
}
func awsRestjson1_serializeDocumentDomainDeliverabilityTrackingOption(v *types.DomainDeliverabilityTrackingOption, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Domain != nil {
ok := object.Key("Domain")
ok.String(*v.Domain)
}
if v.InboxPlacementTrackingOption != nil {
ok := object.Key("InboxPlacementTrackingOption")
if err := awsRestjson1_serializeDocumentInboxPlacementTrackingOption(v.InboxPlacementTrackingOption, ok); err != nil {
return err
}
}
if v.SubscriptionStartDate != nil {
ok := object.Key("SubscriptionStartDate")
ok.Double(smithytime.FormatEpochSeconds(*v.SubscriptionStartDate))
}
return nil
}
func awsRestjson1_serializeDocumentDomainDeliverabilityTrackingOptions(v []types.DomainDeliverabilityTrackingOption, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentDomainDeliverabilityTrackingOption(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentEmailAddressList(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_serializeDocumentEmailContent(v *types.EmailContent, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Raw != nil {
ok := object.Key("Raw")
if err := awsRestjson1_serializeDocumentRawMessage(v.Raw, ok); err != nil {
return err
}
}
if v.Simple != nil {
ok := object.Key("Simple")
if err := awsRestjson1_serializeDocumentMessage(v.Simple, ok); err != nil {
return err
}
}
if v.Template != nil {
ok := object.Key("Template")
if err := awsRestjson1_serializeDocumentTemplate(v.Template, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentEmailTemplateContent(v *types.EmailTemplateContent, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Html != nil {
ok := object.Key("Html")
ok.String(*v.Html)
}
if v.Subject != nil {
ok := object.Key("Subject")
ok.String(*v.Subject)
}
if v.Text != nil {
ok := object.Key("Text")
ok.String(*v.Text)
}
return nil
}
func awsRestjson1_serializeDocumentEventDestinationDefinition(v *types.EventDestinationDefinition, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CloudWatchDestination != nil {
ok := object.Key("CloudWatchDestination")
if err := awsRestjson1_serializeDocumentCloudWatchDestination(v.CloudWatchDestination, ok); err != nil {
return err
}
}
if v.Enabled {
ok := object.Key("Enabled")
ok.Boolean(v.Enabled)
}
if v.KinesisFirehoseDestination != nil {
ok := object.Key("KinesisFirehoseDestination")
if err := awsRestjson1_serializeDocumentKinesisFirehoseDestination(v.KinesisFirehoseDestination, ok); err != nil {
return err
}
}
if v.MatchingEventTypes != nil {
ok := object.Key("MatchingEventTypes")
if err := awsRestjson1_serializeDocumentEventTypes(v.MatchingEventTypes, ok); err != nil {
return err
}
}
if v.PinpointDestination != nil {
ok := object.Key("PinpointDestination")
if err := awsRestjson1_serializeDocumentPinpointDestination(v.PinpointDestination, ok); err != nil {
return err
}
}
if v.SnsDestination != nil {
ok := object.Key("SnsDestination")
if err := awsRestjson1_serializeDocumentSnsDestination(v.SnsDestination, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentEventTypes(v []types.EventType, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsRestjson1_serializeDocumentGuardianAttributes(v *types.GuardianAttributes, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.OptimizedSharedDelivery) > 0 {
ok := object.Key("OptimizedSharedDelivery")
ok.String(string(v.OptimizedSharedDelivery))
}
return nil
}
func awsRestjson1_serializeDocumentGuardianOptions(v *types.GuardianOptions, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.OptimizedSharedDelivery) > 0 {
ok := object.Key("OptimizedSharedDelivery")
ok.String(string(v.OptimizedSharedDelivery))
}
return nil
}
func awsRestjson1_serializeDocumentImportDataSource(v *types.ImportDataSource, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.DataFormat) > 0 {
ok := object.Key("DataFormat")
ok.String(string(v.DataFormat))
}
if v.S3Url != nil {
ok := object.Key("S3Url")
ok.String(*v.S3Url)
}
return nil
}
func awsRestjson1_serializeDocumentImportDestination(v *types.ImportDestination, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContactListDestination != nil {
ok := object.Key("ContactListDestination")
if err := awsRestjson1_serializeDocumentContactListDestination(v.ContactListDestination, ok); err != nil {
return err
}
}
if v.SuppressionListDestination != nil {
ok := object.Key("SuppressionListDestination")
if err := awsRestjson1_serializeDocumentSuppressionListDestination(v.SuppressionListDestination, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentInboxPlacementTrackingOption(v *types.InboxPlacementTrackingOption, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Global {
ok := object.Key("Global")
ok.Boolean(v.Global)
}
if v.TrackedIsps != nil {
ok := object.Key("TrackedIsps")
if err := awsRestjson1_serializeDocumentIspNameList(v.TrackedIsps, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentIspNameList(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_serializeDocumentKinesisFirehoseDestination(v *types.KinesisFirehoseDestination, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DeliveryStreamArn != nil {
ok := object.Key("DeliveryStreamArn")
ok.String(*v.DeliveryStreamArn)
}
if v.IamRoleArn != nil {
ok := object.Key("IamRoleArn")
ok.String(*v.IamRoleArn)
}
return nil
}
func awsRestjson1_serializeDocumentListContactsFilter(v *types.ListContactsFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.FilteredStatus) > 0 {
ok := object.Key("FilteredStatus")
ok.String(string(v.FilteredStatus))
}
if v.TopicFilter != nil {
ok := object.Key("TopicFilter")
if err := awsRestjson1_serializeDocumentTopicFilter(v.TopicFilter, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentListManagementOptions(v *types.ListManagementOptions, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ContactListName != nil {
ok := object.Key("ContactListName")
ok.String(*v.ContactListName)
}
if v.TopicName != nil {
ok := object.Key("TopicName")
ok.String(*v.TopicName)
}
return nil
}
func awsRestjson1_serializeDocumentListRecommendationsFilter(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_serializeDocumentMessage(v *types.Message, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Body != nil {
ok := object.Key("Body")
if err := awsRestjson1_serializeDocumentBody(v.Body, ok); err != nil {
return err
}
}
if v.Subject != nil {
ok := object.Key("Subject")
if err := awsRestjson1_serializeDocumentContent(v.Subject, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentMessageTag(v *types.MessageTag, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("Name")
ok.String(*v.Name)
}
if v.Value != nil {
ok := object.Key("Value")
ok.String(*v.Value)
}
return nil
}
func awsRestjson1_serializeDocumentMessageTagList(v []types.MessageTag, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentMessageTag(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentPinpointDestination(v *types.PinpointDestination, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ApplicationArn != nil {
ok := object.Key("ApplicationArn")
ok.String(*v.ApplicationArn)
}
return nil
}
func awsRestjson1_serializeDocumentRawMessage(v *types.RawMessage, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Data != nil {
ok := object.Key("Data")
ok.Base64EncodeBytes(v.Data)
}
return nil
}
func awsRestjson1_serializeDocumentReplacementEmailContent(v *types.ReplacementEmailContent, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ReplacementTemplate != nil {
ok := object.Key("ReplacementTemplate")
if err := awsRestjson1_serializeDocumentReplacementTemplate(v.ReplacementTemplate, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentReplacementTemplate(v *types.ReplacementTemplate, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ReplacementTemplateData != nil {
ok := object.Key("ReplacementTemplateData")
ok.String(*v.ReplacementTemplateData)
}
return nil
}
func awsRestjson1_serializeDocumentReputationOptions(v *types.ReputationOptions, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.LastFreshStart != nil {
ok := object.Key("LastFreshStart")
ok.Double(smithytime.FormatEpochSeconds(*v.LastFreshStart))
}
if v.ReputationMetricsEnabled {
ok := object.Key("ReputationMetricsEnabled")
ok.Boolean(v.ReputationMetricsEnabled)
}
return nil
}
func awsRestjson1_serializeDocumentSendingOptions(v *types.SendingOptions, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SendingEnabled {
ok := object.Key("SendingEnabled")
ok.Boolean(v.SendingEnabled)
}
return nil
}
func awsRestjson1_serializeDocumentSnsDestination(v *types.SnsDestination, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.TopicArn != nil {
ok := object.Key("TopicArn")
ok.String(*v.TopicArn)
}
return nil
}
func awsRestjson1_serializeDocumentSuppressionListDestination(v *types.SuppressionListDestination, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.SuppressionListImportAction) > 0 {
ok := object.Key("SuppressionListImportAction")
ok.String(string(v.SuppressionListImportAction))
}
return nil
}
func awsRestjson1_serializeDocumentSuppressionListReasons(v []types.SuppressionListReason, 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_serializeDocumentSuppressionOptions(v *types.SuppressionOptions, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SuppressedReasons != nil {
ok := object.Key("SuppressedReasons")
if err := awsRestjson1_serializeDocumentSuppressionListReasons(v.SuppressedReasons, ok); err != nil {
return err
}
}
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
}
func awsRestjson1_serializeDocumentTemplate(v *types.Template, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.TemplateArn != nil {
ok := object.Key("TemplateArn")
ok.String(*v.TemplateArn)
}
if v.TemplateData != nil {
ok := object.Key("TemplateData")
ok.String(*v.TemplateData)
}
if v.TemplateName != nil {
ok := object.Key("TemplateName")
ok.String(*v.TemplateName)
}
return nil
}
func awsRestjson1_serializeDocumentTopic(v *types.Topic, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.DefaultSubscriptionStatus) > 0 {
ok := object.Key("DefaultSubscriptionStatus")
ok.String(string(v.DefaultSubscriptionStatus))
}
if v.Description != nil {
ok := object.Key("Description")
ok.String(*v.Description)
}
if v.DisplayName != nil {
ok := object.Key("DisplayName")
ok.String(*v.DisplayName)
}
if v.TopicName != nil {
ok := object.Key("TopicName")
ok.String(*v.TopicName)
}
return nil
}
func awsRestjson1_serializeDocumentTopicFilter(v *types.TopicFilter, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.TopicName != nil {
ok := object.Key("TopicName")
ok.String(*v.TopicName)
}
if v.UseDefaultIfPreferenceUnavailable {
ok := object.Key("UseDefaultIfPreferenceUnavailable")
ok.Boolean(v.UseDefaultIfPreferenceUnavailable)
}
return nil
}
func awsRestjson1_serializeDocumentTopicPreference(v *types.TopicPreference, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.SubscriptionStatus) > 0 {
ok := object.Key("SubscriptionStatus")
ok.String(string(v.SubscriptionStatus))
}
if v.TopicName != nil {
ok := object.Key("TopicName")
ok.String(*v.TopicName)
}
return nil
}
func awsRestjson1_serializeDocumentTopicPreferenceList(v []types.TopicPreference, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentTopicPreference(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentTopics(v []types.Topic, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentTopic(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentTrackingOptions(v *types.TrackingOptions, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CustomRedirectDomain != nil {
ok := object.Key("CustomRedirectDomain")
ok.String(*v.CustomRedirectDomain)
}
return nil
}
func awsRestjson1_serializeDocumentVdmAttributes(v *types.VdmAttributes, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DashboardAttributes != nil {
ok := object.Key("DashboardAttributes")
if err := awsRestjson1_serializeDocumentDashboardAttributes(v.DashboardAttributes, ok); err != nil {
return err
}
}
if v.GuardianAttributes != nil {
ok := object.Key("GuardianAttributes")
if err := awsRestjson1_serializeDocumentGuardianAttributes(v.GuardianAttributes, ok); err != nil {
return err
}
}
if len(v.VdmEnabled) > 0 {
ok := object.Key("VdmEnabled")
ok.String(string(v.VdmEnabled))
}
return nil
}
func awsRestjson1_serializeDocumentVdmOptions(v *types.VdmOptions, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.DashboardOptions != nil {
ok := object.Key("DashboardOptions")
if err := awsRestjson1_serializeDocumentDashboardOptions(v.DashboardOptions, ok); err != nil {
return err
}
}
if v.GuardianOptions != nil {
ok := object.Key("GuardianOptions")
if err := awsRestjson1_serializeDocumentGuardianOptions(v.GuardianOptions, ok); err != nil {
return err
}
}
return nil
}
| 7,389 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sesv2
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/sesv2/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpBatchGetMetricData struct {
}
func (*validateOpBatchGetMetricData) ID() string {
return "OperationInputValidation"
}
func (m *validateOpBatchGetMetricData) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*BatchGetMetricDataInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpBatchGetMetricDataInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateConfigurationSetEventDestination struct {
}
func (*validateOpCreateConfigurationSetEventDestination) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateConfigurationSetEventDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateConfigurationSetEventDestinationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateConfigurationSetEventDestinationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateConfigurationSet struct {
}
func (*validateOpCreateConfigurationSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateConfigurationSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateConfigurationSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateConfigurationSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateContact struct {
}
func (*validateOpCreateContact) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateContact) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateContactInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateContactInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateContactList struct {
}
func (*validateOpCreateContactList) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateContactList) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateContactListInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateContactListInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateCustomVerificationEmailTemplate struct {
}
func (*validateOpCreateCustomVerificationEmailTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateCustomVerificationEmailTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateCustomVerificationEmailTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateCustomVerificationEmailTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateDedicatedIpPool struct {
}
func (*validateOpCreateDedicatedIpPool) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateDedicatedIpPool) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateDedicatedIpPoolInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateDedicatedIpPoolInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateDeliverabilityTestReport struct {
}
func (*validateOpCreateDeliverabilityTestReport) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateDeliverabilityTestReport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateDeliverabilityTestReportInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateDeliverabilityTestReportInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateEmailIdentity struct {
}
func (*validateOpCreateEmailIdentity) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateEmailIdentity) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateEmailIdentityInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateEmailIdentityInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateEmailIdentityPolicy struct {
}
func (*validateOpCreateEmailIdentityPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateEmailIdentityPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateEmailIdentityPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateEmailIdentityPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateEmailTemplate struct {
}
func (*validateOpCreateEmailTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateEmailTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateEmailTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateEmailTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateImportJob struct {
}
func (*validateOpCreateImportJob) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateImportJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateImportJobInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateImportJobInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteConfigurationSetEventDestination struct {
}
func (*validateOpDeleteConfigurationSetEventDestination) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteConfigurationSetEventDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteConfigurationSetEventDestinationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteConfigurationSetEventDestinationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteConfigurationSet struct {
}
func (*validateOpDeleteConfigurationSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteConfigurationSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteConfigurationSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteConfigurationSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteContact struct {
}
func (*validateOpDeleteContact) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteContact) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteContactInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteContactInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteContactList struct {
}
func (*validateOpDeleteContactList) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteContactList) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteContactListInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteContactListInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteCustomVerificationEmailTemplate struct {
}
func (*validateOpDeleteCustomVerificationEmailTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteCustomVerificationEmailTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteCustomVerificationEmailTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteCustomVerificationEmailTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteDedicatedIpPool struct {
}
func (*validateOpDeleteDedicatedIpPool) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteDedicatedIpPool) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteDedicatedIpPoolInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteDedicatedIpPoolInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteEmailIdentity struct {
}
func (*validateOpDeleteEmailIdentity) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteEmailIdentity) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteEmailIdentityInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteEmailIdentityInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteEmailIdentityPolicy struct {
}
func (*validateOpDeleteEmailIdentityPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteEmailIdentityPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteEmailIdentityPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteEmailIdentityPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteEmailTemplate struct {
}
func (*validateOpDeleteEmailTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteEmailTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteEmailTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteEmailTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteSuppressedDestination struct {
}
func (*validateOpDeleteSuppressedDestination) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteSuppressedDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteSuppressedDestinationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteSuppressedDestinationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetBlacklistReports struct {
}
func (*validateOpGetBlacklistReports) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetBlacklistReports) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetBlacklistReportsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetBlacklistReportsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetConfigurationSetEventDestinations struct {
}
func (*validateOpGetConfigurationSetEventDestinations) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetConfigurationSetEventDestinations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetConfigurationSetEventDestinationsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetConfigurationSetEventDestinationsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetConfigurationSet struct {
}
func (*validateOpGetConfigurationSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetConfigurationSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetConfigurationSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetConfigurationSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetContact struct {
}
func (*validateOpGetContact) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetContact) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetContactInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetContactInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetContactList struct {
}
func (*validateOpGetContactList) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetContactList) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetContactListInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetContactListInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetCustomVerificationEmailTemplate struct {
}
func (*validateOpGetCustomVerificationEmailTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetCustomVerificationEmailTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetCustomVerificationEmailTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetCustomVerificationEmailTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetDedicatedIp struct {
}
func (*validateOpGetDedicatedIp) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetDedicatedIp) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetDedicatedIpInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetDedicatedIpInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetDedicatedIpPool struct {
}
func (*validateOpGetDedicatedIpPool) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetDedicatedIpPool) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetDedicatedIpPoolInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetDedicatedIpPoolInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetDeliverabilityTestReport struct {
}
func (*validateOpGetDeliverabilityTestReport) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetDeliverabilityTestReport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetDeliverabilityTestReportInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetDeliverabilityTestReportInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetDomainDeliverabilityCampaign struct {
}
func (*validateOpGetDomainDeliverabilityCampaign) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetDomainDeliverabilityCampaign) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetDomainDeliverabilityCampaignInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetDomainDeliverabilityCampaignInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetDomainStatisticsReport struct {
}
func (*validateOpGetDomainStatisticsReport) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetDomainStatisticsReport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetDomainStatisticsReportInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetDomainStatisticsReportInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetEmailIdentity struct {
}
func (*validateOpGetEmailIdentity) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetEmailIdentity) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetEmailIdentityInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetEmailIdentityInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetEmailIdentityPolicies struct {
}
func (*validateOpGetEmailIdentityPolicies) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetEmailIdentityPolicies) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetEmailIdentityPoliciesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetEmailIdentityPoliciesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetEmailTemplate struct {
}
func (*validateOpGetEmailTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetEmailTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetEmailTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetEmailTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetImportJob struct {
}
func (*validateOpGetImportJob) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetImportJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetImportJobInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetImportJobInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetSuppressedDestination struct {
}
func (*validateOpGetSuppressedDestination) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetSuppressedDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetSuppressedDestinationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetSuppressedDestinationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListContacts struct {
}
func (*validateOpListContacts) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListContacts) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListContactsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListContactsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListDomainDeliverabilityCampaigns struct {
}
func (*validateOpListDomainDeliverabilityCampaigns) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListDomainDeliverabilityCampaigns) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListDomainDeliverabilityCampaignsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListDomainDeliverabilityCampaignsInput(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 validateOpPutAccountDetails struct {
}
func (*validateOpPutAccountDetails) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutAccountDetails) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutAccountDetailsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutAccountDetailsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutAccountVdmAttributes struct {
}
func (*validateOpPutAccountVdmAttributes) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutAccountVdmAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutAccountVdmAttributesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutAccountVdmAttributesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutConfigurationSetDeliveryOptions struct {
}
func (*validateOpPutConfigurationSetDeliveryOptions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutConfigurationSetDeliveryOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutConfigurationSetDeliveryOptionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutConfigurationSetDeliveryOptionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutConfigurationSetReputationOptions struct {
}
func (*validateOpPutConfigurationSetReputationOptions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutConfigurationSetReputationOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutConfigurationSetReputationOptionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutConfigurationSetReputationOptionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutConfigurationSetSendingOptions struct {
}
func (*validateOpPutConfigurationSetSendingOptions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutConfigurationSetSendingOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutConfigurationSetSendingOptionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutConfigurationSetSendingOptionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutConfigurationSetSuppressionOptions struct {
}
func (*validateOpPutConfigurationSetSuppressionOptions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutConfigurationSetSuppressionOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutConfigurationSetSuppressionOptionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutConfigurationSetSuppressionOptionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutConfigurationSetTrackingOptions struct {
}
func (*validateOpPutConfigurationSetTrackingOptions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutConfigurationSetTrackingOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutConfigurationSetTrackingOptionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutConfigurationSetTrackingOptionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutConfigurationSetVdmOptions struct {
}
func (*validateOpPutConfigurationSetVdmOptions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutConfigurationSetVdmOptions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutConfigurationSetVdmOptionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutConfigurationSetVdmOptionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutDedicatedIpInPool struct {
}
func (*validateOpPutDedicatedIpInPool) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutDedicatedIpInPool) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutDedicatedIpInPoolInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutDedicatedIpInPoolInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutDedicatedIpPoolScalingAttributes struct {
}
func (*validateOpPutDedicatedIpPoolScalingAttributes) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutDedicatedIpPoolScalingAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutDedicatedIpPoolScalingAttributesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutDedicatedIpPoolScalingAttributesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutDedicatedIpWarmupAttributes struct {
}
func (*validateOpPutDedicatedIpWarmupAttributes) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutDedicatedIpWarmupAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutDedicatedIpWarmupAttributesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutDedicatedIpWarmupAttributesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutDeliverabilityDashboardOption struct {
}
func (*validateOpPutDeliverabilityDashboardOption) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutDeliverabilityDashboardOption) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutDeliverabilityDashboardOptionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutDeliverabilityDashboardOptionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutEmailIdentityConfigurationSetAttributes struct {
}
func (*validateOpPutEmailIdentityConfigurationSetAttributes) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutEmailIdentityConfigurationSetAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutEmailIdentityConfigurationSetAttributesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutEmailIdentityConfigurationSetAttributesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutEmailIdentityDkimAttributes struct {
}
func (*validateOpPutEmailIdentityDkimAttributes) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutEmailIdentityDkimAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutEmailIdentityDkimAttributesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutEmailIdentityDkimAttributesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutEmailIdentityDkimSigningAttributes struct {
}
func (*validateOpPutEmailIdentityDkimSigningAttributes) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutEmailIdentityDkimSigningAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutEmailIdentityDkimSigningAttributesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutEmailIdentityDkimSigningAttributesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutEmailIdentityFeedbackAttributes struct {
}
func (*validateOpPutEmailIdentityFeedbackAttributes) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutEmailIdentityFeedbackAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutEmailIdentityFeedbackAttributesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutEmailIdentityFeedbackAttributesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutEmailIdentityMailFromAttributes struct {
}
func (*validateOpPutEmailIdentityMailFromAttributes) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutEmailIdentityMailFromAttributes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutEmailIdentityMailFromAttributesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutEmailIdentityMailFromAttributesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutSuppressedDestination struct {
}
func (*validateOpPutSuppressedDestination) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutSuppressedDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutSuppressedDestinationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutSuppressedDestinationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSendBulkEmail struct {
}
func (*validateOpSendBulkEmail) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSendBulkEmail) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SendBulkEmailInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSendBulkEmailInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSendCustomVerificationEmail struct {
}
func (*validateOpSendCustomVerificationEmail) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSendCustomVerificationEmail) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SendCustomVerificationEmailInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSendCustomVerificationEmailInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpSendEmail struct {
}
func (*validateOpSendEmail) ID() string {
return "OperationInputValidation"
}
func (m *validateOpSendEmail) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*SendEmailInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpSendEmailInput(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 validateOpTestRenderEmailTemplate struct {
}
func (*validateOpTestRenderEmailTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpTestRenderEmailTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*TestRenderEmailTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpTestRenderEmailTemplateInput(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 validateOpUpdateConfigurationSetEventDestination struct {
}
func (*validateOpUpdateConfigurationSetEventDestination) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateConfigurationSetEventDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateConfigurationSetEventDestinationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateConfigurationSetEventDestinationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateContact struct {
}
func (*validateOpUpdateContact) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateContact) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateContactInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateContactInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateContactList struct {
}
func (*validateOpUpdateContactList) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateContactList) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateContactListInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateContactListInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateCustomVerificationEmailTemplate struct {
}
func (*validateOpUpdateCustomVerificationEmailTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateCustomVerificationEmailTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateCustomVerificationEmailTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateCustomVerificationEmailTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateEmailIdentityPolicy struct {
}
func (*validateOpUpdateEmailIdentityPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateEmailIdentityPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateEmailIdentityPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateEmailIdentityPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateEmailTemplate struct {
}
func (*validateOpUpdateEmailTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateEmailTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateEmailTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateEmailTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpBatchGetMetricDataValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpBatchGetMetricData{}, middleware.After)
}
func addOpCreateConfigurationSetEventDestinationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateConfigurationSetEventDestination{}, middleware.After)
}
func addOpCreateConfigurationSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateConfigurationSet{}, middleware.After)
}
func addOpCreateContactValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateContact{}, middleware.After)
}
func addOpCreateContactListValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateContactList{}, middleware.After)
}
func addOpCreateCustomVerificationEmailTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateCustomVerificationEmailTemplate{}, middleware.After)
}
func addOpCreateDedicatedIpPoolValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateDedicatedIpPool{}, middleware.After)
}
func addOpCreateDeliverabilityTestReportValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateDeliverabilityTestReport{}, middleware.After)
}
func addOpCreateEmailIdentityValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateEmailIdentity{}, middleware.After)
}
func addOpCreateEmailIdentityPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateEmailIdentityPolicy{}, middleware.After)
}
func addOpCreateEmailTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateEmailTemplate{}, middleware.After)
}
func addOpCreateImportJobValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateImportJob{}, middleware.After)
}
func addOpDeleteConfigurationSetEventDestinationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteConfigurationSetEventDestination{}, middleware.After)
}
func addOpDeleteConfigurationSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteConfigurationSet{}, middleware.After)
}
func addOpDeleteContactValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteContact{}, middleware.After)
}
func addOpDeleteContactListValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteContactList{}, middleware.After)
}
func addOpDeleteCustomVerificationEmailTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteCustomVerificationEmailTemplate{}, middleware.After)
}
func addOpDeleteDedicatedIpPoolValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteDedicatedIpPool{}, middleware.After)
}
func addOpDeleteEmailIdentityValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteEmailIdentity{}, middleware.After)
}
func addOpDeleteEmailIdentityPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteEmailIdentityPolicy{}, middleware.After)
}
func addOpDeleteEmailTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteEmailTemplate{}, middleware.After)
}
func addOpDeleteSuppressedDestinationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteSuppressedDestination{}, middleware.After)
}
func addOpGetBlacklistReportsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetBlacklistReports{}, middleware.After)
}
func addOpGetConfigurationSetEventDestinationsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetConfigurationSetEventDestinations{}, middleware.After)
}
func addOpGetConfigurationSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetConfigurationSet{}, middleware.After)
}
func addOpGetContactValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetContact{}, middleware.After)
}
func addOpGetContactListValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetContactList{}, middleware.After)
}
func addOpGetCustomVerificationEmailTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetCustomVerificationEmailTemplate{}, middleware.After)
}
func addOpGetDedicatedIpValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetDedicatedIp{}, middleware.After)
}
func addOpGetDedicatedIpPoolValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetDedicatedIpPool{}, middleware.After)
}
func addOpGetDeliverabilityTestReportValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetDeliverabilityTestReport{}, middleware.After)
}
func addOpGetDomainDeliverabilityCampaignValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetDomainDeliverabilityCampaign{}, middleware.After)
}
func addOpGetDomainStatisticsReportValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetDomainStatisticsReport{}, middleware.After)
}
func addOpGetEmailIdentityValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetEmailIdentity{}, middleware.After)
}
func addOpGetEmailIdentityPoliciesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetEmailIdentityPolicies{}, middleware.After)
}
func addOpGetEmailTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetEmailTemplate{}, middleware.After)
}
func addOpGetImportJobValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetImportJob{}, middleware.After)
}
func addOpGetSuppressedDestinationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetSuppressedDestination{}, middleware.After)
}
func addOpListContactsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListContacts{}, middleware.After)
}
func addOpListDomainDeliverabilityCampaignsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListDomainDeliverabilityCampaigns{}, middleware.After)
}
func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After)
}
func addOpPutAccountDetailsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutAccountDetails{}, middleware.After)
}
func addOpPutAccountVdmAttributesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutAccountVdmAttributes{}, middleware.After)
}
func addOpPutConfigurationSetDeliveryOptionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutConfigurationSetDeliveryOptions{}, middleware.After)
}
func addOpPutConfigurationSetReputationOptionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutConfigurationSetReputationOptions{}, middleware.After)
}
func addOpPutConfigurationSetSendingOptionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutConfigurationSetSendingOptions{}, middleware.After)
}
func addOpPutConfigurationSetSuppressionOptionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutConfigurationSetSuppressionOptions{}, middleware.After)
}
func addOpPutConfigurationSetTrackingOptionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutConfigurationSetTrackingOptions{}, middleware.After)
}
func addOpPutConfigurationSetVdmOptionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutConfigurationSetVdmOptions{}, middleware.After)
}
func addOpPutDedicatedIpInPoolValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutDedicatedIpInPool{}, middleware.After)
}
func addOpPutDedicatedIpPoolScalingAttributesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutDedicatedIpPoolScalingAttributes{}, middleware.After)
}
func addOpPutDedicatedIpWarmupAttributesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutDedicatedIpWarmupAttributes{}, middleware.After)
}
func addOpPutDeliverabilityDashboardOptionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutDeliverabilityDashboardOption{}, middleware.After)
}
func addOpPutEmailIdentityConfigurationSetAttributesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutEmailIdentityConfigurationSetAttributes{}, middleware.After)
}
func addOpPutEmailIdentityDkimAttributesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutEmailIdentityDkimAttributes{}, middleware.After)
}
func addOpPutEmailIdentityDkimSigningAttributesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutEmailIdentityDkimSigningAttributes{}, middleware.After)
}
func addOpPutEmailIdentityFeedbackAttributesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutEmailIdentityFeedbackAttributes{}, middleware.After)
}
func addOpPutEmailIdentityMailFromAttributesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutEmailIdentityMailFromAttributes{}, middleware.After)
}
func addOpPutSuppressedDestinationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutSuppressedDestination{}, middleware.After)
}
func addOpSendBulkEmailValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSendBulkEmail{}, middleware.After)
}
func addOpSendCustomVerificationEmailValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSendCustomVerificationEmail{}, middleware.After)
}
func addOpSendEmailValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpSendEmail{}, middleware.After)
}
func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpTagResource{}, middleware.After)
}
func addOpTestRenderEmailTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpTestRenderEmailTemplate{}, middleware.After)
}
func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After)
}
func addOpUpdateConfigurationSetEventDestinationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateConfigurationSetEventDestination{}, middleware.After)
}
func addOpUpdateContactValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateContact{}, middleware.After)
}
func addOpUpdateContactListValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateContactList{}, middleware.After)
}
func addOpUpdateCustomVerificationEmailTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateCustomVerificationEmailTemplate{}, middleware.After)
}
func addOpUpdateEmailIdentityPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateEmailIdentityPolicy{}, middleware.After)
}
func addOpUpdateEmailTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateEmailTemplate{}, middleware.After)
}
func validateBatchGetMetricDataQueries(v []types.BatchGetMetricDataQuery) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BatchGetMetricDataQueries"}
for i := range v {
if err := validateBatchGetMetricDataQuery(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBatchGetMetricDataQuery(v *types.BatchGetMetricDataQuery) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BatchGetMetricDataQuery"}
if v.Id == nil {
invalidParams.Add(smithy.NewErrParamRequired("Id"))
}
if len(v.Namespace) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Namespace"))
}
if len(v.Metric) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Metric"))
}
if v.StartDate == nil {
invalidParams.Add(smithy.NewErrParamRequired("StartDate"))
}
if v.EndDate == nil {
invalidParams.Add(smithy.NewErrParamRequired("EndDate"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBody(v *types.Body) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Body"}
if v.Text != nil {
if err := validateContent(v.Text); err != nil {
invalidParams.AddNested("Text", err.(smithy.InvalidParamsError))
}
}
if v.Html != nil {
if err := validateContent(v.Html); err != nil {
invalidParams.AddNested("Html", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBulkEmailEntry(v *types.BulkEmailEntry) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BulkEmailEntry"}
if v.Destination == nil {
invalidParams.Add(smithy.NewErrParamRequired("Destination"))
}
if v.ReplacementTags != nil {
if err := validateMessageTagList(v.ReplacementTags); err != nil {
invalidParams.AddNested("ReplacementTags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateBulkEmailEntryList(v []types.BulkEmailEntry) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BulkEmailEntryList"}
for i := range v {
if err := validateBulkEmailEntry(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCloudWatchDestination(v *types.CloudWatchDestination) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CloudWatchDestination"}
if v.DimensionConfigurations == nil {
invalidParams.Add(smithy.NewErrParamRequired("DimensionConfigurations"))
} else if v.DimensionConfigurations != nil {
if err := validateCloudWatchDimensionConfigurations(v.DimensionConfigurations); err != nil {
invalidParams.AddNested("DimensionConfigurations", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCloudWatchDimensionConfiguration(v *types.CloudWatchDimensionConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CloudWatchDimensionConfiguration"}
if v.DimensionName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DimensionName"))
}
if len(v.DimensionValueSource) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("DimensionValueSource"))
}
if v.DefaultDimensionValue == nil {
invalidParams.Add(smithy.NewErrParamRequired("DefaultDimensionValue"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCloudWatchDimensionConfigurations(v []types.CloudWatchDimensionConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CloudWatchDimensionConfigurations"}
for i := range v {
if err := validateCloudWatchDimensionConfiguration(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateContactListDestination(v *types.ContactListDestination) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ContactListDestination"}
if v.ContactListName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContactListName"))
}
if len(v.ContactListImportAction) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ContactListImportAction"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateContent(v *types.Content) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Content"}
if v.Data == nil {
invalidParams.Add(smithy.NewErrParamRequired("Data"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateEmailContent(v *types.EmailContent) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "EmailContent"}
if v.Simple != nil {
if err := validateMessage(v.Simple); err != nil {
invalidParams.AddNested("Simple", err.(smithy.InvalidParamsError))
}
}
if v.Raw != nil {
if err := validateRawMessage(v.Raw); err != nil {
invalidParams.AddNested("Raw", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateEventDestinationDefinition(v *types.EventDestinationDefinition) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "EventDestinationDefinition"}
if v.KinesisFirehoseDestination != nil {
if err := validateKinesisFirehoseDestination(v.KinesisFirehoseDestination); err != nil {
invalidParams.AddNested("KinesisFirehoseDestination", err.(smithy.InvalidParamsError))
}
}
if v.CloudWatchDestination != nil {
if err := validateCloudWatchDestination(v.CloudWatchDestination); err != nil {
invalidParams.AddNested("CloudWatchDestination", err.(smithy.InvalidParamsError))
}
}
if v.SnsDestination != nil {
if err := validateSnsDestination(v.SnsDestination); err != nil {
invalidParams.AddNested("SnsDestination", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateImportDataSource(v *types.ImportDataSource) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ImportDataSource"}
if v.S3Url == nil {
invalidParams.Add(smithy.NewErrParamRequired("S3Url"))
}
if len(v.DataFormat) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("DataFormat"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateImportDestination(v *types.ImportDestination) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ImportDestination"}
if v.SuppressionListDestination != nil {
if err := validateSuppressionListDestination(v.SuppressionListDestination); err != nil {
invalidParams.AddNested("SuppressionListDestination", err.(smithy.InvalidParamsError))
}
}
if v.ContactListDestination != nil {
if err := validateContactListDestination(v.ContactListDestination); err != nil {
invalidParams.AddNested("ContactListDestination", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateKinesisFirehoseDestination(v *types.KinesisFirehoseDestination) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "KinesisFirehoseDestination"}
if v.IamRoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("IamRoleArn"))
}
if v.DeliveryStreamArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("DeliveryStreamArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateListManagementOptions(v *types.ListManagementOptions) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListManagementOptions"}
if v.ContactListName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContactListName"))
}
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 v.Subject == nil {
invalidParams.Add(smithy.NewErrParamRequired("Subject"))
} else if v.Subject != nil {
if err := validateContent(v.Subject); err != nil {
invalidParams.AddNested("Subject", err.(smithy.InvalidParamsError))
}
}
if v.Body == nil {
invalidParams.Add(smithy.NewErrParamRequired("Body"))
} else if v.Body != nil {
if err := validateBody(v.Body); err != nil {
invalidParams.AddNested("Body", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateMessageTag(v *types.MessageTag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "MessageTag"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Value == nil {
invalidParams.Add(smithy.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateMessageTagList(v []types.MessageTag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "MessageTagList"}
for i := range v {
if err := validateMessageTag(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRawMessage(v *types.RawMessage) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RawMessage"}
if v.Data == nil {
invalidParams.Add(smithy.NewErrParamRequired("Data"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSnsDestination(v *types.SnsDestination) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SnsDestination"}
if v.TopicArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("TopicArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateSuppressionListDestination(v *types.SuppressionListDestination) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SuppressionListDestination"}
if len(v.SuppressionListImportAction) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("SuppressionListImportAction"))
}
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 validateTopic(v *types.Topic) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Topic"}
if v.TopicName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TopicName"))
}
if v.DisplayName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DisplayName"))
}
if len(v.DefaultSubscriptionStatus) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("DefaultSubscriptionStatus"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTopicPreference(v *types.TopicPreference) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TopicPreference"}
if v.TopicName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TopicName"))
}
if len(v.SubscriptionStatus) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("SubscriptionStatus"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTopicPreferenceList(v []types.TopicPreference) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TopicPreferenceList"}
for i := range v {
if err := validateTopicPreference(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTopics(v []types.Topic) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Topics"}
for i := range v {
if err := validateTopic(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTrackingOptions(v *types.TrackingOptions) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TrackingOptions"}
if v.CustomRedirectDomain == nil {
invalidParams.Add(smithy.NewErrParamRequired("CustomRedirectDomain"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateVdmAttributes(v *types.VdmAttributes) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "VdmAttributes"}
if len(v.VdmEnabled) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("VdmEnabled"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpBatchGetMetricDataInput(v *BatchGetMetricDataInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "BatchGetMetricDataInput"}
if v.Queries == nil {
invalidParams.Add(smithy.NewErrParamRequired("Queries"))
} else if v.Queries != nil {
if err := validateBatchGetMetricDataQueries(v.Queries); err != nil {
invalidParams.AddNested("Queries", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateConfigurationSetEventDestinationInput(v *CreateConfigurationSetEventDestinationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateConfigurationSetEventDestinationInput"}
if v.ConfigurationSetName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ConfigurationSetName"))
}
if v.EventDestinationName == nil {
invalidParams.Add(smithy.NewErrParamRequired("EventDestinationName"))
}
if v.EventDestination == nil {
invalidParams.Add(smithy.NewErrParamRequired("EventDestination"))
} else if v.EventDestination != nil {
if err := validateEventDestinationDefinition(v.EventDestination); err != nil {
invalidParams.AddNested("EventDestination", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateConfigurationSetInput(v *CreateConfigurationSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateConfigurationSetInput"}
if v.ConfigurationSetName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ConfigurationSetName"))
}
if v.TrackingOptions != nil {
if err := validateTrackingOptions(v.TrackingOptions); err != nil {
invalidParams.AddNested("TrackingOptions", 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 validateOpCreateContactInput(v *CreateContactInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateContactInput"}
if v.ContactListName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContactListName"))
}
if v.EmailAddress == nil {
invalidParams.Add(smithy.NewErrParamRequired("EmailAddress"))
}
if v.TopicPreferences != nil {
if err := validateTopicPreferenceList(v.TopicPreferences); err != nil {
invalidParams.AddNested("TopicPreferences", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateContactListInput(v *CreateContactListInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateContactListInput"}
if v.ContactListName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContactListName"))
}
if v.Topics != nil {
if err := validateTopics(v.Topics); err != nil {
invalidParams.AddNested("Topics", 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 validateOpCreateCustomVerificationEmailTemplateInput(v *CreateCustomVerificationEmailTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateCustomVerificationEmailTemplateInput"}
if v.TemplateName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TemplateName"))
}
if v.FromEmailAddress == nil {
invalidParams.Add(smithy.NewErrParamRequired("FromEmailAddress"))
}
if v.TemplateSubject == nil {
invalidParams.Add(smithy.NewErrParamRequired("TemplateSubject"))
}
if v.TemplateContent == nil {
invalidParams.Add(smithy.NewErrParamRequired("TemplateContent"))
}
if v.SuccessRedirectionURL == nil {
invalidParams.Add(smithy.NewErrParamRequired("SuccessRedirectionURL"))
}
if v.FailureRedirectionURL == nil {
invalidParams.Add(smithy.NewErrParamRequired("FailureRedirectionURL"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateDedicatedIpPoolInput(v *CreateDedicatedIpPoolInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateDedicatedIpPoolInput"}
if v.PoolName == nil {
invalidParams.Add(smithy.NewErrParamRequired("PoolName"))
}
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 validateOpCreateDeliverabilityTestReportInput(v *CreateDeliverabilityTestReportInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateDeliverabilityTestReportInput"}
if v.FromEmailAddress == nil {
invalidParams.Add(smithy.NewErrParamRequired("FromEmailAddress"))
}
if v.Content == nil {
invalidParams.Add(smithy.NewErrParamRequired("Content"))
} else if v.Content != nil {
if err := validateEmailContent(v.Content); err != nil {
invalidParams.AddNested("Content", 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 validateOpCreateEmailIdentityInput(v *CreateEmailIdentityInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateEmailIdentityInput"}
if v.EmailIdentity == nil {
invalidParams.Add(smithy.NewErrParamRequired("EmailIdentity"))
}
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 validateOpCreateEmailIdentityPolicyInput(v *CreateEmailIdentityPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateEmailIdentityPolicyInput"}
if v.EmailIdentity == nil {
invalidParams.Add(smithy.NewErrParamRequired("EmailIdentity"))
}
if v.PolicyName == nil {
invalidParams.Add(smithy.NewErrParamRequired("PolicyName"))
}
if v.Policy == nil {
invalidParams.Add(smithy.NewErrParamRequired("Policy"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateEmailTemplateInput(v *CreateEmailTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateEmailTemplateInput"}
if v.TemplateName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TemplateName"))
}
if v.TemplateContent == nil {
invalidParams.Add(smithy.NewErrParamRequired("TemplateContent"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateImportJobInput(v *CreateImportJobInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateImportJobInput"}
if v.ImportDestination == nil {
invalidParams.Add(smithy.NewErrParamRequired("ImportDestination"))
} else if v.ImportDestination != nil {
if err := validateImportDestination(v.ImportDestination); err != nil {
invalidParams.AddNested("ImportDestination", err.(smithy.InvalidParamsError))
}
}
if v.ImportDataSource == nil {
invalidParams.Add(smithy.NewErrParamRequired("ImportDataSource"))
} else if v.ImportDataSource != nil {
if err := validateImportDataSource(v.ImportDataSource); err != nil {
invalidParams.AddNested("ImportDataSource", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteConfigurationSetEventDestinationInput(v *DeleteConfigurationSetEventDestinationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteConfigurationSetEventDestinationInput"}
if v.ConfigurationSetName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ConfigurationSetName"))
}
if v.EventDestinationName == nil {
invalidParams.Add(smithy.NewErrParamRequired("EventDestinationName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteConfigurationSetInput(v *DeleteConfigurationSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteConfigurationSetInput"}
if v.ConfigurationSetName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ConfigurationSetName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteContactInput(v *DeleteContactInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteContactInput"}
if v.ContactListName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContactListName"))
}
if v.EmailAddress == nil {
invalidParams.Add(smithy.NewErrParamRequired("EmailAddress"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteContactListInput(v *DeleteContactListInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteContactListInput"}
if v.ContactListName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContactListName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteCustomVerificationEmailTemplateInput(v *DeleteCustomVerificationEmailTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteCustomVerificationEmailTemplateInput"}
if v.TemplateName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TemplateName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteDedicatedIpPoolInput(v *DeleteDedicatedIpPoolInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteDedicatedIpPoolInput"}
if v.PoolName == nil {
invalidParams.Add(smithy.NewErrParamRequired("PoolName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteEmailIdentityInput(v *DeleteEmailIdentityInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteEmailIdentityInput"}
if v.EmailIdentity == nil {
invalidParams.Add(smithy.NewErrParamRequired("EmailIdentity"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteEmailIdentityPolicyInput(v *DeleteEmailIdentityPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteEmailIdentityPolicyInput"}
if v.EmailIdentity == nil {
invalidParams.Add(smithy.NewErrParamRequired("EmailIdentity"))
}
if v.PolicyName == nil {
invalidParams.Add(smithy.NewErrParamRequired("PolicyName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteEmailTemplateInput(v *DeleteEmailTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteEmailTemplateInput"}
if v.TemplateName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TemplateName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteSuppressedDestinationInput(v *DeleteSuppressedDestinationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteSuppressedDestinationInput"}
if v.EmailAddress == nil {
invalidParams.Add(smithy.NewErrParamRequired("EmailAddress"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetBlacklistReportsInput(v *GetBlacklistReportsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetBlacklistReportsInput"}
if v.BlacklistItemNames == nil {
invalidParams.Add(smithy.NewErrParamRequired("BlacklistItemNames"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetConfigurationSetEventDestinationsInput(v *GetConfigurationSetEventDestinationsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetConfigurationSetEventDestinationsInput"}
if v.ConfigurationSetName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ConfigurationSetName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetConfigurationSetInput(v *GetConfigurationSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetConfigurationSetInput"}
if v.ConfigurationSetName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ConfigurationSetName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetContactInput(v *GetContactInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetContactInput"}
if v.ContactListName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContactListName"))
}
if v.EmailAddress == nil {
invalidParams.Add(smithy.NewErrParamRequired("EmailAddress"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetContactListInput(v *GetContactListInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetContactListInput"}
if v.ContactListName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContactListName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetCustomVerificationEmailTemplateInput(v *GetCustomVerificationEmailTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetCustomVerificationEmailTemplateInput"}
if v.TemplateName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TemplateName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetDedicatedIpInput(v *GetDedicatedIpInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetDedicatedIpInput"}
if v.Ip == nil {
invalidParams.Add(smithy.NewErrParamRequired("Ip"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetDedicatedIpPoolInput(v *GetDedicatedIpPoolInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetDedicatedIpPoolInput"}
if v.PoolName == nil {
invalidParams.Add(smithy.NewErrParamRequired("PoolName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetDeliverabilityTestReportInput(v *GetDeliverabilityTestReportInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetDeliverabilityTestReportInput"}
if v.ReportId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ReportId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetDomainDeliverabilityCampaignInput(v *GetDomainDeliverabilityCampaignInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetDomainDeliverabilityCampaignInput"}
if v.CampaignId == nil {
invalidParams.Add(smithy.NewErrParamRequired("CampaignId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetDomainStatisticsReportInput(v *GetDomainStatisticsReportInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetDomainStatisticsReportInput"}
if v.Domain == nil {
invalidParams.Add(smithy.NewErrParamRequired("Domain"))
}
if v.StartDate == nil {
invalidParams.Add(smithy.NewErrParamRequired("StartDate"))
}
if v.EndDate == nil {
invalidParams.Add(smithy.NewErrParamRequired("EndDate"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetEmailIdentityInput(v *GetEmailIdentityInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetEmailIdentityInput"}
if v.EmailIdentity == nil {
invalidParams.Add(smithy.NewErrParamRequired("EmailIdentity"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetEmailIdentityPoliciesInput(v *GetEmailIdentityPoliciesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetEmailIdentityPoliciesInput"}
if v.EmailIdentity == nil {
invalidParams.Add(smithy.NewErrParamRequired("EmailIdentity"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetEmailTemplateInput(v *GetEmailTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetEmailTemplateInput"}
if v.TemplateName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TemplateName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetImportJobInput(v *GetImportJobInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetImportJobInput"}
if v.JobId == nil {
invalidParams.Add(smithy.NewErrParamRequired("JobId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetSuppressedDestinationInput(v *GetSuppressedDestinationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetSuppressedDestinationInput"}
if v.EmailAddress == nil {
invalidParams.Add(smithy.NewErrParamRequired("EmailAddress"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListContactsInput(v *ListContactsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListContactsInput"}
if v.ContactListName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContactListName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListDomainDeliverabilityCampaignsInput(v *ListDomainDeliverabilityCampaignsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListDomainDeliverabilityCampaignsInput"}
if v.StartDate == nil {
invalidParams.Add(smithy.NewErrParamRequired("StartDate"))
}
if v.EndDate == nil {
invalidParams.Add(smithy.NewErrParamRequired("EndDate"))
}
if v.SubscribedDomain == nil {
invalidParams.Add(smithy.NewErrParamRequired("SubscribedDomain"))
}
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 validateOpPutAccountDetailsInput(v *PutAccountDetailsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutAccountDetailsInput"}
if len(v.MailType) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("MailType"))
}
if v.WebsiteURL == nil {
invalidParams.Add(smithy.NewErrParamRequired("WebsiteURL"))
}
if v.UseCaseDescription == nil {
invalidParams.Add(smithy.NewErrParamRequired("UseCaseDescription"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutAccountVdmAttributesInput(v *PutAccountVdmAttributesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutAccountVdmAttributesInput"}
if v.VdmAttributes == nil {
invalidParams.Add(smithy.NewErrParamRequired("VdmAttributes"))
} else if v.VdmAttributes != nil {
if err := validateVdmAttributes(v.VdmAttributes); err != nil {
invalidParams.AddNested("VdmAttributes", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutConfigurationSetDeliveryOptionsInput(v *PutConfigurationSetDeliveryOptionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutConfigurationSetDeliveryOptionsInput"}
if v.ConfigurationSetName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ConfigurationSetName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutConfigurationSetReputationOptionsInput(v *PutConfigurationSetReputationOptionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutConfigurationSetReputationOptionsInput"}
if v.ConfigurationSetName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ConfigurationSetName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutConfigurationSetSendingOptionsInput(v *PutConfigurationSetSendingOptionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutConfigurationSetSendingOptionsInput"}
if v.ConfigurationSetName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ConfigurationSetName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutConfigurationSetSuppressionOptionsInput(v *PutConfigurationSetSuppressionOptionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutConfigurationSetSuppressionOptionsInput"}
if v.ConfigurationSetName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ConfigurationSetName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutConfigurationSetTrackingOptionsInput(v *PutConfigurationSetTrackingOptionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutConfigurationSetTrackingOptionsInput"}
if v.ConfigurationSetName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ConfigurationSetName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutConfigurationSetVdmOptionsInput(v *PutConfigurationSetVdmOptionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutConfigurationSetVdmOptionsInput"}
if v.ConfigurationSetName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ConfigurationSetName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutDedicatedIpInPoolInput(v *PutDedicatedIpInPoolInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutDedicatedIpInPoolInput"}
if v.Ip == nil {
invalidParams.Add(smithy.NewErrParamRequired("Ip"))
}
if v.DestinationPoolName == nil {
invalidParams.Add(smithy.NewErrParamRequired("DestinationPoolName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutDedicatedIpPoolScalingAttributesInput(v *PutDedicatedIpPoolScalingAttributesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutDedicatedIpPoolScalingAttributesInput"}
if v.PoolName == nil {
invalidParams.Add(smithy.NewErrParamRequired("PoolName"))
}
if len(v.ScalingMode) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("ScalingMode"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutDedicatedIpWarmupAttributesInput(v *PutDedicatedIpWarmupAttributesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutDedicatedIpWarmupAttributesInput"}
if v.Ip == nil {
invalidParams.Add(smithy.NewErrParamRequired("Ip"))
}
if v.WarmupPercentage == nil {
invalidParams.Add(smithy.NewErrParamRequired("WarmupPercentage"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutDeliverabilityDashboardOptionInput(v *PutDeliverabilityDashboardOptionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutDeliverabilityDashboardOptionInput"}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutEmailIdentityConfigurationSetAttributesInput(v *PutEmailIdentityConfigurationSetAttributesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutEmailIdentityConfigurationSetAttributesInput"}
if v.EmailIdentity == nil {
invalidParams.Add(smithy.NewErrParamRequired("EmailIdentity"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutEmailIdentityDkimAttributesInput(v *PutEmailIdentityDkimAttributesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutEmailIdentityDkimAttributesInput"}
if v.EmailIdentity == nil {
invalidParams.Add(smithy.NewErrParamRequired("EmailIdentity"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutEmailIdentityDkimSigningAttributesInput(v *PutEmailIdentityDkimSigningAttributesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutEmailIdentityDkimSigningAttributesInput"}
if v.EmailIdentity == nil {
invalidParams.Add(smithy.NewErrParamRequired("EmailIdentity"))
}
if len(v.SigningAttributesOrigin) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("SigningAttributesOrigin"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutEmailIdentityFeedbackAttributesInput(v *PutEmailIdentityFeedbackAttributesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutEmailIdentityFeedbackAttributesInput"}
if v.EmailIdentity == nil {
invalidParams.Add(smithy.NewErrParamRequired("EmailIdentity"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutEmailIdentityMailFromAttributesInput(v *PutEmailIdentityMailFromAttributesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutEmailIdentityMailFromAttributesInput"}
if v.EmailIdentity == nil {
invalidParams.Add(smithy.NewErrParamRequired("EmailIdentity"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutSuppressedDestinationInput(v *PutSuppressedDestinationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutSuppressedDestinationInput"}
if v.EmailAddress == nil {
invalidParams.Add(smithy.NewErrParamRequired("EmailAddress"))
}
if len(v.Reason) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("Reason"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSendBulkEmailInput(v *SendBulkEmailInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SendBulkEmailInput"}
if v.DefaultEmailTags != nil {
if err := validateMessageTagList(v.DefaultEmailTags); err != nil {
invalidParams.AddNested("DefaultEmailTags", err.(smithy.InvalidParamsError))
}
}
if v.DefaultContent == nil {
invalidParams.Add(smithy.NewErrParamRequired("DefaultContent"))
}
if v.BulkEmailEntries == nil {
invalidParams.Add(smithy.NewErrParamRequired("BulkEmailEntries"))
} else if v.BulkEmailEntries != nil {
if err := validateBulkEmailEntryList(v.BulkEmailEntries); err != nil {
invalidParams.AddNested("BulkEmailEntries", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSendCustomVerificationEmailInput(v *SendCustomVerificationEmailInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SendCustomVerificationEmailInput"}
if v.EmailAddress == nil {
invalidParams.Add(smithy.NewErrParamRequired("EmailAddress"))
}
if v.TemplateName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TemplateName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpSendEmailInput(v *SendEmailInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "SendEmailInput"}
if v.Content == nil {
invalidParams.Add(smithy.NewErrParamRequired("Content"))
} else if v.Content != nil {
if err := validateEmailContent(v.Content); err != nil {
invalidParams.AddNested("Content", err.(smithy.InvalidParamsError))
}
}
if v.EmailTags != nil {
if err := validateMessageTagList(v.EmailTags); err != nil {
invalidParams.AddNested("EmailTags", err.(smithy.InvalidParamsError))
}
}
if v.ListManagementOptions != nil {
if err := validateListManagementOptions(v.ListManagementOptions); err != nil {
invalidParams.AddNested("ListManagementOptions", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpTagResourceInput(v *TagResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if v.Tags == nil {
invalidParams.Add(smithy.NewErrParamRequired("Tags"))
} 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 validateOpTestRenderEmailTemplateInput(v *TestRenderEmailTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "TestRenderEmailTemplateInput"}
if v.TemplateName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TemplateName"))
}
if v.TemplateData == nil {
invalidParams.Add(smithy.NewErrParamRequired("TemplateData"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUntagResourceInput(v *UntagResourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"}
if v.ResourceArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("ResourceArn"))
}
if v.TagKeys == nil {
invalidParams.Add(smithy.NewErrParamRequired("TagKeys"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateConfigurationSetEventDestinationInput(v *UpdateConfigurationSetEventDestinationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateConfigurationSetEventDestinationInput"}
if v.ConfigurationSetName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ConfigurationSetName"))
}
if v.EventDestinationName == nil {
invalidParams.Add(smithy.NewErrParamRequired("EventDestinationName"))
}
if v.EventDestination == nil {
invalidParams.Add(smithy.NewErrParamRequired("EventDestination"))
} else if v.EventDestination != nil {
if err := validateEventDestinationDefinition(v.EventDestination); err != nil {
invalidParams.AddNested("EventDestination", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateContactInput(v *UpdateContactInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateContactInput"}
if v.ContactListName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContactListName"))
}
if v.EmailAddress == nil {
invalidParams.Add(smithy.NewErrParamRequired("EmailAddress"))
}
if v.TopicPreferences != nil {
if err := validateTopicPreferenceList(v.TopicPreferences); err != nil {
invalidParams.AddNested("TopicPreferences", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateContactListInput(v *UpdateContactListInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateContactListInput"}
if v.ContactListName == nil {
invalidParams.Add(smithy.NewErrParamRequired("ContactListName"))
}
if v.Topics != nil {
if err := validateTopics(v.Topics); err != nil {
invalidParams.AddNested("Topics", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateCustomVerificationEmailTemplateInput(v *UpdateCustomVerificationEmailTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateCustomVerificationEmailTemplateInput"}
if v.TemplateName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TemplateName"))
}
if v.FromEmailAddress == nil {
invalidParams.Add(smithy.NewErrParamRequired("FromEmailAddress"))
}
if v.TemplateSubject == nil {
invalidParams.Add(smithy.NewErrParamRequired("TemplateSubject"))
}
if v.TemplateContent == nil {
invalidParams.Add(smithy.NewErrParamRequired("TemplateContent"))
}
if v.SuccessRedirectionURL == nil {
invalidParams.Add(smithy.NewErrParamRequired("SuccessRedirectionURL"))
}
if v.FailureRedirectionURL == nil {
invalidParams.Add(smithy.NewErrParamRequired("FailureRedirectionURL"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateEmailIdentityPolicyInput(v *UpdateEmailIdentityPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateEmailIdentityPolicyInput"}
if v.EmailIdentity == nil {
invalidParams.Add(smithy.NewErrParamRequired("EmailIdentity"))
}
if v.PolicyName == nil {
invalidParams.Add(smithy.NewErrParamRequired("PolicyName"))
}
if v.Policy == nil {
invalidParams.Add(smithy.NewErrParamRequired("Policy"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateEmailTemplateInput(v *UpdateEmailTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateEmailTemplateInput"}
if v.TemplateName == nil {
invalidParams.Add(smithy.NewErrParamRequired("TemplateName"))
}
if v.TemplateContent == nil {
invalidParams.Add(smithy.NewErrParamRequired("TemplateContent"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 3,574 |
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 SESv2 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: "email.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "email-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "email-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "email.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "af-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ca-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-north-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "fips-us-east-1",
}: endpoints.Endpoint{
Hostname: "email-fips.us-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-west-2",
}: endpoints.Endpoint{
Hostname: "email-fips.us-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "me-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "sa-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "email-fips.us-east-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "email-fips.us-west-2.amazonaws.com",
},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "email.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "email-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "email-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "email.{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: "email-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "email.{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: "email-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "email.{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: "email-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "email.{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: "email-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "email.{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: "email.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "email-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "email-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "email.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "fips-us-gov-west-1",
}: endpoints.Endpoint{
Hostname: "email-fips.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-gov-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "email-fips.us-gov-west-1.amazonaws.com",
},
},
},
}
| 412 |
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 BehaviorOnMxFailure string
// Enum values for BehaviorOnMxFailure
const (
BehaviorOnMxFailureUseDefaultValue BehaviorOnMxFailure = "USE_DEFAULT_VALUE"
BehaviorOnMxFailureRejectMessage BehaviorOnMxFailure = "REJECT_MESSAGE"
)
// Values returns all known values for BehaviorOnMxFailure. 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 (BehaviorOnMxFailure) Values() []BehaviorOnMxFailure {
return []BehaviorOnMxFailure{
"USE_DEFAULT_VALUE",
"REJECT_MESSAGE",
}
}
type BulkEmailStatus string
// Enum values for BulkEmailStatus
const (
BulkEmailStatusSuccess BulkEmailStatus = "SUCCESS"
BulkEmailStatusMessageRejected BulkEmailStatus = "MESSAGE_REJECTED"
BulkEmailStatusMailFromDomainNotVerified BulkEmailStatus = "MAIL_FROM_DOMAIN_NOT_VERIFIED"
BulkEmailStatusConfigurationSetNotFound BulkEmailStatus = "CONFIGURATION_SET_NOT_FOUND"
BulkEmailStatusTemplateNotFound BulkEmailStatus = "TEMPLATE_NOT_FOUND"
BulkEmailStatusAccountSuspended BulkEmailStatus = "ACCOUNT_SUSPENDED"
BulkEmailStatusAccountThrottled BulkEmailStatus = "ACCOUNT_THROTTLED"
BulkEmailStatusAccountDailyQuotaExceeded BulkEmailStatus = "ACCOUNT_DAILY_QUOTA_EXCEEDED"
BulkEmailStatusInvalidSendingPoolName BulkEmailStatus = "INVALID_SENDING_POOL_NAME"
BulkEmailStatusAccountSendingPaused BulkEmailStatus = "ACCOUNT_SENDING_PAUSED"
BulkEmailStatusConfigurationSetSendingPaused BulkEmailStatus = "CONFIGURATION_SET_SENDING_PAUSED"
BulkEmailStatusInvalidParameter BulkEmailStatus = "INVALID_PARAMETER"
BulkEmailStatusTransientFailure BulkEmailStatus = "TRANSIENT_FAILURE"
BulkEmailStatusFailed BulkEmailStatus = "FAILED"
)
// Values returns all known values for BulkEmailStatus. 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 (BulkEmailStatus) Values() []BulkEmailStatus {
return []BulkEmailStatus{
"SUCCESS",
"MESSAGE_REJECTED",
"MAIL_FROM_DOMAIN_NOT_VERIFIED",
"CONFIGURATION_SET_NOT_FOUND",
"TEMPLATE_NOT_FOUND",
"ACCOUNT_SUSPENDED",
"ACCOUNT_THROTTLED",
"ACCOUNT_DAILY_QUOTA_EXCEEDED",
"INVALID_SENDING_POOL_NAME",
"ACCOUNT_SENDING_PAUSED",
"CONFIGURATION_SET_SENDING_PAUSED",
"INVALID_PARAMETER",
"TRANSIENT_FAILURE",
"FAILED",
}
}
type ContactLanguage string
// Enum values for ContactLanguage
const (
ContactLanguageEn ContactLanguage = "EN"
ContactLanguageJa ContactLanguage = "JA"
)
// Values returns all known values for ContactLanguage. 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 (ContactLanguage) Values() []ContactLanguage {
return []ContactLanguage{
"EN",
"JA",
}
}
type ContactListImportAction string
// Enum values for ContactListImportAction
const (
ContactListImportActionDelete ContactListImportAction = "DELETE"
ContactListImportActionPut ContactListImportAction = "PUT"
)
// Values returns all known values for ContactListImportAction. 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 (ContactListImportAction) Values() []ContactListImportAction {
return []ContactListImportAction{
"DELETE",
"PUT",
}
}
type DataFormat string
// Enum values for DataFormat
const (
DataFormatCsv DataFormat = "CSV"
DataFormatJson DataFormat = "JSON"
)
// Values returns all known values for DataFormat. 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 (DataFormat) Values() []DataFormat {
return []DataFormat{
"CSV",
"JSON",
}
}
type DeliverabilityDashboardAccountStatus string
// Enum values for DeliverabilityDashboardAccountStatus
const (
DeliverabilityDashboardAccountStatusActive DeliverabilityDashboardAccountStatus = "ACTIVE"
DeliverabilityDashboardAccountStatusPendingExpiration DeliverabilityDashboardAccountStatus = "PENDING_EXPIRATION"
DeliverabilityDashboardAccountStatusDisabled DeliverabilityDashboardAccountStatus = "DISABLED"
)
// Values returns all known values for DeliverabilityDashboardAccountStatus. 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 (DeliverabilityDashboardAccountStatus) Values() []DeliverabilityDashboardAccountStatus {
return []DeliverabilityDashboardAccountStatus{
"ACTIVE",
"PENDING_EXPIRATION",
"DISABLED",
}
}
type DeliverabilityTestStatus string
// Enum values for DeliverabilityTestStatus
const (
DeliverabilityTestStatusInProgress DeliverabilityTestStatus = "IN_PROGRESS"
DeliverabilityTestStatusCompleted DeliverabilityTestStatus = "COMPLETED"
)
// Values returns all known values for DeliverabilityTestStatus. 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 (DeliverabilityTestStatus) Values() []DeliverabilityTestStatus {
return []DeliverabilityTestStatus{
"IN_PROGRESS",
"COMPLETED",
}
}
type DimensionValueSource string
// Enum values for DimensionValueSource
const (
DimensionValueSourceMessageTag DimensionValueSource = "MESSAGE_TAG"
DimensionValueSourceEmailHeader DimensionValueSource = "EMAIL_HEADER"
DimensionValueSourceLinkTag DimensionValueSource = "LINK_TAG"
)
// Values returns all known values for DimensionValueSource. 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 (DimensionValueSource) Values() []DimensionValueSource {
return []DimensionValueSource{
"MESSAGE_TAG",
"EMAIL_HEADER",
"LINK_TAG",
}
}
type DkimSigningAttributesOrigin string
// Enum values for DkimSigningAttributesOrigin
const (
DkimSigningAttributesOriginAwsSes DkimSigningAttributesOrigin = "AWS_SES"
DkimSigningAttributesOriginExternal DkimSigningAttributesOrigin = "EXTERNAL"
)
// Values returns all known values for DkimSigningAttributesOrigin. 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 (DkimSigningAttributesOrigin) Values() []DkimSigningAttributesOrigin {
return []DkimSigningAttributesOrigin{
"AWS_SES",
"EXTERNAL",
}
}
type DkimSigningKeyLength string
// Enum values for DkimSigningKeyLength
const (
DkimSigningKeyLengthRsa1024Bit DkimSigningKeyLength = "RSA_1024_BIT"
DkimSigningKeyLengthRsa2048Bit DkimSigningKeyLength = "RSA_2048_BIT"
)
// Values returns all known values for DkimSigningKeyLength. 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 (DkimSigningKeyLength) Values() []DkimSigningKeyLength {
return []DkimSigningKeyLength{
"RSA_1024_BIT",
"RSA_2048_BIT",
}
}
type DkimStatus string
// Enum values for DkimStatus
const (
DkimStatusPending DkimStatus = "PENDING"
DkimStatusSuccess DkimStatus = "SUCCESS"
DkimStatusFailed DkimStatus = "FAILED"
DkimStatusTemporaryFailure DkimStatus = "TEMPORARY_FAILURE"
DkimStatusNotStarted DkimStatus = "NOT_STARTED"
)
// Values returns all known values for DkimStatus. 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 (DkimStatus) Values() []DkimStatus {
return []DkimStatus{
"PENDING",
"SUCCESS",
"FAILED",
"TEMPORARY_FAILURE",
"NOT_STARTED",
}
}
type EventType string
// Enum values for EventType
const (
EventTypeSend EventType = "SEND"
EventTypeReject EventType = "REJECT"
EventTypeBounce EventType = "BOUNCE"
EventTypeComplaint EventType = "COMPLAINT"
EventTypeDelivery EventType = "DELIVERY"
EventTypeOpen EventType = "OPEN"
EventTypeClick EventType = "CLICK"
EventTypeRenderingFailure EventType = "RENDERING_FAILURE"
EventTypeDeliveryDelay EventType = "DELIVERY_DELAY"
EventTypeSubscription EventType = "SUBSCRIPTION"
)
// Values returns all known values for EventType. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (EventType) Values() []EventType {
return []EventType{
"SEND",
"REJECT",
"BOUNCE",
"COMPLAINT",
"DELIVERY",
"OPEN",
"CLICK",
"RENDERING_FAILURE",
"DELIVERY_DELAY",
"SUBSCRIPTION",
}
}
type FeatureStatus string
// Enum values for FeatureStatus
const (
FeatureStatusEnabled FeatureStatus = "ENABLED"
FeatureStatusDisabled FeatureStatus = "DISABLED"
)
// Values returns all known values for FeatureStatus. 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 (FeatureStatus) Values() []FeatureStatus {
return []FeatureStatus{
"ENABLED",
"DISABLED",
}
}
type IdentityType string
// Enum values for IdentityType
const (
IdentityTypeEmailAddress IdentityType = "EMAIL_ADDRESS"
IdentityTypeDomain IdentityType = "DOMAIN"
IdentityTypeManagedDomain IdentityType = "MANAGED_DOMAIN"
)
// Values returns all known values for IdentityType. 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 (IdentityType) Values() []IdentityType {
return []IdentityType{
"EMAIL_ADDRESS",
"DOMAIN",
"MANAGED_DOMAIN",
}
}
type ImportDestinationType string
// Enum values for ImportDestinationType
const (
ImportDestinationTypeSuppressionList ImportDestinationType = "SUPPRESSION_LIST"
ImportDestinationTypeContactList ImportDestinationType = "CONTACT_LIST"
)
// Values returns all known values for ImportDestinationType. 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 (ImportDestinationType) Values() []ImportDestinationType {
return []ImportDestinationType{
"SUPPRESSION_LIST",
"CONTACT_LIST",
}
}
type JobStatus string
// Enum values for JobStatus
const (
JobStatusCreated JobStatus = "CREATED"
JobStatusProcessing JobStatus = "PROCESSING"
JobStatusCompleted JobStatus = "COMPLETED"
JobStatusFailed JobStatus = "FAILED"
)
// Values returns all known values for JobStatus. 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 (JobStatus) Values() []JobStatus {
return []JobStatus{
"CREATED",
"PROCESSING",
"COMPLETED",
"FAILED",
}
}
type ListRecommendationsFilterKey string
// Enum values for ListRecommendationsFilterKey
const (
ListRecommendationsFilterKeyType ListRecommendationsFilterKey = "TYPE"
ListRecommendationsFilterKeyImpact ListRecommendationsFilterKey = "IMPACT"
ListRecommendationsFilterKeyStatus ListRecommendationsFilterKey = "STATUS"
ListRecommendationsFilterKeyResourceArn ListRecommendationsFilterKey = "RESOURCE_ARN"
)
// Values returns all known values for ListRecommendationsFilterKey. 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 (ListRecommendationsFilterKey) Values() []ListRecommendationsFilterKey {
return []ListRecommendationsFilterKey{
"TYPE",
"IMPACT",
"STATUS",
"RESOURCE_ARN",
}
}
type MailFromDomainStatus string
// Enum values for MailFromDomainStatus
const (
MailFromDomainStatusPending MailFromDomainStatus = "PENDING"
MailFromDomainStatusSuccess MailFromDomainStatus = "SUCCESS"
MailFromDomainStatusFailed MailFromDomainStatus = "FAILED"
MailFromDomainStatusTemporaryFailure MailFromDomainStatus = "TEMPORARY_FAILURE"
)
// Values returns all known values for MailFromDomainStatus. 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 (MailFromDomainStatus) Values() []MailFromDomainStatus {
return []MailFromDomainStatus{
"PENDING",
"SUCCESS",
"FAILED",
"TEMPORARY_FAILURE",
}
}
type MailType string
// Enum values for MailType
const (
MailTypeMarketing MailType = "MARKETING"
MailTypeTransactional MailType = "TRANSACTIONAL"
)
// Values returns all known values for MailType. 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 (MailType) Values() []MailType {
return []MailType{
"MARKETING",
"TRANSACTIONAL",
}
}
type Metric string
// Enum values for Metric
const (
MetricSend Metric = "SEND"
MetricComplaint Metric = "COMPLAINT"
MetricPermanentBounce Metric = "PERMANENT_BOUNCE"
MetricTransientBounce Metric = "TRANSIENT_BOUNCE"
MetricOpen Metric = "OPEN"
MetricClick Metric = "CLICK"
MetricDelivery Metric = "DELIVERY"
MetricDeliveryOpen Metric = "DELIVERY_OPEN"
MetricDeliveryClick Metric = "DELIVERY_CLICK"
MetricDeliveryComplaint Metric = "DELIVERY_COMPLAINT"
)
// Values returns all known values for Metric. 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 (Metric) Values() []Metric {
return []Metric{
"SEND",
"COMPLAINT",
"PERMANENT_BOUNCE",
"TRANSIENT_BOUNCE",
"OPEN",
"CLICK",
"DELIVERY",
"DELIVERY_OPEN",
"DELIVERY_CLICK",
"DELIVERY_COMPLAINT",
}
}
type MetricDimensionName string
// Enum values for MetricDimensionName
const (
MetricDimensionNameEmailIdentity MetricDimensionName = "EMAIL_IDENTITY"
MetricDimensionNameConfigurationSet MetricDimensionName = "CONFIGURATION_SET"
MetricDimensionNameIsp MetricDimensionName = "ISP"
)
// Values returns all known values for MetricDimensionName. 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 (MetricDimensionName) Values() []MetricDimensionName {
return []MetricDimensionName{
"EMAIL_IDENTITY",
"CONFIGURATION_SET",
"ISP",
}
}
type MetricNamespace string
// Enum values for MetricNamespace
const (
MetricNamespaceVdm MetricNamespace = "VDM"
)
// Values returns all known values for MetricNamespace. 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 (MetricNamespace) Values() []MetricNamespace {
return []MetricNamespace{
"VDM",
}
}
type QueryErrorCode string
// Enum values for QueryErrorCode
const (
QueryErrorCodeInternalFailure QueryErrorCode = "INTERNAL_FAILURE"
QueryErrorCodeAccessDenied QueryErrorCode = "ACCESS_DENIED"
)
// Values returns all known values for QueryErrorCode. 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 (QueryErrorCode) Values() []QueryErrorCode {
return []QueryErrorCode{
"INTERNAL_FAILURE",
"ACCESS_DENIED",
}
}
type RecommendationImpact string
// Enum values for RecommendationImpact
const (
RecommendationImpactLow RecommendationImpact = "LOW"
RecommendationImpactHigh RecommendationImpact = "HIGH"
)
// Values returns all known values for RecommendationImpact. 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 (RecommendationImpact) Values() []RecommendationImpact {
return []RecommendationImpact{
"LOW",
"HIGH",
}
}
type RecommendationStatus string
// Enum values for RecommendationStatus
const (
RecommendationStatusOpen RecommendationStatus = "OPEN"
RecommendationStatusFixed RecommendationStatus = "FIXED"
)
// Values returns all known values for RecommendationStatus. 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 (RecommendationStatus) Values() []RecommendationStatus {
return []RecommendationStatus{
"OPEN",
"FIXED",
}
}
type RecommendationType string
// Enum values for RecommendationType
const (
RecommendationTypeDkim RecommendationType = "DKIM"
RecommendationTypeDmarc RecommendationType = "DMARC"
RecommendationTypeSpf RecommendationType = "SPF"
RecommendationTypeBimi RecommendationType = "BIMI"
)
// Values returns all known values for RecommendationType. 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 (RecommendationType) Values() []RecommendationType {
return []RecommendationType{
"DKIM",
"DMARC",
"SPF",
"BIMI",
}
}
type ReviewStatus string
// Enum values for ReviewStatus
const (
ReviewStatusPending ReviewStatus = "PENDING"
ReviewStatusFailed ReviewStatus = "FAILED"
ReviewStatusGranted ReviewStatus = "GRANTED"
ReviewStatusDenied ReviewStatus = "DENIED"
)
// Values returns all known values for ReviewStatus. 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 (ReviewStatus) Values() []ReviewStatus {
return []ReviewStatus{
"PENDING",
"FAILED",
"GRANTED",
"DENIED",
}
}
type ScalingMode string
// Enum values for ScalingMode
const (
ScalingModeStandard ScalingMode = "STANDARD"
ScalingModeManaged ScalingMode = "MANAGED"
)
// Values returns all known values for ScalingMode. 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 (ScalingMode) Values() []ScalingMode {
return []ScalingMode{
"STANDARD",
"MANAGED",
}
}
type SubscriptionStatus string
// Enum values for SubscriptionStatus
const (
SubscriptionStatusOptIn SubscriptionStatus = "OPT_IN"
SubscriptionStatusOptOut SubscriptionStatus = "OPT_OUT"
)
// Values returns all known values for SubscriptionStatus. 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 (SubscriptionStatus) Values() []SubscriptionStatus {
return []SubscriptionStatus{
"OPT_IN",
"OPT_OUT",
}
}
type SuppressionListImportAction string
// Enum values for SuppressionListImportAction
const (
SuppressionListImportActionDelete SuppressionListImportAction = "DELETE"
SuppressionListImportActionPut SuppressionListImportAction = "PUT"
)
// Values returns all known values for SuppressionListImportAction. 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 (SuppressionListImportAction) Values() []SuppressionListImportAction {
return []SuppressionListImportAction{
"DELETE",
"PUT",
}
}
type SuppressionListReason string
// Enum values for SuppressionListReason
const (
SuppressionListReasonBounce SuppressionListReason = "BOUNCE"
SuppressionListReasonComplaint SuppressionListReason = "COMPLAINT"
)
// Values returns all known values for SuppressionListReason. 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 (SuppressionListReason) Values() []SuppressionListReason {
return []SuppressionListReason{
"BOUNCE",
"COMPLAINT",
}
}
type TlsPolicy string
// Enum values for TlsPolicy
const (
TlsPolicyRequire TlsPolicy = "REQUIRE"
TlsPolicyOptional TlsPolicy = "OPTIONAL"
)
// Values returns all known values for TlsPolicy. 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 (TlsPolicy) Values() []TlsPolicy {
return []TlsPolicy{
"REQUIRE",
"OPTIONAL",
}
}
type VerificationStatus string
// Enum values for VerificationStatus
const (
VerificationStatusPending VerificationStatus = "PENDING"
VerificationStatusSuccess VerificationStatus = "SUCCESS"
VerificationStatusFailed VerificationStatus = "FAILED"
VerificationStatusTemporaryFailure VerificationStatus = "TEMPORARY_FAILURE"
VerificationStatusNotStarted VerificationStatus = "NOT_STARTED"
)
// Values returns all known values for VerificationStatus. 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 (VerificationStatus) Values() []VerificationStatus {
return []VerificationStatus{
"PENDING",
"SUCCESS",
"FAILED",
"TEMPORARY_FAILURE",
"NOT_STARTED",
}
}
type WarmupStatus string
// Enum values for WarmupStatus
const (
WarmupStatusInProgress WarmupStatus = "IN_PROGRESS"
WarmupStatusDone WarmupStatus = "DONE"
)
// Values returns all known values for WarmupStatus. 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 (WarmupStatus) Values() []WarmupStatus {
return []WarmupStatus{
"IN_PROGRESS",
"DONE",
}
}
| 712 |
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 message can't be sent because the account's ability to send email has been
// permanently restricted.
type AccountSuspendedException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *AccountSuspendedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *AccountSuspendedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *AccountSuspendedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "AccountSuspendedException"
}
return *e.ErrorCodeOverride
}
func (e *AccountSuspendedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The resource specified in your request already exists.
type AlreadyExistsException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *AlreadyExistsException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *AlreadyExistsException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *AlreadyExistsException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "AlreadyExistsException"
}
return *e.ErrorCodeOverride
}
func (e *AlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The input you provided is invalid.
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 }
// The resource is being modified by another operation or thread.
type ConcurrentModificationException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *ConcurrentModificationException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ConcurrentModificationException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ConcurrentModificationException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ConcurrentModificationException"
}
return *e.ErrorCodeOverride
}
func (e *ConcurrentModificationException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// If there is already an ongoing account details update under review.
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 }
// The request couldn't be processed because an error occurred with the Amazon SES
// API v2.
type InternalServiceErrorException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InternalServiceErrorException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InternalServiceErrorException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InternalServiceErrorException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InternalServiceErrorException"
}
return *e.ErrorCodeOverride
}
func (e *InternalServiceErrorException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// The specified request includes an invalid or expired token.
type InvalidNextTokenException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InvalidNextTokenException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidNextTokenException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidNextTokenException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidNextTokenException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidNextTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// There are too many instances of the specified resource type.
type LimitExceededException struct {
Message *string
ErrorCodeOverride *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 message can't be sent because the sending domain isn't verified.
type MailFromDomainNotVerifiedException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *MailFromDomainNotVerifiedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *MailFromDomainNotVerifiedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *MailFromDomainNotVerifiedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "MailFromDomainNotVerifiedException"
}
return *e.ErrorCodeOverride
}
func (e *MailFromDomainNotVerifiedException) ErrorFault() smithy.ErrorFault {
return smithy.FaultClient
}
// The message can't be sent because it contains invalid content.
type MessageRejected struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *MessageRejected) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *MessageRejected) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *MessageRejected) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "MessageRejected"
}
return *e.ErrorCodeOverride
}
func (e *MessageRejected) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The resource you attempted to access doesn't exist.
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 message can't be sent because the account's ability to send email is
// currently paused.
type SendingPausedException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *SendingPausedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *SendingPausedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *SendingPausedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "SendingPausedException"
}
return *e.ErrorCodeOverride
}
func (e *SendingPausedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Too many requests have been made to the operation.
type TooManyRequestsException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *TooManyRequestsException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *TooManyRequestsException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *TooManyRequestsException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "TooManyRequestsException"
}
return *e.ErrorCodeOverride
}
func (e *TooManyRequestsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
| 352 |
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"
)
// An object that contains information about your account details.
type AccountDetails struct {
// Additional email addresses where updates are sent about your account review
// process.
AdditionalContactEmailAddresses []string
// The language you would prefer for the case. The contact language can be one of
// ENGLISH or JAPANESE .
ContactLanguage ContactLanguage
// The type of email your account is sending. The mail type can be one of the
// following:
// - MARKETING – Most of your sending traffic is to keep your customers informed
// of your latest offering.
// - TRANSACTIONAL – Most of your sending traffic is to communicate during a
// transaction with a customer.
MailType MailType
// Information about the review of the latest details you submitted.
ReviewDetails *ReviewDetails
// A description of the types of email that you plan to send.
UseCaseDescription *string
// The URL of your website. This information helps us better understand the type
// of content that you plan to send.
WebsiteURL *string
noSmithyDocumentSerde
}
// Represents a single metric data query to include in a batch.
type BatchGetMetricDataQuery struct {
// Represents the end date for the query interval.
//
// This member is required.
EndDate *time.Time
// The query identifier.
//
// This member is required.
Id *string
// The queried metric. This can be one of the following:
// - SEND – Emails sent eligible for tracking in the VDM dashboard. This excludes
// emails sent to the mailbox simulator and emails addressed to more than one
// recipient.
// - COMPLAINT – Complaints received for your account. This excludes complaints
// from the mailbox simulator, those originating from your account-level
// suppression list (if enabled), and those for emails addressed to more than one
// recipient
// - PERMANENT_BOUNCE – Permanent bounces - i.e. feedback received for emails
// sent to non-existent mailboxes. Excludes bounces from the mailbox simulator,
// those originating from your account-level suppression list (if enabled), and
// those for emails addressed to more than one recipient.
// - TRANSIENT_BOUNCE – Transient bounces - i.e. feedback received for delivery
// failures excluding issues with non-existent mailboxes. Excludes bounces from the
// mailbox simulator, and those for emails addressed to more than one recipient.
// - OPEN – Unique open events for emails including open trackers. Excludes opens
// for emails addressed to more than one recipient.
// - CLICK – Unique click events for emails including wrapped links. Excludes
// clicks for emails addressed to more than one recipient.
// - DELIVERY – Successful deliveries for email sending attempts. Excludes
// deliveries to the mailbox simulator and for emails addressed to more than one
// recipient.
// - DELIVERY_OPEN – Successful deliveries for email sending attempts. Excludes
// deliveries to the mailbox simulator, for emails addressed to more than one
// recipient, and emails without open trackers.
// - DELIVERY_CLICK – Successful deliveries for email sending attempts. Excludes
// deliveries to the mailbox simulator, for emails addressed to more than one
// recipient, and emails without click trackers.
// - DELIVERY_COMPLAINT – Successful deliveries for email sending attempts.
// Excludes deliveries to the mailbox simulator, for emails addressed to more than
// one recipient, and emails addressed to recipients hosted by ISPs with which
// Amazon SES does not have a feedback loop agreement.
//
// This member is required.
Metric Metric
// The query namespace - e.g. VDM
//
// This member is required.
Namespace MetricNamespace
// Represents the start date for the query interval.
//
// This member is required.
StartDate *time.Time
// An object that contains mapping between MetricDimensionName and
// MetricDimensionValue to filter metrics by.
Dimensions map[string]string
noSmithyDocumentSerde
}
// An object that contains information about a blacklisting event that impacts one
// of the dedicated IP addresses that is associated with your account.
type BlacklistEntry struct {
// Additional information about the blacklisting event, as provided by the
// blacklist maintainer.
Description *string
// The time when the blacklisting event occurred.
ListingTime *time.Time
// The name of the blacklist that the IP address appears on.
RblName *string
noSmithyDocumentSerde
}
// Represents the body of the email message.
type Body struct {
// An object that represents the version of the message that is displayed in email
// clients that support HTML. HTML messages can include formatted text, hyperlinks,
// images, and more.
Html *Content
// An object that represents the version of the message that is displayed in email
// clients that don't support HTML, or clients where the recipient has disabled
// HTML rendering.
Text *Content
noSmithyDocumentSerde
}
// An object that contains the body of the message. You can specify a template
// message.
type BulkEmailContent struct {
// The template to use for the bulk email message.
Template *Template
noSmithyDocumentSerde
}
type BulkEmailEntry struct {
// Represents the destination of the message, consisting of To:, CC:, and BCC:
// fields. Amazon SES does not support the SMTPUTF8 extension, as described in
// RFC6531 (https://tools.ietf.org/html/rfc6531) . For this reason, the local part
// of a destination email address (the part of the email address that precedes the
// @ sign) may only contain 7-bit ASCII characters (https://en.wikipedia.org/wiki/Email_address#Local-part)
// . If the domain part of an address (the part after the @ sign) contains
// non-ASCII characters, they must be encoded using Punycode, as described in
// RFC3492 (https://tools.ietf.org/html/rfc3492.html) .
//
// This member is required.
Destination *Destination
// The ReplacementEmailContent associated with a BulkEmailEntry .
ReplacementEmailContent *ReplacementEmailContent
// A list of tags, in the form of name/value pairs, to apply to an email that you
// send using the SendBulkTemplatedEmail operation. Tags correspond to
// characteristics of the email that you define, so that you can publish email
// sending events.
ReplacementTags []MessageTag
noSmithyDocumentSerde
}
// The result of the SendBulkEmail operation of each specified BulkEmailEntry .
type BulkEmailEntryResult struct {
// A description of an error that prevented a message being sent using the
// SendBulkTemplatedEmail operation.
Error *string
// The unique message identifier returned from the SendBulkTemplatedEmail
// operation.
MessageId *string
// The status of a message sent using the SendBulkTemplatedEmail operation.
// Possible values for this parameter include:
// - SUCCESS: Amazon SES accepted the message, and will attempt to deliver it to
// the recipients.
// - MESSAGE_REJECTED: The message was rejected because it contained a virus.
// - MAIL_FROM_DOMAIN_NOT_VERIFIED: The sender's email address or domain was not
// verified.
// - CONFIGURATION_SET_DOES_NOT_EXIST: The configuration set you specified does
// not exist.
// - TEMPLATE_DOES_NOT_EXIST: The template you specified does not exist.
// - ACCOUNT_SUSPENDED: Your account has been shut down because of issues
// related to your email sending practices.
// - ACCOUNT_THROTTLED: The number of emails you can send has been reduced
// because your account has exceeded its allocated sending limit.
// - ACCOUNT_DAILY_QUOTA_EXCEEDED: You have reached or exceeded the maximum
// number of emails you can send from your account in a 24-hour period.
// - INVALID_SENDING_POOL_NAME: The configuration set you specified refers to an
// IP pool that does not exist.
// - ACCOUNT_SENDING_PAUSED: Email sending for the Amazon SES account was
// disabled using the UpdateAccountSendingEnabled (https://docs.aws.amazon.com/ses/latest/APIReference/API_UpdateAccountSendingEnabled.html)
// operation.
// - CONFIGURATION_SET_SENDING_PAUSED: Email sending for this configuration set
// was disabled using the UpdateConfigurationSetSendingEnabled (https://docs.aws.amazon.com/ses/latest/APIReference/API_UpdateConfigurationSetSendingEnabled.html)
// operation.
// - INVALID_PARAMETER_VALUE: One or more of the parameters you specified when
// calling this operation was invalid. See the error message for additional
// information.
// - TRANSIENT_FAILURE: Amazon SES was unable to process your request because of
// a temporary issue.
// - FAILED: Amazon SES was unable to process your request. See the error
// message for additional information.
Status BulkEmailStatus
noSmithyDocumentSerde
}
// An object that defines an Amazon CloudWatch destination for email events. You
// can use Amazon CloudWatch to monitor and gain insights on your email sending
// metrics.
type CloudWatchDestination struct {
// An array of objects that define the dimensions to use when you send email
// events to Amazon CloudWatch.
//
// This member is required.
DimensionConfigurations []CloudWatchDimensionConfiguration
noSmithyDocumentSerde
}
// An object that defines the dimension configuration to use when you send email
// events to Amazon CloudWatch.
type CloudWatchDimensionConfiguration struct {
// The default value of the dimension that is published to Amazon CloudWatch if
// you don't provide the value of the dimension when you send an email. This value
// has to meet the following criteria:
// - Can only contain ASCII letters (a–z, A–Z), numbers (0–9), underscores (_),
// or dashes (-), at signs (@), and periods (.).
// - It can contain no more than 256 characters.
//
// This member is required.
DefaultDimensionValue *string
// The name of an Amazon CloudWatch dimension associated with an email sending
// metric. The name has to meet the following criteria:
// - It can only contain ASCII letters (a–z, A–Z), numbers (0–9), underscores
// (_), or dashes (-).
// - It can contain no more than 256 characters.
//
// This member is required.
DimensionName *string
// The location where the Amazon SES API v2 finds the value of a dimension to
// publish to Amazon CloudWatch. To use the message tags that you specify using an
// X-SES-MESSAGE-TAGS header or a parameter to the SendEmail or SendRawEmail API,
// choose messageTag . To use your own email headers, choose emailHeader . To use
// link tags, choose linkTags .
//
// This member is required.
DimensionValueSource DimensionValueSource
noSmithyDocumentSerde
}
// A contact is the end-user who is receiving the email.
type Contact struct {
// The contact's email address.
EmailAddress *string
// A timestamp noting the last time the contact's information was updated.
LastUpdatedTimestamp *time.Time
// The default topic preferences applied to the contact.
TopicDefaultPreferences []TopicPreference
// The contact's preference for being opted-in to or opted-out of a topic.
TopicPreferences []TopicPreference
// A boolean value status noting if the contact is unsubscribed from all contact
// list topics.
UnsubscribeAll bool
noSmithyDocumentSerde
}
// A list that contains contacts that have subscribed to a particular topic or
// topics.
type ContactList struct {
// The name of the contact list.
ContactListName *string
// A timestamp noting the last time the contact list was updated.
LastUpdatedTimestamp *time.Time
noSmithyDocumentSerde
}
// An object that contains details about the action of a contact list.
type ContactListDestination struct {
// >The type of action to perform on the addresses. The following are the possible
// values:
// - PUT: add the addresses to the contact list. If the record already exists,
// it will override it with the new value.
// - DELETE: remove the addresses from the contact list.
//
// This member is required.
ContactListImportAction ContactListImportAction
// The name of the contact list.
//
// This member is required.
ContactListName *string
noSmithyDocumentSerde
}
// An object that represents the content of the email, and optionally a character
// set specification.
type Content struct {
// The content of the message itself.
//
// This member is required.
Data *string
// The character set for the content. Because of the constraints of the SMTP
// protocol, Amazon SES uses 7-bit ASCII by default. If the text includes
// characters outside of the ASCII range, you have to specify a character set. For
// example, you could specify UTF-8 , ISO-8859-1 , or Shift_JIS .
Charset *string
noSmithyDocumentSerde
}
// Contains information about a custom verification email template.
type CustomVerificationEmailTemplateMetadata struct {
// The URL that the recipient of the verification email is sent to if his or her
// address is not successfully verified.
FailureRedirectionURL *string
// The email address that the custom verification email is sent from.
FromEmailAddress *string
// The URL that the recipient of the verification email is sent to if his or her
// address is successfully verified.
SuccessRedirectionURL *string
// The name of the custom verification email template.
TemplateName *string
// The subject line of the custom verification email.
TemplateSubject *string
noSmithyDocumentSerde
}
// An object that contains information about the volume of email sent on each day
// of the analysis period.
type DailyVolume struct {
// An object that contains inbox placement metrics for a specified day in the
// analysis period, broken out by the recipient's email provider.
DomainIspPlacements []DomainIspPlacement
// The date that the DailyVolume metrics apply to, in Unix time.
StartDate *time.Time
// An object that contains inbox placement metrics for a specific day in the
// analysis period.
VolumeStatistics *VolumeStatistics
noSmithyDocumentSerde
}
// An object containing additional settings for your VDM configuration as
// applicable to the Dashboard.
type DashboardAttributes struct {
// Specifies the status of your VDM engagement metrics collection. Can be one of
// the following:
// - ENABLED – Amazon SES enables engagement metrics for your account.
// - DISABLED – Amazon SES disables engagement metrics for your account.
EngagementMetrics FeatureStatus
noSmithyDocumentSerde
}
// An object containing additional settings for your VDM configuration as
// applicable to the Dashboard.
type DashboardOptions struct {
// Specifies the status of your VDM engagement metrics collection. Can be one of
// the following:
// - ENABLED – Amazon SES enables engagement metrics for the configuration set.
// - DISABLED – Amazon SES disables engagement metrics for the configuration set.
EngagementMetrics FeatureStatus
noSmithyDocumentSerde
}
// Contains information about a dedicated IP address that is associated with your
// Amazon SES account. To learn more about requesting dedicated IP addresses, see
// Requesting and Relinquishing Dedicated IP Addresses (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/dedicated-ip-case.html)
// in the Amazon SES Developer Guide.
type DedicatedIp struct {
// An IPv4 address.
//
// This member is required.
Ip *string
// Indicates how complete the dedicated IP warm-up process is. When this value
// equals 1, the address has completed the warm-up process and is ready for use.
//
// This member is required.
WarmupPercentage *int32
// The warm-up status of a dedicated IP address. The status can have one of the
// following values:
// - IN_PROGRESS – The IP address isn't ready to use because the dedicated IP
// warm-up process is ongoing.
// - DONE – The dedicated IP warm-up process is complete, and the IP address is
// ready to use.
//
// This member is required.
WarmupStatus WarmupStatus
// The name of the dedicated IP pool that the IP address is associated with.
PoolName *string
noSmithyDocumentSerde
}
// Contains information about a dedicated IP pool.
type DedicatedIpPool struct {
// The name of the dedicated IP pool.
//
// This member is required.
PoolName *string
// The type of the dedicated IP pool.
// - STANDARD – A dedicated IP pool where you can control which IPs are part of
// the pool.
// - MANAGED – A dedicated IP pool where the reputation and number of IPs are
// automatically managed by Amazon SES.
//
// This member is required.
ScalingMode ScalingMode
noSmithyDocumentSerde
}
// An object that contains metadata related to a predictive inbox placement test.
type DeliverabilityTestReport struct {
// The date and time when the predictive inbox placement test was created.
CreateDate *time.Time
// The status of the predictive inbox placement test. If the status is IN_PROGRESS
// , then the predictive inbox placement test is currently running. Predictive
// inbox placement tests are usually complete within 24 hours of creating the test.
// If the status is COMPLETE , then the test is finished, and you can use the
// GetDeliverabilityTestReport to view the results of the test.
DeliverabilityTestStatus DeliverabilityTestStatus
// The sender address that you specified for the predictive inbox placement test.
FromEmailAddress *string
// A unique string that identifies the predictive inbox placement test.
ReportId *string
// A name that helps you identify a predictive inbox placement test report.
ReportName *string
// The subject line for an email that you submitted in a predictive inbox
// placement test.
Subject *string
noSmithyDocumentSerde
}
// Used to associate a configuration set with a dedicated IP pool.
type DeliveryOptions struct {
// The name of the dedicated IP pool to associate with the configuration set.
SendingPoolName *string
// Specifies whether messages that use the configuration set are required to use
// Transport Layer Security (TLS). If the value is Require , messages are only
// delivered if a TLS connection can be established. If the value is Optional ,
// messages can be delivered in plain text if a TLS connection can't be
// established.
TlsPolicy TlsPolicy
noSmithyDocumentSerde
}
// An object that describes the recipients for an email. Amazon SES does not
// support the SMTPUTF8 extension, as described in RFC6531 (https://tools.ietf.org/html/rfc6531)
// . For this reason, the local part of a destination email address (the part of
// the email address that precedes the @ sign) may only contain 7-bit ASCII
// characters (https://en.wikipedia.org/wiki/Email_address#Local-part) . If the
// domain part of an address (the part after the @ sign) contains non-ASCII
// characters, they must be encoded using Punycode, as described in RFC3492 (https://tools.ietf.org/html/rfc3492.html)
// .
type Destination struct {
// An array that contains the email addresses of the "BCC" (blind carbon copy)
// recipients for the email.
BccAddresses []string
// An array that contains the email addresses of the "CC" (carbon copy) recipients
// for the email.
CcAddresses []string
// An array that contains the email addresses of the "To" recipients for the email.
ToAddresses []string
noSmithyDocumentSerde
}
// An object that contains information about the DKIM authentication status for an
// email identity. Amazon SES determines the authentication status by searching for
// specific records in the DNS configuration for the domain. If you used Easy DKIM (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim.html)
// to set up DKIM authentication, Amazon SES tries to find three unique CNAME
// records in the DNS configuration for your domain. If you provided a public key
// to perform DKIM authentication, Amazon SES tries to find a TXT record that uses
// the selector that you specified. The value of the TXT record must be a public
// key that's paired with the private key that you specified in the process of
// creating the identity
type DkimAttributes struct {
// [Easy DKIM] The key length of the DKIM key pair in use.
CurrentSigningKeyLength DkimSigningKeyLength
// [Easy DKIM] The last time a key pair was generated for this identity.
LastKeyGenerationTimestamp *time.Time
// [Easy DKIM] The key length of the future DKIM key pair to be generated. This
// can be changed at most once per day.
NextSigningKeyLength DkimSigningKeyLength
// A string that indicates how DKIM was configured for the identity. These are the
// possible values:
// - AWS_SES – Indicates that DKIM was configured for the identity by using Easy
// DKIM (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim.html) .
// - EXTERNAL – Indicates that DKIM was configured for the identity by using
// Bring Your Own DKIM (BYODKIM).
SigningAttributesOrigin DkimSigningAttributesOrigin
// If the value is true , then the messages that you send from the identity are
// signed using DKIM. If the value is false , then the messages that you send from
// the identity aren't DKIM-signed.
SigningEnabled bool
// Describes whether or not Amazon SES has successfully located the DKIM records
// in the DNS records for the domain. The status can be one of the following:
// - PENDING – The verification process was initiated, but Amazon SES hasn't yet
// detected the DKIM records in the DNS configuration for the domain.
// - SUCCESS – The verification process completed successfully.
// - FAILED – The verification process failed. This typically occurs when Amazon
// SES fails to find the DKIM records in the DNS configuration of the domain.
// - TEMPORARY_FAILURE – A temporary issue is preventing Amazon SES from
// determining the DKIM authentication status of the domain.
// - NOT_STARTED – The DKIM verification process hasn't been initiated for the
// domain.
Status DkimStatus
// If you used Easy DKIM (https://docs.aws.amazon.com/ses/latest/DeveloperGuide/easy-dkim.html)
// to configure DKIM authentication for the domain, then this object contains a set
// of unique strings that you use to create a set of CNAME records that you add to
// the DNS configuration for your domain. When Amazon SES detects these records in
// the DNS configuration for your domain, the DKIM authentication process is
// complete. If you configured DKIM authentication for the domain by providing your
// own public-private key pair, then this object contains the selector for the
// public key. Regardless of the DKIM authentication method you use, Amazon SES
// searches for the appropriate records in the DNS configuration of the domain for
// up to 72 hours.
Tokens []string
noSmithyDocumentSerde
}
// An object that contains configuration for Bring Your Own DKIM (BYODKIM), or,
// for Easy DKIM
type DkimSigningAttributes struct {
// [Bring Your Own DKIM] A private key that's used to generate a DKIM signature.
// The private key must use 1024 or 2048-bit RSA encryption, and must be encoded
// using base64 encoding.
DomainSigningPrivateKey *string
// [Bring Your Own DKIM] A string that's used to identify a public key in the DNS
// configuration for a domain.
DomainSigningSelector *string
// [Easy DKIM] The key length of the future DKIM key pair to be generated. This
// can be changed at most once per day.
NextSigningKeyLength DkimSigningKeyLength
noSmithyDocumentSerde
}
// An object that contains the deliverability data for a specific campaign. This
// data is available for a campaign only if the campaign sent email by using a
// domain that the Deliverability dashboard is enabled for (
// PutDeliverabilityDashboardOption operation).
type DomainDeliverabilityCampaign struct {
// The unique identifier for the campaign. The Deliverability dashboard
// automatically generates and assigns this identifier to a campaign.
CampaignId *string
// The percentage of email messages that were deleted by recipients, without being
// opened first. Due to technical limitations, this value only includes recipients
// who opened the message by using an email client that supports images.
DeleteRate *float64
// The major email providers who handled the email message.
Esps []string
// The first time when the email message was delivered to any recipient's inbox.
// This value can help you determine how long it took for a campaign to deliver an
// email message.
FirstSeenDateTime *time.Time
// The verified email address that the email message was sent from.
FromAddress *string
// The URL of an image that contains a snapshot of the email message that was sent.
ImageUrl *string
// The number of email messages that were delivered to recipients’ inboxes.
InboxCount *int64
// The last time when the email message was delivered to any recipient's inbox.
// This value can help you determine how long it took for a campaign to deliver an
// email message.
LastSeenDateTime *time.Time
// The projected number of recipients that the email message was sent to.
ProjectedVolume *int64
// The percentage of email messages that were opened and then deleted by
// recipients. Due to technical limitations, this value only includes recipients
// who opened the message by using an email client that supports images.
ReadDeleteRate *float64
// The percentage of email messages that were opened by recipients. Due to
// technical limitations, this value only includes recipients who opened the
// message by using an email client that supports images.
ReadRate *float64
// The IP addresses that were used to send the email message.
SendingIps []string
// The number of email messages that were delivered to recipients' spam or junk
// mail folders.
SpamCount *int64
// The subject line, or title, of the email message.
Subject *string
noSmithyDocumentSerde
}
// An object that contains information about the Deliverability dashboard
// subscription for a verified domain that you use to send email and currently has
// an active Deliverability dashboard subscription. If a Deliverability dashboard
// subscription is active for a domain, you gain access to reputation, inbox
// placement, and other metrics for the domain.
type DomainDeliverabilityTrackingOption struct {
// A verified domain that’s associated with your Amazon Web Services account and
// currently has an active Deliverability dashboard subscription.
Domain *string
// An object that contains information about the inbox placement data settings for
// the domain.
InboxPlacementTrackingOption *InboxPlacementTrackingOption
// The date when you enabled the Deliverability dashboard for the domain.
SubscriptionStartDate *time.Time
noSmithyDocumentSerde
}
// An object that contains inbox placement data for email sent from one of your
// email domains to a specific email provider.
type DomainIspPlacement struct {
// The percentage of messages that were sent from the selected domain to the
// specified email provider that arrived in recipients' inboxes.
InboxPercentage *float64
// The total number of messages that were sent from the selected domain to the
// specified email provider that arrived in recipients' inboxes.
InboxRawCount *int64
// The name of the email provider that the inbox placement data applies to.
IspName *string
// The percentage of messages that were sent from the selected domain to the
// specified email provider that arrived in recipients' spam or junk mail folders.
SpamPercentage *float64
// The total number of messages that were sent from the selected domain to the
// specified email provider that arrived in recipients' spam or junk mail folders.
SpamRawCount *int64
noSmithyDocumentSerde
}
// An object that defines the entire content of the email, including the message
// headers and the body content. You can create a simple email message, in which
// you specify the subject and the text and HTML versions of the message body. You
// can also create raw messages, in which you specify a complete MIME-formatted
// message. Raw messages can include attachments and custom headers.
type EmailContent struct {
// The raw email message. The message has to meet the following criteria:
// - The message has to contain a header and a body, separated by one blank
// line.
// - All of the required header fields must be present in the message.
// - Each part of a multipart MIME message must be formatted properly.
// - If you include attachments, they must be in a file format that the Amazon
// SES API v2 supports.
// - The entire message must be Base64 encoded.
// - If any of the MIME parts in your message contain content that is outside of
// the 7-bit ASCII character range, you should encode that content to ensure that
// recipients' email clients render the message properly.
// - The length of any single line of text in the message can't exceed 1,000
// characters. This restriction is defined in RFC 5321 (https://tools.ietf.org/html/rfc5321)
// .
Raw *RawMessage
// The simple email message. The message consists of a subject and a message body.
Simple *Message
// The template to use for the email message.
Template *Template
noSmithyDocumentSerde
}
// The content of the email, composed of a subject line, an HTML part, and a
// text-only part.
type EmailTemplateContent struct {
// The HTML body of the email.
Html *string
// The subject line of the email.
Subject *string
// The email body that will be visible to recipients whose email clients do not
// display HTML.
Text *string
noSmithyDocumentSerde
}
// Contains information about an email template.
type EmailTemplateMetadata struct {
// The time and date the template was created.
CreatedTimestamp *time.Time
// The name of the template.
TemplateName *string
noSmithyDocumentSerde
}
// In the Amazon SES API v2, events include message sends, deliveries, opens,
// clicks, bounces, complaints and delivery delays. Event destinations are places
// that you can send information about these events to. For example, you can send
// event data to Amazon SNS to receive notifications when you receive bounces or
// complaints, or you can use Amazon Kinesis Data Firehose to stream data to Amazon
// S3 for long-term storage.
type EventDestination struct {
// The types of events that Amazon SES sends to the specified event destinations.
// - SEND - The send request was successful and SES will attempt to deliver the
// message to the recipient’s mail server. (If account-level or global suppression
// is being used, SES will still count it as a send, but delivery is suppressed.)
// - REJECT - SES accepted the email, but determined that it contained a virus
// and didn’t attempt to deliver it to the recipient’s mail server.
// - BOUNCE - (Hard bounce) The recipient's mail server permanently rejected the
// email. (Soft bounces are only included when SES fails to deliver the email after
// retrying for a period of time.)
// - COMPLAINT - The email was successfully delivered to the recipient’s mail
// server, but the recipient marked it as spam.
// - DELIVERY - SES successfully delivered the email to the recipient's mail
// server.
// - OPEN - The recipient received the message and opened it in their email
// client.
// - CLICK - The recipient clicked one or more links in the email.
// - RENDERING_FAILURE - The email wasn't sent because of a template rendering
// issue. This event type can occur when template data is missing, or when there is
// a mismatch between template parameters and data. (This event type only occurs
// when you send email using the SendTemplatedEmail (https://docs.aws.amazon.com/ses/latest/APIReference/API_SendTemplatedEmail.html)
// or SendBulkTemplatedEmail (https://docs.aws.amazon.com/ses/latest/APIReference/API_SendBulkTemplatedEmail.html)
// API operations.)
// - DELIVERY_DELAY - The email couldn't be delivered to the recipient’s mail
// server because a temporary issue occurred. Delivery delays can occur, for
// example, when the recipient's inbox is full, or when the receiving email server
// experiences a transient issue.
// - SUBSCRIPTION - The email was successfully delivered, but the recipient
// updated their subscription preferences by clicking on an unsubscribe link as
// part of your subscription management (https://docs.aws.amazon.com/ses/latest/dg/sending-email-subscription-management.html)
// .
//
// This member is required.
MatchingEventTypes []EventType
// A name that identifies the event destination.
//
// This member is required.
Name *string
// An object that defines an Amazon CloudWatch destination for email events. You
// can use Amazon CloudWatch to monitor and gain insights on your email sending
// metrics.
CloudWatchDestination *CloudWatchDestination
// If true , the event destination is enabled. When the event destination is
// enabled, the specified event types are sent to the destinations in this
// EventDestinationDefinition . If false , the event destination is disabled. When
// the event destination is disabled, events aren't sent to the specified
// destinations.
Enabled bool
// An object that defines an Amazon Kinesis Data Firehose destination for email
// events. You can use Amazon Kinesis Data Firehose to stream data to other
// services, such as Amazon S3 and Amazon Redshift.
KinesisFirehoseDestination *KinesisFirehoseDestination
// An object that defines an Amazon Pinpoint project destination for email events.
// You can send email event data to a Amazon Pinpoint project to view metrics using
// the Transactional Messaging dashboards that are built in to Amazon Pinpoint. For
// more information, see Transactional Messaging Charts (https://docs.aws.amazon.com/pinpoint/latest/userguide/analytics-transactional-messages.html)
// in the Amazon Pinpoint User Guide.
PinpointDestination *PinpointDestination
// An object that defines an Amazon SNS destination for email events. You can use
// Amazon SNS to send notification when certain email events occur.
SnsDestination *SnsDestination
noSmithyDocumentSerde
}
// An object that defines the event destination. Specifically, it defines which
// services receive events from emails sent using the configuration set that the
// event destination is associated with. Also defines the types of events that are
// sent to the event destination.
type EventDestinationDefinition struct {
// An object that defines an Amazon CloudWatch destination for email events. You
// can use Amazon CloudWatch to monitor and gain insights on your email sending
// metrics.
CloudWatchDestination *CloudWatchDestination
// If true , the event destination is enabled. When the event destination is
// enabled, the specified event types are sent to the destinations in this
// EventDestinationDefinition . If false , the event destination is disabled. When
// the event destination is disabled, events aren't sent to the specified
// destinations.
Enabled bool
// An object that defines an Amazon Kinesis Data Firehose destination for email
// events. You can use Amazon Kinesis Data Firehose to stream data to other
// services, such as Amazon S3 and Amazon Redshift.
KinesisFirehoseDestination *KinesisFirehoseDestination
// An array that specifies which events the Amazon SES API v2 should send to the
// destinations in this EventDestinationDefinition .
MatchingEventTypes []EventType
// An object that defines an Amazon Pinpoint project destination for email events.
// You can send email event data to a Amazon Pinpoint project to view metrics using
// the Transactional Messaging dashboards that are built in to Amazon Pinpoint. For
// more information, see Transactional Messaging Charts (https://docs.aws.amazon.com/pinpoint/latest/userguide/analytics-transactional-messages.html)
// in the Amazon Pinpoint User Guide.
PinpointDestination *PinpointDestination
// An object that defines an Amazon SNS destination for email events. You can use
// Amazon SNS to send notification when certain email events occur.
SnsDestination *SnsDestination
noSmithyDocumentSerde
}
// An object that contains the failure details about an import job.
type FailureInfo struct {
// A message about why the import job failed.
ErrorMessage *string
// An Amazon S3 presigned URL that contains all the failed records and related
// information.
FailedRecordsS3Url *string
noSmithyDocumentSerde
}
// An object containing additional settings for your VDM configuration as
// applicable to the Guardian.
type GuardianAttributes struct {
// Specifies the status of your VDM optimized shared delivery. Can be one of the
// following:
// - ENABLED – Amazon SES enables optimized shared delivery for your account.
// - DISABLED – Amazon SES disables optimized shared delivery for your account.
OptimizedSharedDelivery FeatureStatus
noSmithyDocumentSerde
}
// An object containing additional settings for your VDM configuration as
// applicable to the Guardian.
type GuardianOptions struct {
// Specifies the status of your VDM optimized shared delivery. Can be one of the
// following:
// - ENABLED – Amazon SES enables optimized shared delivery for the configuration
// set.
// - DISABLED – Amazon SES disables optimized shared delivery for the
// configuration set.
OptimizedSharedDelivery FeatureStatus
noSmithyDocumentSerde
}
// Information about an email identity.
type IdentityInfo struct {
// The address or domain of the identity.
IdentityName *string
// The email identity type. Note: the MANAGED_DOMAIN type is not supported for
// email identity types.
IdentityType IdentityType
// Indicates whether or not you can send email from the identity. An identity is
// an email address or domain that you send email from. Before you can send email
// from an identity, you have to demostrate that you own the identity, and that you
// authorize Amazon SES to send email from that identity.
SendingEnabled bool
// The verification status of the identity. The status can be one of the
// following:
// - PENDING – The verification process was initiated, but Amazon SES hasn't yet
// been able to verify the identity.
// - SUCCESS – The verification process completed successfully.
// - FAILED – The verification process failed.
// - TEMPORARY_FAILURE – A temporary issue is preventing Amazon SES from
// determining the verification status of the identity.
// - NOT_STARTED – The verification process hasn't been initiated for the
// identity.
VerificationStatus VerificationStatus
noSmithyDocumentSerde
}
// An object that contains details about the data source of the import job.
type ImportDataSource struct {
// The data format of the import job's data source.
//
// This member is required.
DataFormat DataFormat
// An Amazon S3 URL in the format s3:///.
//
// This member is required.
S3Url *string
noSmithyDocumentSerde
}
// An object that contains details about the resource destination the import job
// is going to target.
type ImportDestination struct {
// An object that contains the action of the import job towards a contact list.
ContactListDestination *ContactListDestination
// An object that contains the action of the import job towards suppression list.
SuppressionListDestination *SuppressionListDestination
noSmithyDocumentSerde
}
// A summary of the import job.
type ImportJobSummary struct {
// The date and time when the import job was created.
CreatedTimestamp *time.Time
// The number of records that failed processing because of invalid input or other
// reasons.
FailedRecordsCount *int32
// An object that contains details about the resource destination the import job
// is going to target.
ImportDestination *ImportDestination
// A string that represents the import job ID.
JobId *string
// The status of the import job.
JobStatus JobStatus
// The current number of records processed.
ProcessedRecordsCount *int32
noSmithyDocumentSerde
}
// An object that contains information about the inbox placement data settings for
// a verified domain that’s associated with your Amazon Web Services account. This
// data is available only if you enabled the Deliverability dashboard for the
// domain.
type InboxPlacementTrackingOption struct {
// Specifies whether inbox placement data is being tracked for the domain.
Global bool
// An array of strings, one for each major email provider that the inbox placement
// data applies to.
TrackedIsps []string
noSmithyDocumentSerde
}
// An object that describes how email sent during the predictive inbox placement
// test was handled by a certain email provider.
type IspPlacement struct {
// The name of the email provider that the inbox placement data applies to.
IspName *string
// An object that contains inbox placement metrics for a specific email provider.
PlacementStatistics *PlacementStatistics
noSmithyDocumentSerde
}
// An object that defines an Amazon Kinesis Data Firehose destination for email
// events. You can use Amazon Kinesis Data Firehose to stream data to other
// services, such as Amazon S3 and Amazon Redshift.
type KinesisFirehoseDestination struct {
// The Amazon Resource Name (ARN) of the Amazon Kinesis Data Firehose stream that
// the Amazon SES API v2 sends email events to.
//
// This member is required.
DeliveryStreamArn *string
// The Amazon Resource Name (ARN) of the IAM role that the Amazon SES API v2 uses
// to send email events to the Amazon Kinesis Data Firehose stream.
//
// This member is required.
IamRoleArn *string
noSmithyDocumentSerde
}
// A filter that can be applied to a list of contacts.
type ListContactsFilter struct {
// The status by which you are filtering: OPT_IN or OPT_OUT .
FilteredStatus SubscriptionStatus
// Used for filtering by a specific topic preference.
TopicFilter *TopicFilter
noSmithyDocumentSerde
}
// An object used to specify a list or topic to which an email belongs, which will
// be used when a contact chooses to unsubscribe.
type ListManagementOptions struct {
// The name of the contact list.
//
// This member is required.
ContactListName *string
// The name of the topic.
TopicName *string
noSmithyDocumentSerde
}
// A list of attributes that are associated with a MAIL FROM domain.
type MailFromAttributes struct {
// The action to take if the required MX record can't be found when you send an
// email. When you set this value to USE_DEFAULT_VALUE , the mail is sent using
// amazonses.com as the MAIL FROM domain. When you set this value to REJECT_MESSAGE
// , the Amazon SES API v2 returns a MailFromDomainNotVerified error, and doesn't
// attempt to deliver the email. These behaviors are taken when the custom MAIL
// FROM domain configuration is in the Pending , Failed , and TemporaryFailure
// states.
//
// This member is required.
BehaviorOnMxFailure BehaviorOnMxFailure
// The name of a domain that an email identity uses as a custom MAIL FROM domain.
//
// This member is required.
MailFromDomain *string
// The status of the MAIL FROM domain. This status can have the following values:
// - PENDING – Amazon SES hasn't started searching for the MX record yet.
// - SUCCESS – Amazon SES detected the required MX record for the MAIL FROM
// domain.
// - FAILED – Amazon SES can't find the required MX record, or the record no
// longer exists.
// - TEMPORARY_FAILURE – A temporary issue occurred, which prevented Amazon SES
// from determining the status of the MAIL FROM domain.
//
// This member is required.
MailFromDomainStatus MailFromDomainStatus
noSmithyDocumentSerde
}
// Represents the email message that you're sending. The Message object consists
// of a subject line and a message body.
type Message struct {
// The body of the message. You can specify an HTML version of the message, a
// text-only version of the message, or both.
//
// This member is required.
Body *Body
// The subject line of the email. The subject line can only contain 7-bit ASCII
// characters. However, you can specify non-ASCII characters in the subject line by
// using encoded-word syntax, as described in RFC 2047 (https://tools.ietf.org/html/rfc2047)
// .
//
// This member is required.
Subject *Content
noSmithyDocumentSerde
}
// Contains the name and value of a tag that you apply to an email. You can use
// message tags when you publish email sending events.
type MessageTag struct {
// The name of the message tag. The message tag name has to meet the following
// criteria:
// - It can only contain ASCII letters (a–z, A–Z), numbers (0–9), underscores
// (_), or dashes (-).
// - It can contain no more than 256 characters.
//
// This member is required.
Name *string
// The value of the message tag. The message tag value has to meet the following
// criteria:
// - It can only contain ASCII letters (a–z, A–Z), numbers (0–9), underscores
// (_), or dashes (-).
// - It can contain no more than 256 characters.
//
// This member is required.
Value *string
noSmithyDocumentSerde
}
// An error corresponding to the unsuccessful processing of a single metric data
// query.
type MetricDataError struct {
// The query error code. Can be one of:
// - INTERNAL_FAILURE – Amazon SES has failed to process one of the queries.
// - ACCESS_DENIED – You have insufficient access to retrieve metrics based on
// the given query.
Code QueryErrorCode
// The query identifier.
Id *string
// The error message associated with the current query error.
Message *string
noSmithyDocumentSerde
}
// The result of a single metric data query.
type MetricDataResult struct {
// The query identifier.
Id *string
// A list of timestamps for the metric data results.
Timestamps []time.Time
// A list of values (cumulative / sum) for the metric data results.
Values []int64
noSmithyDocumentSerde
}
// An object that contains information about email that was sent from the selected
// domain.
type OverallVolume struct {
// An object that contains inbox and junk mail placement metrics for individual
// email providers.
DomainIspPlacements []DomainIspPlacement
// The percentage of emails that were sent from the domain that were read by their
// recipients.
ReadRatePercent *float64
// An object that contains information about the numbers of messages that arrived
// in recipients' inboxes and junk mail folders.
VolumeStatistics *VolumeStatistics
noSmithyDocumentSerde
}
// An object that defines an Amazon Pinpoint project destination for email events.
// You can send email event data to a Amazon Pinpoint project to view metrics using
// the Transactional Messaging dashboards that are built in to Amazon Pinpoint. For
// more information, see Transactional Messaging Charts (https://docs.aws.amazon.com/pinpoint/latest/userguide/analytics-transactional-messages.html)
// in the Amazon Pinpoint User Guide.
type PinpointDestination struct {
// The Amazon Resource Name (ARN) of the Amazon Pinpoint project to send email
// events to.
ApplicationArn *string
noSmithyDocumentSerde
}
// An object that contains inbox placement data for an email provider.
type PlacementStatistics struct {
// The percentage of emails that were authenticated by using DomainKeys Identified
// Mail (DKIM) during the predictive inbox placement test.
DkimPercentage *float64
// The percentage of emails that arrived in recipients' inboxes during the
// predictive inbox placement test.
InboxPercentage *float64
// The percentage of emails that didn't arrive in recipients' inboxes at all
// during the predictive inbox placement test.
MissingPercentage *float64
// The percentage of emails that arrived in recipients' spam or junk mail folders
// during the predictive inbox placement test.
SpamPercentage *float64
// The percentage of emails that were authenticated by using Sender Policy
// Framework (SPF) during the predictive inbox placement test.
SpfPercentage *float64
noSmithyDocumentSerde
}
// Represents the raw content of an email message.
type RawMessage struct {
// The raw email message. The message has to meet the following criteria:
// - The message has to contain a header and a body, separated by one blank
// line.
// - All of the required header fields must be present in the message.
// - Each part of a multipart MIME message must be formatted properly.
// - Attachments must be in a file format that the Amazon SES supports.
// - The entire message must be Base64 encoded.
// - If any of the MIME parts in your message contain content that is outside of
// the 7-bit ASCII character range, you should encode that content to ensure that
// recipients' email clients render the message properly.
// - The length of any single line of text in the message can't exceed 1,000
// characters. This restriction is defined in RFC 5321 (https://tools.ietf.org/html/rfc5321)
// .
//
// This member is required.
Data []byte
noSmithyDocumentSerde
}
// A recommendation generated for your account.
type Recommendation struct {
// The first time this issue was encountered and the recommendation was generated.
CreatedTimestamp *time.Time
// The recommendation description / disambiguator - e.g. DKIM1 and DKIM2 are
// different recommendations about your DKIM setup.
Description *string
// The recommendation impact, with values like HIGH or LOW .
Impact RecommendationImpact
// The last time the recommendation was updated.
LastUpdatedTimestamp *time.Time
// The resource affected by the recommendation, with values like
// arn:aws:ses:us-east-1:123456789012:identity/example.com .
ResourceArn *string
// The recommendation status, with values like OPEN or FIXED .
Status RecommendationStatus
// The recommendation type, with values like DKIM , SPF , DMARC or BIMI .
Type RecommendationType
noSmithyDocumentSerde
}
// The ReplaceEmailContent object to be used for a specific BulkEmailEntry . The
// ReplacementTemplate can be specified within this object.
type ReplacementEmailContent struct {
// The ReplacementTemplate associated with ReplacementEmailContent .
ReplacementTemplate *ReplacementTemplate
noSmithyDocumentSerde
}
// An object which contains ReplacementTemplateData to be used for a specific
// BulkEmailEntry .
type ReplacementTemplate struct {
// A list of replacement values to apply to the template. This parameter is a JSON
// object, typically consisting of key-value pairs in which the keys correspond to
// replacement tags in the email template.
ReplacementTemplateData *string
noSmithyDocumentSerde
}
// Enable or disable collection of reputation metrics for emails that you send
// using this configuration set in the current Amazon Web Services Region.
type ReputationOptions struct {
// The date and time (in Unix time) when the reputation metrics were last given a
// fresh start. When your account is given a fresh start, your reputation metrics
// are calculated starting from the date of the fresh start.
LastFreshStart *time.Time
// If true , tracking of reputation metrics is enabled for the configuration set.
// If false , tracking of reputation metrics is disabled for the configuration set.
ReputationMetricsEnabled bool
noSmithyDocumentSerde
}
// An object that contains information about your account details review.
type ReviewDetails struct {
// The associated support center case ID (if any).
CaseId *string
// The status of the latest review of your account. The status can be one of the
// following:
// - PENDING – We have received your appeal and are in the process of reviewing
// it.
// - GRANTED – Your appeal has been reviewed and your production access has been
// granted.
// - DENIED – Your appeal has been reviewed and your production access has been
// denied.
// - FAILED – An internal error occurred and we didn't receive your appeal. You
// can submit your appeal again.
Status ReviewStatus
noSmithyDocumentSerde
}
// Used to enable or disable email sending for messages that use this
// configuration set in the current Amazon Web Services Region.
type SendingOptions struct {
// If true , email sending is enabled for the configuration set. If false , email
// sending is disabled for the configuration set.
SendingEnabled bool
noSmithyDocumentSerde
}
// An object that contains information about the per-day and per-second sending
// limits for your Amazon SES account in the current Amazon Web Services Region.
type SendQuota struct {
// The maximum number of emails that you can send in the current Amazon Web
// Services Region over a 24-hour period. A value of -1 signifies an unlimited
// quota. (This value is also referred to as your sending quota.)
Max24HourSend float64
// The maximum number of emails that you can send per second in the current Amazon
// Web Services Region. This value is also called your maximum sending rate or your
// maximum TPS (transactions per second) rate.
MaxSendRate float64
// The number of emails sent from your Amazon SES account in the current Amazon
// Web Services Region over the past 24 hours.
SentLast24Hours float64
noSmithyDocumentSerde
}
// An object that defines an Amazon SNS destination for email events. You can use
// Amazon SNS to send notification when certain email events occur.
type SnsDestination struct {
// The Amazon Resource Name (ARN) of the Amazon SNS topic to publish email events
// to. For more information about Amazon SNS topics, see the Amazon SNS Developer
// Guide (https://docs.aws.amazon.com/sns/latest/dg/CreateTopic.html) .
//
// This member is required.
TopicArn *string
noSmithyDocumentSerde
}
// An object that contains information about an email address that is on the
// suppression list for your account.
type SuppressedDestination struct {
// The email address that is on the suppression list for your account.
//
// This member is required.
EmailAddress *string
// The date and time when the suppressed destination was last updated, shown in
// Unix time format.
//
// This member is required.
LastUpdateTime *time.Time
// The reason that the address was added to the suppression list for your account.
//
// This member is required.
Reason SuppressionListReason
// An optional value that can contain additional information about the reasons
// that the address was added to the suppression list for your account.
Attributes *SuppressedDestinationAttributes
noSmithyDocumentSerde
}
// An object that contains additional attributes that are related an email address
// that is on the suppression list for your account.
type SuppressedDestinationAttributes struct {
// A unique identifier that's generated when an email address is added to the
// suppression list for your account.
FeedbackId *string
// The unique identifier of the email message that caused the email address to be
// added to the suppression list for your account.
MessageId *string
noSmithyDocumentSerde
}
// A summary that describes the suppressed email address.
type SuppressedDestinationSummary struct {
// The email address that's on the suppression list for your account.
//
// This member is required.
EmailAddress *string
// The date and time when the suppressed destination was last updated, shown in
// Unix time format.
//
// This member is required.
LastUpdateTime *time.Time
// The reason that the address was added to the suppression list for your account.
//
// This member is required.
Reason SuppressionListReason
noSmithyDocumentSerde
}
// An object that contains information about the email address suppression
// preferences for your account in the current Amazon Web Services Region.
type SuppressionAttributes struct {
// A list that contains the reasons that email addresses will be automatically
// added to the suppression list for your account. This list can contain any or all
// of the following:
// - COMPLAINT – Amazon SES adds an email address to the suppression list for
// your account when a message sent to that address results in a complaint.
// - BOUNCE – Amazon SES adds an email address to the suppression list for your
// account when a message sent to that address results in a hard bounce.
SuppressedReasons []SuppressionListReason
noSmithyDocumentSerde
}
// An object that contains details about the action of suppression list.
type SuppressionListDestination struct {
// The type of action to perform on the address. The following are possible
// values:
// - PUT: add the addresses to the suppression list. If the record already
// exists, it will override it with the new value.
// - DELETE: remove the addresses from the suppression list.
//
// This member is required.
SuppressionListImportAction SuppressionListImportAction
noSmithyDocumentSerde
}
// An object that contains information about the suppression list preferences for
// your account.
type SuppressionOptions struct {
// A list that contains the reasons that email addresses are automatically added
// to the suppression list for your account. This list can contain any or all of
// the following:
// - COMPLAINT – Amazon SES adds an email address to the suppression list for
// your account when a message sent to that address results in a complaint.
// - BOUNCE – Amazon SES adds an email address to the suppression list for your
// account when a message sent to that address results in a hard bounce.
SuppressedReasons []SuppressionListReason
noSmithyDocumentSerde
}
// An object that defines the tags that are associated with a resource. A tag is a
// label that you optionally define and associate with a resource. Tags can help
// you categorize and manage resources in different ways, such as by purpose,
// owner, environment, or other criteria. A resource can have as many as 50 tags.
// Each tag consists of a required tag key and an associated tag value, both of
// which you define. A tag key is a general label that acts as a category for a
// more specific tag value. A tag value acts as a descriptor within a tag key. A
// tag key can contain as many as 128 characters. A tag value can contain as many
// as 256 characters. The characters can be Unicode letters, digits, white space,
// or one of the following symbols: _ . : / = + -. The following additional
// restrictions apply to tags:
// - Tag keys and values are case sensitive.
// - For each associated resource, each tag key must be unique and it can have
// only one value.
// - The aws: prefix is reserved for use by Amazon Web Services; you can’t use it
// in any tag keys or values that you define. In addition, you can't edit or remove
// tag keys or values that use this prefix. Tags that use this prefix don’t count
// against the limit of 50 tags per resource.
// - You can associate tags with public or shared resources, but the tags are
// available only for your Amazon Web Services account, not any other accounts that
// share the resource. In addition, the tags are available only for resources that
// are located in the specified Amazon Web Services Region for your Amazon Web
// Services account.
type Tag struct {
// One part of a key-value pair that defines a tag. The maximum length of a tag
// key is 128 characters. The minimum length is 1 character.
//
// This member is required.
Key *string
// The optional part of a key-value pair that defines a tag. The maximum length of
// a tag value is 256 characters. The minimum length is 0 characters. If you don't
// want a resource to have a specific tag value, don't specify a value for this
// parameter. If you don't specify a value, Amazon SES sets the value to an empty
// string.
//
// This member is required.
Value *string
noSmithyDocumentSerde
}
// An object that defines the email template to use for an email message, and the
// values to use for any message variables in that template. An email template is a
// type of message template that contains content that you want to define, save,
// and reuse in email messages that you send.
type Template struct {
// The Amazon Resource Name (ARN) of the template.
TemplateArn *string
// An object that defines the values to use for message variables in the template.
// This object is a set of key-value pairs. Each key defines a message variable in
// the template. The corresponding value defines the value to use for that
// variable.
TemplateData *string
// The name of the template. You will refer to this name when you send email using
// the SendTemplatedEmail or SendBulkTemplatedEmail operations.
TemplateName *string
noSmithyDocumentSerde
}
// An interest group, theme, or label within a list. Lists can have multiple
// topics.
type Topic struct {
// The default subscription status to be applied to a contact if the contact has
// not noted their preference for subscribing to a topic.
//
// This member is required.
DefaultSubscriptionStatus SubscriptionStatus
// The name of the topic the contact will see.
//
// This member is required.
DisplayName *string
// The name of the topic.
//
// This member is required.
TopicName *string
// A description of what the topic is about, which the contact will see.
Description *string
noSmithyDocumentSerde
}
// Used for filtering by a specific topic preference.
type TopicFilter struct {
// The name of a topic on which you wish to apply the filter.
TopicName *string
// Notes that the default subscription status should be applied to a contact
// because the contact has not noted their preference for subscribing to a topic.
UseDefaultIfPreferenceUnavailable bool
noSmithyDocumentSerde
}
// The contact's preference for being opted-in to or opted-out of a topic.
type TopicPreference struct {
// The contact's subscription status to a topic which is either OPT_IN or OPT_OUT .
//
// This member is required.
SubscriptionStatus SubscriptionStatus
// The name of the topic.
//
// This member is required.
TopicName *string
noSmithyDocumentSerde
}
// An object that defines the tracking options for a configuration set. When you
// use the Amazon SES API v2 to send an email, it contains an invisible image
// that's used to track when recipients open your email. If your email contains
// links, those links are changed slightly in order to track when recipients click
// them. These images and links include references to a domain operated by Amazon
// Web Services. You can optionally configure the Amazon SES to use a domain that
// you operate for these images and links.
type TrackingOptions struct {
// The domain to use for tracking open and click events.
//
// This member is required.
CustomRedirectDomain *string
noSmithyDocumentSerde
}
// The VDM attributes that apply to your Amazon SES account.
type VdmAttributes struct {
// Specifies the status of your VDM configuration. Can be one of the following:
// - ENABLED – Amazon SES enables VDM for your account.
// - DISABLED – Amazon SES disables VDM for your account.
//
// This member is required.
VdmEnabled FeatureStatus
// Specifies additional settings for your VDM configuration as applicable to the
// Dashboard.
DashboardAttributes *DashboardAttributes
// Specifies additional settings for your VDM configuration as applicable to the
// Guardian.
GuardianAttributes *GuardianAttributes
noSmithyDocumentSerde
}
// An object that defines the VDM settings that apply to emails that you send
// using the configuration set.
type VdmOptions struct {
// Specifies additional settings for your VDM configuration as applicable to the
// Dashboard.
DashboardOptions *DashboardOptions
// Specifies additional settings for your VDM configuration as applicable to the
// Guardian.
GuardianOptions *GuardianOptions
noSmithyDocumentSerde
}
// An object that contains information about the amount of email that was
// delivered to recipients.
type VolumeStatistics struct {
// The total number of emails that arrived in recipients' inboxes.
InboxRawCount *int64
// An estimate of the percentage of emails sent from the current domain that will
// arrive in recipients' inboxes.
ProjectedInbox *int64
// An estimate of the percentage of emails sent from the current domain that will
// arrive in recipients' spam or junk mail folders.
ProjectedSpam *int64
// The total number of emails that arrived in recipients' spam or junk mail
// folders.
SpamRawCount *int64
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
| 1,747 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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 = "SFN"
const ServiceAPIVersion = "2016-11-23"
// Client provides the API client to make operations call for AWS Step Functions.
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, "sfn", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 434 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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 sfn
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/sfn/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates an activity. An activity is a task that you write in any programming
// language and host on any machine that has access to Step Functions. Activities
// must poll Step Functions using the GetActivityTask API action and respond using
// SendTask* API actions. This function lets Step Functions know the existence of
// your activity and returns an identifier for use in a state machine and when
// polling from the activity. This operation is eventually consistent. The results
// are best effort and may not reflect very recent updates and changes.
// CreateActivity is an idempotent API. Subsequent requests won’t create a
// duplicate resource if it was already created. CreateActivity 's idempotency
// check is based on the activity name . If a following request has different tags
// values, Step Functions will ignore these differences and treat it as an
// idempotent request of the previous. In this case, tags will not be updated,
// even if they are different.
func (c *Client) CreateActivity(ctx context.Context, params *CreateActivityInput, optFns ...func(*Options)) (*CreateActivityOutput, error) {
if params == nil {
params = &CreateActivityInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateActivity", params, optFns, c.addOperationCreateActivityMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateActivityOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateActivityInput struct {
// The name of the activity to create. This name must be unique for your Amazon
// Web Services account and region for 90 days. For more information, see Limits
// Related to State Machine Executions (https://docs.aws.amazon.com/step-functions/latest/dg/limits.html#service-limits-state-machine-executions)
// in the Step Functions Developer Guide. A name must not contain:
// - white space
// - brackets < > { } [ ]
// - wildcard characters ? *
// - special characters " # % \ ^ | ~ ` $ & , ; : /
// - control characters ( U+0000-001F , U+007F-009F )
// To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z,
// a-z, - and _.
//
// This member is required.
Name *string
// The list of tags to add to a resource. An array of key-value pairs. For more
// information, see Using Cost Allocation Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html)
// in the Amazon Web Services Billing and Cost Management User Guide, and
// Controlling Access Using IAM Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_iam-tags.html)
// . Tags may only contain Unicode letters, digits, white space, or these symbols:
// _ . : / = + - @ .
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateActivityOutput struct {
// The Amazon Resource Name (ARN) that identifies the created activity.
//
// This member is required.
ActivityArn *string
// The date the activity is created.
//
// This member is required.
CreationDate *time.Time
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateActivityMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreateActivity{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreateActivity{}, 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 = addOpCreateActivityValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateActivity(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_opCreateActivity(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "CreateActivity",
}
}
| 163 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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/sfn/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates a state machine. A state machine consists of a collection of states
// that can do work ( Task states), determine to which states to transition next (
// Choice states), stop an execution with an error ( Fail states), and so on.
// State machines are specified using a JSON-based, structured language. For more
// information, see Amazon States Language (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html)
// in the Step Functions User Guide. If you set the publish parameter of this API
// action to true , it publishes version 1 as the first revision of the state
// machine. This operation is eventually consistent. The results are best effort
// and may not reflect very recent updates and changes. CreateStateMachine is an
// idempotent API. Subsequent requests won’t create a duplicate resource if it was
// already created. CreateStateMachine 's idempotency check is based on the state
// machine name , definition , type , LoggingConfiguration , and
// TracingConfiguration . The check is also based on the publish and
// versionDescription parameters. If a following request has a different roleArn
// or tags , Step Functions will ignore these differences and treat it as an
// idempotent request of the previous. In this case, roleArn and tags will not be
// updated, even if they are different.
func (c *Client) CreateStateMachine(ctx context.Context, params *CreateStateMachineInput, optFns ...func(*Options)) (*CreateStateMachineOutput, error) {
if params == nil {
params = &CreateStateMachineInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateStateMachine", params, optFns, c.addOperationCreateStateMachineMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateStateMachineOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateStateMachineInput struct {
// The Amazon States Language definition of the state machine. See Amazon States
// Language (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html)
// .
//
// This member is required.
Definition *string
// The name of the state machine. A name must not contain:
// - white space
// - brackets < > { } [ ]
// - wildcard characters ? *
// - special characters " # % \ ^ | ~ ` $ & , ; : /
// - control characters ( U+0000-001F , U+007F-009F )
// To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z,
// a-z, - and _.
//
// This member is required.
Name *string
// The Amazon Resource Name (ARN) of the IAM role to use for this state machine.
//
// This member is required.
RoleArn *string
// Defines what execution history events are logged and where they are logged. By
// default, the level is set to OFF . For more information see Log Levels (https://docs.aws.amazon.com/step-functions/latest/dg/cloudwatch-log-level.html)
// in the Step Functions User Guide.
LoggingConfiguration *types.LoggingConfiguration
// Set to true to publish the first version of the state machine during creation.
// The default is false .
Publish bool
// Tags to be added when creating a state machine. An array of key-value pairs.
// For more information, see Using Cost Allocation Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html)
// in the Amazon Web Services Billing and Cost Management User Guide, and
// Controlling Access Using IAM Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_iam-tags.html)
// . Tags may only contain Unicode letters, digits, white space, or these symbols:
// _ . : / = + - @ .
Tags []types.Tag
// Selects whether X-Ray tracing is enabled.
TracingConfiguration *types.TracingConfiguration
// Determines whether a Standard or Express state machine is created. The default
// is STANDARD . You cannot update the type of a state machine once it has been
// created.
Type types.StateMachineType
// Sets description about the state machine version. You can only set the
// description if the publish parameter is set to true . Otherwise, if you set
// versionDescription , but publish to false , this API action throws
// ValidationException .
VersionDescription *string
noSmithyDocumentSerde
}
type CreateStateMachineOutput struct {
// The date the state machine is created.
//
// This member is required.
CreationDate *time.Time
// The Amazon Resource Name (ARN) that identifies the created state machine.
//
// This member is required.
StateMachineArn *string
// The Amazon Resource Name (ARN) that identifies the created state machine
// version. If you do not set the publish parameter to true , this field returns
// null value.
StateMachineVersionArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateStateMachineMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreateStateMachine{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreateStateMachine{}, 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 = addOpCreateStateMachineValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateStateMachine(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_opCreateStateMachine(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "CreateStateMachine",
}
}
| 204 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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/sfn/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates an alias (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-alias.html)
// for a state machine that points to one or two versions (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-version.html)
// of the same state machine. You can set your application to call StartExecution
// with an alias and update the version the alias uses without changing the
// client's code. You can also map an alias to split StartExecution requests
// between two versions of a state machine. To do this, add a second RoutingConfig
// object in the routingConfiguration parameter. You must also specify the
// percentage of execution run requests each version should receive in both
// RoutingConfig objects. Step Functions randomly chooses which version runs a
// given execution based on the percentage you specify. To create an alias that
// points to a single version, specify a single RoutingConfig object with a weight
// set to 100. You can create up to 100 aliases for each state machine. You must
// delete unused aliases using the DeleteStateMachineAlias API action.
// CreateStateMachineAlias is an idempotent API. Step Functions bases the
// idempotency check on the stateMachineArn , description , name , and
// routingConfiguration parameters. Requests that contain the same values for these
// parameters return a successful idempotent response without creating a duplicate
// resource. Related operations:
// - DescribeStateMachineAlias
// - ListStateMachineAliases
// - UpdateStateMachineAlias
// - DeleteStateMachineAlias
func (c *Client) CreateStateMachineAlias(ctx context.Context, params *CreateStateMachineAliasInput, optFns ...func(*Options)) (*CreateStateMachineAliasOutput, error) {
if params == nil {
params = &CreateStateMachineAliasInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateStateMachineAlias", params, optFns, c.addOperationCreateStateMachineAliasMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateStateMachineAliasOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateStateMachineAliasInput struct {
// The name of the state machine alias. To avoid conflict with version ARNs, don't
// use an integer in the name of the alias.
//
// This member is required.
Name *string
// The routing configuration of a state machine alias. The routing configuration
// shifts execution traffic between two state machine versions.
// routingConfiguration contains an array of RoutingConfig objects that specify up
// to two state machine versions. Step Functions then randomly choses which version
// to run an execution with based on the weight assigned to each RoutingConfig .
//
// This member is required.
RoutingConfiguration []types.RoutingConfigurationListItem
// A description for the state machine alias.
Description *string
noSmithyDocumentSerde
}
type CreateStateMachineAliasOutput struct {
// The date the state machine alias was created.
//
// This member is required.
CreationDate *time.Time
// The Amazon Resource Name (ARN) that identifies the created state machine alias.
//
// This member is required.
StateMachineAliasArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateStateMachineAliasMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreateStateMachineAlias{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreateStateMachineAlias{}, 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 = addOpCreateStateMachineAliasValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateStateMachineAlias(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_opCreateStateMachineAlias(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "CreateStateMachineAlias",
}
}
| 167 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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 activity.
func (c *Client) DeleteActivity(ctx context.Context, params *DeleteActivityInput, optFns ...func(*Options)) (*DeleteActivityOutput, error) {
if params == nil {
params = &DeleteActivityInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteActivity", params, optFns, c.addOperationDeleteActivityMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteActivityOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteActivityInput struct {
// The Amazon Resource Name (ARN) of the activity to delete.
//
// This member is required.
ActivityArn *string
noSmithyDocumentSerde
}
type DeleteActivityOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteActivityMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteActivity{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteActivity{}, 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 = addOpDeleteActivityValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteActivity(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_opDeleteActivity(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "DeleteActivity",
}
}
| 120 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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 state machine. This is an asynchronous operation: It sets the state
// machine's status to DELETING and begins the deletion process. A qualified state
// machine ARN can either refer to a Distributed Map state defined within a state
// machine, a version ARN, or an alias ARN. The following are some examples of
// qualified and unqualified state machine ARNs:
// - The following qualified state machine ARN refers to a Distributed Map state
// with a label mapStateLabel in a state machine named myStateMachine .
// arn:partition:states:region:account-id:stateMachine:myStateMachine/mapStateLabel
// If you provide a qualified state machine ARN that refers to a Distributed Map
// state, the request fails with ValidationException .
// - The following unqualified state machine ARN refers to a state machine named
// myStateMachine .
// arn:partition:states:region:account-id:stateMachine:myStateMachine
//
// This API action also deletes all versions (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-version.html)
// and aliases (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-alias.html)
// associated with a state machine. For EXPRESS state machines, the deletion
// happens eventually (usually in less than a minute). Running executions may emit
// logs after DeleteStateMachine API is called.
func (c *Client) DeleteStateMachine(ctx context.Context, params *DeleteStateMachineInput, optFns ...func(*Options)) (*DeleteStateMachineOutput, error) {
if params == nil {
params = &DeleteStateMachineInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteStateMachine", params, optFns, c.addOperationDeleteStateMachineMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteStateMachineOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteStateMachineInput struct {
// The Amazon Resource Name (ARN) of the state machine to delete.
//
// This member is required.
StateMachineArn *string
noSmithyDocumentSerde
}
type DeleteStateMachineOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteStateMachineMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteStateMachine{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteStateMachine{}, 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 = addOpDeleteStateMachineValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteStateMachine(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_opDeleteStateMachine(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "DeleteStateMachine",
}
}
| 138 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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 state machine alias (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-alias.html)
// . After you delete a state machine alias, you can't use it to start executions.
// When you delete a state machine alias, Step Functions doesn't delete the state
// machine versions that alias references. Related operations:
// - CreateStateMachineAlias
// - DescribeStateMachineAlias
// - ListStateMachineAliases
// - UpdateStateMachineAlias
func (c *Client) DeleteStateMachineAlias(ctx context.Context, params *DeleteStateMachineAliasInput, optFns ...func(*Options)) (*DeleteStateMachineAliasOutput, error) {
if params == nil {
params = &DeleteStateMachineAliasInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteStateMachineAlias", params, optFns, c.addOperationDeleteStateMachineAliasMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteStateMachineAliasOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteStateMachineAliasInput struct {
// The Amazon Resource Name (ARN) of the state machine alias to delete.
//
// This member is required.
StateMachineAliasArn *string
noSmithyDocumentSerde
}
type DeleteStateMachineAliasOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteStateMachineAliasMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteStateMachineAlias{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteStateMachineAlias{}, 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 = addOpDeleteStateMachineAliasValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteStateMachineAlias(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_opDeleteStateMachineAlias(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "DeleteStateMachineAlias",
}
}
| 127 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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 state machine version (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-version.html)
// . After you delete a version, you can't call StartExecution using that
// version's ARN or use the version with a state machine alias (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-alias.html)
// . Deleting a state machine version won't terminate its in-progress executions.
// You can't delete a state machine version currently referenced by one or more
// aliases. Before you delete a version, you must either delete the aliases or
// update them to point to another state machine version. Related operations:
// - PublishStateMachineVersion
// - ListStateMachineVersions
func (c *Client) DeleteStateMachineVersion(ctx context.Context, params *DeleteStateMachineVersionInput, optFns ...func(*Options)) (*DeleteStateMachineVersionOutput, error) {
if params == nil {
params = &DeleteStateMachineVersionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteStateMachineVersion", params, optFns, c.addOperationDeleteStateMachineVersionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteStateMachineVersionOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteStateMachineVersionInput struct {
// The Amazon Resource Name (ARN) of the state machine version to delete.
//
// This member is required.
StateMachineVersionArn *string
noSmithyDocumentSerde
}
type DeleteStateMachineVersionOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteStateMachineVersionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteStateMachineVersion{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteStateMachineVersion{}, 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 = addOpDeleteStateMachineVersionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteStateMachineVersion(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_opDeleteStateMachineVersion(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "DeleteStateMachineVersion",
}
}
| 128 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Describes an activity. This operation is eventually consistent. The results are
// best effort and may not reflect very recent updates and changes.
func (c *Client) DescribeActivity(ctx context.Context, params *DescribeActivityInput, optFns ...func(*Options)) (*DescribeActivityOutput, error) {
if params == nil {
params = &DescribeActivityInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeActivity", params, optFns, c.addOperationDescribeActivityMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeActivityOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeActivityInput struct {
// The Amazon Resource Name (ARN) of the activity to describe.
//
// This member is required.
ActivityArn *string
noSmithyDocumentSerde
}
type DescribeActivityOutput struct {
// The Amazon Resource Name (ARN) that identifies the activity.
//
// This member is required.
ActivityArn *string
// The date the activity is created.
//
// This member is required.
CreationDate *time.Time
// The name of the activity. A name must not contain:
// - white space
// - brackets < > { } [ ]
// - wildcard characters ? *
// - special characters " # % \ ^ | ~ ` $ & , ; : /
// - control characters ( U+0000-001F , U+007F-009F )
// To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z,
// a-z, - and _.
//
// This member is required.
Name *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeActivityMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeActivity{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeActivity{}, 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 = addOpDescribeActivityValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeActivity(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_opDescribeActivity(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "DescribeActivity",
}
}
| 145 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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/sfn/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Provides information about a state machine execution, such as the state machine
// associated with the execution, the execution input and output, and relevant
// execution metadata. Use this API action to return the Map Run Amazon Resource
// Name (ARN) if the execution was dispatched by a Map Run. If you specify a
// version or alias ARN when you call the StartExecution API action,
// DescribeExecution returns that ARN. This operation is eventually consistent. The
// results are best effort and may not reflect very recent updates and changes.
// Executions of an EXPRESS state machinearen't supported by DescribeExecution
// unless a Map Run dispatched them.
func (c *Client) DescribeExecution(ctx context.Context, params *DescribeExecutionInput, optFns ...func(*Options)) (*DescribeExecutionOutput, error) {
if params == nil {
params = &DescribeExecutionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeExecution", params, optFns, c.addOperationDescribeExecutionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeExecutionOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeExecutionInput struct {
// The Amazon Resource Name (ARN) of the execution to describe.
//
// This member is required.
ExecutionArn *string
noSmithyDocumentSerde
}
type DescribeExecutionOutput struct {
// The Amazon Resource Name (ARN) that identifies the execution.
//
// This member is required.
ExecutionArn *string
// The date the execution is started.
//
// This member is required.
StartDate *time.Time
// The Amazon Resource Name (ARN) of the executed stated machine.
//
// This member is required.
StateMachineArn *string
// The current status of the execution.
//
// This member is required.
Status types.ExecutionStatus
// The cause string if the state machine execution failed.
Cause *string
// The error string if the state machine execution failed.
Error *string
// The string that contains the JSON input data of the execution. Length
// constraints apply to the payload size, and are expressed as bytes in UTF-8
// encoding.
Input *string
// Provides details about execution input or output.
InputDetails *types.CloudWatchEventsExecutionDataDetails
// The Amazon Resource Name (ARN) that identifies a Map Run, which dispatched this
// execution.
MapRunArn *string
// The name of the execution. A name must not contain:
// - white space
// - brackets < > { } [ ]
// - wildcard characters ? *
// - special characters " # % \ ^ | ~ ` $ & , ; : /
// - control characters ( U+0000-001F , U+007F-009F )
// To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z,
// a-z, - and _.
Name *string
// The JSON output data of the execution. Length constraints apply to the payload
// size, and are expressed as bytes in UTF-8 encoding. This field is set only if
// the execution succeeds. If the execution fails, this field is null.
Output *string
// Provides details about execution input or output.
OutputDetails *types.CloudWatchEventsExecutionDataDetails
// The Amazon Resource Name (ARN) of the state machine alias associated with the
// execution. The alias ARN is a combination of state machine ARN and the alias
// name separated by a colon (:). For example, stateMachineARN:PROD . If you start
// an execution from a StartExecution request with a state machine version ARN,
// this field will be null.
StateMachineAliasArn *string
// The Amazon Resource Name (ARN) of the state machine version associated with the
// execution. The version ARN is a combination of state machine ARN and the version
// number separated by a colon (:). For example, stateMachineARN:1 . If you start
// an execution from a StartExecution request without specifying a state machine
// version or alias ARN, Step Functions returns a null value.
StateMachineVersionArn *string
// If the execution ended, the date the execution stopped.
StopDate *time.Time
// The X-Ray trace header that was passed to the execution.
TraceHeader *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeExecution{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeExecution{}, 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 = addOpDescribeExecutionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeExecution(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_opDescribeExecution(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "DescribeExecution",
}
}
| 207 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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/sfn/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Provides information about a Map Run's configuration, progress, and results.
// For more information, see Examining Map Run (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-examine-map-run.html)
// in the Step Functions Developer Guide.
func (c *Client) DescribeMapRun(ctx context.Context, params *DescribeMapRunInput, optFns ...func(*Options)) (*DescribeMapRunOutput, error) {
if params == nil {
params = &DescribeMapRunInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeMapRun", params, optFns, c.addOperationDescribeMapRunMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeMapRunOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeMapRunInput struct {
// The Amazon Resource Name (ARN) that identifies a Map Run.
//
// This member is required.
MapRunArn *string
noSmithyDocumentSerde
}
type DescribeMapRunOutput struct {
// The Amazon Resource Name (ARN) that identifies the execution in which the Map
// Run was started.
//
// This member is required.
ExecutionArn *string
// A JSON object that contains information about the total number of child
// workflow executions for the Map Run, and the count of child workflow executions
// for each status, such as failed and succeeded .
//
// This member is required.
ExecutionCounts *types.MapRunExecutionCounts
// A JSON object that contains information about the total number of items, and
// the item count for each processing status, such as pending and failed .
//
// This member is required.
ItemCounts *types.MapRunItemCounts
// The Amazon Resource Name (ARN) that identifies a Map Run.
//
// This member is required.
MapRunArn *string
// The maximum number of child workflow executions configured to run in parallel
// for the Map Run at the same time.
//
// This member is required.
MaxConcurrency int32
// The date when the Map Run was started.
//
// This member is required.
StartDate *time.Time
// The current status of the Map Run.
//
// This member is required.
Status types.MapRunStatus
// The maximum number of failed child workflow executions before the Map Run fails.
//
// This member is required.
ToleratedFailureCount int64
// The maximum percentage of failed child workflow executions before the Map Run
// fails.
//
// This member is required.
ToleratedFailurePercentage float32
// The date when the Map Run was stopped.
StopDate *time.Time
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeMapRunMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeMapRun{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeMapRun{}, 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 = addOpDescribeMapRunValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMapRun(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_opDescribeMapRun(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "DescribeMapRun",
}
}
| 179 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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/sfn/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Provides information about a state machine's definition, its IAM role Amazon
// Resource Name (ARN), and configuration. A qualified state machine ARN can either
// refer to a Distributed Map state defined within a state machine, a version ARN,
// or an alias ARN. The following are some examples of qualified and unqualified
// state machine ARNs:
// - The following qualified state machine ARN refers to a Distributed Map state
// with a label mapStateLabel in a state machine named myStateMachine .
// arn:partition:states:region:account-id:stateMachine:myStateMachine/mapStateLabel
// If you provide a qualified state machine ARN that refers to a Distributed Map
// state, the request fails with ValidationException .
// - The following qualified state machine ARN refers to an alias named PROD .
// arn::states:::stateMachine: If you provide a qualified state machine ARN that
// refers to a version ARN or an alias ARN, the request starts execution for that
// version or alias.
// - The following unqualified state machine ARN refers to a state machine named
// myStateMachine . arn::states:::stateMachine:
//
// This API action returns the details for a state machine version if the
// stateMachineArn you specify is a state machine version ARN. This operation is
// eventually consistent. The results are best effort and may not reflect very
// recent updates and changes.
func (c *Client) DescribeStateMachine(ctx context.Context, params *DescribeStateMachineInput, optFns ...func(*Options)) (*DescribeStateMachineOutput, error) {
if params == nil {
params = &DescribeStateMachineInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeStateMachine", params, optFns, c.addOperationDescribeStateMachineMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeStateMachineOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeStateMachineInput struct {
// The Amazon Resource Name (ARN) of the state machine for which you want the
// information. If you specify a state machine version ARN, this API returns
// details about that version. The version ARN is a combination of state machine
// ARN and the version number separated by a colon (:). For example,
// stateMachineARN:1 .
//
// This member is required.
StateMachineArn *string
noSmithyDocumentSerde
}
type DescribeStateMachineOutput struct {
// The date the state machine is created. For a state machine version, creationDate
// is the date the version was created.
//
// This member is required.
CreationDate *time.Time
// The Amazon States Language definition of the state machine. See Amazon States
// Language (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html)
// .
//
// This member is required.
Definition *string
// The name of the state machine. A name must not contain:
// - white space
// - brackets < > { } [ ]
// - wildcard characters ? *
// - special characters " # % \ ^ | ~ ` $ & , ; : /
// - control characters ( U+0000-001F , U+007F-009F )
// To enable logging with CloudWatch Logs, the name should only contain 0-9, A-Z,
// a-z, - and _.
//
// This member is required.
Name *string
// The Amazon Resource Name (ARN) of the IAM role used when creating this state
// machine. (The IAM role maintains security by granting Step Functions access to
// Amazon Web Services resources.)
//
// This member is required.
RoleArn *string
// The Amazon Resource Name (ARN) that identifies the state machine. If you
// specified a state machine version ARN in your request, the API returns the
// version ARN. The version ARN is a combination of state machine ARN and the
// version number separated by a colon (:). For example, stateMachineARN:1 .
//
// This member is required.
StateMachineArn *string
// The type of the state machine ( STANDARD or EXPRESS ).
//
// This member is required.
Type types.StateMachineType
// The description of the state machine version.
Description *string
// A user-defined or an auto-generated string that identifies a Map state. This
// parameter is present only if the stateMachineArn specified in input is a
// qualified state machine ARN.
Label *string
// The LoggingConfiguration data type is used to set CloudWatch Logs options.
LoggingConfiguration *types.LoggingConfiguration
// The revision identifier for the state machine. Use the revisionId parameter to
// compare between versions of a state machine configuration used for executions
// without performing a diff of the properties, such as definition and roleArn .
RevisionId *string
// The current status of the state machine.
Status types.StateMachineStatus
// Selects whether X-Ray tracing is enabled.
TracingConfiguration *types.TracingConfiguration
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeStateMachineMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeStateMachine{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeStateMachine{}, 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 = addOpDescribeStateMachineValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeStateMachine(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_opDescribeStateMachine(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "DescribeStateMachine",
}
}
| 214 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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/sfn/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Returns details about a state machine alias (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-alias.html)
// . Related operations:
// - CreateStateMachineAlias
// - ListStateMachineAliases
// - UpdateStateMachineAlias
// - DeleteStateMachineAlias
func (c *Client) DescribeStateMachineAlias(ctx context.Context, params *DescribeStateMachineAliasInput, optFns ...func(*Options)) (*DescribeStateMachineAliasOutput, error) {
if params == nil {
params = &DescribeStateMachineAliasInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DescribeStateMachineAlias", params, optFns, c.addOperationDescribeStateMachineAliasMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DescribeStateMachineAliasOutput)
out.ResultMetadata = metadata
return out, nil
}
type DescribeStateMachineAliasInput struct {
// The Amazon Resource Name (ARN) of the state machine alias.
//
// This member is required.
StateMachineAliasArn *string
noSmithyDocumentSerde
}
type DescribeStateMachineAliasOutput struct {
// The date the state machine alias was created.
CreationDate *time.Time
// A description of the alias.
Description *string
// The name of the state machine alias.
Name *string
// The routing configuration of the alias.
RoutingConfiguration []types.RoutingConfigurationListItem
// The Amazon Resource Name (ARN) of the state machine alias.
StateMachineAliasArn *string
// The date the state machine alias was last updated. For a newly created state
// machine, this is the same as the creation date.
UpdateDate *time.Time
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDescribeStateMachineAliasMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpDescribeStateMachineAlias{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDescribeStateMachineAlias{}, 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 = addOpDescribeStateMachineAliasValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeStateMachineAlias(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_opDescribeStateMachineAlias(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "DescribeStateMachineAlias",
}
}
| 147 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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"
)
// Used by workers to retrieve a task (with the specified activity ARN) which has
// been scheduled for execution by a running state machine. This initiates a long
// poll, where the service holds the HTTP connection open and responds as soon as a
// task becomes available (i.e. an execution of a task of this type is needed.) The
// maximum time the service holds on to the request before responding is 60
// seconds. If no task is available within 60 seconds, the poll returns a taskToken
// with a null string. This API action isn't logged in CloudTrail. Workers should
// set their client side socket timeout to at least 65 seconds (5 seconds higher
// than the maximum time the service may hold the poll request). Polling with
// GetActivityTask can cause latency in some implementations. See Avoid Latency
// When Polling for Activity Tasks (https://docs.aws.amazon.com/step-functions/latest/dg/bp-activity-pollers.html)
// in the Step Functions Developer Guide.
func (c *Client) GetActivityTask(ctx context.Context, params *GetActivityTaskInput, optFns ...func(*Options)) (*GetActivityTaskOutput, error) {
if params == nil {
params = &GetActivityTaskInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetActivityTask", params, optFns, c.addOperationGetActivityTaskMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetActivityTaskOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetActivityTaskInput struct {
// The Amazon Resource Name (ARN) of the activity to retrieve tasks from (assigned
// when you create the task using CreateActivity .)
//
// This member is required.
ActivityArn *string
// You can provide an arbitrary name in order to identify the worker that the task
// is assigned to. This name is used when it is logged in the execution history.
WorkerName *string
noSmithyDocumentSerde
}
type GetActivityTaskOutput struct {
// The string that contains the JSON input data for the task. Length constraints
// apply to the payload size, and are expressed as bytes in UTF-8 encoding.
Input *string
// A token that identifies the scheduled task. This token must be copied and
// included in subsequent calls to SendTaskHeartbeat , SendTaskSuccess or
// SendTaskFailure in order to report the progress or completion of the task.
TaskToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetActivityTaskMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetActivityTask{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetActivityTask{}, 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 = addOpGetActivityTaskValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetActivityTask(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_opGetActivityTask(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "GetActivityTask",
}
}
| 146 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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/sfn/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the history of the specified execution as a list of events. By default,
// the results are returned in ascending order of the timeStamp of the events. Use
// the reverseOrder parameter to get the latest events first. If nextToken is
// returned, there are more results available. The value of nextToken is a unique
// pagination token for each page. Make the call again using the returned token to
// retrieve the next page. Keep all other arguments unchanged. Each pagination
// token expires after 24 hours. Using an expired pagination token will return an
// HTTP 400 InvalidToken error. This API action is not supported by EXPRESS state
// machines.
func (c *Client) GetExecutionHistory(ctx context.Context, params *GetExecutionHistoryInput, optFns ...func(*Options)) (*GetExecutionHistoryOutput, error) {
if params == nil {
params = &GetExecutionHistoryInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetExecutionHistory", params, optFns, c.addOperationGetExecutionHistoryMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetExecutionHistoryOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetExecutionHistoryInput struct {
// The Amazon Resource Name (ARN) of the execution.
//
// This member is required.
ExecutionArn *string
// You can select whether execution data (input or output of a history event) is
// returned. The default is true .
IncludeExecutionData *bool
// The maximum number of results that are returned per call. You can use nextToken
// to obtain further pages of results. The default is 100 and the maximum allowed
// page size is 1000. A value of 0 uses the default. This is only an upper limit.
// The actual number of results returned per call might be fewer than the specified
// maximum.
MaxResults int32
// If nextToken is returned, there are more results available. The value of
// nextToken is a unique pagination token for each page. Make the call again using
// the returned token to retrieve the next page. Keep all other arguments
// unchanged. Each pagination token expires after 24 hours. Using an expired
// pagination token will return an HTTP 400 InvalidToken error.
NextToken *string
// Lists events in descending order of their timeStamp .
ReverseOrder bool
noSmithyDocumentSerde
}
type GetExecutionHistoryOutput struct {
// The list of events that occurred in the execution.
//
// This member is required.
Events []types.HistoryEvent
// If nextToken is returned, there are more results available. The value of
// nextToken is a unique pagination token for each page. Make the call again using
// the returned token to retrieve the next page. Keep all other arguments
// unchanged. Each pagination token expires after 24 hours. Using an expired
// pagination token will return an HTTP 400 InvalidToken error.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetExecutionHistoryMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetExecutionHistory{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetExecutionHistory{}, 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 = addOpGetExecutionHistoryValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetExecutionHistory(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
}
// GetExecutionHistoryAPIClient is a client that implements the
// GetExecutionHistory operation.
type GetExecutionHistoryAPIClient interface {
GetExecutionHistory(context.Context, *GetExecutionHistoryInput, ...func(*Options)) (*GetExecutionHistoryOutput, error)
}
var _ GetExecutionHistoryAPIClient = (*Client)(nil)
// GetExecutionHistoryPaginatorOptions is the paginator options for
// GetExecutionHistory
type GetExecutionHistoryPaginatorOptions struct {
// The maximum number of results that are returned per call. You can use nextToken
// to obtain further pages of results. The default is 100 and the maximum allowed
// page size is 1000. A value of 0 uses the default. This is only an upper limit.
// The actual number of results returned per call might be fewer than the specified
// maximum.
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
}
// GetExecutionHistoryPaginator is a paginator for GetExecutionHistory
type GetExecutionHistoryPaginator struct {
options GetExecutionHistoryPaginatorOptions
client GetExecutionHistoryAPIClient
params *GetExecutionHistoryInput
nextToken *string
firstPage bool
}
// NewGetExecutionHistoryPaginator returns a new GetExecutionHistoryPaginator
func NewGetExecutionHistoryPaginator(client GetExecutionHistoryAPIClient, params *GetExecutionHistoryInput, optFns ...func(*GetExecutionHistoryPaginatorOptions)) *GetExecutionHistoryPaginator {
if params == nil {
params = &GetExecutionHistoryInput{}
}
options := GetExecutionHistoryPaginatorOptions{}
if params.MaxResults != 0 {
options.Limit = params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &GetExecutionHistoryPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *GetExecutionHistoryPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next GetExecutionHistory page.
func (p *GetExecutionHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetExecutionHistoryOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
params.MaxResults = p.options.Limit
result, err := p.client.GetExecutionHistory(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_opGetExecutionHistory(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "GetExecutionHistory",
}
}
| 255 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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/sfn/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the existing activities. If nextToken is returned, there are more results
// available. The value of nextToken is a unique pagination token for each page.
// Make the call again using the returned token to retrieve the next page. Keep all
// other arguments unchanged. Each pagination token expires after 24 hours. Using
// an expired pagination token will return an HTTP 400 InvalidToken error. This
// operation is eventually consistent. The results are best effort and may not
// reflect very recent updates and changes.
func (c *Client) ListActivities(ctx context.Context, params *ListActivitiesInput, optFns ...func(*Options)) (*ListActivitiesOutput, error) {
if params == nil {
params = &ListActivitiesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListActivities", params, optFns, c.addOperationListActivitiesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListActivitiesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListActivitiesInput struct {
// The maximum number of results that are returned per call. You can use nextToken
// to obtain further pages of results. The default is 100 and the maximum allowed
// page size is 1000. A value of 0 uses the default. This is only an upper limit.
// The actual number of results returned per call might be fewer than the specified
// maximum.
MaxResults int32
// If nextToken is returned, there are more results available. The value of
// nextToken is a unique pagination token for each page. Make the call again using
// the returned token to retrieve the next page. Keep all other arguments
// unchanged. Each pagination token expires after 24 hours. Using an expired
// pagination token will return an HTTP 400 InvalidToken error.
NextToken *string
noSmithyDocumentSerde
}
type ListActivitiesOutput struct {
// The list of activities.
//
// This member is required.
Activities []types.ActivityListItem
// If nextToken is returned, there are more results available. The value of
// nextToken is a unique pagination token for each page. Make the call again using
// the returned token to retrieve the next page. Keep all other arguments
// unchanged. Each pagination token expires after 24 hours. Using an expired
// pagination token will return an HTTP 400 InvalidToken error.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListActivitiesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpListActivities{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListActivities{}, 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_opListActivities(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
}
// ListActivitiesAPIClient is a client that implements the ListActivities
// operation.
type ListActivitiesAPIClient interface {
ListActivities(context.Context, *ListActivitiesInput, ...func(*Options)) (*ListActivitiesOutput, error)
}
var _ ListActivitiesAPIClient = (*Client)(nil)
// ListActivitiesPaginatorOptions is the paginator options for ListActivities
type ListActivitiesPaginatorOptions struct {
// The maximum number of results that are returned per call. You can use nextToken
// to obtain further pages of results. The default is 100 and the maximum allowed
// page size is 1000. A value of 0 uses the default. This is only an upper limit.
// The actual number of results returned per call might be fewer than the specified
// maximum.
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
}
// ListActivitiesPaginator is a paginator for ListActivities
type ListActivitiesPaginator struct {
options ListActivitiesPaginatorOptions
client ListActivitiesAPIClient
params *ListActivitiesInput
nextToken *string
firstPage bool
}
// NewListActivitiesPaginator returns a new ListActivitiesPaginator
func NewListActivitiesPaginator(client ListActivitiesAPIClient, params *ListActivitiesInput, optFns ...func(*ListActivitiesPaginatorOptions)) *ListActivitiesPaginator {
if params == nil {
params = &ListActivitiesInput{}
}
options := ListActivitiesPaginatorOptions{}
if params.MaxResults != 0 {
options.Limit = params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListActivitiesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListActivitiesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListActivities page.
func (p *ListActivitiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListActivitiesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
params.MaxResults = p.options.Limit
result, err := p.client.ListActivities(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_opListActivities(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "ListActivities",
}
}
| 237 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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/sfn/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists all executions of a state machine or a Map Run. You can list all
// executions related to a state machine by specifying a state machine Amazon
// Resource Name (ARN), or those related to a Map Run by specifying a Map Run ARN.
// You can also provide a state machine alias (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-alias.html)
// ARN or version (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-version.html)
// ARN to list the executions associated with a specific alias or version. Results
// are sorted by time, with the most recent execution first. If nextToken is
// returned, there are more results available. The value of nextToken is a unique
// pagination token for each page. Make the call again using the returned token to
// retrieve the next page. Keep all other arguments unchanged. Each pagination
// token expires after 24 hours. Using an expired pagination token will return an
// HTTP 400 InvalidToken error. This operation is eventually consistent. The
// results are best effort and may not reflect very recent updates and changes.
// This API action is not supported by EXPRESS state machines.
func (c *Client) ListExecutions(ctx context.Context, params *ListExecutionsInput, optFns ...func(*Options)) (*ListExecutionsOutput, error) {
if params == nil {
params = &ListExecutionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListExecutions", params, optFns, c.addOperationListExecutionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListExecutionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListExecutionsInput struct {
// The Amazon Resource Name (ARN) of the Map Run that started the child workflow
// executions. If the mapRunArn field is specified, a list of all of the child
// workflow executions started by a Map Run is returned. For more information, see
// Examining Map Run (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-examine-map-run.html)
// in the Step Functions Developer Guide. You can specify either a mapRunArn or a
// stateMachineArn , but not both.
MapRunArn *string
// The maximum number of results that are returned per call. You can use nextToken
// to obtain further pages of results. The default is 100 and the maximum allowed
// page size is 1000. A value of 0 uses the default. This is only an upper limit.
// The actual number of results returned per call might be fewer than the specified
// maximum.
MaxResults int32
// If nextToken is returned, there are more results available. The value of
// nextToken is a unique pagination token for each page. Make the call again using
// the returned token to retrieve the next page. Keep all other arguments
// unchanged. Each pagination token expires after 24 hours. Using an expired
// pagination token will return an HTTP 400 InvalidToken error.
NextToken *string
// The Amazon Resource Name (ARN) of the state machine whose executions is listed.
// You can specify either a mapRunArn or a stateMachineArn , but not both. You can
// also return a list of executions associated with a specific alias (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-alias.html)
// or version (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-version.html)
// , by specifying an alias ARN or a version ARN in the stateMachineArn parameter.
StateMachineArn *string
// If specified, only list the executions whose current execution status matches
// the given filter.
StatusFilter types.ExecutionStatus
noSmithyDocumentSerde
}
type ListExecutionsOutput struct {
// The list of matching executions.
//
// This member is required.
Executions []types.ExecutionListItem
// If nextToken is returned, there are more results available. The value of
// nextToken is a unique pagination token for each page. Make the call again using
// the returned token to retrieve the next page. Keep all other arguments
// unchanged. Each pagination token expires after 24 hours. Using an expired
// pagination token will return an HTTP 400 InvalidToken error.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpListExecutions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListExecutions{}, 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_opListExecutions(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
}
// ListExecutionsAPIClient is a client that implements the ListExecutions
// operation.
type ListExecutionsAPIClient interface {
ListExecutions(context.Context, *ListExecutionsInput, ...func(*Options)) (*ListExecutionsOutput, error)
}
var _ ListExecutionsAPIClient = (*Client)(nil)
// ListExecutionsPaginatorOptions is the paginator options for ListExecutions
type ListExecutionsPaginatorOptions struct {
// The maximum number of results that are returned per call. You can use nextToken
// to obtain further pages of results. The default is 100 and the maximum allowed
// page size is 1000. A value of 0 uses the default. This is only an upper limit.
// The actual number of results returned per call might be fewer than the specified
// maximum.
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
}
// ListExecutionsPaginator is a paginator for ListExecutions
type ListExecutionsPaginator struct {
options ListExecutionsPaginatorOptions
client ListExecutionsAPIClient
params *ListExecutionsInput
nextToken *string
firstPage bool
}
// NewListExecutionsPaginator returns a new ListExecutionsPaginator
func NewListExecutionsPaginator(client ListExecutionsAPIClient, params *ListExecutionsInput, optFns ...func(*ListExecutionsPaginatorOptions)) *ListExecutionsPaginator {
if params == nil {
params = &ListExecutionsInput{}
}
options := ListExecutionsPaginatorOptions{}
if params.MaxResults != 0 {
options.Limit = params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListExecutionsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListExecutionsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListExecutions page.
func (p *ListExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListExecutionsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
params.MaxResults = p.options.Limit
result, err := p.client.ListExecutions(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_opListExecutions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "ListExecutions",
}
}
| 263 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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/sfn/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists all Map Runs that were started by a given state machine execution. Use
// this API action to obtain Map Run ARNs, and then call DescribeMapRun to obtain
// more information, if needed.
func (c *Client) ListMapRuns(ctx context.Context, params *ListMapRunsInput, optFns ...func(*Options)) (*ListMapRunsOutput, error) {
if params == nil {
params = &ListMapRunsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListMapRuns", params, optFns, c.addOperationListMapRunsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListMapRunsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListMapRunsInput struct {
// The Amazon Resource Name (ARN) of the execution for which the Map Runs must be
// listed.
//
// This member is required.
ExecutionArn *string
// The maximum number of results that are returned per call. You can use nextToken
// to obtain further pages of results. The default is 100 and the maximum allowed
// page size is 1000. A value of 0 uses the default. This is only an upper limit.
// The actual number of results returned per call might be fewer than the specified
// maximum.
MaxResults int32
// If nextToken is returned, there are more results available. The value of
// nextToken is a unique pagination token for each page. Make the call again using
// the returned token to retrieve the next page. Keep all other arguments
// unchanged. Each pagination token expires after 24 hours. Using an expired
// pagination token will return an HTTP 400 InvalidToken error.
NextToken *string
noSmithyDocumentSerde
}
type ListMapRunsOutput struct {
// An array that lists information related to a Map Run, such as the Amazon
// Resource Name (ARN) of the Map Run and the ARN of the state machine that started
// the Map Run.
//
// This member is required.
MapRuns []types.MapRunListItem
// If nextToken is returned, there are more results available. The value of
// nextToken is a unique pagination token for each page. Make the call again using
// the returned token to retrieve the next page. Keep all other arguments
// unchanged. Each pagination token expires after 24 hours. Using an expired
// pagination token will return an HTTP 400 InvalidToken error.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListMapRunsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpListMapRuns{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListMapRuns{}, 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 = addOpListMapRunsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListMapRuns(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
}
// ListMapRunsAPIClient is a client that implements the ListMapRuns operation.
type ListMapRunsAPIClient interface {
ListMapRuns(context.Context, *ListMapRunsInput, ...func(*Options)) (*ListMapRunsOutput, error)
}
var _ ListMapRunsAPIClient = (*Client)(nil)
// ListMapRunsPaginatorOptions is the paginator options for ListMapRuns
type ListMapRunsPaginatorOptions struct {
// The maximum number of results that are returned per call. You can use nextToken
// to obtain further pages of results. The default is 100 and the maximum allowed
// page size is 1000. A value of 0 uses the default. This is only an upper limit.
// The actual number of results returned per call might be fewer than the specified
// maximum.
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
}
// ListMapRunsPaginator is a paginator for ListMapRuns
type ListMapRunsPaginator struct {
options ListMapRunsPaginatorOptions
client ListMapRunsAPIClient
params *ListMapRunsInput
nextToken *string
firstPage bool
}
// NewListMapRunsPaginator returns a new ListMapRunsPaginator
func NewListMapRunsPaginator(client ListMapRunsAPIClient, params *ListMapRunsInput, optFns ...func(*ListMapRunsPaginatorOptions)) *ListMapRunsPaginator {
if params == nil {
params = &ListMapRunsInput{}
}
options := ListMapRunsPaginatorOptions{}
if params.MaxResults != 0 {
options.Limit = params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListMapRunsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListMapRunsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListMapRuns page.
func (p *ListMapRunsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMapRunsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
params.MaxResults = p.options.Limit
result, err := p.client.ListMapRuns(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_opListMapRuns(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "ListMapRuns",
}
}
| 243 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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/sfn/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists aliases (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-alias.html)
// for a specified state machine ARN. Results are sorted by time, with the most
// recently created aliases listed first. To list aliases that reference a state
// machine version (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-version.html)
// , you can specify the version ARN in the stateMachineArn parameter. If nextToken
// is returned, there are more results available. The value of nextToken is a
// unique pagination token for each page. Make the call again using the returned
// token to retrieve the next page. Keep all other arguments unchanged. Each
// pagination token expires after 24 hours. Using an expired pagination token will
// return an HTTP 400 InvalidToken error. Related operations:
// - CreateStateMachineAlias
// - DescribeStateMachineAlias
// - UpdateStateMachineAlias
// - DeleteStateMachineAlias
func (c *Client) ListStateMachineAliases(ctx context.Context, params *ListStateMachineAliasesInput, optFns ...func(*Options)) (*ListStateMachineAliasesOutput, error) {
if params == nil {
params = &ListStateMachineAliasesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListStateMachineAliases", params, optFns, c.addOperationListStateMachineAliasesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListStateMachineAliasesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListStateMachineAliasesInput struct {
// The Amazon Resource Name (ARN) of the state machine for which you want to list
// aliases. If you specify a state machine version ARN, this API returns a list of
// aliases for that version.
//
// This member is required.
StateMachineArn *string
// The maximum number of results that are returned per call. You can use nextToken
// to obtain further pages of results. The default is 100 and the maximum allowed
// page size is 1000. A value of 0 uses the default. This is only an upper limit.
// The actual number of results returned per call might be fewer than the specified
// maximum.
MaxResults int32
// If nextToken is returned, there are more results available. The value of
// nextToken is a unique pagination token for each page. Make the call again using
// the returned token to retrieve the next page. Keep all other arguments
// unchanged. Each pagination token expires after 24 hours. Using an expired
// pagination token will return an HTTP 400 InvalidToken error.
NextToken *string
noSmithyDocumentSerde
}
type ListStateMachineAliasesOutput struct {
// Aliases for the state machine.
//
// This member is required.
StateMachineAliases []types.StateMachineAliasListItem
// If nextToken is returned, there are more results available. The value of
// nextToken is a unique pagination token for each page. Make the call again using
// the returned token to retrieve the next page. Keep all other arguments
// unchanged. Each pagination token expires after 24 hours. Using an expired
// pagination token will return an HTTP 400 InvalidToken error.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListStateMachineAliasesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpListStateMachineAliases{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListStateMachineAliases{}, 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 = addOpListStateMachineAliasesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListStateMachineAliases(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_opListStateMachineAliases(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "ListStateMachineAliases",
}
}
| 163 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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/sfn/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the existing state machines. If nextToken is returned, there are more
// results available. The value of nextToken is a unique pagination token for each
// page. Make the call again using the returned token to retrieve the next page.
// Keep all other arguments unchanged. Each pagination token expires after 24
// hours. Using an expired pagination token will return an HTTP 400 InvalidToken
// error. This operation is eventually consistent. The results are best effort and
// may not reflect very recent updates and changes.
func (c *Client) ListStateMachines(ctx context.Context, params *ListStateMachinesInput, optFns ...func(*Options)) (*ListStateMachinesOutput, error) {
if params == nil {
params = &ListStateMachinesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListStateMachines", params, optFns, c.addOperationListStateMachinesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListStateMachinesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListStateMachinesInput struct {
// The maximum number of results that are returned per call. You can use nextToken
// to obtain further pages of results. The default is 100 and the maximum allowed
// page size is 1000. A value of 0 uses the default. This is only an upper limit.
// The actual number of results returned per call might be fewer than the specified
// maximum.
MaxResults int32
// If nextToken is returned, there are more results available. The value of
// nextToken is a unique pagination token for each page. Make the call again using
// the returned token to retrieve the next page. Keep all other arguments
// unchanged. Each pagination token expires after 24 hours. Using an expired
// pagination token will return an HTTP 400 InvalidToken error.
NextToken *string
noSmithyDocumentSerde
}
type ListStateMachinesOutput struct {
// This member is required.
StateMachines []types.StateMachineListItem
// If nextToken is returned, there are more results available. The value of
// nextToken is a unique pagination token for each page. Make the call again using
// the returned token to retrieve the next page. Keep all other arguments
// unchanged. Each pagination token expires after 24 hours. Using an expired
// pagination token will return an HTTP 400 InvalidToken error.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListStateMachinesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpListStateMachines{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListStateMachines{}, 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_opListStateMachines(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
}
// ListStateMachinesAPIClient is a client that implements the ListStateMachines
// operation.
type ListStateMachinesAPIClient interface {
ListStateMachines(context.Context, *ListStateMachinesInput, ...func(*Options)) (*ListStateMachinesOutput, error)
}
var _ ListStateMachinesAPIClient = (*Client)(nil)
// ListStateMachinesPaginatorOptions is the paginator options for ListStateMachines
type ListStateMachinesPaginatorOptions struct {
// The maximum number of results that are returned per call. You can use nextToken
// to obtain further pages of results. The default is 100 and the maximum allowed
// page size is 1000. A value of 0 uses the default. This is only an upper limit.
// The actual number of results returned per call might be fewer than the specified
// maximum.
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
}
// ListStateMachinesPaginator is a paginator for ListStateMachines
type ListStateMachinesPaginator struct {
options ListStateMachinesPaginatorOptions
client ListStateMachinesAPIClient
params *ListStateMachinesInput
nextToken *string
firstPage bool
}
// NewListStateMachinesPaginator returns a new ListStateMachinesPaginator
func NewListStateMachinesPaginator(client ListStateMachinesAPIClient, params *ListStateMachinesInput, optFns ...func(*ListStateMachinesPaginatorOptions)) *ListStateMachinesPaginator {
if params == nil {
params = &ListStateMachinesInput{}
}
options := ListStateMachinesPaginatorOptions{}
if params.MaxResults != 0 {
options.Limit = params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListStateMachinesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListStateMachinesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListStateMachines page.
func (p *ListStateMachinesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStateMachinesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
params.MaxResults = p.options.Limit
result, err := p.client.ListStateMachines(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_opListStateMachines(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "ListStateMachines",
}
}
| 235 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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/sfn/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists versions (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-version.html)
// for the specified state machine Amazon Resource Name (ARN). The results are
// sorted in descending order of the version creation time. If nextToken is
// returned, there are more results available. The value of nextToken is a unique
// pagination token for each page. Make the call again using the returned token to
// retrieve the next page. Keep all other arguments unchanged. Each pagination
// token expires after 24 hours. Using an expired pagination token will return an
// HTTP 400 InvalidToken error. Related operations:
// - PublishStateMachineVersion
// - DeleteStateMachineVersion
func (c *Client) ListStateMachineVersions(ctx context.Context, params *ListStateMachineVersionsInput, optFns ...func(*Options)) (*ListStateMachineVersionsOutput, error) {
if params == nil {
params = &ListStateMachineVersionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListStateMachineVersions", params, optFns, c.addOperationListStateMachineVersionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListStateMachineVersionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListStateMachineVersionsInput struct {
// The Amazon Resource Name (ARN) of the state machine.
//
// This member is required.
StateMachineArn *string
// The maximum number of results that are returned per call. You can use nextToken
// to obtain further pages of results. The default is 100 and the maximum allowed
// page size is 1000. A value of 0 uses the default. This is only an upper limit.
// The actual number of results returned per call might be fewer than the specified
// maximum.
MaxResults int32
// If nextToken is returned, there are more results available. The value of
// nextToken is a unique pagination token for each page. Make the call again using
// the returned token to retrieve the next page. Keep all other arguments
// unchanged. Each pagination token expires after 24 hours. Using an expired
// pagination token will return an HTTP 400 InvalidToken error.
NextToken *string
noSmithyDocumentSerde
}
type ListStateMachineVersionsOutput struct {
// Versions for the state machine.
//
// This member is required.
StateMachineVersions []types.StateMachineVersionListItem
// If nextToken is returned, there are more results available. The value of
// nextToken is a unique pagination token for each page. Make the call again using
// the returned token to retrieve the next page. Keep all other arguments
// unchanged. Each pagination token expires after 24 hours. Using an expired
// pagination token will return an HTTP 400 InvalidToken error.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListStateMachineVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpListStateMachineVersions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListStateMachineVersions{}, 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 = addOpListStateMachineVersionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListStateMachineVersions(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_opListStateMachineVersions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "ListStateMachineVersions",
}
}
| 157 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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/sfn/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// List tags for a given resource. Tags may only contain Unicode letters, digits,
// white space, or these symbols: _ . : / = + - @ .
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) for the Step Functions state machine or activity.
//
// This member is required.
ResourceArn *string
noSmithyDocumentSerde
}
type ListTagsForResourceOutput struct {
// An array of tags associated with the 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(&awsAwsjson10_serializeOpListTagsForResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_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: "states",
OperationName: "ListTagsForResource",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Creates a version (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-version.html)
// from the current revision of a state machine. Use versions to create immutable
// snapshots of your state machine. You can start executions from versions either
// directly or with an alias. To create an alias, use CreateStateMachineAlias . You
// can publish up to 1000 versions for each state machine. You must manually delete
// unused versions using the DeleteStateMachineVersion API action.
// PublishStateMachineVersion is an idempotent API. It doesn't create a duplicate
// state machine version if it already exists for the current revision. Step
// Functions bases PublishStateMachineVersion 's idempotency check on the
// stateMachineArn , name , and revisionId parameters. Requests with the same
// parameters return a successful idempotent response. If you don't specify a
// revisionId , Step Functions checks for a previously published version of the
// state machine's current revision. Related operations:
// - DeleteStateMachineVersion
// - ListStateMachineVersions
func (c *Client) PublishStateMachineVersion(ctx context.Context, params *PublishStateMachineVersionInput, optFns ...func(*Options)) (*PublishStateMachineVersionOutput, error) {
if params == nil {
params = &PublishStateMachineVersionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PublishStateMachineVersion", params, optFns, c.addOperationPublishStateMachineVersionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PublishStateMachineVersionOutput)
out.ResultMetadata = metadata
return out, nil
}
type PublishStateMachineVersionInput struct {
// The Amazon Resource Name (ARN) of the state machine.
//
// This member is required.
StateMachineArn *string
// An optional description of the state machine version.
Description *string
// Only publish the state machine version if the current state machine's revision
// ID matches the specified ID. Use this option to avoid publishing a version if
// the state machine changed since you last updated it. If the specified revision
// ID doesn't match the state machine's current revision ID, the API returns
// ConflictException . To specify an initial revision ID for a state machine with
// no revision ID assigned, specify the string INITIAL for the revisionId
// parameter. For example, you can specify a revisionID of INITIAL when you create
// a state machine using the CreateStateMachine API action.
RevisionId *string
noSmithyDocumentSerde
}
type PublishStateMachineVersionOutput struct {
// The date the version was created.
//
// This member is required.
CreationDate *time.Time
// The Amazon Resource Name (ARN) (ARN) that identifies the state machine version.
//
// This member is required.
StateMachineVersionArn *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPublishStateMachineVersionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpPublishStateMachineVersion{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpPublishStateMachineVersion{}, 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 = addOpPublishStateMachineVersionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPublishStateMachineVersion(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_opPublishStateMachineVersion(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "PublishStateMachineVersion",
}
}
| 159 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package sfn
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"
)
// Used by activity workers and task states using the callback (https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-resource.html#connect-wait-token)
// pattern to report that the task identified by the taskToken failed.
func (c *Client) SendTaskFailure(ctx context.Context, params *SendTaskFailureInput, optFns ...func(*Options)) (*SendTaskFailureOutput, error) {
if params == nil {
params = &SendTaskFailureInput{}
}
result, metadata, err := c.invokeOperation(ctx, "SendTaskFailure", params, optFns, c.addOperationSendTaskFailureMiddlewares)
if err != nil {
return nil, err
}
out := result.(*SendTaskFailureOutput)
out.ResultMetadata = metadata
return out, nil
}
type SendTaskFailureInput struct {
// The token that represents this task. Task tokens are generated by Step
// Functions when tasks are assigned to a worker, or in the context object (https://docs.aws.amazon.com/step-functions/latest/dg/input-output-contextobject.html)
// when a workflow enters a task state. See GetActivityTaskOutput$taskToken .
//
// This member is required.
TaskToken *string
// A more detailed explanation of the cause of the failure.
Cause *string
// The error code of the failure.
Error *string
noSmithyDocumentSerde
}
type SendTaskFailureOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationSendTaskFailureMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson10_serializeOpSendTaskFailure{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpSendTaskFailure{}, 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 = addOpSendTaskFailureValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSendTaskFailure(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_opSendTaskFailure(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "states",
OperationName: "SendTaskFailure",
}
}
| 129 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.