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 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 signer 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: "signer.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "signer-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "signer-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "signer.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "af-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-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: "signer-fips.us-east-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-east-1", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "fips-us-east-2", }: endpoints.Endpoint{ Hostname: "signer-fips.us-east-2.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-east-2", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "fips-us-west-1", }: endpoints.Endpoint{ Hostname: "signer-fips.us-west-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-west-1", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "fips-us-west-2", }: endpoints.Endpoint{ Hostname: "signer-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: "signer-fips.us-east-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-2", Variant: endpoints.FIPSVariant, }: { Hostname: "signer-fips.us-east-2.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-1", Variant: endpoints.FIPSVariant, }: { Hostname: "signer-fips.us-west-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", Variant: endpoints.FIPSVariant, }: { Hostname: "signer-fips.us-west-2.amazonaws.com", }, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "signer.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "signer-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "signer-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "signer.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsCn, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "cn-north-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "cn-northwest-1", }: endpoints.Endpoint{}, }, }, { ID: "aws-iso", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "signer-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "signer.{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: "signer-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "signer.{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: "signer-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "signer.{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: "signer-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "signer.{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: "signer.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "signer-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "signer-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "signer.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, }, }
427
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 Category string // Enum values for Category const ( CategoryAWSIoT Category = "AWSIoT" ) // Values returns all known values for Category. 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 (Category) Values() []Category { return []Category{ "AWSIoT", } } type EncryptionAlgorithm string // Enum values for EncryptionAlgorithm const ( EncryptionAlgorithmRsa EncryptionAlgorithm = "RSA" EncryptionAlgorithmEcdsa EncryptionAlgorithm = "ECDSA" ) // Values returns all known values for EncryptionAlgorithm. 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 (EncryptionAlgorithm) Values() []EncryptionAlgorithm { return []EncryptionAlgorithm{ "RSA", "ECDSA", } } type HashAlgorithm string // Enum values for HashAlgorithm const ( HashAlgorithmSha1 HashAlgorithm = "SHA1" HashAlgorithmSha256 HashAlgorithm = "SHA256" ) // Values returns all known values for HashAlgorithm. 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 (HashAlgorithm) Values() []HashAlgorithm { return []HashAlgorithm{ "SHA1", "SHA256", } } type ImageFormat string // Enum values for ImageFormat const ( ImageFormatJson ImageFormat = "JSON" ImageFormatJSONEmbedded ImageFormat = "JSONEmbedded" ImageFormatJSONDetached ImageFormat = "JSONDetached" ) // Values returns all known values for ImageFormat. 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 (ImageFormat) Values() []ImageFormat { return []ImageFormat{ "JSON", "JSONEmbedded", "JSONDetached", } } type SigningProfileStatus string // Enum values for SigningProfileStatus const ( SigningProfileStatusActive SigningProfileStatus = "Active" SigningProfileStatusCanceled SigningProfileStatus = "Canceled" SigningProfileStatusRevoked SigningProfileStatus = "Revoked" ) // Values returns all known values for SigningProfileStatus. 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 (SigningProfileStatus) Values() []SigningProfileStatus { return []SigningProfileStatus{ "Active", "Canceled", "Revoked", } } type SigningStatus string // Enum values for SigningStatus const ( SigningStatusInProgress SigningStatus = "InProgress" SigningStatusFailed SigningStatus = "Failed" SigningStatusSucceeded SigningStatus = "Succeeded" ) // Values returns all known values for SigningStatus. 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 (SigningStatus) Values() []SigningStatus { return []SigningStatus{ "InProgress", "Failed", "Succeeded", } } type ValidityType string // Enum values for ValidityType const ( ValidityTypeDays ValidityType = "DAYS" ValidityTypeMonths ValidityType = "MONTHS" ValidityTypeYears ValidityType = "YEARS" ) // Values returns all known values for ValidityType. 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 (ValidityType) Values() []ValidityType { return []ValidityType{ "DAYS", "MONTHS", "YEARS", } }
136
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" ) // You do not have sufficient access to perform this action. type AccessDeniedException struct { Message *string ErrorCodeOverride *string Code *string noSmithyDocumentSerde } func (e *AccessDeniedException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *AccessDeniedException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *AccessDeniedException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AccessDeniedException" } return *e.ErrorCodeOverride } func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request contains invalid parameters for the ARN or tags. This exception // also occurs when you call a tagging API on a cancelled signing profile. type BadRequestException struct { Message *string ErrorCodeOverride *string Code *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 encountered a conflicting state. type ConflictException struct { Message *string ErrorCodeOverride *string Code *string noSmithyDocumentSerde } func (e *ConflictException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ConflictException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ConflictException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ConflictException" } return *e.ErrorCodeOverride } func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // An internal error occurred. type InternalServiceErrorException struct { Message *string ErrorCodeOverride *string Code *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 signing profile was not found. type NotFoundException struct { Message *string ErrorCodeOverride *string Code *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 } // A specified resource could not be found. type ResourceNotFoundException struct { Message *string ErrorCodeOverride *string Code *string noSmithyDocumentSerde } func (e *ResourceNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ResourceNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ResourceNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ResourceNotFoundException" } return *e.ErrorCodeOverride } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The client is making a request that exceeds service limits. type ServiceLimitExceededException struct { Message *string ErrorCodeOverride *string Code *string noSmithyDocumentSerde } func (e *ServiceLimitExceededException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ServiceLimitExceededException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ServiceLimitExceededException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ServiceLimitExceededException" } return *e.ErrorCodeOverride } func (e *ServiceLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The request was denied due to request throttling. Instead of this error, // TooManyRequestsException should be used. type ThrottlingException struct { Message *string ErrorCodeOverride *string Code *string noSmithyDocumentSerde } func (e *ThrottlingException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ThrottlingException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ThrottlingException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ThrottlingException" } return *e.ErrorCodeOverride } func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The allowed number of job-signing requests has been exceeded. This error // supersedes the error ThrottlingException . type TooManyRequestsException struct { Message *string ErrorCodeOverride *string Code *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 } // You signing certificate could not be validated. type ValidationException struct { Message *string ErrorCodeOverride *string Code *string noSmithyDocumentSerde } func (e *ValidationException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ValidationException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ValidationException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ValidationException" } return *e.ErrorCodeOverride } func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
292
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" ) // Points to an S3Destination object that contains information about your S3 // bucket. type Destination struct { // The S3Destination object. S3 *S3Destination noSmithyDocumentSerde } // The encryption algorithm options that are available to a code signing job. type EncryptionAlgorithmOptions struct { // The set of accepted encryption algorithms that are allowed in a code signing // job. // // This member is required. AllowedValues []EncryptionAlgorithm // The default encryption algorithm that is used by a code signing job. // // This member is required. DefaultValue EncryptionAlgorithm noSmithyDocumentSerde } // The hash algorithms that are available to a code signing job. type HashAlgorithmOptions struct { // The set of accepted hash algorithms allowed in a code signing job. // // This member is required. AllowedValues []HashAlgorithm // The default hash algorithm that is used in a code signing job. // // This member is required. DefaultValue HashAlgorithm noSmithyDocumentSerde } // A cross-account permission for a signing profile. type Permission struct { // An AWS Signer action permitted as part of cross-account permissions. Action *string // The AWS principal that has been granted a cross-account permission. Principal *string // The signing profile version that a permission applies to. ProfileVersion *string // A unique identifier for a cross-account permission statement. StatementId *string noSmithyDocumentSerde } // The name and prefix of the S3 bucket where code signing saves your signed // objects. type S3Destination struct { // Name of the S3 bucket. BucketName *string // An Amazon S3 prefix that you can use to limit responses to those that begin // with the specified prefix. Prefix *string noSmithyDocumentSerde } // The S3 bucket name and key where code signing saved your signed code image. type S3SignedObject struct { // Name of the S3 bucket. BucketName *string // Key name that uniquely identifies a signed code image in your bucket. Key *string noSmithyDocumentSerde } // Information about the S3 bucket where you saved your unsigned code. type S3Source struct { // Name of the S3 bucket. // // This member is required. BucketName *string // Key name of the bucket object that contains your unsigned code. // // This member is required. Key *string // Version of your source image in your version enabled S3 bucket. // // This member is required. Version *string noSmithyDocumentSerde } // The validity period for a signing job. type SignatureValidityPeriod struct { // The time unit for signature validity. Type ValidityType // The numerical value of the time unit for signature validity. Value int32 noSmithyDocumentSerde } // Points to an S3SignedObject object that contains information about your signed // code image. type SignedObject struct { // The S3SignedObject . S3 *S3SignedObject noSmithyDocumentSerde } // The configuration of a code signing operation. type SigningConfiguration struct { // The encryption algorithm options that are available for a code signing job. // // This member is required. EncryptionAlgorithmOptions *EncryptionAlgorithmOptions // The hash algorithm options that are available for a code signing job. // // This member is required. HashAlgorithmOptions *HashAlgorithmOptions noSmithyDocumentSerde } // A signing configuration that overrides the default encryption or hash algorithm // of a signing job. type SigningConfigurationOverrides struct { // A specified override of the default encryption algorithm that is used in a code // signing job. EncryptionAlgorithm EncryptionAlgorithm // A specified override of the default hash algorithm that is used in a code // signing job. HashAlgorithm HashAlgorithm noSmithyDocumentSerde } // The image format of a code signing platform or profile. type SigningImageFormat struct { // The default format of a code signing image. // // This member is required. DefaultFormat ImageFormat // The supported formats of a code signing image. // // This member is required. SupportedFormats []ImageFormat noSmithyDocumentSerde } // Contains information about a signing job. type SigningJob struct { // The date and time that the signing job was created. CreatedAt *time.Time // Indicates whether the signing job is revoked. IsRevoked bool // The ID of the signing job. JobId *string // The AWS account ID of the job invoker. JobInvoker *string // The AWS account ID of the job owner. JobOwner *string // The name of a signing platform. PlatformDisplayName *string // The unique identifier for a signing platform. PlatformId *string // The name of the signing profile that created a signing job. ProfileName *string // The version of the signing profile that created a signing job. ProfileVersion *string // The time when the signature of a signing job expires. SignatureExpiresAt *time.Time // A SignedObject structure that contains information about a signing job's signed // code image. SignedObject *SignedObject // A SigningMaterial object that contains the Amazon Resource Name (ARN) of the // certificate used for the signing job. SigningMaterial *SigningMaterial // A Source that contains information about a signing job's code image source. Source *Source // The status of the signing job. Status SigningStatus noSmithyDocumentSerde } // Revocation information for a signing job. type SigningJobRevocationRecord struct { // A caller-supplied reason for revocation. Reason *string // The time of revocation. RevokedAt *time.Time // The identity of the revoker. RevokedBy *string noSmithyDocumentSerde } // The ACM certificate that is used to sign your code. type SigningMaterial struct { // The Amazon Resource Name (ARN) of the certificates that is used to sign your // code. // // This member is required. CertificateArn *string noSmithyDocumentSerde } // Contains information about the signing configurations and parameters that are // used to perform a code signing job. type SigningPlatform struct { // The category of a code signing platform. Category Category // The display name of a code signing platform. DisplayName *string // The maximum size (in MB) of code that can be signed by a code signing platform. MaxSizeInMB int32 // Any partner entities linked to a code signing platform. Partner *string // The ID of a code signing platform. PlatformId *string // Indicates whether revocation is supported for the platform. RevocationSupported bool // The configuration of a code signing platform. This includes the designated hash // algorithm and encryption algorithm of a signing platform. SigningConfiguration *SigningConfiguration // The image format of a code signing platform or profile. SigningImageFormat *SigningImageFormat // The types of targets that can be signed by a code signing platform. Target *string noSmithyDocumentSerde } // Any overrides that are applied to the signing configuration of a code signing // platform. type SigningPlatformOverrides struct { // A signing configuration that overrides the default encryption or hash algorithm // of a signing job. SigningConfiguration *SigningConfigurationOverrides // A signed image is a JSON object. When overriding the default signing platform // configuration, a customer can select either of two signing formats, JSONEmbedded // or JSONDetached . (A third format value, JSON , is reserved for future use.) // With JSONEmbedded , the signing image has the payload embedded in it. With // JSONDetached , the payload is not be embedded in the signing image. SigningImageFormat ImageFormat noSmithyDocumentSerde } // Contains information about the ACM certificates and code signing configuration // parameters that can be used by a given code signing user. type SigningProfile struct { // The Amazon Resource Name (ARN) for the signing profile. Arn *string // The name of the signing platform. PlatformDisplayName *string // The ID of a platform that is available for use by a signing profile. PlatformId *string // The name of the signing profile. ProfileName *string // The version of a signing profile. ProfileVersion *string // The ARN of a signing profile, including the profile version. ProfileVersionArn *string // The validity period for a signing job created using this signing profile. SignatureValidityPeriod *SignatureValidityPeriod // The ACM certificate that is available for use by a signing profile. SigningMaterial *SigningMaterial // The parameters that are available for use by a code signing user. SigningParameters map[string]string // The status of a code signing profile. Status SigningProfileStatus // A list of tags associated with the signing profile. Tags map[string]string noSmithyDocumentSerde } // Revocation information for a signing profile. type SigningProfileRevocationRecord struct { // The time when revocation becomes effective. RevocationEffectiveFrom *time.Time // The time when the signing profile was revoked. RevokedAt *time.Time // The identity of the revoker. RevokedBy *string noSmithyDocumentSerde } // An S3Source object that contains information about the S3 bucket where you // saved your unsigned code. type Source struct { // The S3Source object. S3 *S3Source noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
383
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package simspaceweaver import ( "context" cryptorand "crypto/rand" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws/defaults" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/retry" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" smithy "github.com/aws/smithy-go" smithydocument "github.com/aws/smithy-go/document" "github.com/aws/smithy-go/logging" "github.com/aws/smithy-go/middleware" smithyrand "github.com/aws/smithy-go/rand" smithyhttp "github.com/aws/smithy-go/transport/http" "net" "net/http" "time" ) const ServiceID = "SimSpaceWeaver" const ServiceAPIVersion = "2022-10-28" // Client provides the API client to make operations call for AWS SimSpace Weaver. type Client struct { options Options } // New returns an initialized Client based on the functional options. Provide // additional functional options to further configure the behavior of the client, // such as changing the client's endpoint or adding custom middleware behavior. func New(options Options, optFns ...func(*Options)) *Client { options = options.Copy() resolveDefaultLogger(&options) setResolvedDefaultsMode(&options) resolveRetryer(&options) resolveHTTPClient(&options) resolveHTTPSignerV4(&options) resolveDefaultEndpointConfiguration(&options) resolveIdempotencyTokenProvider(&options) for _, fn := range optFns { fn(&options) } client := &Client{ options: options, } return client } type Options struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error // Configures the events that will be sent to the configured logger. ClientLogMode aws.ClientLogMode // The credentials object to use when signing requests. Credentials aws.CredentialsProvider // The configuration DefaultsMode that the SDK should use when constructing the // clients initial default settings. DefaultsMode aws.DefaultsMode // The endpoint options to be used when attempting to resolve an endpoint. EndpointOptions EndpointResolverOptions // The service endpoint resolver. EndpointResolver EndpointResolver // Signature Version 4 (SigV4) Signer HTTPSignerV4 HTTPSignerV4 // Provides idempotency tokens values that will be automatically populated into // idempotent API operations. IdempotencyTokenProvider IdempotencyTokenProvider // The logger writer interface to write logging messages to. Logger logging.Logger // The region to send requests to. (Required) Region string // RetryMaxAttempts specifies the maximum number attempts an API client will call // an operation that fails with a retryable error. A value of 0 is ignored, and // will not be used to configure the API client created default retryer, or modify // per operation call's retry max attempts. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. If specified in an operation call's functional // options with a value that is different than the constructed client's Options, // the Client's Retryer will be wrapped to use the operation's specific // RetryMaxAttempts value. RetryMaxAttempts int // RetryMode specifies the retry mode the API client will be created with, if // Retryer option is not also specified. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. Currently does not support per operation call // overrides, may in the future. RetryMode aws.RetryMode // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. The kind of // default retry created by the API client can be changed with the RetryMode // option. Retryer aws.Retryer // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You // should not populate this structure programmatically, or rely on the values here // within your applications. RuntimeEnvironment aws.RuntimeEnvironment // The initial DefaultsMode used when the client options were constructed. If the // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved // value was at that point in time. Currently does not support per operation call // overrides, may in the future. resolvedDefaultsMode aws.DefaultsMode // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. HTTPClient HTTPClient } // WithAPIOptions returns a functional option for setting the Client's APIOptions // option. func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { return func(o *Options) { o.APIOptions = append(o.APIOptions, optFns...) } } // WithEndpointResolver returns a functional option for setting the Client's // EndpointResolver option. func WithEndpointResolver(v EndpointResolver) func(*Options) { return func(o *Options) { o.EndpointResolver = v } } type HTTPClient interface { Do(*http.Request) (*http.Response, error) } // Copy creates a clone where the APIOptions list is deep copied. func (o Options) Copy() Options { to := o to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) copy(to.APIOptions, o.APIOptions) return to } func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { ctx = middleware.ClearStackValues(ctx) stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) options := c.options.Copy() for _, fn := range optFns { fn(&options) } finalizeRetryMaxAttemptOptions(&options, *c) finalizeClientEndpointResolverOptions(&options) for _, fn := range stackFns { if err := fn(stack, options); err != nil { return nil, metadata, err } } for _, fn := range options.APIOptions { if err := fn(stack); err != nil { return nil, metadata, err } } handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) result, metadata, err = handler.Handle(ctx, params) if err != nil { err = &smithy.OperationError{ ServiceID: ServiceID, OperationName: opID, Err: err, } } return result, metadata, err } type noSmithyDocumentSerde = smithydocument.NoSerde func resolveDefaultLogger(o *Options) { if o.Logger != nil { return } o.Logger = logging.Nop{} } func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { return middleware.AddSetLoggerMiddleware(stack, o.Logger) } func setResolvedDefaultsMode(o *Options) { if len(o.resolvedDefaultsMode) > 0 { return } var mode aws.DefaultsMode mode.SetFromString(string(o.DefaultsMode)) if mode == aws.DefaultsModeAuto { mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) } o.resolvedDefaultsMode = mode } // NewFromConfig returns a new client from the provided config. func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, DefaultsMode: cfg.DefaultsMode, RuntimeEnvironment: cfg.RuntimeEnvironment, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } resolveAWSRetryerProvider(cfg, &opts) resolveAWSRetryMaxAttempts(cfg, &opts) resolveAWSRetryMode(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) return New(opts, optFns...) } func resolveHTTPClient(o *Options) { var buildable *awshttp.BuildableClient if o.HTTPClient != nil { var ok bool buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) if !ok { return } } else { buildable = awshttp.NewBuildableClient() } modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { dialer.Timeout = dialerTimeout } }) buildable = buildable.WithTransportOptions(func(transport *http.Transport) { if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { transport.TLSHandshakeTimeout = tlsHandshakeTimeout } }) } o.HTTPClient = buildable } func resolveRetryer(o *Options) { if o.Retryer != nil { return } if len(o.RetryMode) == 0 { modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { o.RetryMode = modeConfig.RetryMode } } if len(o.RetryMode) == 0 { o.RetryMode = aws.RetryModeStandard } var standardOptions []func(*retry.StandardOptions) if v := o.RetryMaxAttempts; v != 0 { standardOptions = append(standardOptions, func(so *retry.StandardOptions) { so.MaxAttempts = v }) } switch o.RetryMode { case aws.RetryModeAdaptive: var adaptiveOptions []func(*retry.AdaptiveModeOptions) if len(standardOptions) != 0 { adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { ao.StandardOptions = append(ao.StandardOptions, standardOptions...) }) } o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) default: o.Retryer = retry.NewStandard(standardOptions...) } } func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { if cfg.Retryer == nil { return } o.Retryer = cfg.Retryer() } func resolveAWSRetryMode(cfg aws.Config, o *Options) { if len(cfg.RetryMode) == 0 { return } o.RetryMode = cfg.RetryMode } func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { if cfg.RetryMaxAttempts == 0 { return } o.RetryMaxAttempts = cfg.RetryMaxAttempts } func finalizeRetryMaxAttemptOptions(o *Options, client Client) { if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { return } o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) } func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { return } o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) } func addClientUserAgent(stack *middleware.Stack) error { return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "simspaceweaver", goModuleVersion)(stack) } func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ CredentialsProvider: o.Credentials, Signer: o.HTTPSignerV4, LogSigning: o.ClientLogMode.IsSigning(), }) return stack.Finalize.Add(mw, middleware.After) } type HTTPSignerV4 interface { SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error } func resolveHTTPSignerV4(o *Options) { if o.HTTPSignerV4 != nil { return } o.HTTPSignerV4 = newDefaultV4Signer(*o) } func newDefaultV4Signer(o Options) *v4.Signer { return v4.NewSigner(func(so *v4.SignerOptions) { so.Logger = o.Logger so.LogSigning = o.ClientLogMode.IsSigning() }) } func resolveIdempotencyTokenProvider(o *Options) { if o.IdempotencyTokenProvider != nil { return } o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader) } func addRetryMiddlewares(stack *middleware.Stack, o Options) error { mo := retry.AddRetryMiddlewaresOptions{ Retryer: o.Retryer, LogRetryAttempts: o.ClientLogMode.IsRetries(), } return retry.AddRetryMiddlewares(stack, mo) } // resolves dual-stack endpoint configuration func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseDualStackEndpoint = value } return nil } // resolves FIPS endpoint configuration func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseFIPSEndpoint = value } return nil } // IdempotencyTokenProvider interface for providing idempotency token type IdempotencyTokenProvider interface { GetIdempotencyToken() (string, error) } func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) } func addResponseErrorMiddleware(stack *middleware.Stack) error { return awshttp.AddResponseErrorMiddleware(stack) } func addRequestResponseLogging(stack *middleware.Stack, o Options) error { return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ LogRequest: o.ClientLogMode.IsRequest(), LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), LogResponse: o.ClientLogMode.IsResponse(), LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), }, middleware.After) }
454
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package simspaceweaver 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 simspaceweaver 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/simspaceweaver/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a snapshot of the specified simulation. A snapshot is a file that // contains simulation state data at a specific time. The state data saved in a // snapshot includes entity data from the State Fabric, the simulation // configuration specified in the schema, and the clock tick number. You can use // the snapshot to initialize a new simulation. For more information about // snapshots, see Snapshots (https://docs.aws.amazon.com/simspaceweaver/latest/userguide/working-with_snapshots.html) // in the SimSpace Weaver User Guide. You specify a Destination when you create a // snapshot. The Destination is the name of an Amazon S3 bucket and an optional // ObjectKeyPrefix . The ObjectKeyPrefix is usually the name of a folder in the // bucket. SimSpace Weaver creates a snapshot folder inside the Destination and // places the snapshot file there. The snapshot file is an Amazon S3 object. It has // an object key with the form: // object-key-prefix/snapshot/simulation-name-YYMMdd-HHmm-ss.zip , where: // - YY is the 2-digit year // - MM is the 2-digit month // - dd is the 2-digit day of the month // - HH is the 2-digit hour (24-hour clock) // - mm is the 2-digit minutes // - ss is the 2-digit seconds func (c *Client) CreateSnapshot(ctx context.Context, params *CreateSnapshotInput, optFns ...func(*Options)) (*CreateSnapshotOutput, error) { if params == nil { params = &CreateSnapshotInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateSnapshot", params, optFns, c.addOperationCreateSnapshotMiddlewares) if err != nil { return nil, err } out := result.(*CreateSnapshotOutput) out.ResultMetadata = metadata return out, nil } type CreateSnapshotInput struct { // The Amazon S3 bucket and optional folder (object key prefix) where SimSpace // Weaver creates the snapshot file. The Amazon S3 bucket must be in the same // Amazon Web Services Region as the simulation. // // This member is required. Destination *types.S3Destination // The name of the simulation. // // This member is required. Simulation *string noSmithyDocumentSerde } type CreateSnapshotOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateSnapshotMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateSnapshot{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateSnapshot{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateSnapshotValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSnapshot(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateSnapshot(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "simspaceweaver", OperationName: "CreateSnapshot", } }
146
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package simspaceweaver import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes the instance of the given custom app. func (c *Client) DeleteApp(ctx context.Context, params *DeleteAppInput, optFns ...func(*Options)) (*DeleteAppOutput, error) { if params == nil { params = &DeleteAppInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteApp", params, optFns, c.addOperationDeleteAppMiddlewares) if err != nil { return nil, err } out := result.(*DeleteAppOutput) out.ResultMetadata = metadata return out, nil } type DeleteAppInput struct { // The name of the app. // // This member is required. App *string // The name of the domain of the app. // // This member is required. Domain *string // The name of the simulation of the app. // // This member is required. Simulation *string noSmithyDocumentSerde } type DeleteAppOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteAppMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteApp{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteApp{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteAppValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteApp(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteApp(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "simspaceweaver", OperationName: "DeleteApp", } }
130
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package simspaceweaver import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes all SimSpace Weaver resources assigned to the given simulation. Your // simulation uses resources in other Amazon Web Services. This API operation // doesn't delete resources in other Amazon Web Services. func (c *Client) DeleteSimulation(ctx context.Context, params *DeleteSimulationInput, optFns ...func(*Options)) (*DeleteSimulationOutput, error) { if params == nil { params = &DeleteSimulationInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteSimulation", params, optFns, c.addOperationDeleteSimulationMiddlewares) if err != nil { return nil, err } out := result.(*DeleteSimulationOutput) out.ResultMetadata = metadata return out, nil } type DeleteSimulationInput struct { // The name of the simulation. // // This member is required. Simulation *string noSmithyDocumentSerde } type DeleteSimulationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteSimulationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteSimulation{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteSimulation{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteSimulationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSimulation(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteSimulation(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "simspaceweaver", OperationName: "DeleteSimulation", } }
122
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package simspaceweaver 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/simspaceweaver/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns the state of the given custom app. func (c *Client) DescribeApp(ctx context.Context, params *DescribeAppInput, optFns ...func(*Options)) (*DescribeAppOutput, error) { if params == nil { params = &DescribeAppInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeApp", params, optFns, c.addOperationDescribeAppMiddlewares) if err != nil { return nil, err } out := result.(*DescribeAppOutput) out.ResultMetadata = metadata return out, nil } type DescribeAppInput struct { // The name of the app. // // This member is required. App *string // The name of the domain of the app. // // This member is required. Domain *string // The name of the simulation of the app. // // This member is required. Simulation *string noSmithyDocumentSerde } type DescribeAppOutput struct { // The description of the app. Description *string // The name of the domain of the app. Domain *string // Information about the network endpoint for the custom app. You can use the // endpoint to connect to the custom app. EndpointInfo *types.SimulationAppEndpointInfo // Options that apply when the app starts. These options override default behavior. LaunchOverrides *types.LaunchOverrides // The name of the app. Name *string // The name of the simulation of the app. Simulation *string // The current lifecycle state of the custom app. Status types.SimulationAppStatus // The desired lifecycle state of the custom app. TargetStatus types.SimulationAppTargetStatus // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeAppMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeApp{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeApp{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeAppValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeApp(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeApp(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "simspaceweaver", OperationName: "DescribeApp", } }
157
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package simspaceweaver 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/simspaceweaver/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Returns the current state of the given simulation. func (c *Client) DescribeSimulation(ctx context.Context, params *DescribeSimulationInput, optFns ...func(*Options)) (*DescribeSimulationOutput, error) { if params == nil { params = &DescribeSimulationInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeSimulation", params, optFns, c.addOperationDescribeSimulationMiddlewares) if err != nil { return nil, err } out := result.(*DescribeSimulationOutput) out.ResultMetadata = metadata return out, nil } type DescribeSimulationInput struct { // The name of the simulation. // // This member is required. Simulation *string noSmithyDocumentSerde } type DescribeSimulationOutput struct { // The Amazon Resource Name (ARN) of the simulation. For more information about // ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the Amazon Web Services General Reference. Arn *string // The time when the simulation was created, expressed as the number of seconds // and milliseconds in UTC since the Unix epoch (0:0:0.000, January 1, 1970). CreationTime *time.Time // The description of the simulation. Description *string // A universally unique identifier (UUID) for this simulation. ExecutionId *string // A collection of additional state information, such as domain and clock // configuration. LiveSimulationState *types.LiveSimulationState // Settings that control how SimSpace Weaver handles your simulation log data. LoggingConfiguration *types.LoggingConfiguration // The maximum running time of the simulation, specified as a number of minutes (m // or M), hours (h or H), or days (d or D). The simulation stops when it reaches // this limit. The maximum value is 14D , or its equivalent in the other units. The // default value is 14D . A value equivalent to 0 makes the simulation immediately // transition to Stopping as soon as it reaches Started . MaximumDuration *string // The name of the simulation. Name *string // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role // that the simulation assumes to perform actions. For more information about ARNs, // see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the Amazon Web Services General Reference. For more information about IAM // roles, see IAM roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) // in the Identity and Access Management User Guide. RoleArn *string // An error message that SimSpace Weaver returns only if there is a problem with // the simulation schema. // // Deprecated: SchemaError is no longer used, check StartError instead. SchemaError *string // The location of the simulation schema in Amazon Simple Storage Service (Amazon // S3). For more information about Amazon S3, see the Amazon Simple Storage // Service User Guide (https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html) // . SchemaS3Location *types.S3Location // A location in Amazon Simple Storage Service (Amazon S3) where SimSpace Weaver // stores simulation data, such as your app .zip files and schema file. For more // information about Amazon S3, see the Amazon Simple Storage Service User Guide (https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html) // . SnapshotS3Location *types.S3Location // An error message that SimSpace Weaver returns only if a problem occurs when the // simulation is in the STARTING state. StartError *string // The current lifecycle state of the simulation. Status types.SimulationStatus // The desired lifecycle state of the simulation. TargetStatus types.SimulationTargetStatus // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeSimulationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeSimulation{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeSimulation{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeSimulationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeSimulation(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeSimulation(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "simspaceweaver", OperationName: "DescribeSimulation", } }
191
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package simspaceweaver 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/simspaceweaver/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists all custom apps or service apps for the given simulation and domain. func (c *Client) ListApps(ctx context.Context, params *ListAppsInput, optFns ...func(*Options)) (*ListAppsOutput, error) { if params == nil { params = &ListAppsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListApps", params, optFns, c.addOperationListAppsMiddlewares) if err != nil { return nil, err } out := result.(*ListAppsOutput) out.ResultMetadata = metadata return out, nil } type ListAppsInput struct { // The name of the simulation that you want to list apps for. // // This member is required. Simulation *string // The name of the domain that you want to list apps for. Domain *string // The maximum number of apps to list. MaxResults *int32 // If SimSpace Weaver returns nextToken , then there are more results available. // The value of nextToken is a unique pagination token for each page. To retrieve // the next page, call the operation again using the returned token. Keep all other // arguments unchanged. If no results remain, then nextToken is set to null . Each // pagination token expires after 24 hours. If you provide a token that isn't // valid, then you receive an HTTP 400 ValidationException error. NextToken *string noSmithyDocumentSerde } type ListAppsOutput struct { // The list of apps for the given simulation and domain. Apps []types.SimulationAppMetadata // If SimSpace Weaver returns nextToken , then there are more results available. // The value of nextToken is a unique pagination token for each page. To retrieve // the next page, call the operation again using the returned token. Keep all other // arguments unchanged. If no results remain, then nextToken is set to null . Each // pagination token expires after 24 hours. If you provide a token that isn't // valid, then you receive an HTTP 400 ValidationException error. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListAppsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListApps{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListApps{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListAppsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListApps(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListAppsAPIClient is a client that implements the ListApps operation. type ListAppsAPIClient interface { ListApps(context.Context, *ListAppsInput, ...func(*Options)) (*ListAppsOutput, error) } var _ ListAppsAPIClient = (*Client)(nil) // ListAppsPaginatorOptions is the paginator options for ListApps type ListAppsPaginatorOptions struct { // The maximum number of apps to list. 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 } // ListAppsPaginator is a paginator for ListApps type ListAppsPaginator struct { options ListAppsPaginatorOptions client ListAppsAPIClient params *ListAppsInput nextToken *string firstPage bool } // NewListAppsPaginator returns a new ListAppsPaginator func NewListAppsPaginator(client ListAppsAPIClient, params *ListAppsInput, optFns ...func(*ListAppsPaginatorOptions)) *ListAppsPaginator { if params == nil { params = &ListAppsInput{} } options := ListAppsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListAppsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListAppsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListApps page. func (p *ListAppsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAppsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxResults = limit result, err := p.client.ListApps(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListApps(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "simspaceweaver", OperationName: "ListApps", } }
237
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package simspaceweaver 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/simspaceweaver/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Lists the SimSpace Weaver simulations in the Amazon Web Services account used // to make the API call. func (c *Client) ListSimulations(ctx context.Context, params *ListSimulationsInput, optFns ...func(*Options)) (*ListSimulationsOutput, error) { if params == nil { params = &ListSimulationsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListSimulations", params, optFns, c.addOperationListSimulationsMiddlewares) if err != nil { return nil, err } out := result.(*ListSimulationsOutput) out.ResultMetadata = metadata return out, nil } type ListSimulationsInput struct { // The maximum number of simulations to list. MaxResults *int32 // If SimSpace Weaver returns nextToken , then there are more results available. // The value of nextToken is a unique pagination token for each page. To retrieve // the next page, call the operation again using the returned token. Keep all other // arguments unchanged. If no results remain, then nextToken is set to null . Each // pagination token expires after 24 hours. If you provide a token that isn't // valid, then you receive an HTTP 400 ValidationException error. NextToken *string noSmithyDocumentSerde } type ListSimulationsOutput struct { // If SimSpace Weaver returns nextToken , then there are more results available. // The value of nextToken is a unique pagination token for each page. To retrieve // the next page, call the operation again using the returned token. Keep all other // arguments unchanged. If no results remain, then nextToken is set to null . Each // pagination token expires after 24 hours. If you provide a token that isn't // valid, then you receive an HTTP 400 ValidationException error. NextToken *string // The list of simulations. Simulations []types.SimulationMetadata // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListSimulationsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListSimulations{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSimulations{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListSimulations(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // ListSimulationsAPIClient is a client that implements the ListSimulations // operation. type ListSimulationsAPIClient interface { ListSimulations(context.Context, *ListSimulationsInput, ...func(*Options)) (*ListSimulationsOutput, error) } var _ ListSimulationsAPIClient = (*Client)(nil) // ListSimulationsPaginatorOptions is the paginator options for ListSimulations type ListSimulationsPaginatorOptions struct { // The maximum number of simulations to list. 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 } // ListSimulationsPaginator is a paginator for ListSimulations type ListSimulationsPaginator struct { options ListSimulationsPaginatorOptions client ListSimulationsAPIClient params *ListSimulationsInput nextToken *string firstPage bool } // NewListSimulationsPaginator returns a new ListSimulationsPaginator func NewListSimulationsPaginator(client ListSimulationsAPIClient, params *ListSimulationsInput, optFns ...func(*ListSimulationsPaginatorOptions)) *ListSimulationsPaginator { if params == nil { params = &ListSimulationsInput{} } options := ListSimulationsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &ListSimulationsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *ListSimulationsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next ListSimulations page. func (p *ListSimulationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSimulationsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxResults = limit result, err := p.client.ListSimulations(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opListSimulations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "simspaceweaver", OperationName: "ListSimulations", } }
228
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package simspaceweaver 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" ) // Lists all tags on a SimSpace Weaver resource. func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { if params == nil { params = &ListTagsForResourceInput{} } result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) if err != nil { return nil, err } out := result.(*ListTagsForResourceOutput) out.ResultMetadata = metadata return out, nil } type ListTagsForResourceInput struct { // The Amazon Resource Name (ARN) of the resource. For more information about // ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the Amazon Web Services General Reference. // // This member is required. ResourceArn *string noSmithyDocumentSerde } type ListTagsForResourceOutput struct { // The list of tags for the resource. Tags map[string]string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "simspaceweaver", OperationName: "ListTagsForResource", } }
126
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package simspaceweaver 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/simspaceweaver/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Starts a custom app with the configuration specified in the simulation schema. func (c *Client) StartApp(ctx context.Context, params *StartAppInput, optFns ...func(*Options)) (*StartAppOutput, error) { if params == nil { params = &StartAppInput{} } result, metadata, err := c.invokeOperation(ctx, "StartApp", params, optFns, c.addOperationStartAppMiddlewares) if err != nil { return nil, err } out := result.(*StartAppOutput) out.ResultMetadata = metadata return out, nil } type StartAppInput struct { // The name of the domain of the app. // // This member is required. Domain *string // The name of the app. // // This member is required. Name *string // The name of the simulation of the app. // // This member is required. Simulation *string // A value that you provide to ensure that repeated calls to this API operation // using the same parameters complete only once. A ClientToken is also known as an // idempotency token. A ClientToken expires after 24 hours. ClientToken *string // The description of the app. Description *string // Options that apply when the app starts. These options override default behavior. LaunchOverrides *types.LaunchOverrides noSmithyDocumentSerde } type StartAppOutput struct { // The name of the domain of the app. Domain *string // The name of the app. Name *string // The name of the simulation of the app. Simulation *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStartAppMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpStartApp{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartApp{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addIdempotencyToken_opStartAppMiddleware(stack, options); err != nil { return err } if err = addOpStartAppValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartApp(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } type idempotencyToken_initializeOpStartApp struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpStartApp) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpStartApp) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { if m.tokenProvider == nil { return next.HandleInitialize(ctx, in) } input, ok := in.Parameters.(*StartAppInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *StartAppInput ") } if input.ClientToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opStartAppMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpStartApp{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opStartApp(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "simspaceweaver", OperationName: "StartApp", } }
189
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package simspaceweaver 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" ) // Starts the simulation clock. func (c *Client) StartClock(ctx context.Context, params *StartClockInput, optFns ...func(*Options)) (*StartClockOutput, error) { if params == nil { params = &StartClockInput{} } result, metadata, err := c.invokeOperation(ctx, "StartClock", params, optFns, c.addOperationStartClockMiddlewares) if err != nil { return nil, err } out := result.(*StartClockOutput) out.ResultMetadata = metadata return out, nil } type StartClockInput struct { // The name of the simulation. // // This member is required. Simulation *string noSmithyDocumentSerde } type StartClockOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStartClockMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpStartClock{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartClock{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpStartClockValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartClock(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opStartClock(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "simspaceweaver", OperationName: "StartClock", } }
120
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package simspaceweaver 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/simspaceweaver/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Starts a simulation with the given name. You must choose to start your // simulation from a schema or from a snapshot. For more information about the // schema, see the schema reference (https://docs.aws.amazon.com/simspaceweaver/latest/userguide/schema-reference.html) // in the SimSpace Weaver User Guide. For more information about snapshots, see // Snapshots (https://docs.aws.amazon.com/simspaceweaver/latest/userguide/working-with_snapshots.html) // in the SimSpace Weaver User Guide. func (c *Client) StartSimulation(ctx context.Context, params *StartSimulationInput, optFns ...func(*Options)) (*StartSimulationOutput, error) { if params == nil { params = &StartSimulationInput{} } result, metadata, err := c.invokeOperation(ctx, "StartSimulation", params, optFns, c.addOperationStartSimulationMiddlewares) if err != nil { return nil, err } out := result.(*StartSimulationOutput) out.ResultMetadata = metadata return out, nil } type StartSimulationInput struct { // The name of the simulation. // // This member is required. Name *string // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role // that the simulation assumes to perform actions. For more information about ARNs, // see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the Amazon Web Services General Reference. For more information about IAM // roles, see IAM roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) // in the Identity and Access Management User Guide. // // This member is required. RoleArn *string // A value that you provide to ensure that repeated calls to this API operation // using the same parameters complete only once. A ClientToken is also known as an // idempotency token. A ClientToken expires after 24 hours. ClientToken *string // The description of the simulation. Description *string // The maximum running time of the simulation, specified as a number of minutes (m // or M), hours (h or H), or days (d or D). The simulation stops when it reaches // this limit. The maximum value is 14D , or its equivalent in the other units. The // default value is 14D . A value equivalent to 0 makes the simulation immediately // transition to Stopping as soon as it reaches Started . MaximumDuration *string // The location of the simulation schema in Amazon Simple Storage Service (Amazon // S3). For more information about Amazon S3, see the Amazon Simple Storage // Service User Guide (https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html) // . Provide a SchemaS3Location to start your simulation from a schema. If you // provide a SchemaS3Location then you can't provide a SnapshotS3Location . SchemaS3Location *types.S3Location // The location of the snapshot .zip file in Amazon Simple Storage Service (Amazon // S3). For more information about Amazon S3, see the Amazon Simple Storage // Service User Guide (https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html) // . Provide a SnapshotS3Location to start your simulation from a snapshot. The // Amazon S3 bucket must be in the same Amazon Web Services Region as the // simulation. If you provide a SnapshotS3Location then you can't provide a // SchemaS3Location . SnapshotS3Location *types.S3Location // A list of tags for the simulation. For more information about tags, see Tagging // Amazon Web Services resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) // in the Amazon Web Services General Reference. Tags map[string]string noSmithyDocumentSerde } type StartSimulationOutput struct { // The Amazon Resource Name (ARN) of the simulation. For more information about // ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the Amazon Web Services General Reference. Arn *string // The time when the simulation was created, expressed as the number of seconds // and milliseconds in UTC since the Unix epoch (0:0:0.000, January 1, 1970). CreationTime *time.Time // A universally unique identifier (UUID) for this simulation. ExecutionId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStartSimulationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpStartSimulation{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartSimulation{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addIdempotencyToken_opStartSimulationMiddleware(stack, options); err != nil { return err } if err = addOpStartSimulationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartSimulation(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } type idempotencyToken_initializeOpStartSimulation struct { tokenProvider IdempotencyTokenProvider } func (*idempotencyToken_initializeOpStartSimulation) ID() string { return "OperationIdempotencyTokenAutoFill" } func (m *idempotencyToken_initializeOpStartSimulation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { if m.tokenProvider == nil { return next.HandleInitialize(ctx, in) } input, ok := in.Parameters.(*StartSimulationInput) if !ok { return out, metadata, fmt.Errorf("expected middleware input to be of type *StartSimulationInput ") } if input.ClientToken == nil { t, err := m.tokenProvider.GetIdempotencyToken() if err != nil { return out, metadata, err } input.ClientToken = &t } return next.HandleInitialize(ctx, in) } func addIdempotencyToken_opStartSimulationMiddleware(stack *middleware.Stack, cfg Options) error { return stack.Initialize.Add(&idempotencyToken_initializeOpStartSimulation{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) } func newServiceMetadataMiddleware_opStartSimulation(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "simspaceweaver", OperationName: "StartSimulation", } }
223
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package simspaceweaver 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" ) // Stops the given custom app and shuts down all of its allocated compute // resources. func (c *Client) StopApp(ctx context.Context, params *StopAppInput, optFns ...func(*Options)) (*StopAppOutput, error) { if params == nil { params = &StopAppInput{} } result, metadata, err := c.invokeOperation(ctx, "StopApp", params, optFns, c.addOperationStopAppMiddlewares) if err != nil { return nil, err } out := result.(*StopAppOutput) out.ResultMetadata = metadata return out, nil } type StopAppInput struct { // The name of the app. // // This member is required. App *string // The name of the domain of the app. // // This member is required. Domain *string // The name of the simulation of the app. // // This member is required. Simulation *string noSmithyDocumentSerde } type StopAppOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStopAppMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpStopApp{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStopApp{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpStopAppValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopApp(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opStopApp(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "simspaceweaver", OperationName: "StopApp", } }
131
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package simspaceweaver 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" ) // Stops the simulation clock. func (c *Client) StopClock(ctx context.Context, params *StopClockInput, optFns ...func(*Options)) (*StopClockOutput, error) { if params == nil { params = &StopClockInput{} } result, metadata, err := c.invokeOperation(ctx, "StopClock", params, optFns, c.addOperationStopClockMiddlewares) if err != nil { return nil, err } out := result.(*StopClockOutput) out.ResultMetadata = metadata return out, nil } type StopClockInput struct { // The name of the simulation. // // This member is required. Simulation *string noSmithyDocumentSerde } type StopClockOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStopClockMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpStopClock{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStopClock{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpStopClockValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopClock(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opStopClock(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "simspaceweaver", OperationName: "StopClock", } }
120
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package simspaceweaver 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" ) // Stops the given simulation. You can't restart a simulation after you stop it. // If you want to restart a simulation, then you must stop it, delete it, and start // a new instance of it. func (c *Client) StopSimulation(ctx context.Context, params *StopSimulationInput, optFns ...func(*Options)) (*StopSimulationOutput, error) { if params == nil { params = &StopSimulationInput{} } result, metadata, err := c.invokeOperation(ctx, "StopSimulation", params, optFns, c.addOperationStopSimulationMiddlewares) if err != nil { return nil, err } out := result.(*StopSimulationOutput) out.ResultMetadata = metadata return out, nil } type StopSimulationInput struct { // The name of the simulation. // // This member is required. Simulation *string noSmithyDocumentSerde } type StopSimulationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStopSimulationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpStopSimulation{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStopSimulation{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpStopSimulationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStopSimulation(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opStopSimulation(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "simspaceweaver", OperationName: "StopSimulation", } }
122
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package simspaceweaver import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Adds tags to a SimSpace Weaver resource. For more information about tags, see // Tagging Amazon Web Services resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) // in the Amazon Web Services General Reference. 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 tags to. // For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the Amazon Web Services General Reference. // // This member is required. ResourceArn *string // A list of tags to apply to the resource. // // This member is required. Tags map[string]string noSmithyDocumentSerde } type TagResourceOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpTagResourceValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "simspaceweaver", OperationName: "TagResource", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package simspaceweaver import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Removes tags from a SimSpace Weaver resource. For more information about tags, // see Tagging Amazon Web Services resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) // in the Amazon Web Services General Reference. 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 tags // from. For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the Amazon Web Services General Reference. // // This member is required. ResourceArn *string // A list of tag keys to remove from the resource. // // 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: "simspaceweaver", OperationName: "UntagResource", } }
129
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package simspaceweaver import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/simspaceweaver/types" smithy "github.com/aws/smithy-go" smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "strings" ) type awsRestjson1_deserializeOpCreateSnapshot struct { } func (*awsRestjson1_deserializeOpCreateSnapshot) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpCreateSnapshot) 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_deserializeOpErrorCreateSnapshot(response, &metadata) } output := &CreateSnapshotOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorCreateSnapshot(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteApp struct { } func (*awsRestjson1_deserializeOpDeleteApp) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteApp) 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_deserializeOpErrorDeleteApp(response, &metadata) } output := &DeleteAppOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteApp(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDeleteSimulation struct { } func (*awsRestjson1_deserializeOpDeleteSimulation) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDeleteSimulation) 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_deserializeOpErrorDeleteSimulation(response, &metadata) } output := &DeleteSimulationOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorDeleteSimulation(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpDescribeApp struct { } func (*awsRestjson1_deserializeOpDescribeApp) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeApp) 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_deserializeOpErrorDescribeApp(response, &metadata) } output := &DescribeAppOutput{} 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_deserializeOpDocumentDescribeAppOutput(&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_deserializeOpErrorDescribeApp(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeAppOutput(v **DescribeAppOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeAppOutput if *v == nil { sv = &DescribeAppOutput{} } 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 Description to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "Domain": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimSpaceWeaverResourceName to be of type string, got %T instead", value) } sv.Domain = ptr.String(jtv) } case "EndpointInfo": if err := awsRestjson1_deserializeDocumentSimulationAppEndpointInfo(&sv.EndpointInfo, value); err != nil { return err } case "LaunchOverrides": if err := awsRestjson1_deserializeDocumentLaunchOverrides(&sv.LaunchOverrides, value); err != nil { return err } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimSpaceWeaverLongResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Simulation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimSpaceWeaverResourceName to be of type string, got %T instead", value) } sv.Simulation = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimulationAppStatus to be of type string, got %T instead", value) } sv.Status = types.SimulationAppStatus(jtv) } case "TargetStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimulationAppTargetStatus to be of type string, got %T instead", value) } sv.TargetStatus = types.SimulationAppTargetStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpDescribeSimulation struct { } func (*awsRestjson1_deserializeOpDescribeSimulation) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpDescribeSimulation) 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_deserializeOpErrorDescribeSimulation(response, &metadata) } output := &DescribeSimulationOutput{} 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_deserializeOpDocumentDescribeSimulationOutput(&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_deserializeOpErrorDescribeSimulation(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentDescribeSimulationOutput(v **DescribeSimulationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DescribeSimulationOutput if *v == nil { sv = &DescribeSimulationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimSpaceWeaverArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreationTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Description to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "ExecutionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UUID to be of type string, got %T instead", value) } sv.ExecutionId = ptr.String(jtv) } case "LiveSimulationState": if err := awsRestjson1_deserializeDocumentLiveSimulationState(&sv.LiveSimulationState, value); err != nil { return err } case "LoggingConfiguration": if err := awsRestjson1_deserializeDocumentLoggingConfiguration(&sv.LoggingConfiguration, value); err != nil { return err } case "MaximumDuration": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TimeToLiveString to be of type string, got %T instead", value) } sv.MaximumDuration = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimSpaceWeaverResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "RoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) } sv.RoleArn = ptr.String(jtv) } case "SchemaError": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OptionalString to be of type string, got %T instead", value) } sv.SchemaError = ptr.String(jtv) } case "SchemaS3Location": if err := awsRestjson1_deserializeDocumentS3Location(&sv.SchemaS3Location, value); err != nil { return err } case "SnapshotS3Location": if err := awsRestjson1_deserializeDocumentS3Location(&sv.SnapshotS3Location, value); err != nil { return err } case "StartError": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OptionalString to be of type string, got %T instead", value) } sv.StartError = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimulationStatus to be of type string, got %T instead", value) } sv.Status = types.SimulationStatus(jtv) } case "TargetStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimulationTargetStatus to be of type string, got %T instead", value) } sv.TargetStatus = types.SimulationTargetStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListApps struct { } func (*awsRestjson1_deserializeOpListApps) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListApps) 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_deserializeOpErrorListApps(response, &metadata) } output := &ListAppsOutput{} 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_deserializeOpDocumentListAppsOutput(&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_deserializeOpErrorListApps(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListAppsOutput(v **ListAppsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListAppsOutput if *v == nil { sv = &ListAppsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Apps": if err := awsRestjson1_deserializeDocumentSimulationAppList(&sv.Apps, value); err != nil { return err } case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected OptionalString to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpListSimulations struct { } func (*awsRestjson1_deserializeOpListSimulations) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpListSimulations) 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_deserializeOpErrorListSimulations(response, &metadata) } output := &ListSimulationsOutput{} 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_deserializeOpDocumentListSimulationsOutput(&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_deserializeOpErrorListSimulations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListSimulationsOutput(v **ListSimulationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListSimulationsOutput if *v == nil { sv = &ListSimulationsOutput{} } 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 OptionalString to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "Simulations": if err := awsRestjson1_deserializeDocumentSimulationList(&sv.Simulations, 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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListTagsForResourceOutput if *v == nil { sv = &ListTagsForResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpStartApp struct { } func (*awsRestjson1_deserializeOpStartApp) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStartApp) 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_deserializeOpErrorStartApp(response, &metadata) } output := &StartAppOutput{} 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_deserializeOpDocumentStartAppOutput(&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_deserializeOpErrorStartApp(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentStartAppOutput(v **StartAppOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StartAppOutput if *v == nil { sv = &StartAppOutput{} } 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 SimSpaceWeaverResourceName to be of type string, got %T instead", value) } sv.Domain = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimSpaceWeaverResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Simulation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimSpaceWeaverResourceName to be of type string, got %T instead", value) } sv.Simulation = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpStartClock struct { } func (*awsRestjson1_deserializeOpStartClock) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStartClock) 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_deserializeOpErrorStartClock(response, &metadata) } output := &StartClockOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorStartClock(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpStartSimulation struct { } func (*awsRestjson1_deserializeOpStartSimulation) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStartSimulation) 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_deserializeOpErrorStartSimulation(response, &metadata) } output := &StartSimulationOutput{} 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_deserializeOpDocumentStartSimulationOutput(&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_deserializeOpErrorStartSimulation(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ServiceQuotaExceededException", errorCode): return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeOpDocumentStartSimulationOutput(v **StartSimulationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StartSimulationOutput if *v == nil { sv = &StartSimulationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimSpaceWeaverArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreationTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "ExecutionId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected UUID to be of type string, got %T instead", value) } sv.ExecutionId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } type awsRestjson1_deserializeOpStopApp struct { } func (*awsRestjson1_deserializeOpStopApp) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStopApp) 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_deserializeOpErrorStopApp(response, &metadata) } output := &StopAppOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorStopApp(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpStopClock struct { } func (*awsRestjson1_deserializeOpStopClock) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStopClock) 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_deserializeOpErrorStopClock(response, &metadata) } output := &StopClockOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorStopClock(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpStopSimulation struct { } func (*awsRestjson1_deserializeOpStopSimulation) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpStopSimulation) 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_deserializeOpErrorStopSimulation(response, &metadata) } output := &StopSimulationOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorStopSimulation(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("AccessDeniedException", errorCode): return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) case strings.EqualFold("ConflictException", errorCode): return awsRestjson1_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_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("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("TooManyTagsException", errorCode): return awsRestjson1_deserializeErrorTooManyTagsException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsRestjson1_deserializeOpUntagResource struct { } func (*awsRestjson1_deserializeOpUntagResource) ID() string { return "OperationDeserializer" } func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) } output := &UntagResourceOutput{} out.Result = output return out, metadata, err } func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" errorMessage := errorCode headerCode := response.Header.Get("X-Amzn-ErrorType") if len(headerCode) != 0 { errorCode = restjson.SanitizeErrorCode(headerCode) } var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) if len(headerCode) == 0 && len(jsonCode) != 0 { errorCode = restjson.SanitizeErrorCode(jsonCode) } if len(message) != 0 { errorMessage = message } switch { case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ValidationException", errorCode): return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.AccessDeniedException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_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_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InternalServerException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ResourceNotFoundException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ServiceQuotaExceededException{} 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_deserializeDocumentServiceQuotaExceededException(&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_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.TooManyTagsException{} 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_deserializeDocumentTooManyTagsException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ValidationException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } err := awsRestjson1_deserializeDocumentValidationException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.AccessDeniedException if *v == nil { sv = &types.AccessDeniedException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentAppPortMappings(v *[]types.SimulationAppPortMapping, 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.SimulationAppPortMapping if *v == nil { cv = []types.SimulationAppPortMapping{} } else { cv = *v } for _, value := range shape { var col types.SimulationAppPortMapping destAddr := &col if err := awsRestjson1_deserializeDocumentSimulationAppPortMapping(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentCloudWatchLogsLogGroup(v **types.CloudWatchLogsLogGroup, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.CloudWatchLogsLogGroup if *v == nil { sv = &types.CloudWatchLogsLogGroup{} } else { sv = *v } for key, value := range shape { switch key { case "LogGroupArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LogGroupArn to be of type string, got %T instead", value) } sv.LogGroupArn = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ConflictException if *v == nil { sv = &types.ConflictException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDomain(v **types.Domain, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Domain if *v == nil { sv = &types.Domain{} } else { sv = *v } for key, value := range shape { switch key { case "Lifecycle": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LifecycleManagementStrategy to be of type string, got %T instead", value) } sv.Lifecycle = types.LifecycleManagementStrategy(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimSpaceWeaverResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentDomainList(v *[]types.Domain, 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.Domain if *v == nil { cv = []types.Domain{} } else { cv = *v } for _, value := range shape { var col types.Domain destAddr := &col if err := awsRestjson1_deserializeDocumentDomain(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.InternalServerException if *v == nil { sv = &types.InternalServerException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLaunchCommandList(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 NonEmptyString to be of type string, got %T instead", value) } col = jtv } cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentLaunchOverrides(v **types.LaunchOverrides, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LaunchOverrides if *v == nil { sv = &types.LaunchOverrides{} } else { sv = *v } for key, value := range shape { switch key { case "LaunchCommands": if err := awsRestjson1_deserializeDocumentLaunchCommandList(&sv.LaunchCommands, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLiveSimulationState(v **types.LiveSimulationState, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LiveSimulationState if *v == nil { sv = &types.LiveSimulationState{} } else { sv = *v } for key, value := range shape { switch key { case "Clocks": if err := awsRestjson1_deserializeDocumentSimulationClockList(&sv.Clocks, value); err != nil { return err } case "Domains": if err := awsRestjson1_deserializeDocumentDomainList(&sv.Domains, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLogDestination(v **types.LogDestination, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LogDestination if *v == nil { sv = &types.LogDestination{} } else { sv = *v } for key, value := range shape { switch key { case "CloudWatchLogsLogGroup": if err := awsRestjson1_deserializeDocumentCloudWatchLogsLogGroup(&sv.CloudWatchLogsLogGroup, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentLogDestinations(v *[]types.LogDestination, 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.LogDestination if *v == nil { cv = []types.LogDestination{} } else { cv = *v } for _, value := range shape { var col types.LogDestination destAddr := &col if err := awsRestjson1_deserializeDocumentLogDestination(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentLoggingConfiguration(v **types.LoggingConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.LoggingConfiguration if *v == nil { sv = &types.LoggingConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "Destinations": if err := awsRestjson1_deserializeDocumentLogDestinations(&sv.Destinations, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ResourceNotFoundException if *v == nil { sv = &types.ResourceNotFoundException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentS3Location(v **types.S3Location, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.S3Location if *v == nil { sv = &types.S3Location{} } else { sv = *v } for key, value := range shape { switch key { case "BucketName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BucketName to be of type string, got %T instead", value) } sv.BucketName = ptr.String(jtv) } case "ObjectKey": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ObjectKey to be of type string, got %T instead", value) } sv.ObjectKey = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ServiceQuotaExceededException if *v == nil { sv = &types.ServiceQuotaExceededException{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSimulationAppEndpointInfo(v **types.SimulationAppEndpointInfo, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SimulationAppEndpointInfo if *v == nil { sv = &types.SimulationAppEndpointInfo{} } else { sv = *v } for key, value := range shape { switch key { case "Address": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Address = ptr.String(jtv) } case "IngressPortMappings": if err := awsRestjson1_deserializeDocumentAppPortMappings(&sv.IngressPortMappings, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSimulationAppList(v *[]types.SimulationAppMetadata, 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.SimulationAppMetadata if *v == nil { cv = []types.SimulationAppMetadata{} } else { cv = *v } for _, value := range shape { var col types.SimulationAppMetadata destAddr := &col if err := awsRestjson1_deserializeDocumentSimulationAppMetadata(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSimulationAppMetadata(v **types.SimulationAppMetadata, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SimulationAppMetadata if *v == nil { sv = &types.SimulationAppMetadata{} } 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 SimSpaceWeaverResourceName to be of type string, got %T instead", value) } sv.Domain = ptr.String(jtv) } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimSpaceWeaverLongResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Simulation": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimSpaceWeaverResourceName to be of type string, got %T instead", value) } sv.Simulation = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimulationAppStatus to be of type string, got %T instead", value) } sv.Status = types.SimulationAppStatus(jtv) } case "TargetStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimulationAppTargetStatus to be of type string, got %T instead", value) } sv.TargetStatus = types.SimulationAppTargetStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSimulationAppPortMapping(v **types.SimulationAppPortMapping, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SimulationAppPortMapping if *v == nil { sv = &types.SimulationAppPortMapping{} } else { sv = *v } for key, value := range shape { switch key { case "Actual": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PortNumber to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Actual = ptr.Int32(int32(i64)) } case "Declared": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected PortNumber to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Declared = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSimulationClock(v **types.SimulationClock, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SimulationClock if *v == nil { sv = &types.SimulationClock{} } else { sv = *v } for key, value := range shape { switch key { case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClockStatus to be of type string, got %T instead", value) } sv.Status = types.ClockStatus(jtv) } case "TargetStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ClockTargetStatus to be of type string, got %T instead", value) } sv.TargetStatus = types.ClockTargetStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentSimulationClockList(v *[]types.SimulationClock, 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.SimulationClock if *v == nil { cv = []types.SimulationClock{} } else { cv = *v } for _, value := range shape { var col types.SimulationClock destAddr := &col if err := awsRestjson1_deserializeDocumentSimulationClock(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSimulationList(v *[]types.SimulationMetadata, 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.SimulationMetadata if *v == nil { cv = []types.SimulationMetadata{} } else { cv = *v } for _, value := range shape { var col types.SimulationMetadata destAddr := &col if err := awsRestjson1_deserializeDocumentSimulationMetadata(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsRestjson1_deserializeDocumentSimulationMetadata(v **types.SimulationMetadata, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SimulationMetadata if *v == nil { sv = &types.SimulationMetadata{} } else { sv = *v } for key, value := range shape { switch key { case "Arn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimSpaceWeaverArn to be of type string, got %T instead", value) } sv.Arn = ptr.String(jtv) } case "CreationTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "Name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimSpaceWeaverResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimulationStatus to be of type string, got %T instead", value) } sv.Status = types.SimulationStatus(jtv) } case "TargetStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SimulationTargetStatus to be of type string, got %T instead", value) } sv.TargetStatus = types.SimulationTargetStatus(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var mv map[string]string if *v == nil { mv = map[string]string{} } else { mv = *v } for key, value := range shape { var parsedVal string if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } parsedVal = jtv } mv[key] = parsedVal } *v = mv return nil } func awsRestjson1_deserializeDocumentTooManyTagsException(v **types.TooManyTagsException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TooManyTagsException if *v == nil { sv = &types.TooManyTagsException{} } 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 NonEmptyString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *types.ValidationException if *v == nil { sv = &types.ValidationException{} } else { sv = *v } for key, value := range shape { switch key { case "Message": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil }
3,604
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package simspaceweaver provides the API client, operations, and parameter types // for AWS SimSpace Weaver. // // SimSpace Weaver (SimSpace Weaver) is a managed service that you can use to // build and operate large-scale spatial simulations in the Amazon Web Services // Cloud. For example, you can create a digital twin of a city, crowd simulations // with millions of people and objects, and massively multiplayer games with // hundreds of thousands of connected players. For more information about SimSpace // Weaver, see the SimSpace Weaver User Guide (https://docs.aws.amazon.com/simspaceweaver/latest/userguide/) // . This API reference describes the API operations and data types that you can // use to communicate directly with SimSpace Weaver. SimSpace Weaver also provides // the SimSpace Weaver app SDK, which you use for app development. The SimSpace // Weaver app SDK API reference is included in the SimSpace Weaver app SDK // documentation. This documentation is part of the SimSpace Weaver app SDK // distributable package. package simspaceweaver
19
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package simspaceweaver 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/simspaceweaver/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 = "simspaceweaver" } 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 simspaceweaver // goModuleVersion is the tagged release for this module const goModuleVersion = "1.3.1"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package simspaceweaver
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package simspaceweaver import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/simspaceweaver/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) type awsRestjson1_serializeOpCreateSnapshot struct { } func (*awsRestjson1_serializeOpCreateSnapshot) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpCreateSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateSnapshotInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/createsnapshot") 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_serializeOpDocumentCreateSnapshotInput(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_serializeOpHttpBindingsCreateSnapshotInput(v *CreateSnapshotInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentCreateSnapshotInput(v *CreateSnapshotInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Destination != nil { ok := object.Key("Destination") if err := awsRestjson1_serializeDocumentS3Destination(v.Destination, ok); err != nil { return err } } if v.Simulation != nil { ok := object.Key("Simulation") ok.String(*v.Simulation) } return nil } type awsRestjson1_serializeOpDeleteApp struct { } func (*awsRestjson1_serializeOpDeleteApp) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteApp) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteAppInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/deleteapp") 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_serializeOpHttpBindingsDeleteAppInput(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_serializeOpHttpBindingsDeleteAppInput(v *DeleteAppInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.App != nil { encoder.SetQuery("app").String(*v.App) } if v.Domain != nil { encoder.SetQuery("domain").String(*v.Domain) } if v.Simulation != nil { encoder.SetQuery("simulation").String(*v.Simulation) } return nil } type awsRestjson1_serializeOpDeleteSimulation struct { } func (*awsRestjson1_serializeOpDeleteSimulation) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDeleteSimulation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteSimulationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/deletesimulation") 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_serializeOpHttpBindingsDeleteSimulationInput(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_serializeOpHttpBindingsDeleteSimulationInput(v *DeleteSimulationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Simulation != nil { encoder.SetQuery("simulation").String(*v.Simulation) } return nil } type awsRestjson1_serializeOpDescribeApp struct { } func (*awsRestjson1_serializeOpDescribeApp) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeApp) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeAppInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/describeapp") 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_serializeOpHttpBindingsDescribeAppInput(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_serializeOpHttpBindingsDescribeAppInput(v *DescribeAppInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.App != nil { encoder.SetQuery("app").String(*v.App) } if v.Domain != nil { encoder.SetQuery("domain").String(*v.Domain) } if v.Simulation != nil { encoder.SetQuery("simulation").String(*v.Simulation) } return nil } type awsRestjson1_serializeOpDescribeSimulation struct { } func (*awsRestjson1_serializeOpDescribeSimulation) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpDescribeSimulation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DescribeSimulationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/describesimulation") 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_serializeOpHttpBindingsDescribeSimulationInput(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_serializeOpHttpBindingsDescribeSimulationInput(v *DescribeSimulationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Simulation != nil { encoder.SetQuery("simulation").String(*v.Simulation) } return nil } type awsRestjson1_serializeOpListApps struct { } func (*awsRestjson1_serializeOpListApps) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListApps) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListAppsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/listapps") 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_serializeOpHttpBindingsListAppsInput(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_serializeOpHttpBindingsListAppsInput(v *ListAppsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.Domain != nil { encoder.SetQuery("domain").String(*v.Domain) } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } if v.Simulation != nil { encoder.SetQuery("simulation").String(*v.Simulation) } return nil } type awsRestjson1_serializeOpListSimulations struct { } func (*awsRestjson1_serializeOpListSimulations) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListSimulations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListSimulationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/listsimulations") 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_serializeOpHttpBindingsListSimulationsInput(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_serializeOpHttpBindingsListSimulationsInput(v *ListSimulationsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.MaxResults != nil { encoder.SetQuery("maxResults").Integer(*v.MaxResults) } if v.NextToken != nil { encoder.SetQuery("nextToken").String(*v.NextToken) } return nil } type awsRestjson1_serializeOpListTagsForResource struct { } func (*awsRestjson1_serializeOpListTagsForResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListTagsForResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/tags/{ResourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil { return err } } return nil } type awsRestjson1_serializeOpStartApp struct { } func (*awsRestjson1_serializeOpStartApp) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStartApp) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StartAppInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/startapp") 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_serializeOpDocumentStartAppInput(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_serializeOpHttpBindingsStartAppInput(v *StartAppInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentStartAppInput(v *StartAppInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("ClientToken") ok.String(*v.ClientToken) } if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) } if v.Domain != nil { ok := object.Key("Domain") ok.String(*v.Domain) } if v.LaunchOverrides != nil { ok := object.Key("LaunchOverrides") if err := awsRestjson1_serializeDocumentLaunchOverrides(v.LaunchOverrides, ok); err != nil { return err } } if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if v.Simulation != nil { ok := object.Key("Simulation") ok.String(*v.Simulation) } return nil } type awsRestjson1_serializeOpStartClock struct { } func (*awsRestjson1_serializeOpStartClock) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStartClock) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StartClockInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/startclock") 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_serializeOpDocumentStartClockInput(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_serializeOpHttpBindingsStartClockInput(v *StartClockInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentStartClockInput(v *StartClockInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Simulation != nil { ok := object.Key("Simulation") ok.String(*v.Simulation) } return nil } type awsRestjson1_serializeOpStartSimulation struct { } func (*awsRestjson1_serializeOpStartSimulation) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStartSimulation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StartSimulationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/startsimulation") 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_serializeOpDocumentStartSimulationInput(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_serializeOpHttpBindingsStartSimulationInput(v *StartSimulationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentStartSimulationInput(v *StartSimulationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("ClientToken") ok.String(*v.ClientToken) } if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) } if v.MaximumDuration != nil { ok := object.Key("MaximumDuration") ok.String(*v.MaximumDuration) } if v.Name != nil { ok := object.Key("Name") ok.String(*v.Name) } if v.RoleArn != nil { ok := object.Key("RoleArn") ok.String(*v.RoleArn) } if v.SchemaS3Location != nil { ok := object.Key("SchemaS3Location") if err := awsRestjson1_serializeDocumentS3Location(v.SchemaS3Location, ok); err != nil { return err } } if v.SnapshotS3Location != nil { ok := object.Key("SnapshotS3Location") if err := awsRestjson1_serializeDocumentS3Location(v.SnapshotS3Location, ok); err != nil { return err } } if v.Tags != nil { ok := object.Key("Tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpStopApp struct { } func (*awsRestjson1_serializeOpStopApp) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStopApp) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StopAppInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/stopapp") 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_serializeOpDocumentStopAppInput(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_serializeOpHttpBindingsStopAppInput(v *StopAppInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentStopAppInput(v *StopAppInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.App != nil { ok := object.Key("App") ok.String(*v.App) } if v.Domain != nil { ok := object.Key("Domain") ok.String(*v.Domain) } if v.Simulation != nil { ok := object.Key("Simulation") ok.String(*v.Simulation) } return nil } type awsRestjson1_serializeOpStopClock struct { } func (*awsRestjson1_serializeOpStopClock) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStopClock) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StopClockInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/stopclock") 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_serializeOpDocumentStopClockInput(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_serializeOpHttpBindingsStopClockInput(v *StopClockInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentStopClockInput(v *StopClockInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Simulation != nil { ok := object.Key("Simulation") ok.String(*v.Simulation) } return nil } type awsRestjson1_serializeOpStopSimulation struct { } func (*awsRestjson1_serializeOpStopSimulation) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpStopSimulation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StopSimulationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/stopsimulation") 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_serializeOpDocumentStopSimulationInput(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_serializeOpHttpBindingsStopSimulationInput(v *StopSimulationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } return nil } func awsRestjson1_serializeOpDocumentStopSimulationInput(v *StopSimulationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Simulation != nil { ok := object.Key("Simulation") ok.String(*v.Simulation) } return nil } type awsRestjson1_serializeOpTagResource struct { } func (*awsRestjson1_serializeOpTagResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*TagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/tags/{ResourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } restEncoder.SetHeader("Content-Type").String("application/json") jsonEncoder := smithyjson.NewEncoder() if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil { return err } } return nil } func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Tags != nil { ok := object.Key("Tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { return err } } return nil } type awsRestjson1_serializeOpUntagResource struct { } func (*awsRestjson1_serializeOpUntagResource) ID() string { return "OperationSerializer" } func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UntagResourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } opPath, opQuery := httpbinding.SplitURI("/tags/{ResourceArn}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "DELETE" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = restEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")} } if v.ResourceArn != nil { if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil { return err } } if v.TagKeys != nil { for i := range v.TagKeys { encoder.AddQuery("tagKeys").String(v.TagKeys[i]) } } return nil } func awsRestjson1_serializeDocumentLaunchCommandList(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_serializeDocumentLaunchOverrides(v *types.LaunchOverrides, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.LaunchCommands != nil { ok := object.Key("LaunchCommands") if err := awsRestjson1_serializeDocumentLaunchCommandList(v.LaunchCommands, ok); err != nil { return err } } return nil } func awsRestjson1_serializeDocumentS3Destination(v *types.S3Destination, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.BucketName != nil { ok := object.Key("BucketName") ok.String(*v.BucketName) } if v.ObjectKeyPrefix != nil { ok := object.Key("ObjectKeyPrefix") ok.String(*v.ObjectKeyPrefix) } return nil } func awsRestjson1_serializeDocumentS3Location(v *types.S3Location, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.BucketName != nil { ok := object.Key("BucketName") ok.String(*v.BucketName) } if v.ObjectKey != nil { ok := object.Key("ObjectKey") ok.String(*v.ObjectKey) } return nil } func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() for key := range v { om := object.Key(key) om.String(v[key]) } return nil }
1,202
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package simspaceweaver import ( "context" "fmt" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpCreateSnapshot struct { } func (*validateOpCreateSnapshot) ID() string { return "OperationInputValidation" } func (m *validateOpCreateSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateSnapshotInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateSnapshotInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteApp struct { } func (*validateOpDeleteApp) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteApp) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteAppInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteAppInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteSimulation struct { } func (*validateOpDeleteSimulation) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteSimulation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteSimulationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteSimulationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeApp struct { } func (*validateOpDescribeApp) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeApp) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeAppInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeAppInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDescribeSimulation struct { } func (*validateOpDescribeSimulation) ID() string { return "OperationInputValidation" } func (m *validateOpDescribeSimulation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DescribeSimulationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDescribeSimulationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpListApps struct { } func (*validateOpListApps) ID() string { return "OperationInputValidation" } func (m *validateOpListApps) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*ListAppsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpListAppsInput(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 validateOpStartApp struct { } func (*validateOpStartApp) ID() string { return "OperationInputValidation" } func (m *validateOpStartApp) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartAppInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartAppInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStartClock struct { } func (*validateOpStartClock) ID() string { return "OperationInputValidation" } func (m *validateOpStartClock) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartClockInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartClockInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStartSimulation struct { } func (*validateOpStartSimulation) ID() string { return "OperationInputValidation" } func (m *validateOpStartSimulation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartSimulationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartSimulationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStopApp struct { } func (*validateOpStopApp) ID() string { return "OperationInputValidation" } func (m *validateOpStopApp) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StopAppInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStopAppInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStopClock struct { } func (*validateOpStopClock) ID() string { return "OperationInputValidation" } func (m *validateOpStopClock) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StopClockInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStopClockInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStopSimulation struct { } func (*validateOpStopSimulation) ID() string { return "OperationInputValidation" } func (m *validateOpStopSimulation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StopSimulationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStopSimulationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpTagResource struct { } func (*validateOpTagResource) ID() string { return "OperationInputValidation" } func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*TagResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpTagResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUntagResource struct { } func (*validateOpUntagResource) ID() string { return "OperationInputValidation" } func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UntagResourceInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUntagResourceInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpCreateSnapshotValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateSnapshot{}, middleware.After) } func addOpDeleteAppValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteApp{}, middleware.After) } func addOpDeleteSimulationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteSimulation{}, middleware.After) } func addOpDescribeAppValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeApp{}, middleware.After) } func addOpDescribeSimulationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeSimulation{}, middleware.After) } func addOpListAppsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListApps{}, middleware.After) } func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } func addOpStartAppValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartApp{}, middleware.After) } func addOpStartClockValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartClock{}, middleware.After) } func addOpStartSimulationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartSimulation{}, middleware.After) } func addOpStopAppValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStopApp{}, middleware.After) } func addOpStopClockValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStopClock{}, middleware.After) } func addOpStopSimulationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStopSimulation{}, middleware.After) } func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } func validateOpCreateSnapshotInput(v *CreateSnapshotInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateSnapshotInput"} if v.Simulation == nil { invalidParams.Add(smithy.NewErrParamRequired("Simulation")) } if v.Destination == nil { invalidParams.Add(smithy.NewErrParamRequired("Destination")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteAppInput(v *DeleteAppInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteAppInput"} if v.Simulation == nil { invalidParams.Add(smithy.NewErrParamRequired("Simulation")) } if v.Domain == nil { invalidParams.Add(smithy.NewErrParamRequired("Domain")) } if v.App == nil { invalidParams.Add(smithy.NewErrParamRequired("App")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteSimulationInput(v *DeleteSimulationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteSimulationInput"} if v.Simulation == nil { invalidParams.Add(smithy.NewErrParamRequired("Simulation")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeAppInput(v *DescribeAppInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeAppInput"} if v.Simulation == nil { invalidParams.Add(smithy.NewErrParamRequired("Simulation")) } if v.Domain == nil { invalidParams.Add(smithy.NewErrParamRequired("Domain")) } if v.App == nil { invalidParams.Add(smithy.NewErrParamRequired("App")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDescribeSimulationInput(v *DescribeSimulationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeSimulationInput"} if v.Simulation == nil { invalidParams.Add(smithy.NewErrParamRequired("Simulation")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpListAppsInput(v *ListAppsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListAppsInput"} if v.Simulation == nil { invalidParams.Add(smithy.NewErrParamRequired("Simulation")) } 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 validateOpStartAppInput(v *StartAppInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartAppInput"} if v.Simulation == nil { invalidParams.Add(smithy.NewErrParamRequired("Simulation")) } if v.Domain == nil { invalidParams.Add(smithy.NewErrParamRequired("Domain")) } if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStartClockInput(v *StartClockInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartClockInput"} if v.Simulation == nil { invalidParams.Add(smithy.NewErrParamRequired("Simulation")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStartSimulationInput(v *StartSimulationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartSimulationInput"} if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } if v.RoleArn == nil { invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStopAppInput(v *StopAppInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StopAppInput"} if v.Simulation == nil { invalidParams.Add(smithy.NewErrParamRequired("Simulation")) } if v.Domain == nil { invalidParams.Add(smithy.NewErrParamRequired("Domain")) } if v.App == nil { invalidParams.Add(smithy.NewErrParamRequired("App")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStopClockInput(v *StopClockInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StopClockInput"} if v.Simulation == nil { invalidParams.Add(smithy.NewErrParamRequired("Simulation")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStopSimulationInput(v *StopSimulationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StopSimulationInput"} if v.Simulation == nil { invalidParams.Add(smithy.NewErrParamRequired("Simulation")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if v.Tags == nil { invalidParams.Add(smithy.NewErrParamRequired("Tags")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUntagResourceInput(v *UntagResourceInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} if v.ResourceArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) } if v.TagKeys == nil { invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
632
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 SimSpaceWeaver 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: "simspaceweaver.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "simspaceweaver-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "simspaceweaver-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "simspaceweaver.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "simspaceweaver.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "simspaceweaver-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "simspaceweaver-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "simspaceweaver.{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: "simspaceweaver-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "simspaceweaver.{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: "simspaceweaver-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "simspaceweaver.{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: "simspaceweaver-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "simspaceweaver.{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: "simspaceweaver-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "simspaceweaver.{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: "simspaceweaver.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "simspaceweaver-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "simspaceweaver-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "simspaceweaver.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "us-gov-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-gov-west-1", }: endpoints.Endpoint{}, }, }, }
331
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 ClockStatus string // Enum values for ClockStatus const ( ClockStatusUnknown ClockStatus = "UNKNOWN" ClockStatusStarting ClockStatus = "STARTING" ClockStatusStarted ClockStatus = "STARTED" ClockStatusStopping ClockStatus = "STOPPING" ClockStatusStopped ClockStatus = "STOPPED" ) // Values returns all known values for ClockStatus. 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 (ClockStatus) Values() []ClockStatus { return []ClockStatus{ "UNKNOWN", "STARTING", "STARTED", "STOPPING", "STOPPED", } } type ClockTargetStatus string // Enum values for ClockTargetStatus const ( ClockTargetStatusUnknown ClockTargetStatus = "UNKNOWN" ClockTargetStatusStarted ClockTargetStatus = "STARTED" ClockTargetStatusStopped ClockTargetStatus = "STOPPED" ) // Values returns all known values for ClockTargetStatus. 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 (ClockTargetStatus) Values() []ClockTargetStatus { return []ClockTargetStatus{ "UNKNOWN", "STARTED", "STOPPED", } } type LifecycleManagementStrategy string // Enum values for LifecycleManagementStrategy const ( LifecycleManagementStrategyUnknown LifecycleManagementStrategy = "Unknown" LifecycleManagementStrategyPerWorker LifecycleManagementStrategy = "PerWorker" LifecycleManagementStrategyBySpatialSubdivision LifecycleManagementStrategy = "BySpatialSubdivision" LifecycleManagementStrategyByRequest LifecycleManagementStrategy = "ByRequest" ) // Values returns all known values for LifecycleManagementStrategy. 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 (LifecycleManagementStrategy) Values() []LifecycleManagementStrategy { return []LifecycleManagementStrategy{ "Unknown", "PerWorker", "BySpatialSubdivision", "ByRequest", } } type SimulationAppStatus string // Enum values for SimulationAppStatus const ( SimulationAppStatusStarting SimulationAppStatus = "STARTING" SimulationAppStatusStarted SimulationAppStatus = "STARTED" SimulationAppStatusStopping SimulationAppStatus = "STOPPING" SimulationAppStatusStopped SimulationAppStatus = "STOPPED" SimulationAppStatusError SimulationAppStatus = "ERROR" SimulationAppStatusUnknown SimulationAppStatus = "UNKNOWN" ) // Values returns all known values for SimulationAppStatus. 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 (SimulationAppStatus) Values() []SimulationAppStatus { return []SimulationAppStatus{ "STARTING", "STARTED", "STOPPING", "STOPPED", "ERROR", "UNKNOWN", } } type SimulationAppTargetStatus string // Enum values for SimulationAppTargetStatus const ( SimulationAppTargetStatusUnknown SimulationAppTargetStatus = "UNKNOWN" SimulationAppTargetStatusStarted SimulationAppTargetStatus = "STARTED" SimulationAppTargetStatusStopped SimulationAppTargetStatus = "STOPPED" ) // Values returns all known values for SimulationAppTargetStatus. 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 (SimulationAppTargetStatus) Values() []SimulationAppTargetStatus { return []SimulationAppTargetStatus{ "UNKNOWN", "STARTED", "STOPPED", } } type SimulationStatus string // Enum values for SimulationStatus const ( SimulationStatusUnknown SimulationStatus = "UNKNOWN" SimulationStatusStarting SimulationStatus = "STARTING" SimulationStatusStarted SimulationStatus = "STARTED" SimulationStatusStopping SimulationStatus = "STOPPING" SimulationStatusStopped SimulationStatus = "STOPPED" SimulationStatusFailed SimulationStatus = "FAILED" SimulationStatusDeleting SimulationStatus = "DELETING" SimulationStatusDeleted SimulationStatus = "DELETED" SimulationStatusSnapshotInProgress SimulationStatus = "SNAPSHOT_IN_PROGRESS" ) // Values returns all known values for SimulationStatus. 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 (SimulationStatus) Values() []SimulationStatus { return []SimulationStatus{ "UNKNOWN", "STARTING", "STARTED", "STOPPING", "STOPPED", "FAILED", "DELETING", "DELETED", "SNAPSHOT_IN_PROGRESS", } } type SimulationTargetStatus string // Enum values for SimulationTargetStatus const ( SimulationTargetStatusUnknown SimulationTargetStatus = "UNKNOWN" SimulationTargetStatusStarted SimulationTargetStatus = "STARTED" SimulationTargetStatusStopped SimulationTargetStatus = "STOPPED" SimulationTargetStatusDeleted SimulationTargetStatus = "DELETED" ) // Values returns all known values for SimulationTargetStatus. 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 (SimulationTargetStatus) Values() []SimulationTargetStatus { return []SimulationTargetStatus{ "UNKNOWN", "STARTED", "STOPPED", "DELETED", } }
170
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" ) type AccessDeniedException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *AccessDeniedException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *AccessDeniedException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *AccessDeniedException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "AccessDeniedException" } return *e.ErrorCodeOverride } func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } 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 } type InternalServerException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InternalServerException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InternalServerException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InternalServerException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InternalServerException" } return *e.ErrorCodeOverride } func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } type ResourceNotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ResourceNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ResourceNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ResourceNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ResourceNotFoundException" } return *e.ErrorCodeOverride } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } type ServiceQuotaExceededException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ServiceQuotaExceededException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ServiceQuotaExceededException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ServiceQuotaExceededException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ServiceQuotaExceededException" } return *e.ErrorCodeOverride } func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } type TooManyTagsException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *TooManyTagsException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *TooManyTagsException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *TooManyTagsException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "TooManyTagsException" } return *e.ErrorCodeOverride } func (e *TooManyTagsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } type ValidationException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ValidationException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ValidationException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ValidationException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ValidationException" } return *e.ErrorCodeOverride } func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
184
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package types import ( smithydocument "github.com/aws/smithy-go/document" "time" ) // The Amazon CloudWatch Logs log group for the simulation. For more information // about log groups, see Working with log groups and log streams (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html) // in the Amazon CloudWatch Logs User Guide. type CloudWatchLogsLogGroup struct { // The Amazon Resource Name (ARN) of the Amazon CloudWatch Logs log group for the // simulation. For more information about ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the Amazon Web Services General Reference. For more information about log // groups, see Working with log groups and log streams (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html) // in the Amazon CloudWatch Logs User Guide. LogGroupArn *string noSmithyDocumentSerde } // A collection of app instances that run the same executable app code and have // the same launch options and commands. For more information about domains, see // Key concepts: Domains (https://docs.aws.amazon.com/simspaceweaver/latest/userguide/what-is_key-concepts.html#what-is_key-concepts_domains) // in the SimSpace Weaver User Guide. type Domain struct { // The type of lifecycle management for apps in the domain. Indicates whether apps // in this domain are managed (SimSpace Weaver starts and stops the apps) or // unmanaged (you must start and stop the apps). Lifecycle types // - PerWorker – Managed: SimSpace Weaver starts one app on each worker. // - BySpatialSubdivision – Managed: SimSpace Weaver starts one app for each // spatial partition. // - ByRequest – Unmanaged: You use the StartApp API to start the apps and use // the StopApp API to stop the apps. Lifecycle LifecycleManagementStrategy // The name of the domain. Name *string noSmithyDocumentSerde } // Options that apply when the app starts. These options override default behavior. type LaunchOverrides struct { // App launch commands and command line parameters that override the launch // command configured in the simulation schema. LaunchCommands []string noSmithyDocumentSerde } // A collection of additional state information, such as domain and clock // configuration. type LiveSimulationState struct { // A list of simulation clocks. At this time, a simulation has only one clock. Clocks []SimulationClock // A list of domains for the simulation. For more information about domains, see // Key concepts: Domains (https://docs.aws.amazon.com/simspaceweaver/latest/userguide/what-is_key-concepts.html#what-is_key-concepts_domains) // in the SimSpace Weaver User Guide. Domains []Domain noSmithyDocumentSerde } // The location where SimSpace Weaver sends simulation log data. type LogDestination struct { // An Amazon CloudWatch Logs log group that stores simulation log data. For more // information about log groups, see Working with log groups and log streams (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html) // in the Amazon CloudWatch Logs User Guide. CloudWatchLogsLogGroup *CloudWatchLogsLogGroup noSmithyDocumentSerde } // The logging configuration for a simulation. type LoggingConfiguration struct { // A list of the locations where SimSpace Weaver sends simulation log data. Destinations []LogDestination noSmithyDocumentSerde } // An Amazon S3 bucket and optional folder (object key prefix) where SimSpace // Weaver creates a file. type S3Destination struct { // The name of an Amazon S3 bucket. For more information about buckets, see // Creating, configuring, and working with Amazon S3 buckets (https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-buckets-s3.html) // in the Amazon Simple Storage Service User Guide. BucketName *string // A string prefix for an Amazon S3 object key. It's usually a folder name. For // more information about folders in Amazon S3, see Organizing objects in the // Amazon S3 console using folders (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-folders.html) // in the Amazon Simple Storage Service User Guide. ObjectKeyPrefix *string noSmithyDocumentSerde } // A location in Amazon Simple Storage Service (Amazon S3) where SimSpace Weaver // stores simulation data, such as your app .zip files and schema file. For more // information about Amazon S3, see the Amazon Simple Storage Service User Guide (https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html) // . type S3Location struct { // The name of an Amazon S3 bucket. For more information about buckets, see // Creating, configuring, and working with Amazon S3 buckets (https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-buckets-s3.html) // in the Amazon Simple Storage Service User Guide. BucketName *string // The key name of an object in Amazon S3. For more information about Amazon S3 // objects and object keys, see Uploading, downloading, and working with objects // in Amazon S3 (https://docs.aws.amazon.com/AmazonS3/latest/userguide/uploading-downloading-objects.html) // in the Amazon Simple Storage Service User Guide. ObjectKey *string noSmithyDocumentSerde } // Information about the network endpoint that you can use to connect to your // custom or service app. For more information about SimSpace Weaver apps, see Key // concepts: Apps (https://docs.aws.amazon.com/simspaceweaver/latest/userguide/what-is_key-concepts.html#what-is_key-concepts_apps) // in the SimSpace Weaver User Guide.. type SimulationAppEndpointInfo struct { // The IP address of the app. SimSpace Weaver dynamically assigns this IP address // when the app starts. Address *string // The inbound TCP/UDP port numbers of the app. The combination of an IP address // and a port number form a network endpoint. IngressPortMappings []SimulationAppPortMapping noSmithyDocumentSerde } // A collection of metadata about the app. type SimulationAppMetadata struct { // The domain of the app. For more information about domains, see Key concepts: // Domains (https://docs.aws.amazon.com/simspaceweaver/latest/userguide/what-is_key-concepts.html#what-is_key-concepts_domains) // in the SimSpace Weaver User Guide. Domain *string // The name of the app. Name *string // The name of the simulation of the app. Simulation *string // The current status of the app. Status SimulationAppStatus // The desired status of the app. TargetStatus SimulationAppTargetStatus noSmithyDocumentSerde } // A collection of TCP/UDP ports for a custom or service app. type SimulationAppPortMapping struct { // The TCP/UDP port number of the running app. SimSpace Weaver dynamically assigns // this port number when the app starts. SimSpace Weaver maps the Declared port to // the Actual port. Clients connect to the app using the app's IP address and the // Actual port number. Actual *int32 // The TCP/UDP port number of the app, declared in the simulation schema. SimSpace // Weaver maps the Declared port to the Actual port. The source code for the app // should bind to the Declared port. Declared *int32 noSmithyDocumentSerde } // Status information about the simulation clock. type SimulationClock struct { // The current status of the simulation clock. Status ClockStatus // The desired status of the simulation clock. TargetStatus ClockTargetStatus noSmithyDocumentSerde } // A collection of data about the simulation. type SimulationMetadata struct { // The Amazon Resource Name (ARN) of the simulation. For more information about // ARNs, see Amazon Resource Names (ARNs) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the Amazon Web Services General Reference. Arn *string // The time when the simulation was created, expressed as the number of seconds // and milliseconds in UTC since the Unix epoch (0:0:0.000, January 1, 1970). CreationTime *time.Time // The name of the simulation. Name *string // The current status of the simulation. Status SimulationStatus // The desired status of the simulation. TargetStatus SimulationTargetStatus noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
224
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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 = "SMS" const ServiceAPIVersion = "2016-10-24" // Client provides the API client to make operations call for AWS Server Migration // Service. type Client struct { options Options } // New returns an initialized Client based on the functional options. Provide // additional functional options to further configure the behavior of the client, // such as changing the client's endpoint or adding custom middleware behavior. func New(options Options, optFns ...func(*Options)) *Client { options = options.Copy() resolveDefaultLogger(&options) setResolvedDefaultsMode(&options) resolveRetryer(&options) resolveHTTPClient(&options) resolveHTTPSignerV4(&options) resolveDefaultEndpointConfiguration(&options) for _, fn := range optFns { fn(&options) } client := &Client{ options: options, } return client } type Options struct { // Set of options to modify how an operation is invoked. These apply to all // operations invoked for this client. Use functional options on operation call to // modify this list for per operation behavior. APIOptions []func(*middleware.Stack) error // Configures the events that will be sent to the configured logger. ClientLogMode aws.ClientLogMode // The credentials object to use when signing requests. Credentials aws.CredentialsProvider // The configuration DefaultsMode that the SDK should use when constructing the // clients initial default settings. DefaultsMode aws.DefaultsMode // The endpoint options to be used when attempting to resolve an endpoint. EndpointOptions EndpointResolverOptions // The service endpoint resolver. EndpointResolver EndpointResolver // Signature Version 4 (SigV4) Signer HTTPSignerV4 HTTPSignerV4 // The logger writer interface to write logging messages to. Logger logging.Logger // The region to send requests to. (Required) Region string // RetryMaxAttempts specifies the maximum number attempts an API client will call // an operation that fails with a retryable error. A value of 0 is ignored, and // will not be used to configure the API client created default retryer, or modify // per operation call's retry max attempts. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. If specified in an operation call's functional // options with a value that is different than the constructed client's Options, // the Client's Retryer will be wrapped to use the operation's specific // RetryMaxAttempts value. RetryMaxAttempts int // RetryMode specifies the retry mode the API client will be created with, if // Retryer option is not also specified. When creating a new API Clients this // member will only be used if the Retryer Options member is nil. This value will // be ignored if Retryer is not nil. Currently does not support per operation call // overrides, may in the future. RetryMode aws.RetryMode // Retryer guides how HTTP requests should be retried in case of recoverable // failures. When nil the API client will use a default retryer. The kind of // default retry created by the API client can be changed with the RetryMode // option. Retryer aws.Retryer // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You // should not populate this structure programmatically, or rely on the values here // within your applications. RuntimeEnvironment aws.RuntimeEnvironment // The initial DefaultsMode used when the client options were constructed. If the // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved // value was at that point in time. Currently does not support per operation call // overrides, may in the future. resolvedDefaultsMode aws.DefaultsMode // The HTTP client to invoke API calls with. Defaults to client's default HTTP // implementation if nil. HTTPClient HTTPClient } // WithAPIOptions returns a functional option for setting the Client's APIOptions // option. func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { return func(o *Options) { o.APIOptions = append(o.APIOptions, optFns...) } } // WithEndpointResolver returns a functional option for setting the Client's // EndpointResolver option. func WithEndpointResolver(v EndpointResolver) func(*Options) { return func(o *Options) { o.EndpointResolver = v } } type HTTPClient interface { Do(*http.Request) (*http.Response, error) } // Copy creates a clone where the APIOptions list is deep copied. func (o Options) Copy() Options { to := o to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) copy(to.APIOptions, o.APIOptions) return to } func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { ctx = middleware.ClearStackValues(ctx) stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) options := c.options.Copy() for _, fn := range optFns { fn(&options) } finalizeRetryMaxAttemptOptions(&options, *c) finalizeClientEndpointResolverOptions(&options) for _, fn := range stackFns { if err := fn(stack, options); err != nil { return nil, metadata, err } } for _, fn := range options.APIOptions { if err := fn(stack); err != nil { return nil, metadata, err } } handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) result, metadata, err = handler.Handle(ctx, params) if err != nil { err = &smithy.OperationError{ ServiceID: ServiceID, OperationName: opID, Err: err, } } return result, metadata, err } type noSmithyDocumentSerde = smithydocument.NoSerde func resolveDefaultLogger(o *Options) { if o.Logger != nil { return } o.Logger = logging.Nop{} } func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { return middleware.AddSetLoggerMiddleware(stack, o.Logger) } func setResolvedDefaultsMode(o *Options) { if len(o.resolvedDefaultsMode) > 0 { return } var mode aws.DefaultsMode mode.SetFromString(string(o.DefaultsMode)) if mode == aws.DefaultsModeAuto { mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) } o.resolvedDefaultsMode = mode } // NewFromConfig returns a new client from the provided config. func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { opts := Options{ Region: cfg.Region, DefaultsMode: cfg.DefaultsMode, RuntimeEnvironment: cfg.RuntimeEnvironment, HTTPClient: cfg.HTTPClient, Credentials: cfg.Credentials, APIOptions: cfg.APIOptions, Logger: cfg.Logger, ClientLogMode: cfg.ClientLogMode, } resolveAWSRetryerProvider(cfg, &opts) resolveAWSRetryMaxAttempts(cfg, &opts) resolveAWSRetryMode(cfg, &opts) resolveAWSEndpointResolver(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) return New(opts, optFns...) } func resolveHTTPClient(o *Options) { var buildable *awshttp.BuildableClient if o.HTTPClient != nil { var ok bool buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) if !ok { return } } else { buildable = awshttp.NewBuildableClient() } modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { dialer.Timeout = dialerTimeout } }) buildable = buildable.WithTransportOptions(func(transport *http.Transport) { if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { transport.TLSHandshakeTimeout = tlsHandshakeTimeout } }) } o.HTTPClient = buildable } func resolveRetryer(o *Options) { if o.Retryer != nil { return } if len(o.RetryMode) == 0 { modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) if err == nil { o.RetryMode = modeConfig.RetryMode } } if len(o.RetryMode) == 0 { o.RetryMode = aws.RetryModeStandard } var standardOptions []func(*retry.StandardOptions) if v := o.RetryMaxAttempts; v != 0 { standardOptions = append(standardOptions, func(so *retry.StandardOptions) { so.MaxAttempts = v }) } switch o.RetryMode { case aws.RetryModeAdaptive: var adaptiveOptions []func(*retry.AdaptiveModeOptions) if len(standardOptions) != 0 { adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { ao.StandardOptions = append(ao.StandardOptions, standardOptions...) }) } o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) default: o.Retryer = retry.NewStandard(standardOptions...) } } func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { if cfg.Retryer == nil { return } o.Retryer = cfg.Retryer() } func resolveAWSRetryMode(cfg aws.Config, o *Options) { if len(cfg.RetryMode) == 0 { return } o.RetryMode = cfg.RetryMode } func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { if cfg.RetryMaxAttempts == 0 { return } o.RetryMaxAttempts = cfg.RetryMaxAttempts } func finalizeRetryMaxAttemptOptions(o *Options, client Client) { if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { return } o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) } func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { return } o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) } func addClientUserAgent(stack *middleware.Stack) error { return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "sms", goModuleVersion)(stack) } func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ CredentialsProvider: o.Credentials, Signer: o.HTTPSignerV4, LogSigning: o.ClientLogMode.IsSigning(), }) return stack.Finalize.Add(mw, middleware.After) } type HTTPSignerV4 interface { SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error } func resolveHTTPSignerV4(o *Options) { if o.HTTPSignerV4 != nil { return } o.HTTPSignerV4 = newDefaultV4Signer(*o) } func newDefaultV4Signer(o Options) *v4.Signer { return v4.NewSigner(func(so *v4.SignerOptions) { so.Logger = o.Logger so.LogSigning = o.ClientLogMode.IsSigning() }) } func addRetryMiddlewares(stack *middleware.Stack, o Options) error { mo := retry.AddRetryMiddlewaresOptions{ Retryer: o.Retryer, LogRetryAttempts: o.ClientLogMode.IsRetries(), } return retry.AddRetryMiddlewares(stack, mo) } // resolves dual-stack endpoint configuration func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseDualStackEndpoint = value } return nil } // resolves FIPS endpoint configuration func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseFIPSEndpoint = value } return nil } func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) } func addResponseErrorMiddleware(stack *middleware.Stack) error { return awshttp.AddResponseErrorMiddleware(stack) } func addRequestResponseLogging(stack *middleware.Stack, o Options) error { return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ LogRequest: o.ClientLogMode.IsRequest(), LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), LogResponse: o.ClientLogMode.IsResponse(), LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), }, middleware.After) }
435
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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 sms 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/sms/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates an application. An application consists of one or more server groups. // Each server group contain one or more servers. func (c *Client) CreateApp(ctx context.Context, params *CreateAppInput, optFns ...func(*Options)) (*CreateAppOutput, error) { if params == nil { params = &CreateAppInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateApp", params, optFns, c.addOperationCreateAppMiddlewares) if err != nil { return nil, err } out := result.(*CreateAppOutput) out.ResultMetadata = metadata return out, nil } type CreateAppInput struct { // A unique, case-sensitive identifier that you provide to ensure the idempotency // of application creation. ClientToken *string // The description of the new application Description *string // The name of the new application. Name *string // The name of the service role in the customer's account to be used by Server // Migration Service. RoleName *string // The server groups to include in the application. ServerGroups []types.ServerGroup // The tags to be associated with the application. Tags []types.Tag noSmithyDocumentSerde } type CreateAppOutput struct { // A summary description of the application. AppSummary *types.AppSummary // The server groups included in the application. ServerGroups []types.ServerGroup // The tags associated with the application. Tags []types.Tag // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateAppMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateApp{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateApp{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opCreateApp(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateApp(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "CreateApp", } }
144
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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/sms/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Creates a replication job. The replication job schedules periodic replication // runs to replicate your server to Amazon Web Services. Each replication run // creates an Amazon Machine Image (AMI). func (c *Client) CreateReplicationJob(ctx context.Context, params *CreateReplicationJobInput, optFns ...func(*Options)) (*CreateReplicationJobOutput, error) { if params == nil { params = &CreateReplicationJobInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateReplicationJob", params, optFns, c.addOperationCreateReplicationJobMiddlewares) if err != nil { return nil, err } out := result.(*CreateReplicationJobOutput) out.ResultMetadata = metadata return out, nil } type CreateReplicationJobInput struct { // The seed replication time. // // This member is required. SeedReplicationTime *time.Time // The ID of the server. // // This member is required. ServerId *string // The description of the replication job. Description *string // Indicates whether the replication job produces encrypted AMIs. Encrypted *bool // The time between consecutive replication runs, in hours. Frequency *int32 // The ID of the KMS key for replication jobs that produce encrypted AMIs. This // value can be any of the following: // - KMS key ID // - KMS key alias // - ARN referring to the KMS key ID // - ARN referring to the KMS key alias // If encrypted is true but a KMS key ID is not specified, the customer's default // KMS key for Amazon EBS is used. KmsKeyId *string // The license type to be used for the AMI created by a successful replication run. LicenseType types.LicenseType // The maximum number of SMS-created AMIs to retain. The oldest is deleted after // the maximum number is reached and a new AMI is created. NumberOfRecentAmisToKeep *int32 // The name of the IAM role to be used by the Server Migration Service. RoleName *string // Indicates whether to run the replication job one time. RunOnce *bool noSmithyDocumentSerde } type CreateReplicationJobOutput struct { // The unique identifier of the replication job. ReplicationJobId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateReplicationJobMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateReplicationJob{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateReplicationJob{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateReplicationJobValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateReplicationJob(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateReplicationJob(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "CreateReplicationJob", } }
165
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes the specified application. Optionally deletes the launched stack // associated with the application and all Server Migration Service replication // jobs for servers in the application. func (c *Client) DeleteApp(ctx context.Context, params *DeleteAppInput, optFns ...func(*Options)) (*DeleteAppOutput, error) { if params == nil { params = &DeleteAppInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteApp", params, optFns, c.addOperationDeleteAppMiddlewares) if err != nil { return nil, err } out := result.(*DeleteAppOutput) out.ResultMetadata = metadata return out, nil } type DeleteAppInput struct { // The ID of the application. AppId *string // Indicates whether to stop all replication jobs corresponding to the servers in // the application while deleting the application. ForceStopAppReplication *bool // Indicates whether to terminate the stack corresponding to the application while // deleting the application. ForceTerminateApp *bool noSmithyDocumentSerde } type DeleteAppOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteAppMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteApp{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteApp{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opDeleteApp(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteApp(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "DeleteApp", } }
125
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes the launch configuration for the specified application. func (c *Client) DeleteAppLaunchConfiguration(ctx context.Context, params *DeleteAppLaunchConfigurationInput, optFns ...func(*Options)) (*DeleteAppLaunchConfigurationOutput, error) { if params == nil { params = &DeleteAppLaunchConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteAppLaunchConfiguration", params, optFns, c.addOperationDeleteAppLaunchConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*DeleteAppLaunchConfigurationOutput) out.ResultMetadata = metadata return out, nil } type DeleteAppLaunchConfigurationInput struct { // The ID of the application. AppId *string noSmithyDocumentSerde } type DeleteAppLaunchConfigurationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteAppLaunchConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteAppLaunchConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteAppLaunchConfiguration{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opDeleteAppLaunchConfiguration(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteAppLaunchConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "DeleteAppLaunchConfiguration", } }
115
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes the replication configuration for the specified application. func (c *Client) DeleteAppReplicationConfiguration(ctx context.Context, params *DeleteAppReplicationConfigurationInput, optFns ...func(*Options)) (*DeleteAppReplicationConfigurationOutput, error) { if params == nil { params = &DeleteAppReplicationConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteAppReplicationConfiguration", params, optFns, c.addOperationDeleteAppReplicationConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*DeleteAppReplicationConfigurationOutput) out.ResultMetadata = metadata return out, nil } type DeleteAppReplicationConfigurationInput struct { // The ID of the application. AppId *string noSmithyDocumentSerde } type DeleteAppReplicationConfigurationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteAppReplicationConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteAppReplicationConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteAppReplicationConfiguration{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opDeleteAppReplicationConfiguration(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteAppReplicationConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "DeleteAppReplicationConfiguration", } }
115
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes the validation configuration for the specified application. func (c *Client) DeleteAppValidationConfiguration(ctx context.Context, params *DeleteAppValidationConfigurationInput, optFns ...func(*Options)) (*DeleteAppValidationConfigurationOutput, error) { if params == nil { params = &DeleteAppValidationConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteAppValidationConfiguration", params, optFns, c.addOperationDeleteAppValidationConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*DeleteAppValidationConfigurationOutput) out.ResultMetadata = metadata return out, nil } type DeleteAppValidationConfigurationInput struct { // The ID of the application. // // This member is required. AppId *string noSmithyDocumentSerde } type DeleteAppValidationConfigurationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteAppValidationConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteAppValidationConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteAppValidationConfiguration{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteAppValidationConfigurationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAppValidationConfiguration(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteAppValidationConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "DeleteAppValidationConfiguration", } }
120
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes the specified replication job. After you delete a replication job, // there are no further replication runs. Amazon Web Services deletes the contents // of the Amazon S3 bucket used to store Server Migration Service artifacts. The // AMIs created by the replication runs are not deleted. func (c *Client) DeleteReplicationJob(ctx context.Context, params *DeleteReplicationJobInput, optFns ...func(*Options)) (*DeleteReplicationJobOutput, error) { if params == nil { params = &DeleteReplicationJobInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteReplicationJob", params, optFns, c.addOperationDeleteReplicationJobMiddlewares) if err != nil { return nil, err } out := result.(*DeleteReplicationJobOutput) out.ResultMetadata = metadata return out, nil } type DeleteReplicationJobInput struct { // The ID of the replication job. // // This member is required. ReplicationJobId *string noSmithyDocumentSerde } type DeleteReplicationJobOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteReplicationJobMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteReplicationJob{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteReplicationJob{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDeleteReplicationJobValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteReplicationJob(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteReplicationJob(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "DeleteReplicationJob", } }
123
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Deletes all servers from your server catalog. func (c *Client) DeleteServerCatalog(ctx context.Context, params *DeleteServerCatalogInput, optFns ...func(*Options)) (*DeleteServerCatalogOutput, error) { if params == nil { params = &DeleteServerCatalogInput{} } result, metadata, err := c.invokeOperation(ctx, "DeleteServerCatalog", params, optFns, c.addOperationDeleteServerCatalogMiddlewares) if err != nil { return nil, err } out := result.(*DeleteServerCatalogOutput) out.ResultMetadata = metadata return out, nil } type DeleteServerCatalogInput struct { noSmithyDocumentSerde } type DeleteServerCatalogOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDeleteServerCatalogMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteServerCatalog{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteServerCatalog{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opDeleteServerCatalog(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDeleteServerCatalog(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "DeleteServerCatalog", } }
111
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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" ) // Disassociates the specified connector from Server Migration Service. After you // disassociate a connector, it is no longer available to support replication jobs. func (c *Client) DisassociateConnector(ctx context.Context, params *DisassociateConnectorInput, optFns ...func(*Options)) (*DisassociateConnectorOutput, error) { if params == nil { params = &DisassociateConnectorInput{} } result, metadata, err := c.invokeOperation(ctx, "DisassociateConnector", params, optFns, c.addOperationDisassociateConnectorMiddlewares) if err != nil { return nil, err } out := result.(*DisassociateConnectorOutput) out.ResultMetadata = metadata return out, nil } type DisassociateConnectorInput struct { // The ID of the connector. // // This member is required. ConnectorId *string noSmithyDocumentSerde } type DisassociateConnectorOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDisassociateConnectorMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDisassociateConnector{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDisassociateConnector{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDisassociateConnectorValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateConnector(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDisassociateConnector(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "DisassociateConnector", } }
121
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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/sms/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Generates a target change set for a currently launched stack and writes it to // an Amazon S3 object in the customer’s Amazon S3 bucket. func (c *Client) GenerateChangeSet(ctx context.Context, params *GenerateChangeSetInput, optFns ...func(*Options)) (*GenerateChangeSetOutput, error) { if params == nil { params = &GenerateChangeSetInput{} } result, metadata, err := c.invokeOperation(ctx, "GenerateChangeSet", params, optFns, c.addOperationGenerateChangeSetMiddlewares) if err != nil { return nil, err } out := result.(*GenerateChangeSetOutput) out.ResultMetadata = metadata return out, nil } type GenerateChangeSetInput struct { // The ID of the application associated with the change set. AppId *string // The format for the change set. ChangesetFormat types.OutputFormat noSmithyDocumentSerde } type GenerateChangeSetOutput struct { // The location of the Amazon S3 object. S3Location *types.S3Location // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGenerateChangeSetMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGenerateChangeSet{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGenerateChangeSet{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opGenerateChangeSet(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGenerateChangeSet(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "GenerateChangeSet", } }
124
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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/sms/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Generates an CloudFormation template based on the current launch configuration // and writes it to an Amazon S3 object in the customer’s Amazon S3 bucket. func (c *Client) GenerateTemplate(ctx context.Context, params *GenerateTemplateInput, optFns ...func(*Options)) (*GenerateTemplateOutput, error) { if params == nil { params = &GenerateTemplateInput{} } result, metadata, err := c.invokeOperation(ctx, "GenerateTemplate", params, optFns, c.addOperationGenerateTemplateMiddlewares) if err != nil { return nil, err } out := result.(*GenerateTemplateOutput) out.ResultMetadata = metadata return out, nil } type GenerateTemplateInput struct { // The ID of the application associated with the CloudFormation template. AppId *string // The format for generating the CloudFormation template. TemplateFormat types.OutputFormat noSmithyDocumentSerde } type GenerateTemplateOutput struct { // The location of the Amazon S3 object. S3Location *types.S3Location // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGenerateTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGenerateTemplate{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGenerateTemplate{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opGenerateTemplate(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGenerateTemplate(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "GenerateTemplate", } }
124
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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/sms/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieve information about the specified application. func (c *Client) GetApp(ctx context.Context, params *GetAppInput, optFns ...func(*Options)) (*GetAppOutput, error) { if params == nil { params = &GetAppInput{} } result, metadata, err := c.invokeOperation(ctx, "GetApp", params, optFns, c.addOperationGetAppMiddlewares) if err != nil { return nil, err } out := result.(*GetAppOutput) out.ResultMetadata = metadata return out, nil } type GetAppInput struct { // The ID of the application. AppId *string noSmithyDocumentSerde } type GetAppOutput struct { // Information about the application. AppSummary *types.AppSummary // The server groups that belong to the application. ServerGroups []types.ServerGroup // The tags associated with the application. Tags []types.Tag // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetAppMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetApp{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetApp{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opGetApp(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetApp(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "GetApp", } }
126
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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/sms/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves the application launch configuration associated with the specified // application. func (c *Client) GetAppLaunchConfiguration(ctx context.Context, params *GetAppLaunchConfigurationInput, optFns ...func(*Options)) (*GetAppLaunchConfigurationOutput, error) { if params == nil { params = &GetAppLaunchConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "GetAppLaunchConfiguration", params, optFns, c.addOperationGetAppLaunchConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*GetAppLaunchConfigurationOutput) out.ResultMetadata = metadata return out, nil } type GetAppLaunchConfigurationInput struct { // The ID of the application. AppId *string noSmithyDocumentSerde } type GetAppLaunchConfigurationOutput struct { // The ID of the application. AppId *string // Indicates whether the application is configured to launch automatically after // replication is complete. AutoLaunch *bool // The name of the service role in the customer's account that CloudFormation uses // to launch the application. RoleName *string // The launch configurations for server groups in this application. ServerGroupLaunchConfigurations []types.ServerGroupLaunchConfiguration // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetAppLaunchConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetAppLaunchConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetAppLaunchConfiguration{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opGetAppLaunchConfiguration(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetAppLaunchConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "GetAppLaunchConfiguration", } }
132
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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/sms/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves the application replication configuration associated with the // specified application. func (c *Client) GetAppReplicationConfiguration(ctx context.Context, params *GetAppReplicationConfigurationInput, optFns ...func(*Options)) (*GetAppReplicationConfigurationOutput, error) { if params == nil { params = &GetAppReplicationConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "GetAppReplicationConfiguration", params, optFns, c.addOperationGetAppReplicationConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*GetAppReplicationConfigurationOutput) out.ResultMetadata = metadata return out, nil } type GetAppReplicationConfigurationInput struct { // The ID of the application. AppId *string noSmithyDocumentSerde } type GetAppReplicationConfigurationOutput struct { // The replication configurations associated with server groups in this // application. ServerGroupReplicationConfigurations []types.ServerGroupReplicationConfiguration // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetAppReplicationConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetAppReplicationConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetAppReplicationConfiguration{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opGetAppReplicationConfiguration(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetAppReplicationConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "GetAppReplicationConfiguration", } }
122
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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/sms/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves information about a configuration for validating an application. func (c *Client) GetAppValidationConfiguration(ctx context.Context, params *GetAppValidationConfigurationInput, optFns ...func(*Options)) (*GetAppValidationConfigurationOutput, error) { if params == nil { params = &GetAppValidationConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "GetAppValidationConfiguration", params, optFns, c.addOperationGetAppValidationConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*GetAppValidationConfigurationOutput) out.ResultMetadata = metadata return out, nil } type GetAppValidationConfigurationInput struct { // The ID of the application. // // This member is required. AppId *string noSmithyDocumentSerde } type GetAppValidationConfigurationOutput struct { // The configuration for application validation. AppValidationConfigurations []types.AppValidationConfiguration // The configuration for instance validation. ServerGroupValidationConfigurations []types.ServerGroupValidationConfiguration // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetAppValidationConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetAppValidationConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetAppValidationConfiguration{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetAppValidationConfigurationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAppValidationConfiguration(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetAppValidationConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "GetAppValidationConfiguration", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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/sms/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves output from validating an application. func (c *Client) GetAppValidationOutput(ctx context.Context, params *GetAppValidationOutputInput, optFns ...func(*Options)) (*GetAppValidationOutputOutput, error) { if params == nil { params = &GetAppValidationOutputInput{} } result, metadata, err := c.invokeOperation(ctx, "GetAppValidationOutput", params, optFns, c.addOperationGetAppValidationOutputMiddlewares) if err != nil { return nil, err } out := result.(*GetAppValidationOutputOutput) out.ResultMetadata = metadata return out, nil } type GetAppValidationOutputInput struct { // The ID of the application. // // This member is required. AppId *string noSmithyDocumentSerde } type GetAppValidationOutputOutput struct { // The validation output. ValidationOutputList []types.ValidationOutput // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetAppValidationOutputMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetAppValidationOutput{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetAppValidationOutput{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetAppValidationOutputValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAppValidationOutput(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetAppValidationOutput(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "GetAppValidationOutput", } }
125
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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/sms/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Describes the connectors registered with the Server Migration Service. func (c *Client) GetConnectors(ctx context.Context, params *GetConnectorsInput, optFns ...func(*Options)) (*GetConnectorsOutput, error) { if params == nil { params = &GetConnectorsInput{} } result, metadata, err := c.invokeOperation(ctx, "GetConnectors", params, optFns, c.addOperationGetConnectorsMiddlewares) if err != nil { return nil, err } out := result.(*GetConnectorsOutput) out.ResultMetadata = metadata return out, nil } type GetConnectorsInput struct { // The maximum number of results to return in a single call. The default value is // 50. To retrieve the remaining results, make another call with the returned // NextToken value. MaxResults *int32 // The token for the next set of results. NextToken *string noSmithyDocumentSerde } type GetConnectorsOutput struct { // Information about the registered connectors. ConnectorList []types.Connector // The token required to retrieve the next set of results. This value is null when // there are no more results to return. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetConnectorsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetConnectors{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetConnectors{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opGetConnectors(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // GetConnectorsAPIClient is a client that implements the GetConnectors operation. type GetConnectorsAPIClient interface { GetConnectors(context.Context, *GetConnectorsInput, ...func(*Options)) (*GetConnectorsOutput, error) } var _ GetConnectorsAPIClient = (*Client)(nil) // GetConnectorsPaginatorOptions is the paginator options for GetConnectors type GetConnectorsPaginatorOptions struct { // The maximum number of results to return in a single call. The default value is // 50. To retrieve the remaining results, make another call with the returned // NextToken value. 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 } // GetConnectorsPaginator is a paginator for GetConnectors type GetConnectorsPaginator struct { options GetConnectorsPaginatorOptions client GetConnectorsAPIClient params *GetConnectorsInput nextToken *string firstPage bool } // NewGetConnectorsPaginator returns a new GetConnectorsPaginator func NewGetConnectorsPaginator(client GetConnectorsAPIClient, params *GetConnectorsInput, optFns ...func(*GetConnectorsPaginatorOptions)) *GetConnectorsPaginator { if params == nil { params = &GetConnectorsInput{} } options := GetConnectorsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &GetConnectorsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *GetConnectorsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next GetConnectors page. func (p *GetConnectorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetConnectorsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxResults = limit result, err := p.client.GetConnectors(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opGetConnectors(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "GetConnectors", } }
221
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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/sms/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Describes the specified replication job or all of your replication jobs. func (c *Client) GetReplicationJobs(ctx context.Context, params *GetReplicationJobsInput, optFns ...func(*Options)) (*GetReplicationJobsOutput, error) { if params == nil { params = &GetReplicationJobsInput{} } result, metadata, err := c.invokeOperation(ctx, "GetReplicationJobs", params, optFns, c.addOperationGetReplicationJobsMiddlewares) if err != nil { return nil, err } out := result.(*GetReplicationJobsOutput) out.ResultMetadata = metadata return out, nil } type GetReplicationJobsInput struct { // The maximum number of results to return in a single call. The default value is // 50. To retrieve the remaining results, make another call with the returned // NextToken value. MaxResults *int32 // The token for the next set of results. NextToken *string // The ID of the replication job. ReplicationJobId *string noSmithyDocumentSerde } type GetReplicationJobsOutput struct { // The token required to retrieve the next set of results. This value is null when // there are no more results to return. NextToken *string // Information about the replication jobs. ReplicationJobList []types.ReplicationJob // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetReplicationJobsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetReplicationJobs{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetReplicationJobs{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opGetReplicationJobs(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // GetReplicationJobsAPIClient is a client that implements the GetReplicationJobs // operation. type GetReplicationJobsAPIClient interface { GetReplicationJobs(context.Context, *GetReplicationJobsInput, ...func(*Options)) (*GetReplicationJobsOutput, error) } var _ GetReplicationJobsAPIClient = (*Client)(nil) // GetReplicationJobsPaginatorOptions is the paginator options for // GetReplicationJobs type GetReplicationJobsPaginatorOptions struct { // The maximum number of results to return in a single call. The default value is // 50. To retrieve the remaining results, make another call with the returned // NextToken value. 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 } // GetReplicationJobsPaginator is a paginator for GetReplicationJobs type GetReplicationJobsPaginator struct { options GetReplicationJobsPaginatorOptions client GetReplicationJobsAPIClient params *GetReplicationJobsInput nextToken *string firstPage bool } // NewGetReplicationJobsPaginator returns a new GetReplicationJobsPaginator func NewGetReplicationJobsPaginator(client GetReplicationJobsAPIClient, params *GetReplicationJobsInput, optFns ...func(*GetReplicationJobsPaginatorOptions)) *GetReplicationJobsPaginator { if params == nil { params = &GetReplicationJobsInput{} } options := GetReplicationJobsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &GetReplicationJobsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *GetReplicationJobsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next GetReplicationJobs page. func (p *GetReplicationJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetReplicationJobsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxResults = limit result, err := p.client.GetReplicationJobs(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opGetReplicationJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "GetReplicationJobs", } }
226
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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/sms/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Describes the replication runs for the specified replication job. func (c *Client) GetReplicationRuns(ctx context.Context, params *GetReplicationRunsInput, optFns ...func(*Options)) (*GetReplicationRunsOutput, error) { if params == nil { params = &GetReplicationRunsInput{} } result, metadata, err := c.invokeOperation(ctx, "GetReplicationRuns", params, optFns, c.addOperationGetReplicationRunsMiddlewares) if err != nil { return nil, err } out := result.(*GetReplicationRunsOutput) out.ResultMetadata = metadata return out, nil } type GetReplicationRunsInput struct { // The ID of the replication job. // // This member is required. ReplicationJobId *string // The maximum number of results to return in a single call. The default value is // 50. To retrieve the remaining results, make another call with the returned // NextToken value. MaxResults *int32 // The token for the next set of results. NextToken *string noSmithyDocumentSerde } type GetReplicationRunsOutput struct { // The token required to retrieve the next set of results. This value is null when // there are no more results to return. NextToken *string // Information about the replication job. ReplicationJob *types.ReplicationJob // Information about the replication runs. ReplicationRunList []types.ReplicationRun // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetReplicationRunsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetReplicationRuns{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetReplicationRuns{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetReplicationRunsValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetReplicationRuns(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // GetReplicationRunsAPIClient is a client that implements the GetReplicationRuns // operation. type GetReplicationRunsAPIClient interface { GetReplicationRuns(context.Context, *GetReplicationRunsInput, ...func(*Options)) (*GetReplicationRunsOutput, error) } var _ GetReplicationRunsAPIClient = (*Client)(nil) // GetReplicationRunsPaginatorOptions is the paginator options for // GetReplicationRuns type GetReplicationRunsPaginatorOptions struct { // The maximum number of results to return in a single call. The default value is // 50. To retrieve the remaining results, make another call with the returned // NextToken value. 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 } // GetReplicationRunsPaginator is a paginator for GetReplicationRuns type GetReplicationRunsPaginator struct { options GetReplicationRunsPaginatorOptions client GetReplicationRunsAPIClient params *GetReplicationRunsInput nextToken *string firstPage bool } // NewGetReplicationRunsPaginator returns a new GetReplicationRunsPaginator func NewGetReplicationRunsPaginator(client GetReplicationRunsAPIClient, params *GetReplicationRunsInput, optFns ...func(*GetReplicationRunsPaginatorOptions)) *GetReplicationRunsPaginator { if params == nil { params = &GetReplicationRunsInput{} } options := GetReplicationRunsPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &GetReplicationRunsPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *GetReplicationRunsPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next GetReplicationRuns page. func (p *GetReplicationRunsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetReplicationRunsOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxResults = limit result, err := p.client.GetReplicationRuns(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opGetReplicationRuns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "GetReplicationRuns", } }
234
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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/sms/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Describes the servers in your server catalog. Before you can describe your // servers, you must import them using ImportServerCatalog . func (c *Client) GetServers(ctx context.Context, params *GetServersInput, optFns ...func(*Options)) (*GetServersOutput, error) { if params == nil { params = &GetServersInput{} } result, metadata, err := c.invokeOperation(ctx, "GetServers", params, optFns, c.addOperationGetServersMiddlewares) if err != nil { return nil, err } out := result.(*GetServersOutput) out.ResultMetadata = metadata return out, nil } type GetServersInput struct { // The maximum number of results to return in a single call. The default value is // 50. To retrieve the remaining results, make another call with the returned // NextToken value. MaxResults *int32 // The token for the next set of results. NextToken *string // The server addresses. VmServerAddressList []types.VmServerAddress noSmithyDocumentSerde } type GetServersOutput struct { // The time when the server was last modified. LastModifiedOn *time.Time // The token required to retrieve the next set of results. This value is null when // there are no more results to return. NextToken *string // The status of the server catalog. ServerCatalogStatus types.ServerCatalogStatus // Information about the servers. ServerList []types.Server // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetServersMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetServers{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetServers{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opGetServers(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // GetServersAPIClient is a client that implements the GetServers operation. type GetServersAPIClient interface { GetServers(context.Context, *GetServersInput, ...func(*Options)) (*GetServersOutput, error) } var _ GetServersAPIClient = (*Client)(nil) // GetServersPaginatorOptions is the paginator options for GetServers type GetServersPaginatorOptions struct { // The maximum number of results to return in a single call. The default value is // 50. To retrieve the remaining results, make another call with the returned // NextToken value. 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 } // GetServersPaginator is a paginator for GetServers type GetServersPaginator struct { options GetServersPaginatorOptions client GetServersAPIClient params *GetServersInput nextToken *string firstPage bool } // NewGetServersPaginator returns a new GetServersPaginator func NewGetServersPaginator(client GetServersAPIClient, params *GetServersInput, optFns ...func(*GetServersPaginatorOptions)) *GetServersPaginator { if params == nil { params = &GetServersInput{} } options := GetServersPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &GetServersPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *GetServersPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next GetServers page. func (p *GetServersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetServersOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxResults = limit result, err := p.client.GetServers(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opGetServers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "GetServers", } }
232
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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" ) // Allows application import from Migration Hub. func (c *Client) ImportAppCatalog(ctx context.Context, params *ImportAppCatalogInput, optFns ...func(*Options)) (*ImportAppCatalogOutput, error) { if params == nil { params = &ImportAppCatalogInput{} } result, metadata, err := c.invokeOperation(ctx, "ImportAppCatalog", params, optFns, c.addOperationImportAppCatalogMiddlewares) if err != nil { return nil, err } out := result.(*ImportAppCatalogOutput) out.ResultMetadata = metadata return out, nil } type ImportAppCatalogInput struct { // The name of the service role. If you omit this parameter, we create a // service-linked role for Migration Hub in your account. Otherwise, the role that // you provide must have the policy and trust policy (https://docs.aws.amazon.com/migrationhub/latest/ug/new-customer-setup.html#sms-managed) // described in the Migration Hub User Guide. RoleName *string noSmithyDocumentSerde } type ImportAppCatalogOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationImportAppCatalogMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpImportAppCatalog{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpImportAppCatalog{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opImportAppCatalog(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opImportAppCatalog(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "ImportAppCatalog", } }
118
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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" ) // Gathers a complete list of on-premises servers. Connectors must be installed // and monitoring all servers to import. This call returns immediately, but might // take additional time to retrieve all the servers. func (c *Client) ImportServerCatalog(ctx context.Context, params *ImportServerCatalogInput, optFns ...func(*Options)) (*ImportServerCatalogOutput, error) { if params == nil { params = &ImportServerCatalogInput{} } result, metadata, err := c.invokeOperation(ctx, "ImportServerCatalog", params, optFns, c.addOperationImportServerCatalogMiddlewares) if err != nil { return nil, err } out := result.(*ImportServerCatalogOutput) out.ResultMetadata = metadata return out, nil } type ImportServerCatalogInput struct { noSmithyDocumentSerde } type ImportServerCatalogOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationImportServerCatalogMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpImportServerCatalog{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpImportServerCatalog{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opImportServerCatalog(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opImportServerCatalog(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "ImportServerCatalog", } }
113
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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" ) // Launches the specified application as a stack in CloudFormation. func (c *Client) LaunchApp(ctx context.Context, params *LaunchAppInput, optFns ...func(*Options)) (*LaunchAppOutput, error) { if params == nil { params = &LaunchAppInput{} } result, metadata, err := c.invokeOperation(ctx, "LaunchApp", params, optFns, c.addOperationLaunchAppMiddlewares) if err != nil { return nil, err } out := result.(*LaunchAppOutput) out.ResultMetadata = metadata return out, nil } type LaunchAppInput struct { // The ID of the application. AppId *string noSmithyDocumentSerde } type LaunchAppOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationLaunchAppMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpLaunchApp{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpLaunchApp{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opLaunchApp(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opLaunchApp(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "LaunchApp", } }
115
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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/sms/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Retrieves summaries for all applications. func (c *Client) ListApps(ctx context.Context, params *ListAppsInput, optFns ...func(*Options)) (*ListAppsOutput, error) { if params == nil { params = &ListAppsInput{} } result, metadata, err := c.invokeOperation(ctx, "ListApps", params, optFns, c.addOperationListAppsMiddlewares) if err != nil { return nil, err } out := result.(*ListAppsOutput) out.ResultMetadata = metadata return out, nil } type ListAppsInput struct { // The unique application IDs. AppIds []string // The maximum number of results to return in a single call. The default value is // 100. To retrieve the remaining results, make another call with the returned // NextToken value. MaxResults *int32 // The token for the next set of results. NextToken *string noSmithyDocumentSerde } type ListAppsOutput struct { // The application summaries. Apps []types.AppSummary // The token required to retrieve the next set of results. This value is null when // there are no more results to return. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationListAppsMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpListApps{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListApps{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opListApps(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opListApps(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "ListApps", } }
132
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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/sms/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Provides information to Server Migration Service about whether application // validation is successful. func (c *Client) NotifyAppValidationOutput(ctx context.Context, params *NotifyAppValidationOutputInput, optFns ...func(*Options)) (*NotifyAppValidationOutputOutput, error) { if params == nil { params = &NotifyAppValidationOutputInput{} } result, metadata, err := c.invokeOperation(ctx, "NotifyAppValidationOutput", params, optFns, c.addOperationNotifyAppValidationOutputMiddlewares) if err != nil { return nil, err } out := result.(*NotifyAppValidationOutputOutput) out.ResultMetadata = metadata return out, nil } type NotifyAppValidationOutputInput struct { // The ID of the application. // // This member is required. AppId *string // The notification information. NotificationContext *types.NotificationContext noSmithyDocumentSerde } type NotifyAppValidationOutputOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationNotifyAppValidationOutputMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpNotifyAppValidationOutput{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpNotifyAppValidationOutput{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpNotifyAppValidationOutputValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opNotifyAppValidationOutput(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opNotifyAppValidationOutput(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "NotifyAppValidationOutput", } }
125
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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/sms/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates or updates the launch configuration for the specified application. func (c *Client) PutAppLaunchConfiguration(ctx context.Context, params *PutAppLaunchConfigurationInput, optFns ...func(*Options)) (*PutAppLaunchConfigurationOutput, error) { if params == nil { params = &PutAppLaunchConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "PutAppLaunchConfiguration", params, optFns, c.addOperationPutAppLaunchConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*PutAppLaunchConfigurationOutput) out.ResultMetadata = metadata return out, nil } type PutAppLaunchConfigurationInput struct { // The ID of the application. AppId *string // Indicates whether the application is configured to launch automatically after // replication is complete. AutoLaunch *bool // The name of service role in the customer's account that CloudFormation uses to // launch the application. RoleName *string // Information about the launch configurations for server groups in the // application. ServerGroupLaunchConfigurations []types.ServerGroupLaunchConfiguration noSmithyDocumentSerde } type PutAppLaunchConfigurationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationPutAppLaunchConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutAppLaunchConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutAppLaunchConfiguration{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opPutAppLaunchConfiguration(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opPutAppLaunchConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "PutAppLaunchConfiguration", } }
128
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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/sms/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates or updates the replication configuration for the specified application. func (c *Client) PutAppReplicationConfiguration(ctx context.Context, params *PutAppReplicationConfigurationInput, optFns ...func(*Options)) (*PutAppReplicationConfigurationOutput, error) { if params == nil { params = &PutAppReplicationConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "PutAppReplicationConfiguration", params, optFns, c.addOperationPutAppReplicationConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*PutAppReplicationConfigurationOutput) out.ResultMetadata = metadata return out, nil } type PutAppReplicationConfigurationInput struct { // The ID of the application. AppId *string // Information about the replication configurations for server groups in the // application. ServerGroupReplicationConfigurations []types.ServerGroupReplicationConfiguration noSmithyDocumentSerde } type PutAppReplicationConfigurationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationPutAppReplicationConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutAppReplicationConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutAppReplicationConfiguration{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opPutAppReplicationConfiguration(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opPutAppReplicationConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "PutAppReplicationConfiguration", } }
120
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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/sms/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates or updates a validation configuration for the specified application. func (c *Client) PutAppValidationConfiguration(ctx context.Context, params *PutAppValidationConfigurationInput, optFns ...func(*Options)) (*PutAppValidationConfigurationOutput, error) { if params == nil { params = &PutAppValidationConfigurationInput{} } result, metadata, err := c.invokeOperation(ctx, "PutAppValidationConfiguration", params, optFns, c.addOperationPutAppValidationConfigurationMiddlewares) if err != nil { return nil, err } out := result.(*PutAppValidationConfigurationOutput) out.ResultMetadata = metadata return out, nil } type PutAppValidationConfigurationInput struct { // The ID of the application. // // This member is required. AppId *string // The configuration for application validation. AppValidationConfigurations []types.AppValidationConfiguration // The configuration for instance validation. ServerGroupValidationConfigurations []types.ServerGroupValidationConfiguration noSmithyDocumentSerde } type PutAppValidationConfigurationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationPutAppValidationConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutAppValidationConfiguration{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutAppValidationConfiguration{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpPutAppValidationConfigurationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutAppValidationConfiguration(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opPutAppValidationConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "PutAppValidationConfiguration", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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" ) // Starts replicating the specified application by creating replication jobs for // each server in the application. func (c *Client) StartAppReplication(ctx context.Context, params *StartAppReplicationInput, optFns ...func(*Options)) (*StartAppReplicationOutput, error) { if params == nil { params = &StartAppReplicationInput{} } result, metadata, err := c.invokeOperation(ctx, "StartAppReplication", params, optFns, c.addOperationStartAppReplicationMiddlewares) if err != nil { return nil, err } out := result.(*StartAppReplicationOutput) out.ResultMetadata = metadata return out, nil } type StartAppReplicationInput struct { // The ID of the application. AppId *string noSmithyDocumentSerde } type StartAppReplicationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStartAppReplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartAppReplication{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartAppReplication{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opStartAppReplication(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opStartAppReplication(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "StartAppReplication", } }
116
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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" ) // Starts an on-demand replication run for the specified application. func (c *Client) StartOnDemandAppReplication(ctx context.Context, params *StartOnDemandAppReplicationInput, optFns ...func(*Options)) (*StartOnDemandAppReplicationOutput, error) { if params == nil { params = &StartOnDemandAppReplicationInput{} } result, metadata, err := c.invokeOperation(ctx, "StartOnDemandAppReplication", params, optFns, c.addOperationStartOnDemandAppReplicationMiddlewares) if err != nil { return nil, err } out := result.(*StartOnDemandAppReplicationOutput) out.ResultMetadata = metadata return out, nil } type StartOnDemandAppReplicationInput struct { // The ID of the application. // // This member is required. AppId *string // The description of the replication run. Description *string noSmithyDocumentSerde } type StartOnDemandAppReplicationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStartOnDemandAppReplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartOnDemandAppReplication{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartOnDemandAppReplication{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpStartOnDemandAppReplicationValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartOnDemandAppReplication(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opStartOnDemandAppReplication(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "StartOnDemandAppReplication", } }
123
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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" ) // Starts an on-demand replication run for the specified replication job. This // replication run starts immediately. This replication run is in addition to the // ones already scheduled. There is a limit on the number of on-demand replications // runs that you can request in a 24-hour period. func (c *Client) StartOnDemandReplicationRun(ctx context.Context, params *StartOnDemandReplicationRunInput, optFns ...func(*Options)) (*StartOnDemandReplicationRunOutput, error) { if params == nil { params = &StartOnDemandReplicationRunInput{} } result, metadata, err := c.invokeOperation(ctx, "StartOnDemandReplicationRun", params, optFns, c.addOperationStartOnDemandReplicationRunMiddlewares) if err != nil { return nil, err } out := result.(*StartOnDemandReplicationRunOutput) out.ResultMetadata = metadata return out, nil } type StartOnDemandReplicationRunInput struct { // The ID of the replication job. // // This member is required. ReplicationJobId *string // The description of the replication run. Description *string noSmithyDocumentSerde } type StartOnDemandReplicationRunOutput struct { // The ID of the replication run. ReplicationRunId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStartOnDemandReplicationRunMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartOnDemandReplicationRun{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartOnDemandReplicationRun{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpStartOnDemandReplicationRunValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartOnDemandReplicationRun(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opStartOnDemandReplicationRun(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "StartOnDemandReplicationRun", } }
130
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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" ) // Stops replicating the specified application by deleting the replication job for // each server in the application. func (c *Client) StopAppReplication(ctx context.Context, params *StopAppReplicationInput, optFns ...func(*Options)) (*StopAppReplicationOutput, error) { if params == nil { params = &StopAppReplicationInput{} } result, metadata, err := c.invokeOperation(ctx, "StopAppReplication", params, optFns, c.addOperationStopAppReplicationMiddlewares) if err != nil { return nil, err } out := result.(*StopAppReplicationOutput) out.ResultMetadata = metadata return out, nil } type StopAppReplicationInput struct { // The ID of the application. AppId *string noSmithyDocumentSerde } type StopAppReplicationOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationStopAppReplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpStopAppReplication{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStopAppReplication{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opStopAppReplication(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opStopAppReplication(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "StopAppReplication", } }
116
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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" ) // Terminates the stack for the specified application. func (c *Client) TerminateApp(ctx context.Context, params *TerminateAppInput, optFns ...func(*Options)) (*TerminateAppOutput, error) { if params == nil { params = &TerminateAppInput{} } result, metadata, err := c.invokeOperation(ctx, "TerminateApp", params, optFns, c.addOperationTerminateAppMiddlewares) if err != nil { return nil, err } out := result.(*TerminateAppOutput) out.ResultMetadata = metadata return out, nil } type TerminateAppInput struct { // The ID of the application. AppId *string noSmithyDocumentSerde } type TerminateAppOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationTerminateAppMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpTerminateApp{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpTerminateApp{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opTerminateApp(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opTerminateApp(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "TerminateApp", } }
115
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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/sms/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Updates the specified application. func (c *Client) UpdateApp(ctx context.Context, params *UpdateAppInput, optFns ...func(*Options)) (*UpdateAppOutput, error) { if params == nil { params = &UpdateAppInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateApp", params, optFns, c.addOperationUpdateAppMiddlewares) if err != nil { return nil, err } out := result.(*UpdateAppOutput) out.ResultMetadata = metadata return out, nil } type UpdateAppInput struct { // The ID of the application. AppId *string // The new description of the application. Description *string // The new name of the application. Name *string // The name of the service role in the customer's account used by Server Migration // Service. RoleName *string // The server groups in the application to update. ServerGroups []types.ServerGroup // The tags to associate with the application. Tags []types.Tag noSmithyDocumentSerde } type UpdateAppOutput struct { // A summary description of the application. AppSummary *types.AppSummary // The updated server groups in the application. ServerGroups []types.ServerGroup // The tags associated with the application. Tags []types.Tag // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateAppMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateApp{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateApp{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opUpdateApp(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateApp(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "UpdateApp", } }
142
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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/sms/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Updates the specified settings for the specified replication job. func (c *Client) UpdateReplicationJob(ctx context.Context, params *UpdateReplicationJobInput, optFns ...func(*Options)) (*UpdateReplicationJobOutput, error) { if params == nil { params = &UpdateReplicationJobInput{} } result, metadata, err := c.invokeOperation(ctx, "UpdateReplicationJob", params, optFns, c.addOperationUpdateReplicationJobMiddlewares) if err != nil { return nil, err } out := result.(*UpdateReplicationJobOutput) out.ResultMetadata = metadata return out, nil } type UpdateReplicationJobInput struct { // The ID of the replication job. // // This member is required. ReplicationJobId *string // The description of the replication job. Description *string // When true, the replication job produces encrypted AMIs. For more information, // KmsKeyId . Encrypted *bool // The time between consecutive replication runs, in hours. Frequency *int32 // The ID of the KMS key for replication jobs that produce encrypted AMIs. This // value can be any of the following: // - KMS key ID // - KMS key alias // - ARN referring to the KMS key ID // - ARN referring to the KMS key alias // If encrypted is enabled but a KMS key ID is not specified, the customer's // default KMS key for Amazon EBS is used. KmsKeyId *string // The license type to be used for the AMI created by a successful replication run. LicenseType types.LicenseType // The start time of the next replication run. NextReplicationRunStartTime *time.Time // The maximum number of SMS-created AMIs to retain. The oldest is deleted after // the maximum number is reached and a new AMI is created. NumberOfRecentAmisToKeep *int32 // The name of the IAM role to be used by Server Migration Service. RoleName *string noSmithyDocumentSerde } type UpdateReplicationJobOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationUpdateReplicationJobMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateReplicationJob{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateReplicationJob{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpUpdateReplicationJobValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateReplicationJob(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opUpdateReplicationJob(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "sms", OperationName: "UpdateReplicationJob", } }
155
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms import ( "bytes" "context" "encoding/json" "fmt" "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" "github.com/aws/aws-sdk-go-v2/service/sms/types" smithy "github.com/aws/smithy-go" smithyio "github.com/aws/smithy-go/io" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "io" "strings" ) type awsAwsjson11_deserializeOpCreateApp struct { } func (*awsAwsjson11_deserializeOpCreateApp) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateApp) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorCreateApp(response, &metadata) } output := &CreateAppOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentCreateAppOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorCreateApp(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("InternalError", errorCode): return awsAwsjson11_deserializeErrorInternalError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpCreateReplicationJob struct { } func (*awsAwsjson11_deserializeOpCreateReplicationJob) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpCreateReplicationJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorCreateReplicationJob(response, &metadata) } output := &CreateReplicationJobOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentCreateReplicationJobOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorCreateReplicationJob(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("InternalError", errorCode): return awsAwsjson11_deserializeErrorInternalError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("NoConnectorsAvailableException", errorCode): return awsAwsjson11_deserializeErrorNoConnectorsAvailableException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("ReplicationJobAlreadyExistsException", errorCode): return awsAwsjson11_deserializeErrorReplicationJobAlreadyExistsException(response, errorBody) case strings.EqualFold("ServerCannotBeReplicatedException", errorCode): return awsAwsjson11_deserializeErrorServerCannotBeReplicatedException(response, errorBody) case strings.EqualFold("TemporarilyUnavailableException", errorCode): return awsAwsjson11_deserializeErrorTemporarilyUnavailableException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteApp struct { } func (*awsAwsjson11_deserializeOpDeleteApp) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteApp) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorDeleteApp(response, &metadata) } output := &DeleteAppOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentDeleteAppOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorDeleteApp(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("InternalError", errorCode): return awsAwsjson11_deserializeErrorInternalError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteAppLaunchConfiguration struct { } func (*awsAwsjson11_deserializeOpDeleteAppLaunchConfiguration) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteAppLaunchConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorDeleteAppLaunchConfiguration(response, &metadata) } output := &DeleteAppLaunchConfigurationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentDeleteAppLaunchConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorDeleteAppLaunchConfiguration(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("InternalError", errorCode): return awsAwsjson11_deserializeErrorInternalError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteAppReplicationConfiguration struct { } func (*awsAwsjson11_deserializeOpDeleteAppReplicationConfiguration) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteAppReplicationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorDeleteAppReplicationConfiguration(response, &metadata) } output := &DeleteAppReplicationConfigurationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentDeleteAppReplicationConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorDeleteAppReplicationConfiguration(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("InternalError", errorCode): return awsAwsjson11_deserializeErrorInternalError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteAppValidationConfiguration struct { } func (*awsAwsjson11_deserializeOpDeleteAppValidationConfiguration) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteAppValidationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorDeleteAppValidationConfiguration(response, &metadata) } output := &DeleteAppValidationConfigurationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentDeleteAppValidationConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorDeleteAppValidationConfiguration(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("InternalError", errorCode): return awsAwsjson11_deserializeErrorInternalError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteReplicationJob struct { } func (*awsAwsjson11_deserializeOpDeleteReplicationJob) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteReplicationJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorDeleteReplicationJob(response, &metadata) } output := &DeleteReplicationJobOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentDeleteReplicationJobOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorDeleteReplicationJob(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("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("ReplicationJobNotFoundException", errorCode): return awsAwsjson11_deserializeErrorReplicationJobNotFoundException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDeleteServerCatalog struct { } func (*awsAwsjson11_deserializeOpDeleteServerCatalog) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDeleteServerCatalog) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorDeleteServerCatalog(response, &metadata) } output := &DeleteServerCatalogOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentDeleteServerCatalogOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorDeleteServerCatalog(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("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpDisassociateConnector struct { } func (*awsAwsjson11_deserializeOpDisassociateConnector) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpDisassociateConnector) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorDisassociateConnector(response, &metadata) } output := &DisassociateConnectorOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentDisassociateConnectorOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorDisassociateConnector(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("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGenerateChangeSet struct { } func (*awsAwsjson11_deserializeOpGenerateChangeSet) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGenerateChangeSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorGenerateChangeSet(response, &metadata) } output := &GenerateChangeSetOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentGenerateChangeSetOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorGenerateChangeSet(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("InternalError", errorCode): return awsAwsjson11_deserializeErrorInternalError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGenerateTemplate struct { } func (*awsAwsjson11_deserializeOpGenerateTemplate) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGenerateTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorGenerateTemplate(response, &metadata) } output := &GenerateTemplateOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentGenerateTemplateOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorGenerateTemplate(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("InternalError", errorCode): return awsAwsjson11_deserializeErrorInternalError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetApp struct { } func (*awsAwsjson11_deserializeOpGetApp) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetApp) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorGetApp(response, &metadata) } output := &GetAppOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentGetAppOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorGetApp(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("InternalError", errorCode): return awsAwsjson11_deserializeErrorInternalError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetAppLaunchConfiguration struct { } func (*awsAwsjson11_deserializeOpGetAppLaunchConfiguration) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetAppLaunchConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorGetAppLaunchConfiguration(response, &metadata) } output := &GetAppLaunchConfigurationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentGetAppLaunchConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorGetAppLaunchConfiguration(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("InternalError", errorCode): return awsAwsjson11_deserializeErrorInternalError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetAppReplicationConfiguration struct { } func (*awsAwsjson11_deserializeOpGetAppReplicationConfiguration) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetAppReplicationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorGetAppReplicationConfiguration(response, &metadata) } output := &GetAppReplicationConfigurationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentGetAppReplicationConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorGetAppReplicationConfiguration(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("InternalError", errorCode): return awsAwsjson11_deserializeErrorInternalError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetAppValidationConfiguration struct { } func (*awsAwsjson11_deserializeOpGetAppValidationConfiguration) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetAppValidationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorGetAppValidationConfiguration(response, &metadata) } output := &GetAppValidationConfigurationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentGetAppValidationConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorGetAppValidationConfiguration(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("InternalError", errorCode): return awsAwsjson11_deserializeErrorInternalError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetAppValidationOutput struct { } func (*awsAwsjson11_deserializeOpGetAppValidationOutput) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetAppValidationOutput) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorGetAppValidationOutput(response, &metadata) } output := &GetAppValidationOutputOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentGetAppValidationOutputOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorGetAppValidationOutput(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("InternalError", errorCode): return awsAwsjson11_deserializeErrorInternalError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetConnectors struct { } func (*awsAwsjson11_deserializeOpGetConnectors) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetConnectors) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorGetConnectors(response, &metadata) } output := &GetConnectorsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentGetConnectorsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorGetConnectors(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("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetReplicationJobs struct { } func (*awsAwsjson11_deserializeOpGetReplicationJobs) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetReplicationJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorGetReplicationJobs(response, &metadata) } output := &GetReplicationJobsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentGetReplicationJobsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorGetReplicationJobs(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("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetReplicationRuns struct { } func (*awsAwsjson11_deserializeOpGetReplicationRuns) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetReplicationRuns) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorGetReplicationRuns(response, &metadata) } output := &GetReplicationRunsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentGetReplicationRunsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorGetReplicationRuns(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("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpGetServers struct { } func (*awsAwsjson11_deserializeOpGetServers) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpGetServers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorGetServers(response, &metadata) } output := &GetServersOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentGetServersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorGetServers(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("InternalError", errorCode): return awsAwsjson11_deserializeErrorInternalError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpImportAppCatalog struct { } func (*awsAwsjson11_deserializeOpImportAppCatalog) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpImportAppCatalog) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorImportAppCatalog(response, &metadata) } output := &ImportAppCatalogOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentImportAppCatalogOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorImportAppCatalog(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("InternalError", errorCode): return awsAwsjson11_deserializeErrorInternalError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpImportServerCatalog struct { } func (*awsAwsjson11_deserializeOpImportServerCatalog) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpImportServerCatalog) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorImportServerCatalog(response, &metadata) } output := &ImportServerCatalogOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentImportServerCatalogOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorImportServerCatalog(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("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("NoConnectorsAvailableException", errorCode): return awsAwsjson11_deserializeErrorNoConnectorsAvailableException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpLaunchApp struct { } func (*awsAwsjson11_deserializeOpLaunchApp) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpLaunchApp) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorLaunchApp(response, &metadata) } output := &LaunchAppOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentLaunchAppOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorLaunchApp(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("InternalError", errorCode): return awsAwsjson11_deserializeErrorInternalError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpListApps struct { } func (*awsAwsjson11_deserializeOpListApps) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpListApps) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorListApps(response, &metadata) } output := &ListAppsOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentListAppsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorListApps(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("InternalError", errorCode): return awsAwsjson11_deserializeErrorInternalError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpNotifyAppValidationOutput struct { } func (*awsAwsjson11_deserializeOpNotifyAppValidationOutput) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpNotifyAppValidationOutput) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorNotifyAppValidationOutput(response, &metadata) } output := &NotifyAppValidationOutputOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentNotifyAppValidationOutputOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorNotifyAppValidationOutput(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("InternalError", errorCode): return awsAwsjson11_deserializeErrorInternalError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpPutAppLaunchConfiguration struct { } func (*awsAwsjson11_deserializeOpPutAppLaunchConfiguration) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpPutAppLaunchConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorPutAppLaunchConfiguration(response, &metadata) } output := &PutAppLaunchConfigurationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentPutAppLaunchConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorPutAppLaunchConfiguration(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("InternalError", errorCode): return awsAwsjson11_deserializeErrorInternalError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpPutAppReplicationConfiguration struct { } func (*awsAwsjson11_deserializeOpPutAppReplicationConfiguration) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpPutAppReplicationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorPutAppReplicationConfiguration(response, &metadata) } output := &PutAppReplicationConfigurationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentPutAppReplicationConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorPutAppReplicationConfiguration(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("InternalError", errorCode): return awsAwsjson11_deserializeErrorInternalError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpPutAppValidationConfiguration struct { } func (*awsAwsjson11_deserializeOpPutAppValidationConfiguration) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpPutAppValidationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorPutAppValidationConfiguration(response, &metadata) } output := &PutAppValidationConfigurationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentPutAppValidationConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorPutAppValidationConfiguration(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("InternalError", errorCode): return awsAwsjson11_deserializeErrorInternalError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpStartAppReplication struct { } func (*awsAwsjson11_deserializeOpStartAppReplication) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpStartAppReplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorStartAppReplication(response, &metadata) } output := &StartAppReplicationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentStartAppReplicationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorStartAppReplication(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("InternalError", errorCode): return awsAwsjson11_deserializeErrorInternalError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpStartOnDemandAppReplication struct { } func (*awsAwsjson11_deserializeOpStartOnDemandAppReplication) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpStartOnDemandAppReplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorStartOnDemandAppReplication(response, &metadata) } output := &StartOnDemandAppReplicationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentStartOnDemandAppReplicationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorStartOnDemandAppReplication(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("InternalError", errorCode): return awsAwsjson11_deserializeErrorInternalError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpStartOnDemandReplicationRun struct { } func (*awsAwsjson11_deserializeOpStartOnDemandReplicationRun) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpStartOnDemandReplicationRun) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorStartOnDemandReplicationRun(response, &metadata) } output := &StartOnDemandReplicationRunOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentStartOnDemandReplicationRunOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorStartOnDemandReplicationRun(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("DryRunOperationException", errorCode): return awsAwsjson11_deserializeErrorDryRunOperationException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("ReplicationRunLimitExceededException", errorCode): return awsAwsjson11_deserializeErrorReplicationRunLimitExceededException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpStopAppReplication struct { } func (*awsAwsjson11_deserializeOpStopAppReplication) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpStopAppReplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorStopAppReplication(response, &metadata) } output := &StopAppReplicationOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentStopAppReplicationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorStopAppReplication(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("InternalError", errorCode): return awsAwsjson11_deserializeErrorInternalError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpTerminateApp struct { } func (*awsAwsjson11_deserializeOpTerminateApp) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpTerminateApp) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorTerminateApp(response, &metadata) } output := &TerminateAppOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentTerminateAppOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorTerminateApp(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("InternalError", errorCode): return awsAwsjson11_deserializeErrorInternalError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUpdateApp struct { } func (*awsAwsjson11_deserializeOpUpdateApp) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUpdateApp) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorUpdateApp(response, &metadata) } output := &UpdateAppOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentUpdateAppOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorUpdateApp(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("InternalError", errorCode): return awsAwsjson11_deserializeErrorInternalError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } type awsAwsjson11_deserializeOpUpdateReplicationJob struct { } func (*awsAwsjson11_deserializeOpUpdateReplicationJob) ID() string { return "OperationDeserializer" } func (m *awsAwsjson11_deserializeOpUpdateReplicationJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { return out, metadata, err } response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } if response.StatusCode < 200 || response.StatusCode >= 300 { return out, metadata, awsAwsjson11_deserializeOpErrorUpdateReplicationJob(response, &metadata) } output := &UpdateReplicationJobOutput{} out.Result = output var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } err = awsAwsjson11_deserializeOpDocumentUpdateReplicationJobOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return out, metadata, err } return out, metadata, err } func awsAwsjson11_deserializeOpErrorUpdateReplicationJob(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("InternalError", errorCode): return awsAwsjson11_deserializeErrorInternalError(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("MissingRequiredParameterException", errorCode): return awsAwsjson11_deserializeErrorMissingRequiredParameterException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) case strings.EqualFold("ReplicationJobNotFoundException", errorCode): return awsAwsjson11_deserializeErrorReplicationJobNotFoundException(response, errorBody) case strings.EqualFold("ServerCannotBeReplicatedException", errorCode): return awsAwsjson11_deserializeErrorServerCannotBeReplicatedException(response, errorBody) case strings.EqualFold("TemporarilyUnavailableException", errorCode): return awsAwsjson11_deserializeErrorTemporarilyUnavailableException(response, errorBody) case strings.EqualFold("UnauthorizedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnauthorizedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ Code: errorCode, Message: errorMessage, } return genericError } } func awsAwsjson11_deserializeErrorDryRunOperationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.DryRunOperationException{} err := awsAwsjson11_deserializeDocumentDryRunOperationException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorInternalError(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.InternalError{} err := awsAwsjson11_deserializeDocumentInternalError(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.InvalidParameterException{} err := awsAwsjson11_deserializeDocumentInvalidParameterException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorMissingRequiredParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.MissingRequiredParameterException{} err := awsAwsjson11_deserializeDocumentMissingRequiredParameterException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorNoConnectorsAvailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.NoConnectorsAvailableException{} err := awsAwsjson11_deserializeDocumentNoConnectorsAvailableException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorOperationNotPermittedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.OperationNotPermittedException{} err := awsAwsjson11_deserializeDocumentOperationNotPermittedException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorReplicationJobAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.ReplicationJobAlreadyExistsException{} err := awsAwsjson11_deserializeDocumentReplicationJobAlreadyExistsException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorReplicationJobNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.ReplicationJobNotFoundException{} err := awsAwsjson11_deserializeDocumentReplicationJobNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorReplicationRunLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.ReplicationRunLimitExceededException{} err := awsAwsjson11_deserializeDocumentReplicationRunLimitExceededException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorServerCannotBeReplicatedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.ServerCannotBeReplicatedException{} err := awsAwsjson11_deserializeDocumentServerCannotBeReplicatedException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorTemporarilyUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.TemporarilyUnavailableException{} err := awsAwsjson11_deserializeDocumentTemporarilyUnavailableException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeErrorUnauthorizedOperationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } output := &types.UnauthorizedOperationException{} err := awsAwsjson11_deserializeDocumentUnauthorizedOperationException(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } return err } errorBody.Seek(0, io.SeekStart) return output } func awsAwsjson11_deserializeDocumentApps(v *[]types.AppSummary, 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.AppSummary if *v == nil { cv = []types.AppSummary{} } else { cv = *v } for _, value := range shape { var col types.AppSummary destAddr := &col if err := awsAwsjson11_deserializeDocumentAppSummary(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentAppSummary(v **types.AppSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AppSummary if *v == nil { sv = &types.AppSummary{} } else { sv = *v } for key, value := range shape { switch key { case "appId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AppId to be of type string, got %T instead", value) } sv.AppId = ptr.String(jtv) } case "creationTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AppDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "importedAppId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ImportedAppId to be of type string, got %T instead", value) } sv.ImportedAppId = ptr.String(jtv) } case "lastModified": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastModified = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "latestReplicationTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LatestReplicationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "launchConfigurationStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AppLaunchConfigurationStatus to be of type string, got %T instead", value) } sv.LaunchConfigurationStatus = types.AppLaunchConfigurationStatus(jtv) } case "launchDetails": if err := awsAwsjson11_deserializeDocumentLaunchDetails(&sv.LaunchDetails, value); err != nil { return err } case "launchStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AppLaunchStatus to be of type string, got %T instead", value) } sv.LaunchStatus = types.AppLaunchStatus(jtv) } case "launchStatusMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AppLaunchStatusMessage to be of type string, got %T instead", value) } sv.LaunchStatusMessage = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AppName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "replicationConfigurationStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AppReplicationConfigurationStatus to be of type string, got %T instead", value) } sv.ReplicationConfigurationStatus = types.AppReplicationConfigurationStatus(jtv) } case "replicationStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AppReplicationStatus to be of type string, got %T instead", value) } sv.ReplicationStatus = types.AppReplicationStatus(jtv) } case "replicationStatusMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AppReplicationStatusMessage to be of type string, got %T instead", value) } sv.ReplicationStatusMessage = ptr.String(jtv) } case "roleName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RoleName to be of type string, got %T instead", value) } sv.RoleName = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AppStatus to be of type string, got %T instead", value) } sv.Status = types.AppStatus(jtv) } case "statusMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AppStatusMessage to be of type string, got %T instead", value) } sv.StatusMessage = ptr.String(jtv) } case "totalServerGroups": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected TotalServerGroups to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TotalServerGroups = ptr.Int32(int32(i64)) } case "totalServers": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected TotalServers to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.TotalServers = ptr.Int32(int32(i64)) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentAppValidationConfiguration(v **types.AppValidationConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AppValidationConfiguration if *v == nil { sv = &types.AppValidationConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "appValidationStrategy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AppValidationStrategy to be of type string, got %T instead", value) } sv.AppValidationStrategy = types.AppValidationStrategy(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyStringWithMaxLen255 to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "ssmValidationParameters": if err := awsAwsjson11_deserializeDocumentSSMValidationParameters(&sv.SsmValidationParameters, value); err != nil { return err } case "validationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ValidationId to be of type string, got %T instead", value) } sv.ValidationId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentAppValidationConfigurations(v *[]types.AppValidationConfiguration, 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.AppValidationConfiguration if *v == nil { cv = []types.AppValidationConfiguration{} } else { cv = *v } for _, value := range shape { var col types.AppValidationConfiguration destAddr := &col if err := awsAwsjson11_deserializeDocumentAppValidationConfiguration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentAppValidationOutput(v **types.AppValidationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.AppValidationOutput if *v == nil { sv = &types.AppValidationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "ssmOutput": if err := awsAwsjson11_deserializeDocumentSSMOutput(&sv.SsmOutput, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentConnector(v **types.Connector, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Connector if *v == nil { sv = &types.Connector{} } else { sv = *v } for key, value := range shape { switch key { case "associatedOn": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.AssociatedOn = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "capabilityList": if err := awsAwsjson11_deserializeDocumentConnectorCapabilityList(&sv.CapabilityList, value); err != nil { return err } case "connectorId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConnectorId to be of type string, got %T instead", value) } sv.ConnectorId = ptr.String(jtv) } case "ipAddress": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected IpAddress to be of type string, got %T instead", value) } sv.IpAddress = ptr.String(jtv) } case "macAddress": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected MacAddress to be of type string, got %T instead", value) } sv.MacAddress = ptr.String(jtv) } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConnectorStatus to be of type string, got %T instead", value) } sv.Status = types.ConnectorStatus(jtv) } case "version": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConnectorVersion to be of type string, got %T instead", value) } sv.Version = ptr.String(jtv) } case "vmManagerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VmManagerId to be of type string, got %T instead", value) } sv.VmManagerId = ptr.String(jtv) } case "vmManagerName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VmManagerName to be of type string, got %T instead", value) } sv.VmManagerName = ptr.String(jtv) } case "vmManagerType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VmManagerType to be of type string, got %T instead", value) } sv.VmManagerType = types.VmManagerType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentConnectorCapabilityList(v *[]types.ConnectorCapability, 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.ConnectorCapability if *v == nil { cv = []types.ConnectorCapability{} } else { cv = *v } for _, value := range shape { var col types.ConnectorCapability if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ConnectorCapability to be of type string, got %T instead", value) } col = types.ConnectorCapability(jtv) } cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentConnectorList(v *[]types.Connector, 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.Connector if *v == nil { cv = []types.Connector{} } else { cv = *v } for _, value := range shape { var col types.Connector destAddr := &col if err := awsAwsjson11_deserializeDocumentConnector(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentDryRunOperationException(v **types.DryRunOperationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.DryRunOperationException if *v == nil { sv = &types.DryRunOperationException{} } 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 awsAwsjson11_deserializeDocumentInternalError(v **types.InternalError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.InternalError if *v == nil { sv = &types.InternalError{} } 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 awsAwsjson11_deserializeDocumentInvalidParameterException(v **types.InvalidParameterException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.InvalidParameterException if *v == nil { sv = &types.InvalidParameterException{} } 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 awsAwsjson11_deserializeDocumentLaunchDetails(v **types.LaunchDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.LaunchDetails if *v == nil { sv = &types.LaunchDetails{} } else { sv = *v } for key, value := range shape { switch key { case "latestLaunchTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LatestLaunchTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "stackId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected StackId to be of type string, got %T instead", value) } sv.StackId = ptr.String(jtv) } case "stackName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected StackName to be of type string, got %T instead", value) } sv.StackName = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentMissingRequiredParameterException(v **types.MissingRequiredParameterException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.MissingRequiredParameterException if *v == nil { sv = &types.MissingRequiredParameterException{} } 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 awsAwsjson11_deserializeDocumentNoConnectorsAvailableException(v **types.NoConnectorsAvailableException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.NoConnectorsAvailableException if *v == nil { sv = &types.NoConnectorsAvailableException{} } 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 awsAwsjson11_deserializeDocumentOperationNotPermittedException(v **types.OperationNotPermittedException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.OperationNotPermittedException if *v == nil { sv = &types.OperationNotPermittedException{} } 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 awsAwsjson11_deserializeDocumentReplicationJob(v **types.ReplicationJob, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ReplicationJob if *v == nil { sv = &types.ReplicationJob{} } 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 Description to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } case "encrypted": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Encrypted to be of type *bool, got %T instead", value) } sv.Encrypted = ptr.Bool(jtv) } case "frequency": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Frequency to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Frequency = ptr.Int32(int32(i64)) } case "kmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected KmsKeyId to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } case "latestAmiId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AmiId to be of type string, got %T instead", value) } sv.LatestAmiId = ptr.String(jtv) } case "licenseType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LicenseType to be of type string, got %T instead", value) } sv.LicenseType = types.LicenseType(jtv) } case "nextReplicationRunStartTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.NextReplicationRunStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "numberOfRecentAmisToKeep": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected NumberOfRecentAmisToKeep to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.NumberOfRecentAmisToKeep = ptr.Int32(int32(i64)) } case "replicationJobId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationJobId to be of type string, got %T instead", value) } sv.ReplicationJobId = ptr.String(jtv) } case "replicationRunList": if err := awsAwsjson11_deserializeDocumentReplicationRunList(&sv.ReplicationRunList, value); err != nil { return err } case "roleName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RoleName to be of type string, got %T instead", value) } sv.RoleName = ptr.String(jtv) } case "runOnce": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected RunOnce to be of type *bool, got %T instead", value) } sv.RunOnce = ptr.Bool(jtv) } case "seedReplicationTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.SeedReplicationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "serverId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerId to be of type string, got %T instead", value) } sv.ServerId = ptr.String(jtv) } case "serverType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerType to be of type string, got %T instead", value) } sv.ServerType = types.ServerType(jtv) } case "state": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationJobState to be of type string, got %T instead", value) } sv.State = types.ReplicationJobState(jtv) } case "statusMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationJobStatusMessage to be of type string, got %T instead", value) } sv.StatusMessage = ptr.String(jtv) } case "vmServer": if err := awsAwsjson11_deserializeDocumentVmServer(&sv.VmServer, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentReplicationJobAlreadyExistsException(v **types.ReplicationJobAlreadyExistsException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ReplicationJobAlreadyExistsException if *v == nil { sv = &types.ReplicationJobAlreadyExistsException{} } 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 awsAwsjson11_deserializeDocumentReplicationJobList(v *[]types.ReplicationJob, 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.ReplicationJob if *v == nil { cv = []types.ReplicationJob{} } else { cv = *v } for _, value := range shape { var col types.ReplicationJob destAddr := &col if err := awsAwsjson11_deserializeDocumentReplicationJob(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentReplicationJobNotFoundException(v **types.ReplicationJobNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ReplicationJobNotFoundException if *v == nil { sv = &types.ReplicationJobNotFoundException{} } 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 awsAwsjson11_deserializeDocumentReplicationRun(v **types.ReplicationRun, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ReplicationRun if *v == nil { sv = &types.ReplicationRun{} } else { sv = *v } for key, value := range shape { switch key { case "amiId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AmiId to be of type string, got %T instead", value) } sv.AmiId = ptr.String(jtv) } case "completedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.CompletedTime = 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 "encrypted": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Encrypted to be of type *bool, got %T instead", value) } sv.Encrypted = ptr.Bool(jtv) } case "kmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected KmsKeyId to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } case "replicationRunId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationRunId to be of type string, got %T instead", value) } sv.ReplicationRunId = ptr.String(jtv) } case "scheduledStartTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.ScheduledStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "stageDetails": if err := awsAwsjson11_deserializeDocumentReplicationRunStageDetails(&sv.StageDetails, value); err != nil { return err } case "state": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationRunState to be of type string, got %T instead", value) } sv.State = types.ReplicationRunState(jtv) } case "statusMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationRunStatusMessage to be of type string, got %T instead", value) } sv.StatusMessage = ptr.String(jtv) } case "type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationRunType to be of type string, got %T instead", value) } sv.Type = types.ReplicationRunType(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentReplicationRunLimitExceededException(v **types.ReplicationRunLimitExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ReplicationRunLimitExceededException if *v == nil { sv = &types.ReplicationRunLimitExceededException{} } 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 awsAwsjson11_deserializeDocumentReplicationRunList(v *[]types.ReplicationRun, 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.ReplicationRun if *v == nil { cv = []types.ReplicationRun{} } else { cv = *v } for _, value := range shape { var col types.ReplicationRun destAddr := &col if err := awsAwsjson11_deserializeDocumentReplicationRun(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentReplicationRunStageDetails(v **types.ReplicationRunStageDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ReplicationRunStageDetails if *v == nil { sv = &types.ReplicationRunStageDetails{} } else { sv = *v } for key, value := range shape { switch key { case "stage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationRunStage to be of type string, got %T instead", value) } sv.Stage = ptr.String(jtv) } case "stageProgress": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationRunStageProgress to be of type string, got %T instead", value) } sv.StageProgress = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentS3Location(v **types.S3Location, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.S3Location if *v == nil { sv = &types.S3Location{} } else { sv = *v } for key, value := range shape { switch key { case "bucket": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3BucketName to be of type string, got %T instead", value) } sv.Bucket = ptr.String(jtv) } case "key": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected S3KeyName to be of type string, got %T instead", value) } sv.Key = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentServer(v **types.Server, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Server if *v == nil { sv = &types.Server{} } else { sv = *v } for key, value := range shape { switch key { case "replicationJobId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationJobId to be of type string, got %T instead", value) } sv.ReplicationJobId = ptr.String(jtv) } case "replicationJobTerminated": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected ReplicationJobTerminated to be of type *bool, got %T instead", value) } sv.ReplicationJobTerminated = ptr.Bool(jtv) } case "serverId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerId to be of type string, got %T instead", value) } sv.ServerId = ptr.String(jtv) } case "serverType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerType to be of type string, got %T instead", value) } sv.ServerType = types.ServerType(jtv) } case "vmServer": if err := awsAwsjson11_deserializeDocumentVmServer(&sv.VmServer, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentServerCannotBeReplicatedException(v **types.ServerCannotBeReplicatedException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ServerCannotBeReplicatedException if *v == nil { sv = &types.ServerCannotBeReplicatedException{} } 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 awsAwsjson11_deserializeDocumentServerGroup(v **types.ServerGroup, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ServerGroup if *v == nil { sv = &types.ServerGroup{} } else { sv = *v } for key, value := range shape { switch key { case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerGroupName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "serverGroupId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerGroupId to be of type string, got %T instead", value) } sv.ServerGroupId = ptr.String(jtv) } case "serverList": if err := awsAwsjson11_deserializeDocumentServerList(&sv.ServerList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentServerGroupLaunchConfiguration(v **types.ServerGroupLaunchConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ServerGroupLaunchConfiguration if *v == nil { sv = &types.ServerGroupLaunchConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "launchOrder": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected LaunchOrder to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.LaunchOrder = ptr.Int32(int32(i64)) } case "serverGroupId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerGroupId to be of type string, got %T instead", value) } sv.ServerGroupId = ptr.String(jtv) } case "serverLaunchConfigurations": if err := awsAwsjson11_deserializeDocumentServerLaunchConfigurations(&sv.ServerLaunchConfigurations, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentServerGroupLaunchConfigurations(v *[]types.ServerGroupLaunchConfiguration, 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.ServerGroupLaunchConfiguration if *v == nil { cv = []types.ServerGroupLaunchConfiguration{} } else { cv = *v } for _, value := range shape { var col types.ServerGroupLaunchConfiguration destAddr := &col if err := awsAwsjson11_deserializeDocumentServerGroupLaunchConfiguration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentServerGroupReplicationConfiguration(v **types.ServerGroupReplicationConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ServerGroupReplicationConfiguration if *v == nil { sv = &types.ServerGroupReplicationConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "serverGroupId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerGroupId to be of type string, got %T instead", value) } sv.ServerGroupId = ptr.String(jtv) } case "serverReplicationConfigurations": if err := awsAwsjson11_deserializeDocumentServerReplicationConfigurations(&sv.ServerReplicationConfigurations, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentServerGroupReplicationConfigurations(v *[]types.ServerGroupReplicationConfiguration, 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.ServerGroupReplicationConfiguration if *v == nil { cv = []types.ServerGroupReplicationConfiguration{} } else { cv = *v } for _, value := range shape { var col types.ServerGroupReplicationConfiguration destAddr := &col if err := awsAwsjson11_deserializeDocumentServerGroupReplicationConfiguration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentServerGroups(v *[]types.ServerGroup, 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.ServerGroup if *v == nil { cv = []types.ServerGroup{} } else { cv = *v } for _, value := range shape { var col types.ServerGroup destAddr := &col if err := awsAwsjson11_deserializeDocumentServerGroup(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentServerGroupValidationConfiguration(v **types.ServerGroupValidationConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ServerGroupValidationConfiguration if *v == nil { sv = &types.ServerGroupValidationConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "serverGroupId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerGroupId to be of type string, got %T instead", value) } sv.ServerGroupId = ptr.String(jtv) } case "serverValidationConfigurations": if err := awsAwsjson11_deserializeDocumentServerValidationConfigurations(&sv.ServerValidationConfigurations, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentServerGroupValidationConfigurations(v *[]types.ServerGroupValidationConfiguration, 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.ServerGroupValidationConfiguration if *v == nil { cv = []types.ServerGroupValidationConfiguration{} } else { cv = *v } for _, value := range shape { var col types.ServerGroupValidationConfiguration destAddr := &col if err := awsAwsjson11_deserializeDocumentServerGroupValidationConfiguration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentServerLaunchConfiguration(v **types.ServerLaunchConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ServerLaunchConfiguration if *v == nil { sv = &types.ServerLaunchConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "associatePublicIpAddress": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected AssociatePublicIpAddress to be of type *bool, got %T instead", value) } sv.AssociatePublicIpAddress = ptr.Bool(jtv) } case "configureScript": if err := awsAwsjson11_deserializeDocumentS3Location(&sv.ConfigureScript, value); err != nil { return err } case "configureScriptType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ScriptType to be of type string, got %T instead", value) } sv.ConfigureScriptType = types.ScriptType(jtv) } case "ec2KeyName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected EC2KeyName to be of type string, got %T instead", value) } sv.Ec2KeyName = ptr.String(jtv) } case "iamInstanceProfileName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RoleName to be of type string, got %T instead", value) } sv.IamInstanceProfileName = ptr.String(jtv) } case "instanceType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected InstanceType to be of type string, got %T instead", value) } sv.InstanceType = ptr.String(jtv) } case "logicalId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LogicalId to be of type string, got %T instead", value) } sv.LogicalId = ptr.String(jtv) } case "securityGroup": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected SecurityGroup to be of type string, got %T instead", value) } sv.SecurityGroup = ptr.String(jtv) } case "server": if err := awsAwsjson11_deserializeDocumentServer(&sv.Server, value); err != nil { return err } case "subnet": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Subnet to be of type string, got %T instead", value) } sv.Subnet = ptr.String(jtv) } case "userData": if err := awsAwsjson11_deserializeDocumentUserData(&sv.UserData, value); err != nil { return err } case "vpc": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VPC to be of type string, got %T instead", value) } sv.Vpc = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentServerLaunchConfigurations(v *[]types.ServerLaunchConfiguration, 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.ServerLaunchConfiguration if *v == nil { cv = []types.ServerLaunchConfiguration{} } else { cv = *v } for _, value := range shape { var col types.ServerLaunchConfiguration destAddr := &col if err := awsAwsjson11_deserializeDocumentServerLaunchConfiguration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentServerList(v *[]types.Server, 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.Server if *v == nil { cv = []types.Server{} } else { cv = *v } for _, value := range shape { var col types.Server destAddr := &col if err := awsAwsjson11_deserializeDocumentServer(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentServerReplicationConfiguration(v **types.ServerReplicationConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ServerReplicationConfiguration if *v == nil { sv = &types.ServerReplicationConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "server": if err := awsAwsjson11_deserializeDocumentServer(&sv.Server, value); err != nil { return err } case "serverReplicationParameters": if err := awsAwsjson11_deserializeDocumentServerReplicationParameters(&sv.ServerReplicationParameters, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentServerReplicationConfigurations(v *[]types.ServerReplicationConfiguration, 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.ServerReplicationConfiguration if *v == nil { cv = []types.ServerReplicationConfiguration{} } else { cv = *v } for _, value := range shape { var col types.ServerReplicationConfiguration destAddr := &col if err := awsAwsjson11_deserializeDocumentServerReplicationConfiguration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentServerReplicationParameters(v **types.ServerReplicationParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ServerReplicationParameters if *v == nil { sv = &types.ServerReplicationParameters{} } else { sv = *v } for key, value := range shape { switch key { case "encrypted": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected Encrypted to be of type *bool, got %T instead", value) } sv.Encrypted = ptr.Bool(jtv) } case "frequency": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected Frequency to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.Frequency = ptr.Int32(int32(i64)) } case "kmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected KmsKeyId to be of type string, got %T instead", value) } sv.KmsKeyId = ptr.String(jtv) } case "licenseType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected LicenseType to be of type string, got %T instead", value) } sv.LicenseType = types.LicenseType(jtv) } case "numberOfRecentAmisToKeep": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected NumberOfRecentAmisToKeep to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.NumberOfRecentAmisToKeep = ptr.Int32(int32(i64)) } case "runOnce": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected RunOnce to be of type *bool, got %T instead", value) } sv.RunOnce = ptr.Bool(jtv) } case "seedTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.SeedTime = 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 awsAwsjson11_deserializeDocumentServerValidationConfiguration(v **types.ServerValidationConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ServerValidationConfiguration if *v == nil { sv = &types.ServerValidationConfiguration{} } else { sv = *v } for key, value := range shape { switch key { case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyStringWithMaxLen255 to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "server": if err := awsAwsjson11_deserializeDocumentServer(&sv.Server, value); err != nil { return err } case "serverValidationStrategy": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerValidationStrategy to be of type string, got %T instead", value) } sv.ServerValidationStrategy = types.ServerValidationStrategy(jtv) } case "userDataValidationParameters": if err := awsAwsjson11_deserializeDocumentUserDataValidationParameters(&sv.UserDataValidationParameters, value); err != nil { return err } case "validationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ValidationId to be of type string, got %T instead", value) } sv.ValidationId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentServerValidationConfigurations(v *[]types.ServerValidationConfiguration, 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.ServerValidationConfiguration if *v == nil { cv = []types.ServerValidationConfiguration{} } else { cv = *v } for _, value := range shape { var col types.ServerValidationConfiguration destAddr := &col if err := awsAwsjson11_deserializeDocumentServerValidationConfiguration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentServerValidationOutput(v **types.ServerValidationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ServerValidationOutput if *v == nil { sv = &types.ServerValidationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "server": if err := awsAwsjson11_deserializeDocumentServer(&sv.Server, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentSource(v **types.Source, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.Source if *v == nil { sv = &types.Source{} } else { sv = *v } for key, value := range shape { switch key { case "s3Location": if err := awsAwsjson11_deserializeDocumentS3Location(&sv.S3Location, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentSSMOutput(v **types.SSMOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SSMOutput if *v == nil { sv = &types.SSMOutput{} } else { sv = *v } for key, value := range shape { switch key { case "s3Location": if err := awsAwsjson11_deserializeDocumentS3Location(&sv.S3Location, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentSSMValidationParameters(v **types.SSMValidationParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.SSMValidationParameters if *v == nil { sv = &types.SSMValidationParameters{} } else { sv = *v } for key, value := range shape { switch key { case "command": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Command to be of type string, got %T instead", value) } sv.Command = ptr.String(jtv) } case "executionTimeoutSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { return fmt.Errorf("expected ExecutionTimeoutSeconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } sv.ExecutionTimeoutSeconds = int32(i64) } case "instanceId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected InstanceId to be of type string, got %T instead", value) } sv.InstanceId = ptr.String(jtv) } case "outputS3BucketName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected BucketName to be of type string, got %T instead", value) } sv.OutputS3BucketName = ptr.String(jtv) } case "scriptType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ScriptType to be of type string, got %T instead", value) } sv.ScriptType = types.ScriptType(jtv) } case "source": if err := awsAwsjson11_deserializeDocumentSource(&sv.Source, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_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 awsAwsjson11_deserializeDocumentTags(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 := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentTemporarilyUnavailableException(v **types.TemporarilyUnavailableException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.TemporarilyUnavailableException if *v == nil { sv = &types.TemporarilyUnavailableException{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentUnauthorizedOperationException(v **types.UnauthorizedOperationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.UnauthorizedOperationException if *v == nil { sv = &types.UnauthorizedOperationException{} } 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 awsAwsjson11_deserializeDocumentUserData(v **types.UserData, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.UserData if *v == nil { sv = &types.UserData{} } else { sv = *v } for key, value := range shape { switch key { case "s3Location": if err := awsAwsjson11_deserializeDocumentS3Location(&sv.S3Location, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentUserDataValidationParameters(v **types.UserDataValidationParameters, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.UserDataValidationParameters if *v == nil { sv = &types.UserDataValidationParameters{} } else { sv = *v } for key, value := range shape { switch key { case "scriptType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ScriptType to be of type string, got %T instead", value) } sv.ScriptType = types.ScriptType(jtv) } case "source": if err := awsAwsjson11_deserializeDocumentSource(&sv.Source, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentValidationOutput(v **types.ValidationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.ValidationOutput if *v == nil { sv = &types.ValidationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "appValidationOutput": if err := awsAwsjson11_deserializeDocumentAppValidationOutput(&sv.AppValidationOutput, value); err != nil { return err } case "latestValidationTime": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LatestValidationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } case "name": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyStringWithMaxLen255 to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "serverValidationOutput": if err := awsAwsjson11_deserializeDocumentServerValidationOutput(&sv.ServerValidationOutput, value); err != nil { return err } case "status": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ValidationStatus to be of type string, got %T instead", value) } sv.Status = types.ValidationStatus(jtv) } case "statusMessage": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ValidationStatusMessage to be of type string, got %T instead", value) } sv.StatusMessage = ptr.String(jtv) } case "validationId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ValidationId to be of type string, got %T instead", value) } sv.ValidationId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentValidationOutputList(v *[]types.ValidationOutput, 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.ValidationOutput if *v == nil { cv = []types.ValidationOutput{} } else { cv = *v } for _, value := range shape { var col types.ValidationOutput destAddr := &col if err := awsAwsjson11_deserializeDocumentValidationOutput(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } *v = cv return nil } func awsAwsjson11_deserializeDocumentVmServer(v **types.VmServer, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.VmServer if *v == nil { sv = &types.VmServer{} } else { sv = *v } for key, value := range shape { switch key { case "vmManagerName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VmManagerName to be of type string, got %T instead", value) } sv.VmManagerName = ptr.String(jtv) } case "vmManagerType": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VmManagerType to be of type string, got %T instead", value) } sv.VmManagerType = types.VmManagerType(jtv) } case "vmName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VmName to be of type string, got %T instead", value) } sv.VmName = ptr.String(jtv) } case "vmPath": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VmPath to be of type string, got %T instead", value) } sv.VmPath = ptr.String(jtv) } case "vmServerAddress": if err := awsAwsjson11_deserializeDocumentVmServerAddress(&sv.VmServerAddress, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeDocumentVmServerAddress(v **types.VmServerAddress, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", 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.VmServerAddress if *v == nil { sv = &types.VmServerAddress{} } else { sv = *v } for key, value := range shape { switch key { case "vmId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VmId to be of type string, got %T instead", value) } sv.VmId = ptr.String(jtv) } case "vmManagerId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected VmManagerId to be of type string, got %T instead", value) } sv.VmManagerId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateAppOutput(v **CreateAppOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateAppOutput if *v == nil { sv = &CreateAppOutput{} } else { sv = *v } for key, value := range shape { switch key { case "appSummary": if err := awsAwsjson11_deserializeDocumentAppSummary(&sv.AppSummary, value); err != nil { return err } case "serverGroups": if err := awsAwsjson11_deserializeDocumentServerGroups(&sv.ServerGroups, value); err != nil { return err } case "tags": if err := awsAwsjson11_deserializeDocumentTags(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentCreateReplicationJobOutput(v **CreateReplicationJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *CreateReplicationJobOutput if *v == nil { sv = &CreateReplicationJobOutput{} } else { sv = *v } for key, value := range shape { switch key { case "replicationJobId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationJobId to be of type string, got %T instead", value) } sv.ReplicationJobId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDeleteAppLaunchConfigurationOutput(v **DeleteAppLaunchConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteAppLaunchConfigurationOutput if *v == nil { sv = &DeleteAppLaunchConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDeleteAppOutput(v **DeleteAppOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteAppOutput if *v == nil { sv = &DeleteAppOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDeleteAppReplicationConfigurationOutput(v **DeleteAppReplicationConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteAppReplicationConfigurationOutput if *v == nil { sv = &DeleteAppReplicationConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDeleteAppValidationConfigurationOutput(v **DeleteAppValidationConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteAppValidationConfigurationOutput if *v == nil { sv = &DeleteAppValidationConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDeleteReplicationJobOutput(v **DeleteReplicationJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteReplicationJobOutput if *v == nil { sv = &DeleteReplicationJobOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDeleteServerCatalogOutput(v **DeleteServerCatalogOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DeleteServerCatalogOutput if *v == nil { sv = &DeleteServerCatalogOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentDisassociateConnectorOutput(v **DisassociateConnectorOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *DisassociateConnectorOutput if *v == nil { sv = &DisassociateConnectorOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGenerateChangeSetOutput(v **GenerateChangeSetOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GenerateChangeSetOutput if *v == nil { sv = &GenerateChangeSetOutput{} } else { sv = *v } for key, value := range shape { switch key { case "s3Location": if err := awsAwsjson11_deserializeDocumentS3Location(&sv.S3Location, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGenerateTemplateOutput(v **GenerateTemplateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GenerateTemplateOutput if *v == nil { sv = &GenerateTemplateOutput{} } else { sv = *v } for key, value := range shape { switch key { case "s3Location": if err := awsAwsjson11_deserializeDocumentS3Location(&sv.S3Location, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetAppLaunchConfigurationOutput(v **GetAppLaunchConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetAppLaunchConfigurationOutput if *v == nil { sv = &GetAppLaunchConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "appId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected AppId to be of type string, got %T instead", value) } sv.AppId = ptr.String(jtv) } case "autoLaunch": if value != nil { jtv, ok := value.(bool) if !ok { return fmt.Errorf("expected AutoLaunch to be of type *bool, got %T instead", value) } sv.AutoLaunch = ptr.Bool(jtv) } case "roleName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected RoleName to be of type string, got %T instead", value) } sv.RoleName = ptr.String(jtv) } case "serverGroupLaunchConfigurations": if err := awsAwsjson11_deserializeDocumentServerGroupLaunchConfigurations(&sv.ServerGroupLaunchConfigurations, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetAppOutput(v **GetAppOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetAppOutput if *v == nil { sv = &GetAppOutput{} } else { sv = *v } for key, value := range shape { switch key { case "appSummary": if err := awsAwsjson11_deserializeDocumentAppSummary(&sv.AppSummary, value); err != nil { return err } case "serverGroups": if err := awsAwsjson11_deserializeDocumentServerGroups(&sv.ServerGroups, value); err != nil { return err } case "tags": if err := awsAwsjson11_deserializeDocumentTags(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetAppReplicationConfigurationOutput(v **GetAppReplicationConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetAppReplicationConfigurationOutput if *v == nil { sv = &GetAppReplicationConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "serverGroupReplicationConfigurations": if err := awsAwsjson11_deserializeDocumentServerGroupReplicationConfigurations(&sv.ServerGroupReplicationConfigurations, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetAppValidationConfigurationOutput(v **GetAppValidationConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetAppValidationConfigurationOutput if *v == nil { sv = &GetAppValidationConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { case "appValidationConfigurations": if err := awsAwsjson11_deserializeDocumentAppValidationConfigurations(&sv.AppValidationConfigurations, value); err != nil { return err } case "serverGroupValidationConfigurations": if err := awsAwsjson11_deserializeDocumentServerGroupValidationConfigurations(&sv.ServerGroupValidationConfigurations, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetAppValidationOutputOutput(v **GetAppValidationOutputOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetAppValidationOutputOutput if *v == nil { sv = &GetAppValidationOutputOutput{} } else { sv = *v } for key, value := range shape { switch key { case "validationOutputList": if err := awsAwsjson11_deserializeDocumentValidationOutputList(&sv.ValidationOutputList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetConnectorsOutput(v **GetConnectorsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetConnectorsOutput if *v == nil { sv = &GetConnectorsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "connectorList": if err := awsAwsjson11_deserializeDocumentConnectorList(&sv.ConnectorList, 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 } func awsAwsjson11_deserializeOpDocumentGetReplicationJobsOutput(v **GetReplicationJobsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetReplicationJobsOutput if *v == nil { sv = &GetReplicationJobsOutput{} } 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 "replicationJobList": if err := awsAwsjson11_deserializeDocumentReplicationJobList(&sv.ReplicationJobList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetReplicationRunsOutput(v **GetReplicationRunsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetReplicationRunsOutput if *v == nil { sv = &GetReplicationRunsOutput{} } 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 "replicationJob": if err := awsAwsjson11_deserializeDocumentReplicationJob(&sv.ReplicationJob, value); err != nil { return err } case "replicationRunList": if err := awsAwsjson11_deserializeDocumentReplicationRunList(&sv.ReplicationRunList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentGetServersOutput(v **GetServersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *GetServersOutput if *v == nil { sv = &GetServersOutput{} } else { sv = *v } for key, value := range shape { switch key { case "lastModifiedOn": if value != nil { switch jtv := value.(type) { case json.Number: f64, err := jtv.Float64() if err != nil { return err } sv.LastModifiedOn = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) } } 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 "serverCatalogStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ServerCatalogStatus to be of type string, got %T instead", value) } sv.ServerCatalogStatus = types.ServerCatalogStatus(jtv) } case "serverList": if err := awsAwsjson11_deserializeDocumentServerList(&sv.ServerList, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentImportAppCatalogOutput(v **ImportAppCatalogOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ImportAppCatalogOutput if *v == nil { sv = &ImportAppCatalogOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentImportServerCatalogOutput(v **ImportServerCatalogOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ImportServerCatalogOutput if *v == nil { sv = &ImportServerCatalogOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentLaunchAppOutput(v **LaunchAppOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *LaunchAppOutput if *v == nil { sv = &LaunchAppOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentListAppsOutput(v **ListAppsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *ListAppsOutput if *v == nil { sv = &ListAppsOutput{} } else { sv = *v } for key, value := range shape { switch key { case "apps": if err := awsAwsjson11_deserializeDocumentApps(&sv.Apps, 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 } func awsAwsjson11_deserializeOpDocumentNotifyAppValidationOutputOutput(v **NotifyAppValidationOutputOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *NotifyAppValidationOutputOutput if *v == nil { sv = &NotifyAppValidationOutputOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentPutAppLaunchConfigurationOutput(v **PutAppLaunchConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *PutAppLaunchConfigurationOutput if *v == nil { sv = &PutAppLaunchConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentPutAppReplicationConfigurationOutput(v **PutAppReplicationConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *PutAppReplicationConfigurationOutput if *v == nil { sv = &PutAppReplicationConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentPutAppValidationConfigurationOutput(v **PutAppValidationConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *PutAppValidationConfigurationOutput if *v == nil { sv = &PutAppValidationConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentStartAppReplicationOutput(v **StartAppReplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StartAppReplicationOutput if *v == nil { sv = &StartAppReplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentStartOnDemandAppReplicationOutput(v **StartOnDemandAppReplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StartOnDemandAppReplicationOutput if *v == nil { sv = &StartOnDemandAppReplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentStartOnDemandReplicationRunOutput(v **StartOnDemandReplicationRunOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StartOnDemandReplicationRunOutput if *v == nil { sv = &StartOnDemandReplicationRunOutput{} } else { sv = *v } for key, value := range shape { switch key { case "replicationRunId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected ReplicationRunId to be of type string, got %T instead", value) } sv.ReplicationRunId = ptr.String(jtv) } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentStopAppReplicationOutput(v **StopAppReplicationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *StopAppReplicationOutput if *v == nil { sv = &StopAppReplicationOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentTerminateAppOutput(v **TerminateAppOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *TerminateAppOutput if *v == nil { sv = &TerminateAppOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUpdateAppOutput(v **UpdateAppOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateAppOutput if *v == nil { sv = &UpdateAppOutput{} } else { sv = *v } for key, value := range shape { switch key { case "appSummary": if err := awsAwsjson11_deserializeDocumentAppSummary(&sv.AppSummary, value); err != nil { return err } case "serverGroups": if err := awsAwsjson11_deserializeDocumentServerGroups(&sv.ServerGroups, value); err != nil { return err } case "tags": if err := awsAwsjson11_deserializeDocumentTags(&sv.Tags, value); err != nil { return err } default: _, _ = key, value } } *v = sv return nil } func awsAwsjson11_deserializeOpDocumentUpdateReplicationJobOutput(v **UpdateReplicationJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } if value == nil { return nil } shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } var sv *UpdateReplicationJobOutput if *v == nil { sv = &UpdateReplicationJobOutput{} } else { sv = *v } for key, value := range shape { switch key { default: _, _ = key, value } } *v = sv return nil }
9,180
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. // Package sms provides the API client, operations, and parameter types for AWS // Server Migration Service. // // Product update We recommend Amazon Web Services Application Migration Service (http://aws.amazon.com/application-migration-service) // (Amazon Web Services MGN) as the primary migration service for lift-and-shift // migrations. If Amazon Web Services MGN is unavailable in a specific Amazon Web // Services Region, you can use the Server Migration Service APIs through March // 2023. Server Migration Service (Server Migration Service) makes it easier and // faster for you to migrate your on-premises workloads to Amazon Web Services. To // learn more about Server Migration Service, see the following resources: // - Server Migration Service product page (http://aws.amazon.com/server-migration-service/) // - Server Migration Service User Guide (https://docs.aws.amazon.com/server-migration-service/latest/userguide/) package sms
16
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms 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/sms/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 = "sms" } 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 sms // goModuleVersion is the tagged release for this module const goModuleVersion = "1.13.12"
7
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms
4
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms import ( "bytes" "context" "fmt" "github.com/aws/aws-sdk-go-v2/service/sms/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "path" ) type awsAwsjson11_serializeOpCreateApp struct { } func (*awsAwsjson11_serializeOpCreateApp) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateApp) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateAppInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.CreateApp") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateAppInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpCreateReplicationJob struct { } func (*awsAwsjson11_serializeOpCreateReplicationJob) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpCreateReplicationJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*CreateReplicationJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.CreateReplicationJob") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentCreateReplicationJobInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpDeleteApp struct { } func (*awsAwsjson11_serializeOpDeleteApp) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteApp) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteAppInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.DeleteApp") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteAppInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpDeleteAppLaunchConfiguration struct { } func (*awsAwsjson11_serializeOpDeleteAppLaunchConfiguration) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteAppLaunchConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteAppLaunchConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.DeleteAppLaunchConfiguration") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteAppLaunchConfigurationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpDeleteAppReplicationConfiguration struct { } func (*awsAwsjson11_serializeOpDeleteAppReplicationConfiguration) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteAppReplicationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteAppReplicationConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.DeleteAppReplicationConfiguration") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteAppReplicationConfigurationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpDeleteAppValidationConfiguration struct { } func (*awsAwsjson11_serializeOpDeleteAppValidationConfiguration) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteAppValidationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteAppValidationConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.DeleteAppValidationConfiguration") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteAppValidationConfigurationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpDeleteReplicationJob struct { } func (*awsAwsjson11_serializeOpDeleteReplicationJob) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteReplicationJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteReplicationJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.DeleteReplicationJob") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteReplicationJobInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpDeleteServerCatalog struct { } func (*awsAwsjson11_serializeOpDeleteServerCatalog) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDeleteServerCatalog) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DeleteServerCatalogInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.DeleteServerCatalog") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDeleteServerCatalogInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpDisassociateConnector struct { } func (*awsAwsjson11_serializeOpDisassociateConnector) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpDisassociateConnector) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*DisassociateConnectorInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.DisassociateConnector") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentDisassociateConnectorInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpGenerateChangeSet struct { } func (*awsAwsjson11_serializeOpGenerateChangeSet) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGenerateChangeSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GenerateChangeSetInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.GenerateChangeSet") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGenerateChangeSetInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpGenerateTemplate struct { } func (*awsAwsjson11_serializeOpGenerateTemplate) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGenerateTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GenerateTemplateInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.GenerateTemplate") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGenerateTemplateInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpGetApp struct { } func (*awsAwsjson11_serializeOpGetApp) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetApp) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetAppInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.GetApp") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetAppInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpGetAppLaunchConfiguration struct { } func (*awsAwsjson11_serializeOpGetAppLaunchConfiguration) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetAppLaunchConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetAppLaunchConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.GetAppLaunchConfiguration") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetAppLaunchConfigurationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpGetAppReplicationConfiguration struct { } func (*awsAwsjson11_serializeOpGetAppReplicationConfiguration) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetAppReplicationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetAppReplicationConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.GetAppReplicationConfiguration") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetAppReplicationConfigurationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpGetAppValidationConfiguration struct { } func (*awsAwsjson11_serializeOpGetAppValidationConfiguration) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetAppValidationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetAppValidationConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.GetAppValidationConfiguration") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetAppValidationConfigurationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpGetAppValidationOutput struct { } func (*awsAwsjson11_serializeOpGetAppValidationOutput) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetAppValidationOutput) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetAppValidationOutputInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.GetAppValidationOutput") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetAppValidationOutputInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpGetConnectors struct { } func (*awsAwsjson11_serializeOpGetConnectors) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetConnectors) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetConnectorsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.GetConnectors") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetConnectorsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpGetReplicationJobs struct { } func (*awsAwsjson11_serializeOpGetReplicationJobs) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetReplicationJobs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetReplicationJobsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.GetReplicationJobs") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetReplicationJobsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpGetReplicationRuns struct { } func (*awsAwsjson11_serializeOpGetReplicationRuns) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetReplicationRuns) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetReplicationRunsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.GetReplicationRuns") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetReplicationRunsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpGetServers struct { } func (*awsAwsjson11_serializeOpGetServers) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpGetServers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*GetServersInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.GetServers") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentGetServersInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpImportAppCatalog struct { } func (*awsAwsjson11_serializeOpImportAppCatalog) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpImportAppCatalog) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ImportAppCatalogInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.ImportAppCatalog") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentImportAppCatalogInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpImportServerCatalog struct { } func (*awsAwsjson11_serializeOpImportServerCatalog) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpImportServerCatalog) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ImportServerCatalogInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.ImportServerCatalog") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentImportServerCatalogInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpLaunchApp struct { } func (*awsAwsjson11_serializeOpLaunchApp) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpLaunchApp) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*LaunchAppInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.LaunchApp") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentLaunchAppInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpListApps struct { } func (*awsAwsjson11_serializeOpListApps) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpListApps) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*ListAppsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.ListApps") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentListAppsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpNotifyAppValidationOutput struct { } func (*awsAwsjson11_serializeOpNotifyAppValidationOutput) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpNotifyAppValidationOutput) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*NotifyAppValidationOutputInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.NotifyAppValidationOutput") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentNotifyAppValidationOutputInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpPutAppLaunchConfiguration struct { } func (*awsAwsjson11_serializeOpPutAppLaunchConfiguration) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpPutAppLaunchConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*PutAppLaunchConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.PutAppLaunchConfiguration") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentPutAppLaunchConfigurationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpPutAppReplicationConfiguration struct { } func (*awsAwsjson11_serializeOpPutAppReplicationConfiguration) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpPutAppReplicationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*PutAppReplicationConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.PutAppReplicationConfiguration") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentPutAppReplicationConfigurationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpPutAppValidationConfiguration struct { } func (*awsAwsjson11_serializeOpPutAppValidationConfiguration) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpPutAppValidationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*PutAppValidationConfigurationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.PutAppValidationConfiguration") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentPutAppValidationConfigurationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpStartAppReplication struct { } func (*awsAwsjson11_serializeOpStartAppReplication) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpStartAppReplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StartAppReplicationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.StartAppReplication") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentStartAppReplicationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpStartOnDemandAppReplication struct { } func (*awsAwsjson11_serializeOpStartOnDemandAppReplication) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpStartOnDemandAppReplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StartOnDemandAppReplicationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.StartOnDemandAppReplication") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentStartOnDemandAppReplicationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpStartOnDemandReplicationRun struct { } func (*awsAwsjson11_serializeOpStartOnDemandReplicationRun) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpStartOnDemandReplicationRun) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StartOnDemandReplicationRunInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.StartOnDemandReplicationRun") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentStartOnDemandReplicationRunInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpStopAppReplication struct { } func (*awsAwsjson11_serializeOpStopAppReplication) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpStopAppReplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*StopAppReplicationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.StopAppReplication") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentStopAppReplicationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpTerminateApp struct { } func (*awsAwsjson11_serializeOpTerminateApp) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpTerminateApp) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*TerminateAppInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.TerminateApp") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentTerminateAppInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpUpdateApp struct { } func (*awsAwsjson11_serializeOpUpdateApp) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpUpdateApp) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateAppInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.UpdateApp") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentUpdateAppInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } type awsAwsjson11_serializeOpUpdateReplicationJob struct { } func (*awsAwsjson11_serializeOpUpdateReplicationJob) ID() string { return "OperationSerializer" } func (m *awsAwsjson11_serializeOpUpdateReplicationJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } input, ok := in.Parameters.(*UpdateReplicationJobInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } operationPath := "/" if len(request.Request.URL.Path) == 0 { request.Request.URL.Path = operationPath } else { request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { request.Request.URL.Path += "/" } } request.Request.Method = "POST" httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSServerMigrationService_V2016_10_24.UpdateReplicationJob") jsonEncoder := smithyjson.NewEncoder() if err := awsAwsjson11_serializeOpDocumentUpdateReplicationJobInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } in.Request = request return next.HandleSerialize(ctx, in) } func awsAwsjson11_serializeDocumentAppIds(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() av.String(v[i]) } return nil } func awsAwsjson11_serializeDocumentAppValidationConfiguration(v *types.AppValidationConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.AppValidationStrategy) > 0 { ok := object.Key("appValidationStrategy") ok.String(string(v.AppValidationStrategy)) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.SsmValidationParameters != nil { ok := object.Key("ssmValidationParameters") if err := awsAwsjson11_serializeDocumentSSMValidationParameters(v.SsmValidationParameters, ok); err != nil { return err } } if v.ValidationId != nil { ok := object.Key("validationId") ok.String(*v.ValidationId) } return nil } func awsAwsjson11_serializeDocumentAppValidationConfigurations(v []types.AppValidationConfiguration, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentAppValidationConfiguration(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentNotificationContext(v *types.NotificationContext, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.Status) > 0 { ok := object.Key("status") ok.String(string(v.Status)) } if v.StatusMessage != nil { ok := object.Key("statusMessage") ok.String(*v.StatusMessage) } if v.ValidationId != nil { ok := object.Key("validationId") ok.String(*v.ValidationId) } return nil } func awsAwsjson11_serializeDocumentS3Location(v *types.S3Location, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Bucket != nil { ok := object.Key("bucket") ok.String(*v.Bucket) } if v.Key != nil { ok := object.Key("key") ok.String(*v.Key) } return nil } func awsAwsjson11_serializeDocumentServer(v *types.Server, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ReplicationJobId != nil { ok := object.Key("replicationJobId") ok.String(*v.ReplicationJobId) } if v.ReplicationJobTerminated != nil { ok := object.Key("replicationJobTerminated") ok.Boolean(*v.ReplicationJobTerminated) } if v.ServerId != nil { ok := object.Key("serverId") ok.String(*v.ServerId) } if len(v.ServerType) > 0 { ok := object.Key("serverType") ok.String(string(v.ServerType)) } if v.VmServer != nil { ok := object.Key("vmServer") if err := awsAwsjson11_serializeDocumentVmServer(v.VmServer, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentServerGroup(v *types.ServerGroup, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.ServerGroupId != nil { ok := object.Key("serverGroupId") ok.String(*v.ServerGroupId) } if v.ServerList != nil { ok := object.Key("serverList") if err := awsAwsjson11_serializeDocumentServerList(v.ServerList, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentServerGroupLaunchConfiguration(v *types.ServerGroupLaunchConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.LaunchOrder != nil { ok := object.Key("launchOrder") ok.Integer(*v.LaunchOrder) } if v.ServerGroupId != nil { ok := object.Key("serverGroupId") ok.String(*v.ServerGroupId) } if v.ServerLaunchConfigurations != nil { ok := object.Key("serverLaunchConfigurations") if err := awsAwsjson11_serializeDocumentServerLaunchConfigurations(v.ServerLaunchConfigurations, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentServerGroupLaunchConfigurations(v []types.ServerGroupLaunchConfiguration, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentServerGroupLaunchConfiguration(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentServerGroupReplicationConfiguration(v *types.ServerGroupReplicationConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ServerGroupId != nil { ok := object.Key("serverGroupId") ok.String(*v.ServerGroupId) } if v.ServerReplicationConfigurations != nil { ok := object.Key("serverReplicationConfigurations") if err := awsAwsjson11_serializeDocumentServerReplicationConfigurations(v.ServerReplicationConfigurations, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentServerGroupReplicationConfigurations(v []types.ServerGroupReplicationConfiguration, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentServerGroupReplicationConfiguration(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentServerGroups(v []types.ServerGroup, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentServerGroup(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentServerGroupValidationConfiguration(v *types.ServerGroupValidationConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ServerGroupId != nil { ok := object.Key("serverGroupId") ok.String(*v.ServerGroupId) } if v.ServerValidationConfigurations != nil { ok := object.Key("serverValidationConfigurations") if err := awsAwsjson11_serializeDocumentServerValidationConfigurations(v.ServerValidationConfigurations, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentServerGroupValidationConfigurations(v []types.ServerGroupValidationConfiguration, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentServerGroupValidationConfiguration(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentServerLaunchConfiguration(v *types.ServerLaunchConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AssociatePublicIpAddress != nil { ok := object.Key("associatePublicIpAddress") ok.Boolean(*v.AssociatePublicIpAddress) } if v.ConfigureScript != nil { ok := object.Key("configureScript") if err := awsAwsjson11_serializeDocumentS3Location(v.ConfigureScript, ok); err != nil { return err } } if len(v.ConfigureScriptType) > 0 { ok := object.Key("configureScriptType") ok.String(string(v.ConfigureScriptType)) } if v.Ec2KeyName != nil { ok := object.Key("ec2KeyName") ok.String(*v.Ec2KeyName) } if v.IamInstanceProfileName != nil { ok := object.Key("iamInstanceProfileName") ok.String(*v.IamInstanceProfileName) } if v.InstanceType != nil { ok := object.Key("instanceType") ok.String(*v.InstanceType) } if v.LogicalId != nil { ok := object.Key("logicalId") ok.String(*v.LogicalId) } if v.SecurityGroup != nil { ok := object.Key("securityGroup") ok.String(*v.SecurityGroup) } if v.Server != nil { ok := object.Key("server") if err := awsAwsjson11_serializeDocumentServer(v.Server, ok); err != nil { return err } } if v.Subnet != nil { ok := object.Key("subnet") ok.String(*v.Subnet) } if v.UserData != nil { ok := object.Key("userData") if err := awsAwsjson11_serializeDocumentUserData(v.UserData, ok); err != nil { return err } } if v.Vpc != nil { ok := object.Key("vpc") ok.String(*v.Vpc) } return nil } func awsAwsjson11_serializeDocumentServerLaunchConfigurations(v []types.ServerLaunchConfiguration, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentServerLaunchConfiguration(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentServerList(v []types.Server, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentServer(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentServerReplicationConfiguration(v *types.ServerReplicationConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Server != nil { ok := object.Key("server") if err := awsAwsjson11_serializeDocumentServer(v.Server, ok); err != nil { return err } } if v.ServerReplicationParameters != nil { ok := object.Key("serverReplicationParameters") if err := awsAwsjson11_serializeDocumentServerReplicationParameters(v.ServerReplicationParameters, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentServerReplicationConfigurations(v []types.ServerReplicationConfiguration, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentServerReplicationConfiguration(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentServerReplicationParameters(v *types.ServerReplicationParameters, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Encrypted != nil { ok := object.Key("encrypted") ok.Boolean(*v.Encrypted) } if v.Frequency != nil { ok := object.Key("frequency") ok.Integer(*v.Frequency) } if v.KmsKeyId != nil { ok := object.Key("kmsKeyId") ok.String(*v.KmsKeyId) } if len(v.LicenseType) > 0 { ok := object.Key("licenseType") ok.String(string(v.LicenseType)) } if v.NumberOfRecentAmisToKeep != nil { ok := object.Key("numberOfRecentAmisToKeep") ok.Integer(*v.NumberOfRecentAmisToKeep) } if v.RunOnce != nil { ok := object.Key("runOnce") ok.Boolean(*v.RunOnce) } if v.SeedTime != nil { ok := object.Key("seedTime") ok.Double(smithytime.FormatEpochSeconds(*v.SeedTime)) } return nil } func awsAwsjson11_serializeDocumentServerValidationConfiguration(v *types.ServerValidationConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.Server != nil { ok := object.Key("server") if err := awsAwsjson11_serializeDocumentServer(v.Server, ok); err != nil { return err } } if len(v.ServerValidationStrategy) > 0 { ok := object.Key("serverValidationStrategy") ok.String(string(v.ServerValidationStrategy)) } if v.UserDataValidationParameters != nil { ok := object.Key("userDataValidationParameters") if err := awsAwsjson11_serializeDocumentUserDataValidationParameters(v.UserDataValidationParameters, ok); err != nil { return err } } if v.ValidationId != nil { ok := object.Key("validationId") ok.String(*v.ValidationId) } return nil } func awsAwsjson11_serializeDocumentServerValidationConfigurations(v []types.ServerValidationConfiguration, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentServerValidationConfiguration(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentSource(v *types.Source, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.S3Location != nil { ok := object.Key("s3Location") if err := awsAwsjson11_serializeDocumentS3Location(v.S3Location, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentSSMValidationParameters(v *types.SSMValidationParameters, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Command != nil { ok := object.Key("command") ok.String(*v.Command) } if v.ExecutionTimeoutSeconds != 0 { ok := object.Key("executionTimeoutSeconds") ok.Integer(v.ExecutionTimeoutSeconds) } if v.InstanceId != nil { ok := object.Key("instanceId") ok.String(*v.InstanceId) } if v.OutputS3BucketName != nil { ok := object.Key("outputS3BucketName") ok.String(*v.OutputS3BucketName) } if len(v.ScriptType) > 0 { ok := object.Key("scriptType") ok.String(string(v.ScriptType)) } if v.Source != nil { ok := object.Key("source") if err := awsAwsjson11_serializeDocumentSource(v.Source, ok); err != nil { return err } } return nil } func awsAwsjson11_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 awsAwsjson11_serializeDocumentTags(v []types.Tag, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentTag(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentUserData(v *types.UserData, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.S3Location != nil { ok := object.Key("s3Location") if err := awsAwsjson11_serializeDocumentS3Location(v.S3Location, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentUserDataValidationParameters(v *types.UserDataValidationParameters, value smithyjson.Value) error { object := value.Object() defer object.Close() if len(v.ScriptType) > 0 { ok := object.Key("scriptType") ok.String(string(v.ScriptType)) } if v.Source != nil { ok := object.Key("source") if err := awsAwsjson11_serializeDocumentSource(v.Source, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentVmServer(v *types.VmServer, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.VmManagerName != nil { ok := object.Key("vmManagerName") ok.String(*v.VmManagerName) } if len(v.VmManagerType) > 0 { ok := object.Key("vmManagerType") ok.String(string(v.VmManagerType)) } if v.VmName != nil { ok := object.Key("vmName") ok.String(*v.VmName) } if v.VmPath != nil { ok := object.Key("vmPath") ok.String(*v.VmPath) } if v.VmServerAddress != nil { ok := object.Key("vmServerAddress") if err := awsAwsjson11_serializeDocumentVmServerAddress(v.VmServerAddress, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeDocumentVmServerAddress(v *types.VmServerAddress, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.VmId != nil { ok := object.Key("vmId") ok.String(*v.VmId) } if v.VmManagerId != nil { ok := object.Key("vmManagerId") ok.String(*v.VmManagerId) } return nil } func awsAwsjson11_serializeDocumentVmServerAddressList(v []types.VmServerAddress, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() if err := awsAwsjson11_serializeDocumentVmServerAddress(&v[i], av); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentCreateAppInput(v *CreateAppInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ClientToken != nil { ok := object.Key("clientToken") ok.String(*v.ClientToken) } if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.RoleName != nil { ok := object.Key("roleName") ok.String(*v.RoleName) } if v.ServerGroups != nil { ok := object.Key("serverGroups") if err := awsAwsjson11_serializeDocumentServerGroups(v.ServerGroups, ok); err != nil { return err } } if v.Tags != nil { ok := object.Key("tags") if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentCreateReplicationJobInput(v *CreateReplicationJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.Encrypted != nil { ok := object.Key("encrypted") ok.Boolean(*v.Encrypted) } if v.Frequency != nil { ok := object.Key("frequency") ok.Integer(*v.Frequency) } if v.KmsKeyId != nil { ok := object.Key("kmsKeyId") ok.String(*v.KmsKeyId) } if len(v.LicenseType) > 0 { ok := object.Key("licenseType") ok.String(string(v.LicenseType)) } if v.NumberOfRecentAmisToKeep != nil { ok := object.Key("numberOfRecentAmisToKeep") ok.Integer(*v.NumberOfRecentAmisToKeep) } if v.RoleName != nil { ok := object.Key("roleName") ok.String(*v.RoleName) } if v.RunOnce != nil { ok := object.Key("runOnce") ok.Boolean(*v.RunOnce) } if v.SeedReplicationTime != nil { ok := object.Key("seedReplicationTime") ok.Double(smithytime.FormatEpochSeconds(*v.SeedReplicationTime)) } if v.ServerId != nil { ok := object.Key("serverId") ok.String(*v.ServerId) } return nil } func awsAwsjson11_serializeOpDocumentDeleteAppInput(v *DeleteAppInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AppId != nil { ok := object.Key("appId") ok.String(*v.AppId) } if v.ForceStopAppReplication != nil { ok := object.Key("forceStopAppReplication") ok.Boolean(*v.ForceStopAppReplication) } if v.ForceTerminateApp != nil { ok := object.Key("forceTerminateApp") ok.Boolean(*v.ForceTerminateApp) } return nil } func awsAwsjson11_serializeOpDocumentDeleteAppLaunchConfigurationInput(v *DeleteAppLaunchConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AppId != nil { ok := object.Key("appId") ok.String(*v.AppId) } return nil } func awsAwsjson11_serializeOpDocumentDeleteAppReplicationConfigurationInput(v *DeleteAppReplicationConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AppId != nil { ok := object.Key("appId") ok.String(*v.AppId) } return nil } func awsAwsjson11_serializeOpDocumentDeleteAppValidationConfigurationInput(v *DeleteAppValidationConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AppId != nil { ok := object.Key("appId") ok.String(*v.AppId) } return nil } func awsAwsjson11_serializeOpDocumentDeleteReplicationJobInput(v *DeleteReplicationJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ReplicationJobId != nil { ok := object.Key("replicationJobId") ok.String(*v.ReplicationJobId) } return nil } func awsAwsjson11_serializeOpDocumentDeleteServerCatalogInput(v *DeleteServerCatalogInput, value smithyjson.Value) error { object := value.Object() defer object.Close() return nil } func awsAwsjson11_serializeOpDocumentDisassociateConnectorInput(v *DisassociateConnectorInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.ConnectorId != nil { ok := object.Key("connectorId") ok.String(*v.ConnectorId) } return nil } func awsAwsjson11_serializeOpDocumentGenerateChangeSetInput(v *GenerateChangeSetInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AppId != nil { ok := object.Key("appId") ok.String(*v.AppId) } if len(v.ChangesetFormat) > 0 { ok := object.Key("changesetFormat") ok.String(string(v.ChangesetFormat)) } return nil } func awsAwsjson11_serializeOpDocumentGenerateTemplateInput(v *GenerateTemplateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AppId != nil { ok := object.Key("appId") ok.String(*v.AppId) } if len(v.TemplateFormat) > 0 { ok := object.Key("templateFormat") ok.String(string(v.TemplateFormat)) } return nil } func awsAwsjson11_serializeOpDocumentGetAppInput(v *GetAppInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AppId != nil { ok := object.Key("appId") ok.String(*v.AppId) } return nil } func awsAwsjson11_serializeOpDocumentGetAppLaunchConfigurationInput(v *GetAppLaunchConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AppId != nil { ok := object.Key("appId") ok.String(*v.AppId) } return nil } func awsAwsjson11_serializeOpDocumentGetAppReplicationConfigurationInput(v *GetAppReplicationConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AppId != nil { ok := object.Key("appId") ok.String(*v.AppId) } return nil } func awsAwsjson11_serializeOpDocumentGetAppValidationConfigurationInput(v *GetAppValidationConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AppId != nil { ok := object.Key("appId") ok.String(*v.AppId) } return nil } func awsAwsjson11_serializeOpDocumentGetAppValidationOutputInput(v *GetAppValidationOutputInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AppId != nil { ok := object.Key("appId") ok.String(*v.AppId) } return nil } func awsAwsjson11_serializeOpDocumentGetConnectorsInput(v *GetConnectorsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != nil { ok := object.Key("maxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } return nil } func awsAwsjson11_serializeOpDocumentGetReplicationJobsInput(v *GetReplicationJobsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != nil { ok := object.Key("maxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } if v.ReplicationJobId != nil { ok := object.Key("replicationJobId") ok.String(*v.ReplicationJobId) } return nil } func awsAwsjson11_serializeOpDocumentGetReplicationRunsInput(v *GetReplicationRunsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != nil { ok := object.Key("maxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } if v.ReplicationJobId != nil { ok := object.Key("replicationJobId") ok.String(*v.ReplicationJobId) } return nil } func awsAwsjson11_serializeOpDocumentGetServersInput(v *GetServersInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.MaxResults != nil { ok := object.Key("maxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } if v.VmServerAddressList != nil { ok := object.Key("vmServerAddressList") if err := awsAwsjson11_serializeDocumentVmServerAddressList(v.VmServerAddressList, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentImportAppCatalogInput(v *ImportAppCatalogInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.RoleName != nil { ok := object.Key("roleName") ok.String(*v.RoleName) } return nil } func awsAwsjson11_serializeOpDocumentImportServerCatalogInput(v *ImportServerCatalogInput, value smithyjson.Value) error { object := value.Object() defer object.Close() return nil } func awsAwsjson11_serializeOpDocumentLaunchAppInput(v *LaunchAppInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AppId != nil { ok := object.Key("appId") ok.String(*v.AppId) } return nil } func awsAwsjson11_serializeOpDocumentListAppsInput(v *ListAppsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AppIds != nil { ok := object.Key("appIds") if err := awsAwsjson11_serializeDocumentAppIds(v.AppIds, ok); err != nil { return err } } if v.MaxResults != nil { ok := object.Key("maxResults") ok.Integer(*v.MaxResults) } if v.NextToken != nil { ok := object.Key("nextToken") ok.String(*v.NextToken) } return nil } func awsAwsjson11_serializeOpDocumentNotifyAppValidationOutputInput(v *NotifyAppValidationOutputInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AppId != nil { ok := object.Key("appId") ok.String(*v.AppId) } if v.NotificationContext != nil { ok := object.Key("notificationContext") if err := awsAwsjson11_serializeDocumentNotificationContext(v.NotificationContext, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentPutAppLaunchConfigurationInput(v *PutAppLaunchConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AppId != nil { ok := object.Key("appId") ok.String(*v.AppId) } if v.AutoLaunch != nil { ok := object.Key("autoLaunch") ok.Boolean(*v.AutoLaunch) } if v.RoleName != nil { ok := object.Key("roleName") ok.String(*v.RoleName) } if v.ServerGroupLaunchConfigurations != nil { ok := object.Key("serverGroupLaunchConfigurations") if err := awsAwsjson11_serializeDocumentServerGroupLaunchConfigurations(v.ServerGroupLaunchConfigurations, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentPutAppReplicationConfigurationInput(v *PutAppReplicationConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AppId != nil { ok := object.Key("appId") ok.String(*v.AppId) } if v.ServerGroupReplicationConfigurations != nil { ok := object.Key("serverGroupReplicationConfigurations") if err := awsAwsjson11_serializeDocumentServerGroupReplicationConfigurations(v.ServerGroupReplicationConfigurations, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentPutAppValidationConfigurationInput(v *PutAppValidationConfigurationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AppId != nil { ok := object.Key("appId") ok.String(*v.AppId) } if v.AppValidationConfigurations != nil { ok := object.Key("appValidationConfigurations") if err := awsAwsjson11_serializeDocumentAppValidationConfigurations(v.AppValidationConfigurations, ok); err != nil { return err } } if v.ServerGroupValidationConfigurations != nil { ok := object.Key("serverGroupValidationConfigurations") if err := awsAwsjson11_serializeDocumentServerGroupValidationConfigurations(v.ServerGroupValidationConfigurations, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentStartAppReplicationInput(v *StartAppReplicationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AppId != nil { ok := object.Key("appId") ok.String(*v.AppId) } return nil } func awsAwsjson11_serializeOpDocumentStartOnDemandAppReplicationInput(v *StartOnDemandAppReplicationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AppId != nil { ok := object.Key("appId") ok.String(*v.AppId) } if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } return nil } func awsAwsjson11_serializeOpDocumentStartOnDemandReplicationRunInput(v *StartOnDemandReplicationRunInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.ReplicationJobId != nil { ok := object.Key("replicationJobId") ok.String(*v.ReplicationJobId) } return nil } func awsAwsjson11_serializeOpDocumentStopAppReplicationInput(v *StopAppReplicationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AppId != nil { ok := object.Key("appId") ok.String(*v.AppId) } return nil } func awsAwsjson11_serializeOpDocumentTerminateAppInput(v *TerminateAppInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AppId != nil { ok := object.Key("appId") ok.String(*v.AppId) } return nil } func awsAwsjson11_serializeOpDocumentUpdateAppInput(v *UpdateAppInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.AppId != nil { ok := object.Key("appId") ok.String(*v.AppId) } if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.Name != nil { ok := object.Key("name") ok.String(*v.Name) } if v.RoleName != nil { ok := object.Key("roleName") ok.String(*v.RoleName) } if v.ServerGroups != nil { ok := object.Key("serverGroups") if err := awsAwsjson11_serializeDocumentServerGroups(v.ServerGroups, ok); err != nil { return err } } if v.Tags != nil { ok := object.Key("tags") if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { return err } } return nil } func awsAwsjson11_serializeOpDocumentUpdateReplicationJobInput(v *UpdateReplicationJobInput, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) } if v.Encrypted != nil { ok := object.Key("encrypted") ok.Boolean(*v.Encrypted) } if v.Frequency != nil { ok := object.Key("frequency") ok.Integer(*v.Frequency) } if v.KmsKeyId != nil { ok := object.Key("kmsKeyId") ok.String(*v.KmsKeyId) } if len(v.LicenseType) > 0 { ok := object.Key("licenseType") ok.String(string(v.LicenseType)) } if v.NextReplicationRunStartTime != nil { ok := object.Key("nextReplicationRunStartTime") ok.Double(smithytime.FormatEpochSeconds(*v.NextReplicationRunStartTime)) } if v.NumberOfRecentAmisToKeep != nil { ok := object.Key("numberOfRecentAmisToKeep") ok.Integer(*v.NumberOfRecentAmisToKeep) } if v.ReplicationJobId != nil { ok := object.Key("replicationJobId") ok.String(*v.ReplicationJobId) } if v.RoleName != nil { ok := object.Key("roleName") ok.String(*v.RoleName) } return nil }
3,287
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package sms import ( "context" "fmt" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) type validateOpCreateReplicationJob struct { } func (*validateOpCreateReplicationJob) ID() string { return "OperationInputValidation" } func (m *validateOpCreateReplicationJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*CreateReplicationJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpCreateReplicationJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteAppValidationConfiguration struct { } func (*validateOpDeleteAppValidationConfiguration) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteAppValidationConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteAppValidationConfigurationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteAppValidationConfigurationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDeleteReplicationJob struct { } func (*validateOpDeleteReplicationJob) ID() string { return "OperationInputValidation" } func (m *validateOpDeleteReplicationJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DeleteReplicationJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDeleteReplicationJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpDisassociateConnector struct { } func (*validateOpDisassociateConnector) ID() string { return "OperationInputValidation" } func (m *validateOpDisassociateConnector) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*DisassociateConnectorInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpDisassociateConnectorInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetAppValidationConfiguration struct { } func (*validateOpGetAppValidationConfiguration) ID() string { return "OperationInputValidation" } func (m *validateOpGetAppValidationConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetAppValidationConfigurationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetAppValidationConfigurationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetAppValidationOutput struct { } func (*validateOpGetAppValidationOutput) ID() string { return "OperationInputValidation" } func (m *validateOpGetAppValidationOutput) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetAppValidationOutputInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetAppValidationOutputInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpGetReplicationRuns struct { } func (*validateOpGetReplicationRuns) ID() string { return "OperationInputValidation" } func (m *validateOpGetReplicationRuns) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*GetReplicationRunsInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpGetReplicationRunsInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpNotifyAppValidationOutput struct { } func (*validateOpNotifyAppValidationOutput) ID() string { return "OperationInputValidation" } func (m *validateOpNotifyAppValidationOutput) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*NotifyAppValidationOutputInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpNotifyAppValidationOutputInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpPutAppValidationConfiguration struct { } func (*validateOpPutAppValidationConfiguration) ID() string { return "OperationInputValidation" } func (m *validateOpPutAppValidationConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*PutAppValidationConfigurationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpPutAppValidationConfigurationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStartOnDemandAppReplication struct { } func (*validateOpStartOnDemandAppReplication) ID() string { return "OperationInputValidation" } func (m *validateOpStartOnDemandAppReplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartOnDemandAppReplicationInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartOnDemandAppReplicationInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpStartOnDemandReplicationRun struct { } func (*validateOpStartOnDemandReplicationRun) ID() string { return "OperationInputValidation" } func (m *validateOpStartOnDemandReplicationRun) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*StartOnDemandReplicationRunInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpStartOnDemandReplicationRunInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } type validateOpUpdateReplicationJob struct { } func (*validateOpUpdateReplicationJob) ID() string { return "OperationInputValidation" } func (m *validateOpUpdateReplicationJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( out middleware.InitializeOutput, metadata middleware.Metadata, err error, ) { input, ok := in.Parameters.(*UpdateReplicationJobInput) if !ok { return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) } if err := validateOpUpdateReplicationJobInput(input); err != nil { return out, metadata, err } return next.HandleInitialize(ctx, in) } func addOpCreateReplicationJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateReplicationJob{}, middleware.After) } func addOpDeleteAppValidationConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteAppValidationConfiguration{}, middleware.After) } func addOpDeleteReplicationJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteReplicationJob{}, middleware.After) } func addOpDisassociateConnectorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisassociateConnector{}, middleware.After) } func addOpGetAppValidationConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetAppValidationConfiguration{}, middleware.After) } func addOpGetAppValidationOutputValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetAppValidationOutput{}, middleware.After) } func addOpGetReplicationRunsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetReplicationRuns{}, middleware.After) } func addOpNotifyAppValidationOutputValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpNotifyAppValidationOutput{}, middleware.After) } func addOpPutAppValidationConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutAppValidationConfiguration{}, middleware.After) } func addOpStartOnDemandAppReplicationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartOnDemandAppReplication{}, middleware.After) } func addOpStartOnDemandReplicationRunValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartOnDemandReplicationRun{}, middleware.After) } func addOpUpdateReplicationJobValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateReplicationJob{}, middleware.After) } func validateOpCreateReplicationJobInput(v *CreateReplicationJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateReplicationJobInput"} if v.ServerId == nil { invalidParams.Add(smithy.NewErrParamRequired("ServerId")) } if v.SeedReplicationTime == nil { invalidParams.Add(smithy.NewErrParamRequired("SeedReplicationTime")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteAppValidationConfigurationInput(v *DeleteAppValidationConfigurationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteAppValidationConfigurationInput"} if v.AppId == nil { invalidParams.Add(smithy.NewErrParamRequired("AppId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDeleteReplicationJobInput(v *DeleteReplicationJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DeleteReplicationJobInput"} if v.ReplicationJobId == nil { invalidParams.Add(smithy.NewErrParamRequired("ReplicationJobId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpDisassociateConnectorInput(v *DisassociateConnectorInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "DisassociateConnectorInput"} if v.ConnectorId == nil { invalidParams.Add(smithy.NewErrParamRequired("ConnectorId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetAppValidationConfigurationInput(v *GetAppValidationConfigurationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetAppValidationConfigurationInput"} if v.AppId == nil { invalidParams.Add(smithy.NewErrParamRequired("AppId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetAppValidationOutputInput(v *GetAppValidationOutputInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetAppValidationOutputInput"} if v.AppId == nil { invalidParams.Add(smithy.NewErrParamRequired("AppId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpGetReplicationRunsInput(v *GetReplicationRunsInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetReplicationRunsInput"} if v.ReplicationJobId == nil { invalidParams.Add(smithy.NewErrParamRequired("ReplicationJobId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpNotifyAppValidationOutputInput(v *NotifyAppValidationOutputInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "NotifyAppValidationOutputInput"} if v.AppId == nil { invalidParams.Add(smithy.NewErrParamRequired("AppId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpPutAppValidationConfigurationInput(v *PutAppValidationConfigurationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "PutAppValidationConfigurationInput"} if v.AppId == nil { invalidParams.Add(smithy.NewErrParamRequired("AppId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStartOnDemandAppReplicationInput(v *StartOnDemandAppReplicationInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartOnDemandAppReplicationInput"} if v.AppId == nil { invalidParams.Add(smithy.NewErrParamRequired("AppId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpStartOnDemandReplicationRunInput(v *StartOnDemandReplicationRunInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "StartOnDemandReplicationRunInput"} if v.ReplicationJobId == nil { invalidParams.Add(smithy.NewErrParamRequired("ReplicationJobId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } } func validateOpUpdateReplicationJobInput(v *UpdateReplicationJobInput) error { if v == nil { return nil } invalidParams := smithy.InvalidParamsError{Context: "UpdateReplicationJobInput"} if v.ReplicationJobId == nil { invalidParams.Add(smithy.NewErrParamRequired("ReplicationJobId")) } if invalidParams.Len() > 0 { return invalidParams } else { return nil } }
482
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 SMS 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: "sms.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "sms-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "sms-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "sms.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "af-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-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: "sms-fips.us-east-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-east-1", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "fips-us-east-2", }: endpoints.Endpoint{ Hostname: "sms-fips.us-east-2.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-east-2", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "fips-us-west-1", }: endpoints.Endpoint{ Hostname: "sms-fips.us-west-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-west-1", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "fips-us-west-2", }: endpoints.Endpoint{ Hostname: "sms-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: "sms-fips.us-east-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-2", Variant: endpoints.FIPSVariant, }: { Hostname: "sms-fips.us-east-2.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-1", Variant: endpoints.FIPSVariant, }: { Hostname: "sms-fips.us-west-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", Variant: endpoints.FIPSVariant, }: { Hostname: "sms-fips.us-west-2.amazonaws.com", }, }, }, { ID: "aws-cn", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.DualStackVariant, }: { Hostname: "sms.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "sms-fips.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "sms-fips.{region}.api.amazonwebservices.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "sms.{region}.amazonaws.com.cn", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsCn, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "cn-north-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "cn-northwest-1", }: endpoints.Endpoint{}, }, }, { ID: "aws-iso", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ { Variant: endpoints.FIPSVariant, }: { Hostname: "sms-fips.{region}.c2s.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "sms.{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: "sms-fips.{region}.sc2s.sgov.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "sms.{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: "sms-fips.{region}.cloud.adc-e.uk", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "sms.{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: "sms-fips.{region}.csp.hci.ic.gov", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "sms.{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: "sms.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant, }: { Hostname: "sms-fips.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, }: { Hostname: "sms-fips.{region}.api.aws", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, { Variant: 0, }: { Hostname: "sms.{region}.amazonaws.com", Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, Endpoints: endpoints.Endpoints{ endpoints.EndpointKey{ Region: "fips-us-gov-east-1", }: endpoints.Endpoint{ Hostname: "sms-fips.us-gov-east-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-east-1", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "fips-us-gov-west-1", }: endpoints.Endpoint{ Hostname: "sms-fips.us-gov-west-1.amazonaws.com", CredentialScope: endpoints.CredentialScope{ Region: "us-gov-west-1", }, Deprecated: aws.TrueTernary, }, endpoints.EndpointKey{ Region: "us-gov-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-gov-east-1", Variant: endpoints.FIPSVariant, }: { Hostname: "sms-fips.us-gov-east-1.amazonaws.com", }, endpoints.EndpointKey{ Region: "us-gov-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-gov-west-1", Variant: endpoints.FIPSVariant, }: { Hostname: "sms-fips.us-gov-west-1.amazonaws.com", }, }, }, }
465
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 AppLaunchConfigurationStatus string // Enum values for AppLaunchConfigurationStatus const ( AppLaunchConfigurationStatusNotConfigured AppLaunchConfigurationStatus = "NOT_CONFIGURED" AppLaunchConfigurationStatusConfigured AppLaunchConfigurationStatus = "CONFIGURED" ) // Values returns all known values for AppLaunchConfigurationStatus. 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 (AppLaunchConfigurationStatus) Values() []AppLaunchConfigurationStatus { return []AppLaunchConfigurationStatus{ "NOT_CONFIGURED", "CONFIGURED", } } type AppLaunchStatus string // Enum values for AppLaunchStatus const ( AppLaunchStatusReadyForConfiguration AppLaunchStatus = "READY_FOR_CONFIGURATION" AppLaunchStatusConfigurationInProgress AppLaunchStatus = "CONFIGURATION_IN_PROGRESS" AppLaunchStatusConfigurationInvalid AppLaunchStatus = "CONFIGURATION_INVALID" AppLaunchStatusReadyForLaunch AppLaunchStatus = "READY_FOR_LAUNCH" AppLaunchStatusValidationInProgress AppLaunchStatus = "VALIDATION_IN_PROGRESS" AppLaunchStatusLaunchPending AppLaunchStatus = "LAUNCH_PENDING" AppLaunchStatusLaunchInProgress AppLaunchStatus = "LAUNCH_IN_PROGRESS" AppLaunchStatusLaunched AppLaunchStatus = "LAUNCHED" AppLaunchStatusPartiallyLaunched AppLaunchStatus = "PARTIALLY_LAUNCHED" AppLaunchStatusDeltaLaunchInProgress AppLaunchStatus = "DELTA_LAUNCH_IN_PROGRESS" AppLaunchStatusDeltaLaunchFailed AppLaunchStatus = "DELTA_LAUNCH_FAILED" AppLaunchStatusLaunchFailed AppLaunchStatus = "LAUNCH_FAILED" AppLaunchStatusTerminateInProgress AppLaunchStatus = "TERMINATE_IN_PROGRESS" AppLaunchStatusTerminateFailed AppLaunchStatus = "TERMINATE_FAILED" AppLaunchStatusTerminated AppLaunchStatus = "TERMINATED" ) // Values returns all known values for AppLaunchStatus. 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 (AppLaunchStatus) Values() []AppLaunchStatus { return []AppLaunchStatus{ "READY_FOR_CONFIGURATION", "CONFIGURATION_IN_PROGRESS", "CONFIGURATION_INVALID", "READY_FOR_LAUNCH", "VALIDATION_IN_PROGRESS", "LAUNCH_PENDING", "LAUNCH_IN_PROGRESS", "LAUNCHED", "PARTIALLY_LAUNCHED", "DELTA_LAUNCH_IN_PROGRESS", "DELTA_LAUNCH_FAILED", "LAUNCH_FAILED", "TERMINATE_IN_PROGRESS", "TERMINATE_FAILED", "TERMINATED", } } type AppReplicationConfigurationStatus string // Enum values for AppReplicationConfigurationStatus const ( AppReplicationConfigurationStatusNotConfigured AppReplicationConfigurationStatus = "NOT_CONFIGURED" AppReplicationConfigurationStatusConfigured AppReplicationConfigurationStatus = "CONFIGURED" ) // Values returns all known values for AppReplicationConfigurationStatus. 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 (AppReplicationConfigurationStatus) Values() []AppReplicationConfigurationStatus { return []AppReplicationConfigurationStatus{ "NOT_CONFIGURED", "CONFIGURED", } } type AppReplicationStatus string // Enum values for AppReplicationStatus const ( AppReplicationStatusReadyForConfiguration AppReplicationStatus = "READY_FOR_CONFIGURATION" AppReplicationStatusConfigurationInProgress AppReplicationStatus = "CONFIGURATION_IN_PROGRESS" AppReplicationStatusConfigurationInvalid AppReplicationStatus = "CONFIGURATION_INVALID" AppReplicationStatusReadyForReplication AppReplicationStatus = "READY_FOR_REPLICATION" AppReplicationStatusValidationInProgress AppReplicationStatus = "VALIDATION_IN_PROGRESS" AppReplicationStatusReplicationPending AppReplicationStatus = "REPLICATION_PENDING" AppReplicationStatusReplicationInProgress AppReplicationStatus = "REPLICATION_IN_PROGRESS" AppReplicationStatusReplicated AppReplicationStatus = "REPLICATED" AppReplicationStatusPartiallyReplicated AppReplicationStatus = "PARTIALLY_REPLICATED" AppReplicationStatusDeltaReplicationInProgress AppReplicationStatus = "DELTA_REPLICATION_IN_PROGRESS" AppReplicationStatusDeltaReplicated AppReplicationStatus = "DELTA_REPLICATED" AppReplicationStatusDeltaReplicationFailed AppReplicationStatus = "DELTA_REPLICATION_FAILED" AppReplicationStatusReplicationFailed AppReplicationStatus = "REPLICATION_FAILED" AppReplicationStatusReplicationStopping AppReplicationStatus = "REPLICATION_STOPPING" AppReplicationStatusReplicationStopFailed AppReplicationStatus = "REPLICATION_STOP_FAILED" AppReplicationStatusReplicationStopped AppReplicationStatus = "REPLICATION_STOPPED" ) // Values returns all known values for AppReplicationStatus. 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 (AppReplicationStatus) Values() []AppReplicationStatus { return []AppReplicationStatus{ "READY_FOR_CONFIGURATION", "CONFIGURATION_IN_PROGRESS", "CONFIGURATION_INVALID", "READY_FOR_REPLICATION", "VALIDATION_IN_PROGRESS", "REPLICATION_PENDING", "REPLICATION_IN_PROGRESS", "REPLICATED", "PARTIALLY_REPLICATED", "DELTA_REPLICATION_IN_PROGRESS", "DELTA_REPLICATED", "DELTA_REPLICATION_FAILED", "REPLICATION_FAILED", "REPLICATION_STOPPING", "REPLICATION_STOP_FAILED", "REPLICATION_STOPPED", } } type AppStatus string // Enum values for AppStatus const ( AppStatusCreating AppStatus = "CREATING" AppStatusActive AppStatus = "ACTIVE" AppStatusUpdating AppStatus = "UPDATING" AppStatusDeleting AppStatus = "DELETING" AppStatusDeleted AppStatus = "DELETED" AppStatusDeleteFailed AppStatus = "DELETE_FAILED" ) // Values returns all known values for AppStatus. 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 (AppStatus) Values() []AppStatus { return []AppStatus{ "CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "DELETE_FAILED", } } type AppValidationStrategy string // Enum values for AppValidationStrategy const ( AppValidationStrategySsm AppValidationStrategy = "SSM" ) // Values returns all known values for AppValidationStrategy. 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 (AppValidationStrategy) Values() []AppValidationStrategy { return []AppValidationStrategy{ "SSM", } } type ConnectorCapability string // Enum values for ConnectorCapability const ( ConnectorCapabilityVSphere ConnectorCapability = "VSPHERE" ConnectorCapabilityScvmm ConnectorCapability = "SCVMM" ConnectorCapabilityHyperVManager ConnectorCapability = "HYPERV-MANAGER" ConnectorCapabilitySnapshotBatching ConnectorCapability = "SNAPSHOT_BATCHING" ConnectorCapabilitySmsOptimized ConnectorCapability = "SMS_OPTIMIZED" ) // Values returns all known values for ConnectorCapability. 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 (ConnectorCapability) Values() []ConnectorCapability { return []ConnectorCapability{ "VSPHERE", "SCVMM", "HYPERV-MANAGER", "SNAPSHOT_BATCHING", "SMS_OPTIMIZED", } } type ConnectorStatus string // Enum values for ConnectorStatus const ( ConnectorStatusHealthy ConnectorStatus = "HEALTHY" ConnectorStatusUnhealthy ConnectorStatus = "UNHEALTHY" ) // Values returns all known values for ConnectorStatus. 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 (ConnectorStatus) Values() []ConnectorStatus { return []ConnectorStatus{ "HEALTHY", "UNHEALTHY", } } type LicenseType string // Enum values for LicenseType const ( LicenseTypeAws LicenseType = "AWS" LicenseTypeByol LicenseType = "BYOL" ) // Values returns all known values for LicenseType. 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 (LicenseType) Values() []LicenseType { return []LicenseType{ "AWS", "BYOL", } } type OutputFormat string // Enum values for OutputFormat const ( OutputFormatJson OutputFormat = "JSON" OutputFormatYaml OutputFormat = "YAML" ) // Values returns all known values for OutputFormat. 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 (OutputFormat) Values() []OutputFormat { return []OutputFormat{ "JSON", "YAML", } } type ReplicationJobState string // Enum values for ReplicationJobState const ( ReplicationJobStatePending ReplicationJobState = "PENDING" ReplicationJobStateActive ReplicationJobState = "ACTIVE" ReplicationJobStateFailed ReplicationJobState = "FAILED" ReplicationJobStateDeleting ReplicationJobState = "DELETING" ReplicationJobStateDeleted ReplicationJobState = "DELETED" ReplicationJobStateCompleted ReplicationJobState = "COMPLETED" ReplicationJobStatePausedOnFailure ReplicationJobState = "PAUSED_ON_FAILURE" ReplicationJobStateFailing ReplicationJobState = "FAILING" ) // Values returns all known values for ReplicationJobState. 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 (ReplicationJobState) Values() []ReplicationJobState { return []ReplicationJobState{ "PENDING", "ACTIVE", "FAILED", "DELETING", "DELETED", "COMPLETED", "PAUSED_ON_FAILURE", "FAILING", } } type ReplicationRunState string // Enum values for ReplicationRunState const ( ReplicationRunStatePending ReplicationRunState = "PENDING" ReplicationRunStateMissed ReplicationRunState = "MISSED" ReplicationRunStateActive ReplicationRunState = "ACTIVE" ReplicationRunStateFailed ReplicationRunState = "FAILED" ReplicationRunStateCompleted ReplicationRunState = "COMPLETED" ReplicationRunStateDeleting ReplicationRunState = "DELETING" ReplicationRunStateDeleted ReplicationRunState = "DELETED" ) // Values returns all known values for ReplicationRunState. 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 (ReplicationRunState) Values() []ReplicationRunState { return []ReplicationRunState{ "PENDING", "MISSED", "ACTIVE", "FAILED", "COMPLETED", "DELETING", "DELETED", } } type ReplicationRunType string // Enum values for ReplicationRunType const ( ReplicationRunTypeOnDemand ReplicationRunType = "ON_DEMAND" ReplicationRunTypeAutomatic ReplicationRunType = "AUTOMATIC" ) // Values returns all known values for ReplicationRunType. 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 (ReplicationRunType) Values() []ReplicationRunType { return []ReplicationRunType{ "ON_DEMAND", "AUTOMATIC", } } type ScriptType string // Enum values for ScriptType const ( ScriptTypeShellScript ScriptType = "SHELL_SCRIPT" ScriptTypePowershellScript ScriptType = "POWERSHELL_SCRIPT" ) // Values returns all known values for ScriptType. 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 (ScriptType) Values() []ScriptType { return []ScriptType{ "SHELL_SCRIPT", "POWERSHELL_SCRIPT", } } type ServerCatalogStatus string // Enum values for ServerCatalogStatus const ( ServerCatalogStatusNotImported ServerCatalogStatus = "NOT_IMPORTED" ServerCatalogStatusImporting ServerCatalogStatus = "IMPORTING" ServerCatalogStatusAvailable ServerCatalogStatus = "AVAILABLE" ServerCatalogStatusDeleted ServerCatalogStatus = "DELETED" ServerCatalogStatusExpired ServerCatalogStatus = "EXPIRED" ) // Values returns all known values for ServerCatalogStatus. 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 (ServerCatalogStatus) Values() []ServerCatalogStatus { return []ServerCatalogStatus{ "NOT_IMPORTED", "IMPORTING", "AVAILABLE", "DELETED", "EXPIRED", } } type ServerType string // Enum values for ServerType const ( ServerTypeVirtualMachine ServerType = "VIRTUAL_MACHINE" ) // Values returns all known values for ServerType. 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 (ServerType) Values() []ServerType { return []ServerType{ "VIRTUAL_MACHINE", } } type ServerValidationStrategy string // Enum values for ServerValidationStrategy const ( ServerValidationStrategyUserdata ServerValidationStrategy = "USERDATA" ) // Values returns all known values for ServerValidationStrategy. 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 (ServerValidationStrategy) Values() []ServerValidationStrategy { return []ServerValidationStrategy{ "USERDATA", } } type ValidationStatus string // Enum values for ValidationStatus const ( ValidationStatusReadyForValidation ValidationStatus = "READY_FOR_VALIDATION" ValidationStatusPending ValidationStatus = "PENDING" ValidationStatusInProgress ValidationStatus = "IN_PROGRESS" ValidationStatusSucceeded ValidationStatus = "SUCCEEDED" ValidationStatusFailed ValidationStatus = "FAILED" ) // Values returns all known values for ValidationStatus. 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 (ValidationStatus) Values() []ValidationStatus { return []ValidationStatus{ "READY_FOR_VALIDATION", "PENDING", "IN_PROGRESS", "SUCCEEDED", "FAILED", } } type VmManagerType string // Enum values for VmManagerType const ( VmManagerTypeVSphere VmManagerType = "VSPHERE" VmManagerTypeScvmm VmManagerType = "SCVMM" VmManagerTypeHyperVManager VmManagerType = "HYPERV-MANAGER" ) // Values returns all known values for VmManagerType. 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 (VmManagerType) Values() []VmManagerType { return []VmManagerType{ "VSPHERE", "SCVMM", "HYPERV-MANAGER", } }
446
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 user has the required permissions, so the request would have succeeded, but // a dry run was performed. type DryRunOperationException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *DryRunOperationException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *DryRunOperationException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *DryRunOperationException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "DryRunOperationException" } return *e.ErrorCodeOverride } func (e *DryRunOperationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // An internal error occurred. type InternalError struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InternalError) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InternalError) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InternalError) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InternalError" } return *e.ErrorCodeOverride } func (e *InternalError) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // A specified parameter is not valid. type InvalidParameterException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *InvalidParameterException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *InvalidParameterException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *InvalidParameterException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "InvalidParameterException" } return *e.ErrorCodeOverride } func (e *InvalidParameterException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // A required parameter is missing. type MissingRequiredParameterException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *MissingRequiredParameterException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *MissingRequiredParameterException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *MissingRequiredParameterException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "MissingRequiredParameterException" } return *e.ErrorCodeOverride } func (e *MissingRequiredParameterException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // There are no connectors available. type NoConnectorsAvailableException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *NoConnectorsAvailableException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *NoConnectorsAvailableException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *NoConnectorsAvailableException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "NoConnectorsAvailableException" } return *e.ErrorCodeOverride } func (e *NoConnectorsAvailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // This operation is not allowed. type OperationNotPermittedException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *OperationNotPermittedException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *OperationNotPermittedException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *OperationNotPermittedException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "OperationNotPermittedException" } return *e.ErrorCodeOverride } func (e *OperationNotPermittedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The specified replication job already exists. type ReplicationJobAlreadyExistsException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ReplicationJobAlreadyExistsException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ReplicationJobAlreadyExistsException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ReplicationJobAlreadyExistsException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ReplicationJobAlreadyExistsException" } return *e.ErrorCodeOverride } func (e *ReplicationJobAlreadyExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The specified replication job does not exist. type ReplicationJobNotFoundException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ReplicationJobNotFoundException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ReplicationJobNotFoundException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ReplicationJobNotFoundException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ReplicationJobNotFoundException" } return *e.ErrorCodeOverride } func (e *ReplicationJobNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // You have exceeded the number of on-demand replication runs you can request in a // 24-hour period. type ReplicationRunLimitExceededException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ReplicationRunLimitExceededException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ReplicationRunLimitExceededException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ReplicationRunLimitExceededException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ReplicationRunLimitExceededException" } return *e.ErrorCodeOverride } func (e *ReplicationRunLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The specified server cannot be replicated. type ServerCannotBeReplicatedException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *ServerCannotBeReplicatedException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *ServerCannotBeReplicatedException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *ServerCannotBeReplicatedException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "ServerCannotBeReplicatedException" } return *e.ErrorCodeOverride } func (e *ServerCannotBeReplicatedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The service is temporarily unavailable. type TemporarilyUnavailableException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *TemporarilyUnavailableException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *TemporarilyUnavailableException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *TemporarilyUnavailableException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "TemporarilyUnavailableException" } return *e.ErrorCodeOverride } func (e *TemporarilyUnavailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } // You lack permissions needed to perform this operation. Check your IAM policies, // and ensure that you are using the correct access keys. type UnauthorizedOperationException struct { Message *string ErrorCodeOverride *string noSmithyDocumentSerde } func (e *UnauthorizedOperationException) Error() string { return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) } func (e *UnauthorizedOperationException) ErrorMessage() string { if e.Message == nil { return "" } return *e.Message } func (e *UnauthorizedOperationException) ErrorCode() string { if e == nil || e.ErrorCodeOverride == nil { return "UnauthorizedOperationException" } return *e.ErrorCodeOverride } func (e *UnauthorizedOperationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
328
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" ) // Information about the application. type AppSummary struct { // The unique ID of the application. AppId *string // The creation time of the application. CreationTime *time.Time // The description of the application. Description *string // The ID of the application. ImportedAppId *string // The last modified time of the application. LastModified *time.Time // The timestamp of the application's most recent successful replication. LatestReplicationTime *time.Time // Status of the launch configuration. LaunchConfigurationStatus AppLaunchConfigurationStatus // Details about the latest launch of the application. LaunchDetails *LaunchDetails // The launch status of the application. LaunchStatus AppLaunchStatus // A message related to the launch status of the application. LaunchStatusMessage *string // The name of the application. Name *string // Status of the replication configuration. ReplicationConfigurationStatus AppReplicationConfigurationStatus // The replication status of the application. ReplicationStatus AppReplicationStatus // A message related to the replication status of the application. ReplicationStatusMessage *string // The name of the service role in the customer's account used by Server Migration // Service. RoleName *string // Status of the application. Status AppStatus // A message related to the status of the application StatusMessage *string // The number of server groups present in the application. TotalServerGroups *int32 // The number of servers present in the application. TotalServers *int32 noSmithyDocumentSerde } // Configuration for validating an application. type AppValidationConfiguration struct { // The validation strategy. AppValidationStrategy AppValidationStrategy // The name of the configuration. Name *string // The validation parameters. SsmValidationParameters *SSMValidationParameters // The ID of the validation. ValidationId *string noSmithyDocumentSerde } // Output from validating an application. type AppValidationOutput struct { // Output from using SSM to validate the application. SsmOutput *SSMOutput noSmithyDocumentSerde } // Represents a connector. type Connector struct { // The time the connector was associated. AssociatedOn *time.Time // The capabilities of the connector. CapabilityList []ConnectorCapability // The ID of the connector. ConnectorId *string // The IP address of the connector. IpAddress *string // The MAC address of the connector. MacAddress *string // The status of the connector. Status ConnectorStatus // The connector version. Version *string // The ID of the VM manager. VmManagerId *string // The name of the VM manager. VmManagerName *string // The VM management product. VmManagerType VmManagerType noSmithyDocumentSerde } // Details about the latest launch of an application. type LaunchDetails struct { // The latest time that this application was launched successfully. LatestLaunchTime *time.Time // The ID of the latest stack launched for this application. StackId *string // The name of the latest stack launched for this application. StackName *string noSmithyDocumentSerde } // Contains the status of validating an application. type NotificationContext struct { // The status of the validation. Status ValidationStatus // The status message. StatusMessage *string // The ID of the validation. ValidationId *string noSmithyDocumentSerde } // Represents a replication job. type ReplicationJob struct { // The description of the replication job. Description *string // Indicates whether the replication job should produce encrypted AMIs. Encrypted *bool // The time between consecutive replication runs, in hours. Frequency *int32 // The ID of the KMS key for replication jobs that produce encrypted AMIs. This // value can be any of the following: // - KMS key ID // - KMS key alias // - ARN referring to the KMS key ID // - ARN referring to the KMS key alias // If encrypted is enabled but a KMS key ID is not specified, the customer's // default KMS key for Amazon EBS is used. KmsKeyId *string // The ID of the latest Amazon Machine Image (AMI). LatestAmiId *string // The license type to be used for the AMI created by a successful replication run. LicenseType LicenseType // The start time of the next replication run. NextReplicationRunStartTime *time.Time // The number of recent AMIs to keep in the customer's account for a replication // job. By default, the value is set to zero, meaning that all AMIs are kept. NumberOfRecentAmisToKeep *int32 // The ID of the replication job. ReplicationJobId *string // Information about the replication runs. ReplicationRunList []ReplicationRun // The name of the IAM role to be used by Server Migration Service. RoleName *string // Indicates whether to run the replication job one time. RunOnce *bool // The seed replication time. SeedReplicationTime *time.Time // The ID of the server. ServerId *string // The type of server. ServerType ServerType // The state of the replication job. State ReplicationJobState // The description of the current status of the replication job. StatusMessage *string // Information about the VM server. VmServer *VmServer noSmithyDocumentSerde } // Represents a replication run. type ReplicationRun struct { // The ID of the Amazon Machine Image (AMI) from the replication run. AmiId *string // The completion time of the last replication run. CompletedTime *time.Time // The description of the replication run. Description *string // Indicates whether the replication run should produce an encrypted AMI. Encrypted *bool // The ID of the KMS key for replication jobs that produce encrypted AMIs. This // value can be any of the following: // - KMS key ID // - KMS key alias // - ARN referring to the KMS key ID // - ARN referring to the KMS key alias // If encrypted is true but a KMS key ID is not specified, the customer's default // KMS key for Amazon EBS is used. KmsKeyId *string // The ID of the replication run. ReplicationRunId *string // The start time of the next replication run. ScheduledStartTime *time.Time // Details about the current stage of the replication run. StageDetails *ReplicationRunStageDetails // The state of the replication run. State ReplicationRunState // The description of the current status of the replication job. StatusMessage *string // The type of replication run. Type ReplicationRunType noSmithyDocumentSerde } // Details of the current stage of a replication run. type ReplicationRunStageDetails struct { // The current stage of a replication run. Stage *string // The progress of the current stage of a replication run. StageProgress *string noSmithyDocumentSerde } // Location of an Amazon S3 object. type S3Location struct { // The Amazon S3 bucket name. Bucket *string // The Amazon S3 bucket key. Key *string noSmithyDocumentSerde } // Represents a server. type Server struct { // The ID of the replication job. ReplicationJobId *string // Indicates whether the replication job is deleted or failed. ReplicationJobTerminated *bool // The ID of the server. ServerId *string // The type of server. ServerType ServerType // Information about the VM server. VmServer *VmServer noSmithyDocumentSerde } // Logical grouping of servers. type ServerGroup struct { // The name of a server group. Name *string // The ID of a server group. ServerGroupId *string // The servers that belong to a server group. ServerList []Server noSmithyDocumentSerde } // Launch configuration for a server group. type ServerGroupLaunchConfiguration struct { // The launch order of servers in the server group. LaunchOrder *int32 // The ID of the server group with which the launch configuration is associated. ServerGroupId *string // The launch configuration for servers in the server group. ServerLaunchConfigurations []ServerLaunchConfiguration noSmithyDocumentSerde } // Replication configuration for a server group. type ServerGroupReplicationConfiguration struct { // The ID of the server group with which this replication configuration is // associated. ServerGroupId *string // The replication configuration for servers in the server group. ServerReplicationConfigurations []ServerReplicationConfiguration noSmithyDocumentSerde } // Configuration for validating an instance. type ServerGroupValidationConfiguration struct { // The ID of the server group. ServerGroupId *string // The validation configuration. ServerValidationConfigurations []ServerValidationConfiguration noSmithyDocumentSerde } // Launch configuration for a server. type ServerLaunchConfiguration struct { // Indicates whether a publicly accessible IP address is created when launching // the server. AssociatePublicIpAddress *bool // Location of an Amazon S3 object. ConfigureScript *S3Location // The type of configuration script. ConfigureScriptType ScriptType // The name of the Amazon EC2 SSH key to be used for connecting to the launched // server. Ec2KeyName *string // The name of the IAM instance profile. IamInstanceProfileName *string // The instance type to use when launching the server. InstanceType *string // The logical ID of the server in the CloudFormation template. LogicalId *string // The ID of the security group that applies to the launched server. SecurityGroup *string // The ID of the server with which the launch configuration is associated. Server *Server // The ID of the subnet the server should be launched into. Subnet *string // Location of the user-data script to be executed when launching the server. UserData *UserData // The ID of the VPC into which the server should be launched. Vpc *string noSmithyDocumentSerde } // Replication configuration of a server. type ServerReplicationConfiguration struct { // The ID of the server with which this replication configuration is associated. Server *Server // The parameters for replicating the server. ServerReplicationParameters *ServerReplicationParameters noSmithyDocumentSerde } // The replication parameters for replicating a server. type ServerReplicationParameters struct { // Indicates whether the replication job produces encrypted AMIs. Encrypted *bool // The frequency of creating replication jobs for the server. Frequency *int32 // The ID of the KMS key for replication jobs that produce encrypted AMIs. This // value can be any of the following: // - KMS key ID // - KMS key alias // - ARN referring to the KMS key ID // - ARN referring to the KMS key alias // If encrypted is enabled but a KMS key ID is not specified, the customer's // default KMS key for Amazon EBS is used. KmsKeyId *string // The license type for creating a replication job for the server. LicenseType LicenseType // The number of recent AMIs to keep when creating a replication job for this // server. NumberOfRecentAmisToKeep *int32 // Indicates whether to run the replication job one time. RunOnce *bool // The seed time for creating a replication job for the server. SeedTime *time.Time noSmithyDocumentSerde } // Configuration for validating an instance. type ServerValidationConfiguration struct { // The name of the configuration. Name *string // Represents a server. Server *Server // The validation strategy. ServerValidationStrategy ServerValidationStrategy // The validation parameters. UserDataValidationParameters *UserDataValidationParameters // The ID of the validation. ValidationId *string noSmithyDocumentSerde } // Contains output from validating an instance. type ServerValidationOutput struct { // Represents a server. Server *Server noSmithyDocumentSerde } // Contains the location of a validation script. type Source struct { // Location of an Amazon S3 object. S3Location *S3Location noSmithyDocumentSerde } // Contains the location of validation output. type SSMOutput struct { // Location of an Amazon S3 object. S3Location *S3Location noSmithyDocumentSerde } // Contains validation parameters. type SSMValidationParameters struct { // The command to run the validation script. Command *string // The timeout interval, in seconds. ExecutionTimeoutSeconds int32 // The ID of the instance. The instance must have the following tag: // UserForSMSApplicationValidation=true. InstanceId *string // The name of the S3 bucket for output. OutputS3BucketName *string // The type of validation script. ScriptType ScriptType // The location of the validation script. Source *Source noSmithyDocumentSerde } // Key/value pair that can be assigned to an application. type Tag struct { // The tag key. Key *string // The tag value. Value *string noSmithyDocumentSerde } // A script that runs on first launch of an Amazon EC2 instance. Used for // configuring the server during launch. type UserData struct { // Amazon S3 location of the user-data script. S3Location *S3Location noSmithyDocumentSerde } // Contains validation parameters. type UserDataValidationParameters struct { // The type of validation script. ScriptType ScriptType // The location of the validation script. Source *Source noSmithyDocumentSerde } // Contains validation output. type ValidationOutput struct { // The output from validating an application. AppValidationOutput *AppValidationOutput // The latest time that the validation was performed. LatestValidationTime *time.Time // The name of the validation. Name *string // The output from validation an instance. ServerValidationOutput *ServerValidationOutput // The status of the validation. Status ValidationStatus // The status message. StatusMessage *string // The ID of the validation. ValidationId *string noSmithyDocumentSerde } // Represents a VM server. type VmServer struct { // The name of the VM manager. VmManagerName *string // The type of VM management product. VmManagerType VmManagerType // The name of the VM. VmName *string // The VM folder path in the vCenter Server virtual machine inventory tree. VmPath *string // The VM server location. VmServerAddress *VmServerAddress noSmithyDocumentSerde } // Represents a VM server location. type VmServerAddress struct { // The ID of the VM. VmId *string // The ID of the VM manager. VmManagerId *string noSmithyDocumentSerde } type noSmithyDocumentSerde = smithydocument.NoSerde
640
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package snowball 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 = "Snowball" const ServiceAPIVersion = "2016-06-30" // Client provides the API client to make operations call for Amazon Import/Export // Snowball. 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, "snowball", goModuleVersion)(stack) } func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ CredentialsProvider: o.Credentials, Signer: o.HTTPSignerV4, LogSigning: o.ClientLogMode.IsSigning(), }) return stack.Finalize.Add(mw, middleware.After) } type HTTPSignerV4 interface { SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error } func resolveHTTPSignerV4(o *Options) { if o.HTTPSignerV4 != nil { return } o.HTTPSignerV4 = newDefaultV4Signer(*o) } func newDefaultV4Signer(o Options) *v4.Signer { return v4.NewSigner(func(so *v4.SignerOptions) { so.Logger = o.Logger so.LogSigning = o.ClientLogMode.IsSigning() }) } func addRetryMiddlewares(stack *middleware.Stack, o Options) error { mo := retry.AddRetryMiddlewaresOptions{ Retryer: o.Retryer, LogRetryAttempts: o.ClientLogMode.IsRetries(), } return retry.AddRetryMiddlewares(stack, mo) } // resolves dual-stack endpoint configuration func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseDualStackEndpoint = value } return nil } // resolves FIPS endpoint configuration func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { if len(cfg.ConfigSources) == 0 { return nil } value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) if err != nil { return err } if found { o.EndpointOptions.UseFIPSEndpoint = value } return nil } func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) } func addResponseErrorMiddleware(stack *middleware.Stack) error { return awshttp.AddResponseErrorMiddleware(stack) } func addRequestResponseLogging(stack *middleware.Stack, o Options) error { return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ LogRequest: o.ClientLogMode.IsRequest(), LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), LogResponse: o.ClientLogMode.IsResponse(), LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), }, middleware.After) }
435
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package snowball 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 snowball 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" ) // Cancels a cluster job. You can only cancel a cluster job while it's in the // AwaitingQuorum status. You'll have at least an hour after creating a cluster job // to cancel it. func (c *Client) CancelCluster(ctx context.Context, params *CancelClusterInput, optFns ...func(*Options)) (*CancelClusterOutput, error) { if params == nil { params = &CancelClusterInput{} } result, metadata, err := c.invokeOperation(ctx, "CancelCluster", params, optFns, c.addOperationCancelClusterMiddlewares) if err != nil { return nil, err } out := result.(*CancelClusterOutput) out.ResultMetadata = metadata return out, nil } type CancelClusterInput struct { // The 39-character ID for the cluster that you want to cancel, for example // CID123e4567-e89b-12d3-a456-426655440000 . // // This member is required. ClusterId *string noSmithyDocumentSerde } type CancelClusterOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCancelClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCancelCluster{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCancelCluster{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCancelClusterValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelCluster(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCancelCluster(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "snowball", OperationName: "CancelCluster", } }
123
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package snowball 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" ) // Cancels the specified job. You can only cancel a job before its JobState value // changes to PreparingAppliance . Requesting the ListJobs or DescribeJob action // returns a job's JobState as part of the response element data returned. func (c *Client) CancelJob(ctx context.Context, params *CancelJobInput, optFns ...func(*Options)) (*CancelJobOutput, error) { if params == nil { params = &CancelJobInput{} } result, metadata, err := c.invokeOperation(ctx, "CancelJob", params, optFns, c.addOperationCancelJobMiddlewares) if err != nil { return nil, err } out := result.(*CancelJobOutput) out.ResultMetadata = metadata return out, nil } type CancelJobInput struct { // The 39-character job ID for the job that you want to cancel, for example // JID123e4567-e89b-12d3-a456-426655440000 . // // This member is required. JobId *string noSmithyDocumentSerde } type CancelJobOutput struct { // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCancelJobMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCancelJob{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCancelJob{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCancelJobValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelJob(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCancelJob(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "snowball", OperationName: "CancelJob", } }
123
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package snowball 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/snowball/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates an address for a Snow device to be shipped to. In most regions, // addresses are validated at the time of creation. The address you provide must be // located within the serviceable area of your region. If the address is invalid or // unsupported, then an exception is thrown. func (c *Client) CreateAddress(ctx context.Context, params *CreateAddressInput, optFns ...func(*Options)) (*CreateAddressOutput, error) { if params == nil { params = &CreateAddressInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateAddress", params, optFns, c.addOperationCreateAddressMiddlewares) if err != nil { return nil, err } out := result.(*CreateAddressOutput) out.ResultMetadata = metadata return out, nil } type CreateAddressInput struct { // The address that you want the Snow device shipped to. // // This member is required. Address *types.Address noSmithyDocumentSerde } type CreateAddressOutput struct { // The automatically generated ID for a specific address. You'll use this ID when // you create a job to specify which address you want the Snow device for that job // shipped to. AddressId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateAddressMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateAddress{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateAddress{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateAddressValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAddress(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateAddress(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "snowball", OperationName: "CreateAddress", } }
130
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package snowball 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/snowball/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates an empty cluster. Each cluster supports five nodes. You use the // CreateJob action separately to create the jobs for each of these nodes. The // cluster does not ship until these five node jobs have been created. func (c *Client) CreateCluster(ctx context.Context, params *CreateClusterInput, optFns ...func(*Options)) (*CreateClusterOutput, error) { if params == nil { params = &CreateClusterInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateCluster", params, optFns, c.addOperationCreateClusterMiddlewares) if err != nil { return nil, err } out := result.(*CreateClusterOutput) out.ResultMetadata = metadata return out, nil } type CreateClusterInput struct { // The ID for the address that you want the cluster shipped to. // // This member is required. AddressId *string // The type of job for this cluster. Currently, the only job type supported for // clusters is LOCAL_USE . For more information, see // "https://docs.aws.amazon.com/snowball/latest/snowcone-guide/snow-device-types.html" // (Snow Family Devices and Capacity) in the Snowcone User Guide or // "https://docs.aws.amazon.com/snowball/latest/developer-guide/snow-device-types.html" // (Snow Family Devices and Capacity) in the Snowcone User Guide. // // This member is required. JobType types.JobType // The shipping speed for each node in this cluster. This speed doesn't dictate // how soon you'll get each Snowball Edge device, rather it represents how quickly // each device moves to its destination while in transit. Regional shipping speeds // are as follows: // - In Australia, you have access to express shipping. Typically, Snow devices // shipped express are delivered in about a day. // - In the European Union (EU), you have access to express shipping. Typically, // Snow devices shipped express are delivered in about a day. In addition, most // countries in the EU have access to standard shipping, which typically takes less // than a week, one way. // - In India, Snow devices are delivered in one to seven days. // - In the United States of America (US), you have access to one-day shipping // and two-day shipping. // // - In Australia, you have access to express shipping. Typically, devices // shipped express are delivered in about a day. // - In the European Union (EU), you have access to express shipping. Typically, // Snow devices shipped express are delivered in about a day. In addition, most // countries in the EU have access to standard shipping, which typically takes less // than a week, one way. // - In India, Snow devices are delivered in one to seven days. // - In the US, you have access to one-day shipping and two-day shipping. // // This member is required. ShippingOption types.ShippingOption // The type of Snow Family devices to use for this cluster. For cluster jobs, // Amazon Web Services Snow Family currently supports only the EDGE device type. // For more information, see // "https://docs.aws.amazon.com/snowball/latest/snowcone-guide/snow-device-types.html" // (Snow Family Devices and Capacity) in the Snowcone User Guide or // "https://docs.aws.amazon.com/snowball/latest/developer-guide/snow-device-types.html" // (Snow Family Devices and Capacity) in the Snowcone User Guide. // // This member is required. SnowballType types.SnowballType // An optional description of this specific cluster, for example Environmental // Data Cluster-01 . Description *string // Force to create cluster when user attempts to overprovision or underprovision a // cluster. A cluster is overprovisioned or underprovisioned if the initial size of // the cluster is more (overprovisioned) or less (underprovisioned) than what // needed to meet capacity requirement specified with OnDeviceServiceConfiguration . ForceCreateJobs bool // The forwarding address ID for a cluster. This field is not supported in most // regions. ForwardingAddressId *string // If provided, each job will be automatically created and associated with the new // cluster. If not provided, will be treated as 0. InitialClusterSize *int32 // The KmsKeyARN value that you want to associate with this cluster. KmsKeyARN // values are created by using the CreateKey (https://docs.aws.amazon.com/kms/latest/APIReference/API_CreateKey.html) // API action in Key Management Service (KMS). KmsKeyARN *string // Lists long-term pricing id that will be used to associate with jobs // automatically created for the new cluster. LongTermPricingIds []string // The Amazon Simple Notification Service (Amazon SNS) notification settings for // this cluster. Notification *types.Notification // Specifies the service or services on the Snow Family device that your // transferred data will be exported from or imported into. Amazon Web Services // Snow Family device clusters support Amazon S3 and NFS (Network File System). OnDeviceServiceConfiguration *types.OnDeviceServiceConfiguration // Allows you to securely operate and manage Snow devices in a cluster remotely // from outside of your internal network. When set to INSTALLED_AUTOSTART , remote // management will automatically be available when the device arrives at your // location. Otherwise, you need to use the Snowball Client to manage the device. RemoteManagement types.RemoteManagement // The resources associated with the cluster job. These resources include Amazon // S3 buckets and optional Lambda functions written in the Python language. Resources *types.JobResource // The RoleARN that you want to associate with this cluster. RoleArn values are // created by using the CreateRole (https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateRole.html) // API action in Identity and Access Management (IAM). RoleARN *string // If your job is being created in one of the US regions, you have the option of // specifying what size Snow device you'd like for this job. In all other regions, // Snowballs come with 80 TB in storage capacity. For more information, see // "https://docs.aws.amazon.com/snowball/latest/snowcone-guide/snow-device-types.html" // (Snow Family Devices and Capacity) in the Snowcone User Guide or // "https://docs.aws.amazon.com/snowball/latest/developer-guide/snow-device-types.html" // (Snow Family Devices and Capacity) in the Snowcone User Guide. SnowballCapacityPreference types.SnowballCapacity // The tax documents required in your Amazon Web Services Region. TaxDocuments *types.TaxDocuments noSmithyDocumentSerde } type CreateClusterOutput struct { // The automatically generated ID for a cluster. ClusterId *string // List of jobs created for this cluster. For syntax, see // ListJobsResult$JobListEntries (https://docs.aws.amazon.com/snowball/latest/api-reference/API_ListJobs.html#API_ListJobs_ResponseSyntax) // in this guide. JobListEntries []types.JobListEntry // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateCluster{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateCluster{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateClusterValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCluster(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateCluster(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "snowball", OperationName: "CreateCluster", } }
242
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package snowball 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/snowball/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a job to import or export data between Amazon S3 and your on-premises // data center. Your Amazon Web Services account must have the right trust policies // and permissions in place to create a job for a Snow device. If you're creating a // job for a node in a cluster, you only need to provide the clusterId value; the // other job attributes are inherited from the cluster. Only the Snowball; Edge // device type is supported when ordering clustered jobs. The device capacity is // optional. Availability of device types differ by Amazon Web Services Region. For // more information about Region availability, see Amazon Web Services Regional // Services (https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/?p=ngi&loc=4) // . Snow Family devices and their capacities. // - Device type: SNC1_SSD // - Capacity: T14 // - Description: Snowcone // - Device type: SNC1_HDD // - Capacity: T8 // - Description: Snowcone // - Device type: EDGE_S // - Capacity: T98 // - Description: Snowball Edge Storage Optimized for data transfer only // - Device type: EDGE_CG // - Capacity: T42 // - Description: Snowball Edge Compute Optimized with GPU // - Device type: EDGE_C // - Capacity: T42 // - Description: Snowball Edge Compute Optimized without GPU // - Device type: EDGE // - Capacity: T100 // - Description: Snowball Edge Storage Optimized with EC2 Compute // - Device type: STANDARD // - Capacity: T50 // - Description: Original Snowball device This device is only available in the // Ningxia, Beijing, and Singapore Amazon Web Services Region // - Device type: STANDARD // - Capacity: T80 // - Description: Original Snowball device This device is only available in the // Ningxia, Beijing, and Singapore Amazon Web Services Region. // - Device type: V3_5C // - Capacity: T32 // - Description: Snowball Edge Compute Optimized without GPU // - Device type: V3_5S // - Capacity: T240 // - Description: Snowball Edge Storage Optimized 210TB func (c *Client) CreateJob(ctx context.Context, params *CreateJobInput, optFns ...func(*Options)) (*CreateJobOutput, error) { if params == nil { params = &CreateJobInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateJob", params, optFns, c.addOperationCreateJobMiddlewares) if err != nil { return nil, err } out := result.(*CreateJobOutput) out.ResultMetadata = metadata return out, nil } type CreateJobInput struct { // The ID for the address that you want the Snow device shipped to. AddressId *string // The ID of a cluster. If you're creating a job for a node in a cluster, you need // to provide only this clusterId value. The other job attributes are inherited // from the cluster. ClusterId *string // Defines an optional description of this specific job, for example Important // Photos 2016-08-11 . Description *string // Defines the device configuration for an Snowcone job. For more information, see // "https://docs.aws.amazon.com/snowball/latest/snowcone-guide/snow-device-types.html" // (Snow Family Devices and Capacity) in the Snowcone User Guide or // "https://docs.aws.amazon.com/snowball/latest/developer-guide/snow-device-types.html" // (Snow Family Devices and Capacity) in the Snowcone User Guide. DeviceConfiguration *types.DeviceConfiguration // The forwarding address ID for a job. This field is not supported in most // Regions. ForwardingAddressId *string // Defines the type of job that you're creating. JobType types.JobType // The KmsKeyARN that you want to associate with this job. KmsKeyARN s are created // using the CreateKey (https://docs.aws.amazon.com/kms/latest/APIReference/API_CreateKey.html) // Key Management Service (KMS) API action. KmsKeyARN *string // The ID of the long-term pricing type for the device. LongTermPricingId *string // Defines the Amazon Simple Notification Service (Amazon SNS) notification // settings for this job. Notification *types.Notification // Specifies the service or services on the Snow Family device that your // transferred data will be exported from or imported into. Amazon Web Services // Snow Family supports Amazon S3 and NFS (Network File System) and the Amazon Web // Services Storage Gateway service Tape Gateway type. OnDeviceServiceConfiguration *types.OnDeviceServiceConfiguration // Allows you to securely operate and manage Snowcone devices remotely from // outside of your internal network. When set to INSTALLED_AUTOSTART , remote // management will automatically be available when the device arrives at your // location. Otherwise, you need to use the Snowball Client to manage the device. RemoteManagement types.RemoteManagement // Defines the Amazon S3 buckets associated with this job. With IMPORT jobs, you // specify the bucket or buckets that your transferred data will be imported into. // With EXPORT jobs, you specify the bucket or buckets that your transferred data // will be exported from. Optionally, you can also specify a KeyRange value. If // you choose to export a range, you define the length of the range by providing // either an inclusive BeginMarker value, an inclusive EndMarker value, or both. // Ranges are UTF-8 binary sorted. Resources *types.JobResource // The RoleARN that you want to associate with this job. RoleArn s are created // using the CreateRole (https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateRole.html) // Identity and Access Management (IAM) API action. RoleARN *string // The shipping speed for this job. This speed doesn't dictate how soon you'll get // the Snow device, rather it represents how quickly the Snow device moves to its // destination while in transit. Regional shipping speeds are as follows: // - In Australia, you have access to express shipping. Typically, Snow devices // shipped express are delivered in about a day. // - In the European Union (EU), you have access to express shipping. Typically, // Snow devices shipped express are delivered in about a day. In addition, most // countries in the EU have access to standard shipping, which typically takes less // than a week, one way. // - In India, Snow devices are delivered in one to seven days. // - In the US, you have access to one-day shipping and two-day shipping. ShippingOption types.ShippingOption // If your job is being created in one of the US regions, you have the option of // specifying what size Snow device you'd like for this job. In all other regions, // Snowballs come with 80 TB in storage capacity. For more information, see // "https://docs.aws.amazon.com/snowball/latest/snowcone-guide/snow-device-types.html" // (Snow Family Devices and Capacity) in the Snowcone User Guide or // "https://docs.aws.amazon.com/snowball/latest/developer-guide/snow-device-types.html" // (Snow Family Devices and Capacity) in the Snowcone User Guide. SnowballCapacityPreference types.SnowballCapacity // The type of Snow Family devices to use for this job. For cluster jobs, Amazon // Web Services Snow Family currently supports only the EDGE device type. The type // of Amazon Web Services Snow device to use for this job. Currently, the only // supported device type for cluster jobs is EDGE . For more information, see // Snowball Edge Device Options (https://docs.aws.amazon.com/snowball/latest/developer-guide/device-differences.html) // in the Snowball Edge Developer Guide. For more information, see // "https://docs.aws.amazon.com/snowball/latest/snowcone-guide/snow-device-types.html" // (Snow Family Devices and Capacity) in the Snowcone User Guide or // "https://docs.aws.amazon.com/snowball/latest/developer-guide/snow-device-types.html" // (Snow Family Devices and Capacity) in the Snowcone User Guide. SnowballType types.SnowballType // The tax documents required in your Amazon Web Services Region. TaxDocuments *types.TaxDocuments noSmithyDocumentSerde } type CreateJobOutput struct { // The automatically generated ID for a job, for example // JID123e4567-e89b-12d3-a456-426655440000 . JobId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateJobMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateJob{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateJob{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateJobValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateJob(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateJob(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "snowball", OperationName: "CreateJob", } }
263
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package snowball 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/snowball/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a job with the long-term usage option for a device. The long-term usage // is a 1-year or 3-year long-term pricing type for the device. You are billed // upfront, and Amazon Web Services provides discounts for long-term pricing. func (c *Client) CreateLongTermPricing(ctx context.Context, params *CreateLongTermPricingInput, optFns ...func(*Options)) (*CreateLongTermPricingOutput, error) { if params == nil { params = &CreateLongTermPricingInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateLongTermPricing", params, optFns, c.addOperationCreateLongTermPricingMiddlewares) if err != nil { return nil, err } out := result.(*CreateLongTermPricingOutput) out.ResultMetadata = metadata return out, nil } type CreateLongTermPricingInput struct { // The type of long-term pricing option you want for the device, either 1-year or // 3-year long-term pricing. // // This member is required. LongTermPricingType types.LongTermPricingType // Specifies whether the current long-term pricing type for the device should be // renewed. IsLongTermPricingAutoRenew *bool // The type of Snow Family devices to use for the long-term pricing job. SnowballType types.SnowballType noSmithyDocumentSerde } type CreateLongTermPricingOutput struct { // The ID of the long-term pricing type for the device. LongTermPricingId *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateLongTermPricingMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateLongTermPricing{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateLongTermPricing{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateLongTermPricingValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateLongTermPricing(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateLongTermPricing(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "snowball", OperationName: "CreateLongTermPricing", } }
135
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package snowball 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/snowball/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Creates a shipping label that will be used to return the Snow device to Amazon // Web Services. func (c *Client) CreateReturnShippingLabel(ctx context.Context, params *CreateReturnShippingLabelInput, optFns ...func(*Options)) (*CreateReturnShippingLabelOutput, error) { if params == nil { params = &CreateReturnShippingLabelInput{} } result, metadata, err := c.invokeOperation(ctx, "CreateReturnShippingLabel", params, optFns, c.addOperationCreateReturnShippingLabelMiddlewares) if err != nil { return nil, err } out := result.(*CreateReturnShippingLabelOutput) out.ResultMetadata = metadata return out, nil } type CreateReturnShippingLabelInput struct { // The ID for a job that you want to create the return shipping label for; for // example, JID123e4567-e89b-12d3-a456-426655440000 . // // This member is required. JobId *string // The shipping speed for a particular job. This speed doesn't dictate how soon // the device is returned to Amazon Web Services. This speed represents how quickly // it moves to its destination while in transit. Regional shipping speeds are as // follows: ShippingOption types.ShippingOption noSmithyDocumentSerde } type CreateReturnShippingLabelOutput struct { // The status information of the task on a Snow device that is being returned to // Amazon Web Services. Status types.ShippingLabelStatus // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationCreateReturnShippingLabelMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateReturnShippingLabel{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateReturnShippingLabel{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpCreateReturnShippingLabelValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateReturnShippingLabel(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opCreateReturnShippingLabel(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "snowball", OperationName: "CreateReturnShippingLabel", } }
134
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package snowball 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/snowball/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Takes an AddressId and returns specific details about that address in the form // of an Address object. func (c *Client) DescribeAddress(ctx context.Context, params *DescribeAddressInput, optFns ...func(*Options)) (*DescribeAddressOutput, error) { if params == nil { params = &DescribeAddressInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeAddress", params, optFns, c.addOperationDescribeAddressMiddlewares) if err != nil { return nil, err } out := result.(*DescribeAddressOutput) out.ResultMetadata = metadata return out, nil } type DescribeAddressInput struct { // The automatically generated ID for a specific address. // // This member is required. AddressId *string noSmithyDocumentSerde } type DescribeAddressOutput struct { // The address that you want the Snow device(s) associated with a specific job to // be shipped to. Address *types.Address // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeAddressMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAddress{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeAddress{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeAddressValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAddress(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeAddress(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "snowball", OperationName: "DescribeAddress", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package snowball 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/snowball/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a specified number of ADDRESS objects. Calling this API in one of the // US regions will return addresses from the list of all addresses associated with // this account in all US regions. func (c *Client) DescribeAddresses(ctx context.Context, params *DescribeAddressesInput, optFns ...func(*Options)) (*DescribeAddressesOutput, error) { if params == nil { params = &DescribeAddressesInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeAddresses", params, optFns, c.addOperationDescribeAddressesMiddlewares) if err != nil { return nil, err } out := result.(*DescribeAddressesOutput) out.ResultMetadata = metadata return out, nil } type DescribeAddressesInput struct { // The number of ADDRESS objects to return. MaxResults *int32 // HTTP requests are stateless. To identify what object comes "next" in the list // of ADDRESS objects, you have the option of specifying a value for NextToken as // the starting point for your list of returned addresses. NextToken *string noSmithyDocumentSerde } type DescribeAddressesOutput struct { // The Snow device shipping addresses that were created for this account. Addresses []types.Address // HTTP requests are stateless. If you use the automatically generated NextToken // value in your next DescribeAddresses call, your list of returned addresses will // start from this point in the array. NextToken *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeAddressesMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAddresses{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeAddresses{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); 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_opDescribeAddresses(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(stack); err != nil { return err } if err = addResponseErrorMiddleware(stack); err != nil { return err } if err = addRequestResponseLogging(stack, options); err != nil { return err } return nil } // DescribeAddressesAPIClient is a client that implements the DescribeAddresses // operation. type DescribeAddressesAPIClient interface { DescribeAddresses(context.Context, *DescribeAddressesInput, ...func(*Options)) (*DescribeAddressesOutput, error) } var _ DescribeAddressesAPIClient = (*Client)(nil) // DescribeAddressesPaginatorOptions is the paginator options for DescribeAddresses type DescribeAddressesPaginatorOptions struct { // The number of ADDRESS objects to return. Limit int32 // Set to true if pagination should stop if the service returns a pagination token // that matches the most recent token provided to the service. StopOnDuplicateToken bool } // DescribeAddressesPaginator is a paginator for DescribeAddresses type DescribeAddressesPaginator struct { options DescribeAddressesPaginatorOptions client DescribeAddressesAPIClient params *DescribeAddressesInput nextToken *string firstPage bool } // NewDescribeAddressesPaginator returns a new DescribeAddressesPaginator func NewDescribeAddressesPaginator(client DescribeAddressesAPIClient, params *DescribeAddressesInput, optFns ...func(*DescribeAddressesPaginatorOptions)) *DescribeAddressesPaginator { if params == nil { params = &DescribeAddressesInput{} } options := DescribeAddressesPaginatorOptions{} if params.MaxResults != nil { options.Limit = *params.MaxResults } for _, fn := range optFns { fn(&options) } return &DescribeAddressesPaginator{ options: options, client: client, params: params, firstPage: true, nextToken: params.NextToken, } } // HasMorePages returns a boolean indicating whether more pages are available func (p *DescribeAddressesPaginator) HasMorePages() bool { return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) } // NextPage retrieves the next DescribeAddresses page. func (p *DescribeAddressesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAddressesOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.NextToken = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.options.Limit } params.MaxResults = limit result, err := p.client.DescribeAddresses(ctx, &params, optFns...) if err != nil { return nil, err } p.firstPage = false prevToken := p.nextToken p.nextToken = result.NextToken if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { p.nextToken = nil } return result, nil } func newServiceMetadataMiddleware_opDescribeAddresses(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "snowball", OperationName: "DescribeAddresses", } }
223
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package snowball 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/snowball/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns information about a specific cluster including shipping information, // cluster status, and other important metadata. func (c *Client) DescribeCluster(ctx context.Context, params *DescribeClusterInput, optFns ...func(*Options)) (*DescribeClusterOutput, error) { if params == nil { params = &DescribeClusterInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeCluster", params, optFns, c.addOperationDescribeClusterMiddlewares) if err != nil { return nil, err } out := result.(*DescribeClusterOutput) out.ResultMetadata = metadata return out, nil } type DescribeClusterInput struct { // The automatically generated ID for a cluster. // // This member is required. ClusterId *string noSmithyDocumentSerde } type DescribeClusterOutput struct { // Information about a specific cluster, including shipping information, cluster // status, and other important metadata. ClusterMetadata *types.ClusterMetadata // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeClusterMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeCluster{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeCluster{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeClusterValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCluster(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeCluster(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "snowball", OperationName: "DescribeCluster", } }
127
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package snowball 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/snowball/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns information about a specific job including shipping information, job // status, and other important metadata. func (c *Client) DescribeJob(ctx context.Context, params *DescribeJobInput, optFns ...func(*Options)) (*DescribeJobOutput, error) { if params == nil { params = &DescribeJobInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeJob", params, optFns, c.addOperationDescribeJobMiddlewares) if err != nil { return nil, err } out := result.(*DescribeJobOutput) out.ResultMetadata = metadata return out, nil } type DescribeJobInput struct { // The automatically generated ID for a job, for example // JID123e4567-e89b-12d3-a456-426655440000 . // // This member is required. JobId *string noSmithyDocumentSerde } type DescribeJobOutput struct { // Information about a specific job, including shipping information, job status, // and other important metadata. JobMetadata *types.JobMetadata // Information about a specific job part (in the case of an export job), including // shipping information, job status, and other important metadata. SubJobMetadata []types.JobMetadata // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeJobMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeJob{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeJob{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeJobValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeJob(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeJob(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "snowball", OperationName: "DescribeJob", } }
132
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package snowball 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/snowball/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" ) // Information on the shipping label of a Snow device that is being returned to // Amazon Web Services. func (c *Client) DescribeReturnShippingLabel(ctx context.Context, params *DescribeReturnShippingLabelInput, optFns ...func(*Options)) (*DescribeReturnShippingLabelOutput, error) { if params == nil { params = &DescribeReturnShippingLabelInput{} } result, metadata, err := c.invokeOperation(ctx, "DescribeReturnShippingLabel", params, optFns, c.addOperationDescribeReturnShippingLabelMiddlewares) if err != nil { return nil, err } out := result.(*DescribeReturnShippingLabelOutput) out.ResultMetadata = metadata return out, nil } type DescribeReturnShippingLabelInput struct { // The automatically generated ID for a job, for example // JID123e4567-e89b-12d3-a456-426655440000 . // // This member is required. JobId *string noSmithyDocumentSerde } type DescribeReturnShippingLabelOutput struct { // The expiration date of the current return shipping label. ExpirationDate *time.Time // The pre-signed Amazon S3 URI used to download the return shipping label. ReturnShippingLabelURI *string // The status information of the task on a Snow device that is being returned to // Amazon Web Services. Status types.ShippingLabelStatus // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationDescribeReturnShippingLabelMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeReturnShippingLabel{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeReturnShippingLabel{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpDescribeReturnShippingLabelValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeReturnShippingLabel(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opDescribeReturnShippingLabel(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "snowball", OperationName: "DescribeReturnShippingLabel", } }
135
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package snowball import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Returns a link to an Amazon S3 presigned URL for the manifest file associated // with the specified JobId value. You can access the manifest file for up to 60 // minutes after this request has been made. To access the manifest file after 60 // minutes have passed, you'll have to make another call to the GetJobManifest // action. The manifest is an encrypted file that you can download after your job // enters the WithCustomer status. This is the only valid status for calling this // API as the manifest and UnlockCode code value are used for securing your device // and should only be used when you have the device. The manifest is decrypted by // using the UnlockCode code value, when you pass both values to the Snow device // through the Snowball client when the client is started for the first time. As a // best practice, we recommend that you don't save a copy of an UnlockCode value // in the same location as the manifest file for that job. Saving these separately // helps prevent unauthorized parties from gaining access to the Snow device // associated with that job. The credentials of a given job, including its manifest // file and unlock code, expire 360 days after the job is created. func (c *Client) GetJobManifest(ctx context.Context, params *GetJobManifestInput, optFns ...func(*Options)) (*GetJobManifestOutput, error) { if params == nil { params = &GetJobManifestInput{} } result, metadata, err := c.invokeOperation(ctx, "GetJobManifest", params, optFns, c.addOperationGetJobManifestMiddlewares) if err != nil { return nil, err } out := result.(*GetJobManifestOutput) out.ResultMetadata = metadata return out, nil } type GetJobManifestInput struct { // The ID for a job that you want to get the manifest file for, for example // JID123e4567-e89b-12d3-a456-426655440000 . // // This member is required. JobId *string noSmithyDocumentSerde } type GetJobManifestOutput struct { // The Amazon S3 presigned URL for the manifest file associated with the specified // JobId value. ManifestURI *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetJobManifestMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetJobManifest{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetJobManifest{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetJobManifestValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetJobManifest(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetJobManifest(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "snowball", OperationName: "GetJobManifest", } }
140
aws-sdk-go-v2
aws
Go
// Code generated by smithy-go-codegen DO NOT EDIT. package snowball 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 UnlockCode code value for the specified job. A particular UnlockCode // value can be accessed for up to 360 days after the associated job has been // created. The UnlockCode value is a 29-character code with 25 alphanumeric // characters and 4 hyphens. This code is used to decrypt the manifest file when it // is passed along with the manifest to the Snow device through the Snowball client // when the client is started for the first time. The only valid status for calling // this API is WithCustomer as the manifest and Unlock code values are used for // securing your device and should only be used when you have the device. As a best // practice, we recommend that you don't save a copy of the UnlockCode in the same // location as the manifest file for that job. Saving these separately helps // prevent unauthorized parties from gaining access to the Snow device associated // with that job. func (c *Client) GetJobUnlockCode(ctx context.Context, params *GetJobUnlockCodeInput, optFns ...func(*Options)) (*GetJobUnlockCodeOutput, error) { if params == nil { params = &GetJobUnlockCodeInput{} } result, metadata, err := c.invokeOperation(ctx, "GetJobUnlockCode", params, optFns, c.addOperationGetJobUnlockCodeMiddlewares) if err != nil { return nil, err } out := result.(*GetJobUnlockCodeOutput) out.ResultMetadata = metadata return out, nil } type GetJobUnlockCodeInput struct { // The ID for the job that you want to get the UnlockCode value for, for example // JID123e4567-e89b-12d3-a456-426655440000 . // // This member is required. JobId *string noSmithyDocumentSerde } type GetJobUnlockCodeOutput struct { // The UnlockCode value for the specified job. The UnlockCode value can be // accessed for up to 360 days after the job has been created. UnlockCode *string // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata noSmithyDocumentSerde } func (c *Client) addOperationGetJobUnlockCodeMiddlewares(stack *middleware.Stack, options Options) (err error) { err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetJobUnlockCode{}, middleware.After) if err != nil { return err } err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetJobUnlockCode{}, middleware.After) if err != nil { return err } if err = addSetLoggerMiddleware(stack, options); err != nil { return err } if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { return err } if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { return err } if err = addResolveEndpointMiddleware(stack, options); err != nil { return err } if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { return err } if err = addRetryMiddlewares(stack, options); err != nil { return err } if err = addHTTPSignerV4Middleware(stack, options); err != nil { return err } if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { return err } if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { return err } if err = addClientUserAgent(stack); err != nil { return err } if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { return err } if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { return err } if err = addOpGetJobUnlockCodeValidationMiddleware(stack); err != nil { return err } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetJobUnlockCode(options.Region), middleware.Before); err != nil { return err } if err = awsmiddleware.AddRecursionDetection(stack); err != nil { return err } if err = addRequestIDRetrieverMiddleware(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_opGetJobUnlockCode(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, ServiceID: ServiceID, SigningName: "snowball", OperationName: "GetJobUnlockCode", } }
137